summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--JavaScriptCore/API/APICast.h4
-rw-r--r--JavaScriptCore/API/JSValueRef.cpp2
-rw-r--r--JavaScriptCore/ChangeLog768
-rw-r--r--JavaScriptCore/Configurations/FeatureDefines.xcconfig5
-rwxr-xr-xJavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh10
-rw-r--r--JavaScriptCore/assembler/ARMAssembler.h4
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerARM.cpp4
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerARM.h9
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.cpp4
-rw-r--r--JavaScriptCore/bytecompiler/NodesCodegen.cpp2
-rw-r--r--JavaScriptCore/debugger/Debugger.cpp9
-rw-r--r--JavaScriptCore/debugger/DebuggerCallFrame.cpp9
-rw-r--r--JavaScriptCore/interpreter/CachedCall.h10
-rw-r--r--JavaScriptCore/interpreter/CallFrame.h4
-rw-r--r--JavaScriptCore/interpreter/Interpreter.cpp308
-rw-r--r--JavaScriptCore/interpreter/Interpreter.h20
-rw-r--r--JavaScriptCore/jit/JITArithmetic.cpp2
-rw-r--r--JavaScriptCore/jit/JITArithmetic32_64.cpp47
-rw-r--r--JavaScriptCore/jit/JITCode.h5
-rw-r--r--JavaScriptCore/jit/JITInlineMethods.h2
-rw-r--r--JavaScriptCore/jit/JITOpcodes.cpp15
-rw-r--r--JavaScriptCore/jit/JITOpcodes32_64.cpp34
-rw-r--r--JavaScriptCore/jit/JITPropertyAccess.cpp6
-rw-r--r--JavaScriptCore/jit/JITPropertyAccess32_64.cpp6
-rw-r--r--JavaScriptCore/jit/JITStubs.cpp259
-rw-r--r--JavaScriptCore/jit/JITStubs.h18
-rw-r--r--JavaScriptCore/jsc.cpp12
-rw-r--r--JavaScriptCore/parser/JSParser.cpp2
-rw-r--r--JavaScriptCore/parser/Parser.cpp2
-rw-r--r--JavaScriptCore/parser/Parser.h6
-rw-r--r--JavaScriptCore/runtime/Arguments.cpp4
-rw-r--r--JavaScriptCore/runtime/ArrayConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/ArrayPrototype.cpp72
-rw-r--r--JavaScriptCore/runtime/BooleanConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/CachedTranscendentalFunction.h6
-rw-r--r--JavaScriptCore/runtime/CallData.cpp2
-rw-r--r--JavaScriptCore/runtime/Completion.cpp8
-rw-r--r--JavaScriptCore/runtime/ConstructData.cpp2
-rw-r--r--JavaScriptCore/runtime/DateConstructor.cpp12
-rw-r--r--JavaScriptCore/runtime/DateInstance.cpp10
-rw-r--r--JavaScriptCore/runtime/DatePrototype.cpp98
-rw-r--r--JavaScriptCore/runtime/Error.cpp24
-rw-r--r--JavaScriptCore/runtime/ErrorConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/ExceptionHelpers.cpp13
-rw-r--r--JavaScriptCore/runtime/ExceptionHelpers.h4
-rw-r--r--JavaScriptCore/runtime/FunctionConstructor.cpp6
-rw-r--r--JavaScriptCore/runtime/FunctionPrototype.cpp2
-rw-r--r--JavaScriptCore/runtime/GetterSetter.h4
-rw-r--r--JavaScriptCore/runtime/JSArray.cpp6
-rw-r--r--JavaScriptCore/runtime/JSByteArray.cpp2
-rw-r--r--JavaScriptCore/runtime/JSByteArray.h6
-rw-r--r--JavaScriptCore/runtime/JSCell.h4
-rw-r--r--JavaScriptCore/runtime/JSFunction.cpp10
-rw-r--r--JavaScriptCore/runtime/JSGlobalObject.cpp12
-rw-r--r--JavaScriptCore/runtime/JSGlobalObject.h2
-rw-r--r--JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp14
-rw-r--r--JavaScriptCore/runtime/JSNumberCell.h56
-rw-r--r--JavaScriptCore/runtime/JSONObject.cpp12
-rw-r--r--JavaScriptCore/runtime/JSString.cpp2
-rw-r--r--JavaScriptCore/runtime/JSString.h10
-rw-r--r--JavaScriptCore/runtime/JSValue.h195
-rw-r--r--JavaScriptCore/runtime/LiteralParser.cpp2
-rw-r--r--JavaScriptCore/runtime/MathObject.cpp56
-rw-r--r--JavaScriptCore/runtime/NativeErrorConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/NumberConstructor.cpp26
-rw-r--r--JavaScriptCore/runtime/NumberPrototype.cpp2
-rw-r--r--JavaScriptCore/runtime/ObjectConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/Operations.cpp4
-rw-r--r--JavaScriptCore/runtime/Operations.h8
-rw-r--r--JavaScriptCore/runtime/Protect.h4
-rw-r--r--JavaScriptCore/runtime/PrototypeFunction.cpp4
-rw-r--r--JavaScriptCore/runtime/RegExpConstructor.cpp4
-rw-r--r--JavaScriptCore/runtime/RegExpObject.cpp4
-rw-r--r--JavaScriptCore/runtime/StringConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/StringPrototype.cpp32
-rw-r--r--JavaScriptCore/runtime/UString.cpp8
-rw-r--r--JavaScriptCore/wtf/Assertions.h4
-rw-r--r--JavaScriptCore/wtf/ByteArray.h4
-rw-r--r--JavaScriptCore/wtf/DateMath.cpp3
-rw-r--r--JavaScriptCore/wtf/Platform.h20
-rw-r--r--JavaScriptCore/wtf/PlatformRefPtr.h9
-rw-r--r--JavaScriptCore/wtf/StdLibExtras.h48
-rw-r--r--JavaScriptCore/wtf/gobject/GTypedefs.h1
-rw-r--r--JavaScriptCore/wtf/text/WTFString.h12
-rw-r--r--JavaScriptCore/yarr/RegexInterpreter.cpp7
-rw-r--r--JavaScriptGlue/ChangeLog25
-rw-r--r--JavaScriptGlue/JSUtils.cpp2
-rw-r--r--JavaScriptGlue/UserObjectImp.cpp2
-rw-r--r--LayoutTests/fast/js/resources/js-test-pre.js18
-rw-r--r--LayoutTests/storage/indexeddb/constants-expected.txt2
-rw-r--r--LayoutTests/storage/indexeddb/constants.html2
-rw-r--r--LayoutTests/storage/indexeddb/database-quota-expected.txt1032
-rw-r--r--LayoutTests/storage/indexeddb/database-quota.html10
-rw-r--r--LayoutTests/storage/indexeddb/duplicates-expected.txt541
-rw-r--r--LayoutTests/storage/indexeddb/duplicates.html213
-rw-r--r--LayoutTests/storage/indexeddb/index-basics-expected.txt4
-rw-r--r--LayoutTests/storage/indexeddb/index-basics.html15
-rw-r--r--LayoutTests/storage/indexeddb/index-cursor-expected.txt38
-rw-r--r--LayoutTests/storage/indexeddb/index-cursor.html34
-rw-r--r--LayoutTests/storage/indexeddb/keyrange-expected.txt12
-rw-r--r--LayoutTests/storage/indexeddb/keyrange.html47
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics-expected.txt11
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics.html36
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt20
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-cursor.html37
-rw-r--r--LayoutTests/storage/indexeddb/open-cursor-expected.txt3
-rw-r--r--LayoutTests/storage/indexeddb/open-cursor.html8
-rw-r--r--LayoutTests/storage/indexeddb/tutorial-expected.txt2
-rw-r--r--LayoutTests/storage/indexeddb/tutorial.html433
-rw-r--r--WebCore/Android.derived.jscbindings.mk1
-rw-r--r--WebCore/Android.derived.v8bindings.mk7
-rw-r--r--WebCore/Android.jscbindings.mk9
-rw-r--r--WebCore/Android.mk7
-rw-r--r--WebCore/CMakeLists.txt8
-rw-r--r--WebCore/CMakeListsEfl.txt1
-rw-r--r--WebCore/ChangeLog6987
-rw-r--r--WebCore/Configurations/FeatureDefines.xcconfig4
-rw-r--r--WebCore/DerivedSources.cpp1
-rw-r--r--WebCore/DerivedSources.make1
-rw-r--r--WebCore/English.lproj/localizedStrings.jsbin51194 -> 51426 bytes
-rw-r--r--WebCore/GNUmakefile.am40
-rw-r--r--WebCore/WebCore.exp.in37
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp26
-rw-r--r--WebCore/WebCore.gypi45
-rw-r--r--WebCore/WebCore.pri1
-rw-r--r--WebCore/WebCore.pro61
-rw-r--r--WebCore/WebCore.vcproj/QTMovieWin.vcproj8
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj625
-rw-r--r--WebCore/WebCore.vcproj/WebCoreCairo.vsprops2
-rw-r--r--WebCore/WebCore.vcproj/WebCoreGenerated.vcproj12
-rwxr-xr-xWebCore/WebCore.vcproj/copyForwardingHeaders.cmd1
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj185
-rw-r--r--WebCore/WebCorePrefix.h2
-rw-r--r--WebCore/accessibility/AXObjectCache.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityARIAGrid.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityARIAGridCell.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityARIAGridRow.cpp6
-rw-r--r--WebCore/accessibility/AccessibilityListBoxOption.cpp4
-rw-r--r--WebCore/accessibility/AccessibilityObject.h2
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp46
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.h2
-rw-r--r--WebCore/accessibility/AccessibilityTable.cpp84
-rw-r--r--WebCore/accessibility/AccessibilityTable.h5
-rw-r--r--WebCore/accessibility/AccessibilityTableCell.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityTableHeaderContainer.cpp2
-rw-r--r--WebCore/accessibility/AccessibilityTableRow.cpp2
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp111
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectWrapper.mm12
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.h1
-rw-r--r--WebCore/bindings/gobject/GNUmakefile.am3
-rw-r--r--WebCore/bindings/js/JSAudioConstructor.cpp2
-rw-r--r--WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSCallbackData.cpp4
-rw-r--r--WebCore/bindings/js/JSCoordinatesCustom.cpp16
-rw-r--r--WebCore/bindings/js/JSCustomXPathNSResolver.cpp4
-rw-r--r--WebCore/bindings/js/JSDOMBinding.cpp10
-rw-r--r--WebCore/bindings/js/JSDOMWindowCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSDeviceMotionEventCustom.cpp14
-rw-r--r--WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSEventListener.cpp8
-rw-r--r--WebCore/bindings/js/JSFileReaderCustom.cpp55
-rw-r--r--WebCore/bindings/js/JSGeolocationCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSHTMLInputElementCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSIDBKeyCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSInjectedScriptHostCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSOptionConstructor.cpp2
-rw-r--r--WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSSVGLengthCustom.cpp20
-rw-r--r--WebCore/bindings/js/JSSVGPODTypeWrapper.h2
-rw-r--r--WebCore/bindings/js/JSScriptProfileNodeCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSWorkerContextCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSWorkerContextErrorHandler.cpp10
-rw-r--r--WebCore/bindings/js/ScheduledAction.cpp4
-rw-r--r--WebCore/bindings/js/ScriptFunctionCall.cpp10
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.cpp8
-rw-r--r--WebCore/bindings/js/WorkerScriptController.cpp4
-rw-r--r--WebCore/bindings/objc/WebScriptObject.mm8
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm96
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorGObject.pm32
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm288
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorObjC.pm221
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm221
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp92
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h55
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp163
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h54
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h39
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp194
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h87
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h37
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm95
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h38
-rw-r--r--WebCore/bindings/scripts/test/TestMediaQueryListListener.idl32
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp109
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h72
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp12
-rw-r--r--WebCore/bindings/v8/DateExtension.cpp2
-rw-r--r--WebCore/bindings/v8/IDBBindingUtilities.cpp4
-rw-r--r--WebCore/bindings/v8/SerializedScriptValue.cpp33
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp6
-rw-r--r--WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp41
-rwxr-xr-xWebCore/bindings/v8/custom/V8FileReaderCustom.cpp16
-rw-r--r--WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp19
-rw-r--r--WebCore/bridge/NP_jsobject.cpp16
-rw-r--r--WebCore/bridge/c/c_instance.cpp4
-rw-r--r--WebCore/bridge/c/c_utility.cpp4
-rw-r--r--WebCore/bridge/jni/jni_jsobject.mm8
-rw-r--r--WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp18
-rw-r--r--WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp18
-rw-r--r--WebCore/bridge/objc/objc_instance.mm4
-rw-r--r--WebCore/bridge/objc/objc_utility.mm26
-rw-r--r--WebCore/bridge/qt/qt_instance.cpp4
-rw-r--r--WebCore/bridge/qt/qt_pixmapruntime.cpp10
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp12
-rw-r--r--WebCore/bridge/runtime_array.cpp4
-rw-r--r--WebCore/bridge/runtime_method.cpp4
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp3
-rw-r--r--WebCore/css/CSSFontFaceSource.cpp2
-rw-r--r--WebCore/css/CSSRule.h5
-rw-r--r--WebCore/css/CSSStyleSelector.cpp63
-rw-r--r--WebCore/css/CSSStyleSelector.h6
-rw-r--r--WebCore/dom/Document.cpp12
-rw-r--r--WebCore/dom/Document.h17
-rw-r--r--WebCore/dom/DocumentMarker.h17
-rw-r--r--WebCore/dom/DocumentMarkerController.cpp75
-rw-r--r--WebCore/dom/DocumentMarkerController.h4
-rw-r--r--WebCore/dom/Element.cpp88
-rw-r--r--WebCore/dom/Element.h14
-rw-r--r--WebCore/dom/ElementRareData.h4
-rw-r--r--WebCore/dom/EventListener.h3
-rw-r--r--WebCore/dom/ExceptionCode.cpp46
-rw-r--r--WebCore/dom/ExceptionCode.h3
-rw-r--r--WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h57
-rw-r--r--WebCore/dom/InputElement.cpp5
-rw-r--r--WebCore/dom/KeyboardEvent.h5
-rw-r--r--WebCore/dom/Node.cpp4
-rw-r--r--WebCore/dom/ScriptElement.cpp39
-rw-r--r--WebCore/dom/ScriptElement.h3
-rw-r--r--WebCore/dom/SpaceSplitString.cpp34
-rw-r--r--WebCore/dom/SpaceSplitString.h5
-rw-r--r--WebCore/dom/StyledElement.cpp3
-rw-r--r--WebCore/dom/StyledElement.h1
-rw-r--r--WebCore/editing/ApplyStyleCommand.cpp75
-rw-r--r--WebCore/editing/ApplyStyleCommand.h8
-rw-r--r--WebCore/editing/CompositeEditCommand.cpp2
-rw-r--r--WebCore/editing/DeleteSelectionCommand.cpp6
-rw-r--r--WebCore/editing/EditingAllInOne.cpp1
-rw-r--r--WebCore/editing/Editor.cpp640
-rw-r--r--WebCore/editing/Editor.h15
-rw-r--r--WebCore/editing/EditorCommand.cpp2
-rw-r--r--WebCore/editing/IndentOutdentCommand.cpp3
-rw-r--r--WebCore/editing/RemoveFormatCommand.cpp82
-rw-r--r--WebCore/editing/TextCheckingHelper.cpp525
-rw-r--r--WebCore/editing/TextCheckingHelper.h52
-rw-r--r--WebCore/editing/TypingCommand.cpp18
-rw-r--r--WebCore/editing/visible_units.cpp24
-rw-r--r--WebCore/editing/visible_units.h9
-rw-r--r--WebCore/fileapi/AsyncFileWriterClient.h4
-rw-r--r--WebCore/fileapi/BlobBuilder.cpp56
-rw-r--r--WebCore/fileapi/BlobBuilder.h17
-rw-r--r--WebCore/fileapi/BlobBuilder.idl3
-rw-r--r--WebCore/fileapi/DOMFileSystemBase.cpp3
-rw-r--r--WebCore/fileapi/DOMFileSystemBase.h2
-rw-r--r--WebCore/fileapi/DirectoryEntry.cpp8
-rw-r--r--WebCore/fileapi/DirectoryEntry.h4
-rw-r--r--WebCore/fileapi/DirectoryEntrySync.cpp9
-rw-r--r--WebCore/fileapi/DirectoryEntrySync.h4
-rw-r--r--WebCore/fileapi/DirectoryReader.cpp2
-rw-r--r--WebCore/fileapi/DirectoryReader.h6
-rw-r--r--WebCore/fileapi/DirectoryReaderBase.h6
-rw-r--r--WebCore/fileapi/DirectoryReaderSync.cpp6
-rw-r--r--WebCore/fileapi/DirectoryReaderSync.h4
-rw-r--r--WebCore/fileapi/Entry.cpp12
-rw-r--r--WebCore/fileapi/Entry.h4
-rw-r--r--WebCore/fileapi/EntryBase.h6
-rw-r--r--WebCore/fileapi/EntrySync.cpp11
-rw-r--r--WebCore/fileapi/EntrySync.h4
-rw-r--r--WebCore/fileapi/FileEntry.cpp2
-rw-r--r--WebCore/fileapi/FileEntry.h4
-rw-r--r--WebCore/fileapi/FileEntrySync.cpp2
-rw-r--r--WebCore/fileapi/FileEntrySync.h4
-rw-r--r--WebCore/fileapi/FileError.h24
-rw-r--r--WebCore/fileapi/FileError.idl24
-rw-r--r--WebCore/fileapi/FileException.h27
-rw-r--r--WebCore/fileapi/FileException.idl22
-rw-r--r--WebCore/fileapi/FileReader.cpp211
-rw-r--r--WebCore/fileapi/FileReader.h68
-rw-r--r--WebCore/fileapi/FileReader.idl3
-rw-r--r--WebCore/fileapi/FileReaderLoader.cpp302
-rw-r--r--WebCore/fileapi/FileReaderLoader.h119
-rw-r--r--WebCore/fileapi/FileReaderLoaderClient.h52
-rw-r--r--WebCore/fileapi/FileReaderSync.cpp151
-rw-r--r--WebCore/fileapi/FileReaderSync.h22
-rw-r--r--WebCore/fileapi/FileReaderSync.idl2
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.cpp18
-rw-r--r--WebCore/fileapi/FileSystemCallbacks.h17
-rw-r--r--WebCore/fileapi/FileWriter.cpp34
-rw-r--r--WebCore/fileapi/FileWriter.h6
-rw-r--r--WebCore/fileapi/SyncCallbackHelper.h13
-rw-r--r--WebCore/history/BackForwardList.h66
-rw-r--r--WebCore/history/BackForwardListChromium.cpp17
-rw-r--r--WebCore/history/BackForwardListImpl.h27
-rw-r--r--WebCore/history/CachedFrame.cpp2
-rw-r--r--WebCore/history/PageCache.cpp11
-rw-r--r--WebCore/html/BaseButtonInputType.cpp50
-rw-r--r--WebCore/html/BaseButtonInputType.h50
-rw-r--r--WebCore/html/BaseCheckableInputType.cpp60
-rw-r--r--WebCore/html/BaseCheckableInputType.h51
-rw-r--r--WebCore/html/ButtonInputType.h6
-rw-r--r--WebCore/html/CheckboxInputType.h6
-rw-r--r--WebCore/html/ClassList.cpp146
-rw-r--r--WebCore/html/ClassList.h74
-rw-r--r--WebCore/html/DOMSettableTokenList.cpp98
-rw-r--r--WebCore/html/DOMSettableTokenList.h71
-rw-r--r--WebCore/html/DOMSettableTokenList.idl35
-rw-r--r--WebCore/html/DOMTokenList.cpp124
-rw-r--r--WebCore/html/DOMTokenList.h48
-rw-r--r--WebCore/html/FileInputType.cpp76
-rw-r--r--WebCore/html/FileInputType.h8
-rw-r--r--WebCore/html/HTMLAttributeNames.in1
-rw-r--r--WebCore/html/HTMLDocument.cpp2
-rw-r--r--WebCore/html/HTMLElement.cpp11
-rw-r--r--WebCore/html/HTMLElement.h3
-rw-r--r--WebCore/html/HTMLElement.idl2
-rw-r--r--WebCore/html/HTMLFormControlElement.cpp14
-rw-r--r--WebCore/html/HTMLFormControlElement.h2
-rw-r--r--WebCore/html/HTMLFrameElementBase.cpp5
-rw-r--r--WebCore/html/HTMLFrameElementBase.h2
-rw-r--r--WebCore/html/HTMLFrameSetElement.cpp16
-rw-r--r--WebCore/html/HTMLFrameSetElement.h5
-rw-r--r--WebCore/html/HTMLInputElement.cpp205
-rw-r--r--WebCore/html/HTMLInputElement.h4
-rw-r--r--WebCore/html/HTMLInputElement.idl1
-rw-r--r--WebCore/html/HTMLMeterElement.cpp12
-rw-r--r--WebCore/html/HTMLObjectElement.cpp47
-rw-r--r--WebCore/html/HTMLObjectElement.h2
-rw-r--r--WebCore/html/HiddenInputType.cpp6
-rw-r--r--WebCore/html/HiddenInputType.h1
-rw-r--r--WebCore/html/ImageDocument.cpp2
-rw-r--r--WebCore/html/ImageInputType.cpp64
-rw-r--r--WebCore/html/ImageInputType.h9
-rw-r--r--WebCore/html/InputType.cpp34
-rw-r--r--WebCore/html/InputType.h24
-rw-r--r--WebCore/html/NumberInputType.cpp30
-rw-r--r--WebCore/html/PasswordInputType.cpp13
-rw-r--r--WebCore/html/PasswordInputType.h2
-rw-r--r--WebCore/html/RadioInputType.h6
-rw-r--r--WebCore/html/RangeInputType.cpp6
-rw-r--r--WebCore/html/RangeInputType.h1
-rw-r--r--WebCore/html/ResetInputType.h6
-rw-r--r--WebCore/html/SubmitInputType.cpp10
-rw-r--r--WebCore/html/SubmitInputType.h7
-rw-r--r--WebCore/html/TextFieldInputType.cpp7
-rw-r--r--WebCore/html/TextFieldInputType.h1
-rw-r--r--WebCore/html/canvas/ArrayBuffer.cpp11
-rw-r--r--WebCore/html/canvas/ArrayBuffer.h1
-rw-r--r--WebCore/html/canvas/WebGLFramebuffer.cpp7
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp34
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.h1
-rw-r--r--WebCore/html/canvas/WebGLTexture.h2
-rw-r--r--WebCore/html/parser/HTMLElementStack.cpp18
-rw-r--r--WebCore/html/parser/HTMLParserIdioms.cpp5
-rw-r--r--WebCore/html/parser/HTMLScriptRunner.cpp2
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.cpp189
-rw-r--r--WebCore/html/parser/HTMLTreeBuilder.h16
-rw-r--r--WebCore/inspector/Inspector.idl17
-rw-r--r--WebCore/inspector/InspectorCSSAgent.cpp245
-rw-r--r--WebCore/inspector/InspectorCSSAgent.h13
-rw-r--r--WebCore/inspector/InspectorCSSStore.cpp3
-rw-r--r--WebCore/inspector/InspectorController.cpp363
-rw-r--r--WebCore/inspector/InspectorController.h38
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp108
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h1
-rw-r--r--WebCore/inspector/InspectorDOMStorageResource.cpp4
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.cpp7
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.h1
-rw-r--r--WebCore/inspector/InspectorInstrumentation.cpp22
-rw-r--r--WebCore/inspector/InspectorInstrumentation.h53
-rw-r--r--WebCore/inspector/InspectorResource.cpp4
-rw-r--r--WebCore/inspector/InspectorResource.h3
-rw-r--r--WebCore/inspector/InspectorResourceAgent.cpp76
-rw-r--r--WebCore/inspector/InspectorResourceAgent.h6
-rw-r--r--WebCore/inspector/InspectorState.cpp2
-rw-r--r--WebCore/inspector/InspectorState.h201
-rw-r--r--WebCore/inspector/InspectorStyleSheet.cpp539
-rw-r--r--WebCore/inspector/InspectorStyleSheet.h136
-rw-r--r--WebCore/inspector/front-end/ApplicationCacheItemsView.js2
-rw-r--r--WebCore/inspector/front-end/AuditLauncherView.js1
-rw-r--r--WebCore/inspector/front-end/AuditRules.js17
-rw-r--r--WebCore/inspector/front-end/AuditsPanel.js10
-rw-r--r--WebCore/inspector/front-end/CSSStyleModel.js106
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js25
-rw-r--r--WebCore/inspector/front-end/CookieItemsView.js244
-rwxr-xr-xWebCore/inspector/front-end/CookieParser.js20
-rw-r--r--WebCore/inspector/front-end/DOMAgent.js249
-rw-r--r--WebCore/inspector/front-end/DataGrid.js21
-rw-r--r--WebCore/inspector/front-end/DatabaseTableView.js2
-rw-r--r--WebCore/inspector/front-end/EventListenersSidebarPane.js15
-rw-r--r--WebCore/inspector/front-end/ExtensionServer.js33
-rw-r--r--WebCore/inspector/front-end/FontView.js1
-rw-r--r--WebCore/inspector/front-end/HAREntry.js14
-rw-r--r--WebCore/inspector/front-end/ImageView.js8
-rw-r--r--WebCore/inspector/front-end/Images/frame.pngbin0 -> 448 bytes
-rw-r--r--WebCore/inspector/front-end/Images/networkIcon.pngbin6431 -> 4628 bytes
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js2
-rw-r--r--WebCore/inspector/front-end/MetricsSidebarPane.js56
-rw-r--r--WebCore/inspector/front-end/NetworkPanel.js99
-rw-r--r--WebCore/inspector/front-end/Panel.js2
-rw-r--r--WebCore/inspector/front-end/Resource.js89
-rw-r--r--WebCore/inspector/front-end/ResourceCategory.js29
-rw-r--r--WebCore/inspector/front-end/ResourceManager.js462
-rw-r--r--WebCore/inspector/front-end/ResourceView.js104
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js107
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js23
-rw-r--r--WebCore/inspector/front-end/Settings.js114
-rw-r--r--WebCore/inspector/front-end/SourceView.js3
-rw-r--r--WebCore/inspector/front-end/StoragePanel.js626
-rw-r--r--WebCore/inspector/front-end/StylesSidebarPane.js347
-rw-r--r--WebCore/inspector/front-end/WatchExpressionsSidebarPane.js4
-rw-r--r--WebCore/inspector/front-end/WebKit.qrc1
-rw-r--r--WebCore/inspector/front-end/inspector.css151
-rw-r--r--WebCore/inspector/front-end/inspector.js165
-rw-r--r--WebCore/inspector/front-end/networkPanel.css43
-rw-r--r--WebCore/loader/Cache.cpp16
-rw-r--r--WebCore/loader/CachedFont.cpp6
-rw-r--r--WebCore/loader/CachedFont.h3
-rw-r--r--WebCore/loader/CachedImage.cpp2
-rw-r--r--WebCore/loader/DocumentLoader.cpp21
-rw-r--r--WebCore/loader/DocumentLoader.h5
-rw-r--r--WebCore/loader/EmptyClients.h7
-rw-r--r--WebCore/loader/FrameLoader.cpp23
-rw-r--r--WebCore/loader/FrameLoader.h6
-rw-r--r--WebCore/loader/FrameLoaderClient.h5
-rw-r--r--WebCore/loader/MainResourceLoader.cpp3
-rw-r--r--WebCore/loader/PolicyCallback.cpp7
-rw-r--r--WebCore/loader/PolicyCallback.h8
-rw-r--r--WebCore/loader/PolicyChecker.cpp2
-rw-r--r--WebCore/loader/ThreadableLoaderClient.h2
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.cpp6
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.h1
-rw-r--r--WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html50
-rw-r--r--WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html76
-rw-r--r--WebCore/manual-tests/cursor-empty-url.html3
-rw-r--r--WebCore/manual-tests/indexed-database.html49
-rw-r--r--WebCore/manual-tests/indexeddb-persists.html69
-rw-r--r--WebCore/manual-tests/plugins/windowed.html4
-rw-r--r--WebCore/manual-tests/plugins/windowless.html4
-rw-r--r--WebCore/manual-tests/resources/cursor-empty-url.css1
-rw-r--r--WebCore/mathml/RenderMathMLFenced.cpp20
-rw-r--r--WebCore/mathml/RenderMathMLFenced.h3
-rw-r--r--WebCore/mathml/RenderMathMLFraction.cpp7
-rw-r--r--WebCore/mathml/RenderMathMLOperator.cpp3
-rw-r--r--WebCore/mathml/RenderMathMLRoot.cpp6
-rw-r--r--WebCore/mathml/RenderMathMLRow.cpp76
-rw-r--r--WebCore/mathml/RenderMathMLRow.h1
-rw-r--r--WebCore/mathml/RenderMathMLSubSup.cpp62
-rw-r--r--WebCore/mathml/RenderMathMLUnderOver.cpp20
-rw-r--r--WebCore/mathml/mathtags.in4
-rw-r--r--WebCore/page/Chrome.cpp4
-rw-r--r--WebCore/page/Chrome.h3
-rw-r--r--WebCore/page/ChromeClient.h5
-rw-r--r--WebCore/page/ContextMenuController.cpp3
-rw-r--r--WebCore/page/DOMWindow.cpp9
-rw-r--r--WebCore/page/DOMWindow.idl7
-rw-r--r--WebCore/page/EventHandler.cpp17
-rw-r--r--WebCore/page/Frame.cpp34
-rw-r--r--WebCore/page/Frame.h6
-rw-r--r--WebCore/page/FrameView.cpp30
-rw-r--r--WebCore/page/FrameView.h3
-rw-r--r--WebCore/page/SecurityOriginHash.h2
-rw-r--r--WebCore/page/Settings.cpp21
-rw-r--r--WebCore/page/Settings.h11
-rw-r--r--WebCore/page/SpeechInput.cpp6
-rw-r--r--WebCore/page/SpeechInput.h4
-rw-r--r--WebCore/page/SpeechInputClient.h4
-rw-r--r--WebCore/page/SpeechInputListener.h5
-rw-r--r--WebCore/page/SpeechInputResult.cpp56
-rw-r--r--WebCore/page/SpeechInputResult.h57
-rw-r--r--WebCore/page/animation/KeyframeAnimation.cpp4
-rw-r--r--WebCore/page/animation/KeyframeAnimation.h1
-rw-r--r--WebCore/platform/AsyncFileSystemCallbacks.h3
-rw-r--r--WebCore/platform/ContextMenu.cpp2
-rw-r--r--WebCore/platform/FileMetadata.h62
-rw-r--r--WebCore/platform/MIMETypeRegistry.cpp7
-rw-r--r--WebCore/platform/ScrollView.cpp11
-rw-r--r--WebCore/platform/ScrollView.h6
-rw-r--r--WebCore/platform/UUID.cpp29
-rw-r--r--WebCore/platform/android/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/audio/AudioBus.cpp4
-rw-r--r--WebCore/platform/audio/AudioChannel.cpp4
-rw-r--r--WebCore/platform/audio/AudioDSPKernel.h10
-rw-r--r--WebCore/platform/audio/AudioResamplerKernel.cpp143
-rw-r--r--WebCore/platform/audio/AudioResamplerKernel.h76
-rw-r--r--WebCore/platform/audio/Biquad.cpp5
-rw-r--r--WebCore/platform/audio/FFTConvolver.cpp4
-rw-r--r--WebCore/platform/audio/FFTConvolver.h2
-rw-r--r--WebCore/platform/audio/Panner.cpp2
-rw-r--r--WebCore/platform/audio/Reverb.cpp16
-rw-r--r--WebCore/platform/audio/ReverbAccumulationBuffer.cpp4
-rw-r--r--WebCore/platform/audio/ReverbAccumulationBuffer.h2
-rw-r--r--WebCore/platform/audio/ReverbConvolver.cpp12
-rw-r--r--WebCore/platform/audio/ReverbConvolver.h2
-rw-r--r--WebCore/platform/audio/ReverbConvolverStage.cpp10
-rw-r--r--WebCore/platform/audio/ReverbConvolverStage.h2
-rw-r--r--WebCore/platform/audio/ReverbInputBuffer.h2
-rw-r--r--WebCore/platform/audio/VectorMath.cpp84
-rw-r--r--WebCore/platform/audio/VectorMath.h41
-rw-r--r--WebCore/platform/brew/LanguageBrew.cpp40
-rw-r--r--WebCore/platform/brew/LocalizedStringsBrew.cpp5
-rw-r--r--WebCore/platform/brew/TemporaryLinkStubs.cpp40
-rw-r--r--WebCore/platform/cf/SchedulePair.h2
-rw-r--r--WebCore/platform/chromium/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/efl/LanguageEfl.cpp16
-rw-r--r--WebCore/platform/efl/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/graphics/FontCache.cpp12
-rw-r--r--WebCore/platform/graphics/FontDescription.h9
-rw-r--r--WebCore/platform/graphics/FontOrientation.h35
-rw-r--r--WebCore/platform/graphics/Gradient.cpp10
-rw-r--r--WebCore/platform/graphics/Gradient.h1
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.cpp2
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h5
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.h20
-rw-r--r--WebCore/platform/graphics/ImageSource.h5
-rw-r--r--WebCore/platform/graphics/SimpleFontData.h6
-rw-r--r--WebCore/platform/graphics/TiledBackingStoreClient.h1
-rw-r--r--WebCore/platform/graphics/WOFFFileFormat.cpp20
-rw-r--r--WebCore/platform/graphics/cairo/FontCacheFreeType.cpp68
-rw-r--r--WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/cairo/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h2
-rw-r--r--WebCore/platform/graphics/cairo/PathCairo.cpp2
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp190
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp131
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h2
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.cpp4
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.h1
-rw-r--r--WebCore/platform/graphics/cocoa/FontPlatformData.h21
-rw-r--r--WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm37
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.cpp18
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.cpp47
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.cpp15
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.cpp13
-rw-r--r--WebCore/platform/graphics/filters/FEDisplacementMap.cpp12
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.cpp14
-rw-r--r--WebCore/platform/graphics/filters/FEMorphology.cpp7
-rw-r--r--WebCore/platform/graphics/filters/FETile.cpp8
-rw-r--r--WebCore/platform/graphics/filters/FETile.h4
-rw-r--r--WebCore/platform/graphics/filters/FETurbulence.cpp4
-rw-r--r--WebCore/platform/graphics/filters/Filter.h4
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.cpp17
-rw-r--r--WebCore/platform/graphics/filters/FilterEffect.h3
-rw-r--r--WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp2
-rw-r--r--WebCore/platform/graphics/gtk/FontPlatformDataPango.h2
-rw-r--r--WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/haiku/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/mac/FontCacheMac.mm5
-rw-r--r--WebCore/platform/graphics/mac/FontCustomPlatformData.cpp4
-rw-r--r--WebCore/platform/graphics/mac/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/mac/FontMac.mm33
-rw-r--r--WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp71
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm2
-rw-r--r--WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp12
-rw-r--r--WebCore/platform/graphics/mac/SimpleFontDataMac.mm31
-rw-r--r--WebCore/platform/graphics/opengl/TextureMapperGL.cpp591
-rw-r--r--WebCore/platform/graphics/opengl/TextureMapperGL.h83
-rw-r--r--WebCore/platform/graphics/qt/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp2
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp50
-rw-r--r--WebCore/platform/graphics/qt/GraphicsLayerQt.cpp10
-rw-r--r--WebCore/platform/graphics/qt/ImageBufferQt.cpp17
-rw-r--r--WebCore/platform/graphics/qt/TileQt.cpp5
-rw-r--r--WebCore/platform/graphics/skia/FontCustomPlatformData.cpp15
-rw-r--r--WebCore/platform/graphics/skia/FontCustomPlatformData.h9
-rw-r--r--WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp (renamed from WebCore/platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp)0
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp7
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp10
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.h1
-rw-r--r--WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp12
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h3
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp23
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h2
-rw-r--r--WebCore/platform/graphics/win/QTDecompressionSession.cpp170
-rw-r--r--WebCore/platform/graphics/win/QTDecompressionSession.h64
-rw-r--r--WebCore/platform/graphics/win/QTMovieVisualContext.cpp57
-rw-r--r--WebCore/platform/graphics/win/QTMovieVisualContext.h6
-rw-r--r--WebCore/platform/graphics/win/QTPixelBuffer.cpp36
-rw-r--r--WebCore/platform/graphics/win/QTPixelBuffer.h3
-rw-r--r--WebCore/platform/graphics/wince/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wince/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/wince/FontPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp14
-rw-r--r--WebCore/platform/graphics/wince/ImageBufferWinCE.cpp4
-rw-r--r--WebCore/platform/graphics/wince/ImageWinCE.cpp6
-rw-r--r--WebCore/platform/graphics/wx/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wx/FontCustomPlatformData.h3
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformDataWx.cpp29
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.cpp60
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.h13
-rw-r--r--WebCore/platform/gtk/ScrollViewGtk.cpp61
-rw-r--r--WebCore/platform/gtk/TemporaryLinkStubs.cpp2
-rw-r--r--WebCore/platform/haiku/TemporaryLinkStubs.cpp6
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.cpp23
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.h47
-rw-r--r--WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp2
-rw-r--r--WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp79
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp2
-rw-r--r--WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp2
-rw-r--r--WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp11
-rw-r--r--WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp4
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.h4
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.mm3
-rw-r--r--WebCore/platform/mock/SpeechInputClientMock.cpp37
-rw-r--r--WebCore/platform/mock/SpeechInputClientMock.h11
-rw-r--r--WebCore/platform/network/CookieStorage.h35
-rw-r--r--WebCore/platform/network/cf/AuthenticationChallenge.h1
-rw-r--r--WebCore/platform/network/cf/CookieJarCFNet.cpp (renamed from WebCore/platform/network/win/CookieJarCFNetWin.cpp)2
-rw-r--r--WebCore/platform/network/cf/CookieStorageCFNet.cpp (renamed from WebCore/platform/network/win/CookieStorageWin.cpp)18
-rw-r--r--WebCore/platform/network/cf/CookieStorageCFNet.h (renamed from WebCore/platform/network/win/CookieStorageWin.h)9
-rw-r--r--WebCore/platform/network/cf/ResourceError.h2
-rw-r--r--WebCore/platform/network/cf/ResourceHandleCFNet.cpp2
-rw-r--r--WebCore/platform/network/cf/ResourceRequest.h2
-rw-r--r--WebCore/platform/network/cf/ResourceResponse.h1
-rw-r--r--WebCore/platform/network/cf/SocketStreamError.h16
-rw-r--r--WebCore/platform/network/cf/SocketStreamHandle.h100
-rw-r--r--WebCore/platform/network/curl/CookieJarCurl.cpp5
-rw-r--r--WebCore/platform/network/mac/CookieStorageMac.mm38
-rw-r--r--WebCore/platform/network/mac/FormDataStreamMac.mm6
-rw-r--r--WebCore/platform/network/soup/ResourceHandleSoup.cpp9
-rw-r--r--WebCore/platform/network/soup/ResourceRequestSoup.cpp11
-rw-r--r--WebCore/platform/network/soup/ResourceResponseSoup.cpp5
-rw-r--r--WebCore/platform/network/soup/SoupURIUtils.cpp44
-rw-r--r--WebCore/platform/network/soup/SoupURIUtils.h37
-rw-r--r--WebCore/platform/network/win/AuthenticationChallenge.h46
-rw-r--r--WebCore/platform/network/win/NetworkStateNotifierWin.cpp5
-rw-r--r--WebCore/platform/network/win/ResourceError.h46
-rw-r--r--WebCore/platform/network/win/ResourceHandleWin.cpp4
-rw-r--r--WebCore/platform/network/win/ResourceRequest.h71
-rw-r--r--WebCore/platform/network/win/ResourceResponse.h55
-rw-r--r--WebCore/platform/network/win/SocketStreamError.h50
-rw-r--r--WebCore/platform/network/win/SocketStreamHandle.h68
-rw-r--r--WebCore/platform/network/win/SocketStreamHandleWin.cpp89
-rw-r--r--WebCore/platform/qt/QWebPageClient.h8
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp33
-rw-r--r--WebCore/platform/qt/TemporaryLinkStubsQt.cpp6
-rw-r--r--WebCore/platform/sql/SQLiteDatabase.cpp6
-rw-r--r--WebCore/platform/text/TextEncoding.cpp4
-rw-r--r--WebCore/platform/text/brew/StringBrew.cpp44
-rw-r--r--WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp278
-rw-r--r--WebCore/platform/text/gtk/TextCodecGtk.cpp689
-rw-r--r--WebCore/platform/text/gtk/TextCodecGtk.h87
-rw-r--r--WebCore/platform/win/COMPtr.h9
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp42
-rw-r--r--WebCore/platform/win/ContextMenuItemWin.cpp12
-rw-r--r--WebCore/platform/win/FileSystemWin.cpp4
-rw-r--r--WebCore/platform/wince/FileSystemWinCE.cpp4
-rw-r--r--WebCore/platform/wince/TemporaryLinkStubs.cpp37
-rw-r--r--WebCore/plugins/PluginDatabase.cpp36
-rw-r--r--WebCore/plugins/PluginPackage.cpp2
-rw-r--r--WebCore/plugins/PluginStream.cpp1
-rw-r--r--WebCore/plugins/gtk/PluginViewGtk.cpp2
-rw-r--r--WebCore/plugins/gtk/gtk2xtbin.c5
-rw-r--r--WebCore/plugins/gtk/gtk2xtbin.h2
-rw-r--r--WebCore/plugins/win/PluginDatabaseWin.cpp12
-rw-r--r--WebCore/plugins/win/PluginPackageWin.cpp2
-rw-r--r--WebCore/rendering/InlineBox.cpp26
-rw-r--r--WebCore/rendering/InlineBox.h7
-rw-r--r--WebCore/rendering/InlineFlowBox.cpp310
-rw-r--r--WebCore/rendering/InlineFlowBox.h55
-rw-r--r--WebCore/rendering/InlineTextBox.cpp212
-rw-r--r--WebCore/rendering/InlineTextBox.h18
-rw-r--r--WebCore/rendering/RenderBlock.cpp26
-rw-r--r--WebCore/rendering/RenderBlock.h4
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp3
-rw-r--r--WebCore/rendering/RenderBox.cpp71
-rw-r--r--WebCore/rendering/RenderBox.h12
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp240
-rw-r--r--WebCore/rendering/RenderBoxModelObject.h8
-rw-r--r--WebCore/rendering/RenderFlexibleBox.cpp2
-rw-r--r--WebCore/rendering/RenderLayer.cpp17
-rw-r--r--WebCore/rendering/RenderLayer.h5
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp7
-rw-r--r--WebCore/rendering/RenderLineBoxList.cpp94
-rw-r--r--WebCore/rendering/RenderLineBoxList.h4
-rw-r--r--WebCore/rendering/RenderMeter.h2
-rw-r--r--WebCore/rendering/RenderSVGImage.cpp1
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp13
-rw-r--r--WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp68
-rw-r--r--WebCore/rendering/RenderSVGResourceFilterPrimitive.h10
-rw-r--r--WebCore/rendering/RenderSVGResourceMasker.cpp7
-rw-r--r--WebCore/rendering/RenderScrollbar.cpp18
-rw-r--r--WebCore/rendering/RenderTextControl.cpp34
-rw-r--r--WebCore/rendering/RenderTextControl.h9
-rw-r--r--WebCore/rendering/RenderTextFragment.cpp22
-rw-r--r--WebCore/rendering/RenderTextFragment.h4
-rw-r--r--WebCore/rendering/RenderView.cpp5
-rw-r--r--WebCore/rendering/RenderView.h2
-rw-r--r--WebCore/rendering/RootInlineBox.cpp2
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp26
-rw-r--r--WebCore/rendering/TextControlInnerElements.h3
-rw-r--r--WebCore/rendering/style/CursorList.h2
-rw-r--r--WebCore/rendering/style/RenderStyle.cpp25
-rw-r--r--WebCore/rendering/style/RenderStyle.h9
-rw-r--r--WebCore/rendering/svg/SVGInlineTextBox.cpp2
-rw-r--r--WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp9
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.cpp85
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.h13
-rw-r--r--WebCore/storage/IDBDatabaseException.h3
-rw-r--r--WebCore/storage/IDBDatabaseException.idl3
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.cpp77
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.h13
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.cpp29
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.h3
-rw-r--r--WebCore/storage/IDBRequest.cpp14
-rw-r--r--WebCore/storage/IDBSQLiteDatabase.cpp (renamed from WebKit/mac/WebView/WebHTMLRepresentationInternal.h)35
-rw-r--r--WebCore/storage/IDBSQLiteDatabase.h62
-rw-r--r--WebCore/storage/IDBTransactionBackendImpl.cpp2
-rw-r--r--WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h88
-rw-r--r--WebCore/svg/DeprecatedSVGAnimatedTemplate.h11
-rw-r--r--WebCore/svg/SVGAElement.h4
-rw-r--r--WebCore/svg/SVGAngle.cpp235
-rw-r--r--WebCore/svg/SVGAngle.h54
-rw-r--r--WebCore/svg/SVGAngle.idl30
-rw-r--r--WebCore/svg/SVGAnimatedAngle.h34
-rw-r--r--WebCore/svg/SVGAnimatedBoolean.h33
-rw-r--r--WebCore/svg/SVGAnimatedBoolean.idl5
-rw-r--r--WebCore/svg/SVGAnimatedEnumeration.h33
-rw-r--r--WebCore/svg/SVGAnimatedEnumeration.idl3
-rw-r--r--WebCore/svg/SVGAnimatedInteger.h33
-rw-r--r--WebCore/svg/SVGAnimatedLength.h34
-rw-r--r--WebCore/svg/SVGAnimatedLengthList.h34
-rw-r--r--WebCore/svg/SVGAnimatedRect.h34
-rw-r--r--WebCore/svg/SVGAnimationElement.h4
-rw-r--r--WebCore/svg/SVGCircleElement.h10
-rw-r--r--WebCore/svg/SVGClipPathElement.h8
-rw-r--r--WebCore/svg/SVGComponentTransferFunctionElement.h5
-rw-r--r--WebCore/svg/SVGCursorElement.h9
-rw-r--r--WebCore/svg/SVGDefsElement.h3
-rw-r--r--WebCore/svg/SVGElement.cpp15
-rw-r--r--WebCore/svg/SVGElement.h3
-rw-r--r--WebCore/svg/SVGEllipseElement.h12
-rw-r--r--WebCore/svg/SVGExternalResourcesRequired.cpp1
-rw-r--r--WebCore/svg/SVGExternalResourcesRequired.h32
-rw-r--r--WebCore/svg/SVGFEBlendElement.h2
-rw-r--r--WebCore/svg/SVGFEColorMatrixElement.h2
-rw-r--r--WebCore/svg/SVGFECompositeElement.h2
-rw-r--r--WebCore/svg/SVGFEConvolveMatrixElement.h12
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.cpp15
-rw-r--r--WebCore/svg/SVGFEDiffuseLightingElement.h10
-rw-r--r--WebCore/svg/SVGFEDisplacementMapElement.h4
-rw-r--r--WebCore/svg/SVGFEGaussianBlurElement.cpp15
-rw-r--r--WebCore/svg/SVGFEGaussianBlurElement.h10
-rw-r--r--WebCore/svg/SVGFEImageElement.h2
-rw-r--r--WebCore/svg/SVGFEMorphologyElement.h5
-rw-r--r--WebCore/svg/SVGFESpecularLightingElement.cpp12
-rw-r--r--WebCore/svg/SVGFESpecularLightingElement.h10
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.cpp15
-rw-r--r--WebCore/svg/SVGFETurbulenceElement.h16
-rw-r--r--WebCore/svg/SVGFilterElement.cpp15
-rw-r--r--WebCore/svg/SVGFilterElement.h27
-rw-r--r--WebCore/svg/SVGFilterPrimitiveStandardAttributes.h10
-rw-r--r--WebCore/svg/SVGFitToViewBox.h2
-rw-r--r--WebCore/svg/SVGFontElement.h3
-rw-r--r--WebCore/svg/SVGFontFaceElement.cpp2
-rw-r--r--WebCore/svg/SVGFontFaceSrcElement.cpp7
-rw-r--r--WebCore/svg/SVGForeignObjectElement.h12
-rw-r--r--WebCore/svg/SVGGElement.h3
-rw-r--r--WebCore/svg/SVGGradientElement.h7
-rw-r--r--WebCore/svg/SVGImageElement.h12
-rw-r--r--WebCore/svg/SVGLength.idl2
-rw-r--r--WebCore/svg/SVGLengthList.cpp24
-rw-r--r--WebCore/svg/SVGLengthList.h18
-rw-r--r--WebCore/svg/SVGLengthList.idl2
-rw-r--r--WebCore/svg/SVGLineElement.h12
-rw-r--r--WebCore/svg/SVGLinearGradientElement.h10
-rw-r--r--WebCore/svg/SVGMPathElement.h5
-rw-r--r--WebCore/svg/SVGMarkerElement.cpp18
-rw-r--r--WebCore/svg/SVGMarkerElement.h26
-rw-r--r--WebCore/svg/SVGMaskElement.h16
-rw-r--r--WebCore/svg/SVGNumber.idl3
-rw-r--r--WebCore/svg/SVGPathElement.h3
-rw-r--r--WebCore/svg/SVGPatternElement.h18
-rw-r--r--WebCore/svg/SVGPoint.idl6
-rw-r--r--WebCore/svg/SVGPolyElement.h3
-rw-r--r--WebCore/svg/SVGRadialGradientElement.h12
-rw-r--r--WebCore/svg/SVGRect.idl14
-rw-r--r--WebCore/svg/SVGRectElement.h16
-rw-r--r--WebCore/svg/SVGSVGElement.cpp6
-rw-r--r--WebCore/svg/SVGSVGElement.h15
-rw-r--r--WebCore/svg/SVGSVGElement.idl4
-rw-r--r--WebCore/svg/SVGScriptElement.h7
-rw-r--r--WebCore/svg/SVGStyledElement.cpp9
-rw-r--r--WebCore/svg/SVGSwitchElement.h3
-rw-r--r--WebCore/svg/SVGSymbolElement.h5
-rw-r--r--WebCore/svg/SVGTextContentElement.h8
-rw-r--r--WebCore/svg/SVGTextPathElement.h6
-rw-r--r--WebCore/svg/SVGTextPositioningElement.cpp49
-rw-r--r--WebCore/svg/SVGTextPositioningElement.h8
-rw-r--r--WebCore/svg/SVGUseElement.h12
-rw-r--r--WebCore/svg/SVGViewElement.h5
-rw-r--r--WebCore/svg/SVGViewSpec.cpp2
-rw-r--r--WebCore/svg/SVGViewSpec.h11
-rw-r--r--WebCore/svg/SVGZoomEvent.idl2
-rw-r--r--WebCore/svg/graphics/filters/SVGFilter.cpp60
-rw-r--r--WebCore/svg/graphics/filters/SVGFilter.h6
-rw-r--r--WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h94
-rw-r--r--WebCore/svg/properties/SVGAnimatedProperty.h105
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertyDescription.h100
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertyMacros.h126
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h2
-rw-r--r--WebCore/svg/properties/SVGAnimatedPropertyTearOff.h71
-rw-r--r--WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h73
-rw-r--r--WebCore/svg/properties/SVGListPropertyTearOff.h382
-rw-r--r--WebCore/svg/properties/SVGProperty.h42
-rw-r--r--WebCore/svg/properties/SVGPropertyTearOff.h124
-rw-r--r--WebCore/svg/properties/SVGPropertyTraits.h114
-rw-r--r--WebCore/webaudio/AudioContext.cpp72
-rw-r--r--WebCore/webaudio/AudioContext.h18
-rw-r--r--WebCore/webaudio/AudioNode.cpp24
-rw-r--r--WebCore/webaudio/AudioNode.h26
-rw-r--r--WebCore/webaudio/AudioNode.idl24
-rw-r--r--WebCore/webaudio/AudioNodeInput.cpp270
-rw-r--r--WebCore/webaudio/AudioNodeInput.h125
-rw-r--r--WebCore/webaudio/AudioNodeOutput.cpp216
-rw-r--r--WebCore/webaudio/AudioNodeOutput.h134
-rw-r--r--WebCore/webaudio/DelayNode.cpp47
-rw-r--r--WebCore/webaudio/DelayNode.h53
-rw-r--r--WebCore/webaudio/DelayNode.idl32
-rw-r--r--WebCore/webaudio/DelayProcessor.cpp54
-rw-r--r--WebCore/webaudio/DelayProcessor.h53
-rw-r--r--WebCore/websockets/WebSocketChannel.cpp55
-rw-r--r--WebCore/websockets/WebSocketChannel.h8
-rw-r--r--WebCore/workers/WorkerContext.cpp9
-rw-r--r--WebCore/xml/XSLTProcessor.cpp1
-rw-r--r--WebKit/ChangeLog39
-rw-r--r--WebKit/WebKit.xcodeproj/project.pbxproj6
-rw-r--r--WebKit/chromium/ChangeLog704
-rw-r--r--WebKit/chromium/DEPS2
-rw-r--r--WebKit/chromium/WebKit.gyp99
-rw-r--r--WebKit/chromium/features.gypi3
-rw-r--r--WebKit/chromium/public/WebExternalPopupMenu.h46
-rw-r--r--WebKit/chromium/public/WebExternalPopupMenuClient.h56
-rw-r--r--WebKit/chromium/public/WebFileError.h21
-rw-r--r--WebKit/chromium/public/WebFrameClient.h6
-rw-r--r--WebKit/chromium/public/WebIDBCursor.h2
-rw-r--r--WebKit/chromium/public/WebIDBDatabase.h2
-rw-r--r--WebKit/chromium/public/WebIDBDatabaseError.h2
-rwxr-xr-xWebKit/chromium/public/WebIDBFactory.h2
-rw-r--r--WebKit/chromium/public/WebIDBIndex.h2
-rw-r--r--WebKit/chromium/public/WebIDBKey.h1
-rwxr-xr-xWebKit/chromium/public/WebIDBObjectStore.h2
-rw-r--r--WebKit/chromium/public/WebIDBTransaction.h2
-rw-r--r--WebKit/chromium/public/WebMenuItemInfo.h9
-rw-r--r--WebKit/chromium/public/WebSecurityOrigin.h1
-rw-r--r--WebKit/chromium/public/WebSpeechInputController.h4
-rw-r--r--WebKit/chromium/public/WebSpeechInputControllerMock.h4
-rw-r--r--WebKit/chromium/public/WebSpeechInputListener.h8
-rw-r--r--WebKit/chromium/public/WebSpeechInputResult.h63
-rw-r--r--WebKit/chromium/public/WebView.h10
-rw-r--r--WebKit/chromium/public/WebViewClient.h4
-rw-r--r--WebKit/chromium/src/ApplicationCacheHost.cpp5
-rw-r--r--WebKit/chromium/src/AssertMatchingEnums.cpp20
-rw-r--r--WebKit/chromium/src/AsyncFileWriterChromium.cpp2
-rw-r--r--WebKit/chromium/src/BackForwardListClientImpl.cpp13
-rw-r--r--WebKit/chromium/src/BackForwardListClientImpl.h3
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.cpp7
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.h2
-rw-r--r--WebKit/chromium/src/ContextMenuClientImpl.cpp2
-rw-r--r--WebKit/chromium/src/EditorClientImpl.cpp2
-rw-r--r--WebKit/chromium/src/EventListenerWrapper.cpp2
-rw-r--r--WebKit/chromium/src/ExternalPopupMenu.cpp141
-rw-r--r--WebKit/chromium/src/ExternalPopupMenu.h82
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.cpp13
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.h4
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.cpp19
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.h13
-rw-r--r--WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp9
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp45
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h6
-rw-r--r--WebKit/chromium/src/WebIDBDatabaseImpl.h2
-rwxr-xr-xWebKit/chromium/src/WebIDBFactory.cpp17
-rwxr-xr-xWebKit/chromium/src/WebIDBObjectStoreImpl.cpp2
-rw-r--r--WebKit/chromium/src/WebMediaPlayerClientImpl.cpp29
-rw-r--r--WebKit/chromium/src/WebMediaPlayerClientImpl.h7
-rw-r--r--WebKit/chromium/src/WebSecurityOrigin.cpp5
-rw-r--r--WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp13
-rw-r--r--WebKit/chromium/src/WebSpeechInputControllerMockImpl.h9
-rw-r--r--WebKit/chromium/src/WebSpeechInputResult.cpp54
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp42
-rw-r--r--WebKit/chromium/src/WebViewImpl.h9
-rw-r--r--WebKit/chromium/src/js/Tests.js140
-rw-r--r--WebKit/chromium/src/mac/WebInputEventFactory.mm2
-rw-r--r--WebKit/efl/ChangeLog57
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp3
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.h2
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp10
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h5
-rw-r--r--WebKit/efl/ewk/ewk_history.cpp10
-rw-r--r--WebKit/efl/ewk/ewk_private.h4
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp9
-rw-r--r--WebKit/gtk/ChangeLog185
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp7
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.h2
-rw-r--r--WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp56
-rw-r--r--WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h39
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp13
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h5
-rw-r--r--WebKit/gtk/tests/testatk.c120
-rw-r--r--WebKit/gtk/webkit/webkitprivate.h11
-rw-r--r--WebKit/gtk/webkit/webkitwebbackforwardlist.cpp42
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp115
-rw-r--r--WebKit/haiku/ChangeLog40
-rw-r--r--WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp3
-rw-r--r--WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h2
-rw-r--r--WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp10
-rw-r--r--WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h5
-rw-r--r--WebKit/mac/ChangeLog309
-rw-r--r--WebKit/mac/Configurations/FeatureDefines.xcconfig7
-rw-r--r--WebKit/mac/History/WebBackForwardList.mm26
-rw-r--r--WebKit/mac/History/WebBackForwardListInternal.h8
-rw-r--r--WebKit/mac/Misc/WebDownload.mm2
-rw-r--r--WebKit/mac/Misc/WebElementDictionary.mm6
-rw-r--r--WebKit/mac/Misc/WebKitVersionChecks.h1
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h4
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm15
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm55
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm18
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyInstance.mm4
-rw-r--r--WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs3
-rw-r--r--WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs3
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.h2
-rw-r--r--WebKit/mac/WebCoreSupport/WebChromeClient.mm12
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h5
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm21
-rw-r--r--WebKit/mac/WebCoreSupport/WebSystemInterface.mm5
-rw-r--r--WebKit/mac/WebKit.exp1
-rw-r--r--WebKit/mac/WebView/WebFrameView.mm4
-rw-r--r--WebKit/mac/WebView/WebHTMLViewPrivate.h4
-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/WebScriptDebugDelegate.mm2
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.mm6
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm1
-rw-r--r--WebKit/mac/WebView/WebView.mm67
-rw-r--r--WebKit/mac/WebView/WebViewData.h2
-rw-r--r--WebKit/mac/WebView/WebViewPrivate.h4
-rw-r--r--WebKit/qt/Api/qwebelement.cpp5
-rw-r--r--WebKit/qt/Api/qwebframe.h2
-rw-r--r--WebKit/qt/Api/qwebframe_p.h7
-rw-r--r--WebKit/qt/Api/qwebhistory.cpp4
-rw-r--r--WebKit/qt/Api/qwebhistory_p.h6
-rw-r--r--WebKit/qt/Api/qwebpage.cpp148
-rw-r--r--WebKit/qt/ChangeLog293
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp7
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.h2
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp5
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h1
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp27
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h6
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.cpp144
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.h45
-rw-r--r--WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp46
-rw-r--r--WebKit/qt/tests/qwebelement/tst_qwebelement.cpp6
-rw-r--r--WebKit/qt/tests/qwebframe/tst_qwebframe.cpp13
-rw-r--r--WebKit/qt/tests/qwebpage/tst_qwebpage.cpp35
-rw-r--r--WebKit/win/ChangeLog148
-rwxr-xr-xWebKit/win/Interfaces/IWebFramePrivate.idl2
-rw-r--r--WebKit/win/Interfaces/IWebView.idl1
-rw-r--r--WebKit/win/Interfaces/WebKit.idl3
-rw-r--r--WebKit/win/WebBackForwardList.cpp12
-rw-r--r--WebKit/win/WebBackForwardList.h8
-rw-r--r--WebKit/win/WebCookieManagerCFNet.cpp2
-rw-r--r--WebKit/win/WebCoreSupport/WebChromeClient.cpp13
-rw-r--r--WebKit/win/WebCoreSupport/WebChromeClient.h2
-rw-r--r--WebKit/win/WebCoreSupport/WebContextMenuClient.cpp2
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp15
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameLoaderClient.h5
-rw-r--r--WebKit/win/WebElementPropertyBag.cpp5
-rw-r--r--WebKit/win/WebFrame.cpp17
-rw-r--r--WebKit/win/WebFrame.h6
-rw-r--r--WebKit/win/WebKitPrefix.h2
-rw-r--r--WebKit/win/WebView.cpp11
-rw-r--r--WebKit/win/WebView.h7
-rw-r--r--WebKit/wince/ChangeLog65
-rw-r--r--WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp3
-rw-r--r--WebKit/wince/WebCoreSupport/ChromeClientWinCE.h2
-rw-r--r--WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp225
-rw-r--r--WebKit/wince/WebCoreSupport/EditorClientWinCE.h2
-rw-r--r--WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp10
-rw-r--r--WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h5
-rw-r--r--WebKit/wx/ChangeLog51
-rw-r--r--WebKit/wx/WebFrame.cpp10
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.cpp3
-rw-r--r--WebKit/wx/WebKitSupport/ChromeClientWx.h2
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp10
-rw-r--r--WebKit/wx/WebKitSupport/FrameLoaderClientWx.h5
-rw-r--r--WebKitLibraries/ChangeLog84
-rw-r--r--WebKitLibraries/WebKitSystemInterface.h14
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceLeopard.abin1621352 -> 1372392 bytes
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.abin1353260 -> 1108516 bytes
-rw-r--r--WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h1
-rw-r--r--WebKitLibraries/win/lib/WebKitSystemInterface.libbin1237016 -> 1246502 bytes
-rw-r--r--WebKitLibraries/win/lib/WebKitSystemInterface_debug.libbin482408 -> 484884 bytes
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops35
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops39
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json4
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg1
-rw-r--r--WebKitTools/ChangeLog2086
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp31
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.h5
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj35
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.cpp16
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.h6
-rw-r--r--WebKitTools/DumpRenderTree/PixelDumpSupport.cpp3
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp1
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h1
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp35
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h5
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp70
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp203
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp52
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj8
-rw-r--r--WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp229
-rw-r--r--WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h (renamed from WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.h)13
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp49
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp12
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.h11
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h8
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h1
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.cpp9
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.h21
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.cpp42
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.h1
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp13
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.h4
-rw-r--r--WebKitTools/DumpRenderTree/config.h12
-rw-r--r--WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp7
-rw-r--r--WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp71
-rw-r--r--WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp12
-rw-r--r--WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm28
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm5
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm37
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h22
-rw-r--r--WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm26
-rw-r--r--WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h1
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm2
-rw-r--r--WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.mm200
-rw-r--r--WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm76
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp8
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h3
-rw-r--r--WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro1
-rw-r--r--WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp7
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp10
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj12
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h2
-rw-r--r--WebKitTools/DumpRenderTree/win/EditingDelegate.cpp69
-rw-r--r--WebKitTools/DumpRenderTree/win/EditingDelegate.h2
-rw-r--r--WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp13
-rw-r--r--WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp3
-rwxr-xr-xWebKitTools/EWSTools/start-queue.sh2
-rw-r--r--WebKitTools/GNUmakefile.am2
-rw-r--r--WebKitTools/GtkLauncher/main.c138
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m31
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.cpp22
-rw-r--r--WebKitTools/QtTestBrowser/fpstimer.cpp9
-rw-r--r--WebKitTools/QtTestBrowser/fpstimer.h2
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.cpp37
-rw-r--r--WebKitTools/QueueStatusServer/model/queues_unittest.py7
-rw-r--r--WebKitTools/Scripts/VCSUtils.pm3
-rwxr-xr-xWebKitTools/Scripts/build-webkit128
-rwxr-xr-xWebKitTools/Scripts/old-run-webkit-tests26
-rwxr-xr-xWebKitTools/Scripts/prepare-ChangeLog4
-rwxr-xr-xWebKitTools/Scripts/print-vse-failure-logs80
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm6
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl56
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/__init__.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/api.py14
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/scm.py47
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/__init__.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/common/memoized.py55
-rw-r--r--WebKitTools/Scripts/webkitpy/common/memoized_unittest.py65
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla.py25
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/credentials.py57
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py66
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/rietveld.py79
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/statusserver.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py44
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py8
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py18
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py50
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py18
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py61
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py (renamed from WebKitTools/Scripts/webkitpy/common/net/rietveld_unittest.py)29
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py8
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py24
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py15
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py17
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py1
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py51
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py26
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checker.py22
-rwxr-xr-xWebKitTools/Scripts/webkitpy/style/checker_unittest.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py13
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py6
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/__init__.py6
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py60
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download.py16
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py7
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py11
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py70
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues.py106
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py91
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py22
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload.py6
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py11
-rwxr-xr-xWebKitTools/Scripts/webkitpy/tool/main.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool.py58
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/__init__.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/options.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/runtests.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py (renamed from WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py)43
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py45
-rw-r--r--WebKitTools/TestResultServer/handlers/testfilehandler.py57
-rw-r--r--WebKitTools/TestResultServer/index.yaml15
-rwxr-xr-xWebKitTools/TestResultServer/model/jsonresults.py65
-rwxr-xr-xWebKitTools/TestResultServer/model/jsonresults_unittest.py11
-rw-r--r--WebKitTools/TestResultServer/model/testfile.py28
-rw-r--r--WebKitTools/TestResultServer/templates/showfilelist.html5
-rw-r--r--WebKitTools/TestResultServer/templates/uploadform.html8
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig2
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleController.cpp6
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleController.h2
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleTest.h2
-rw-r--r--WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj38
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp65
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp50
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp61
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp11
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp61
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp59
-rw-r--r--WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm2
-rw-r--r--WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj12
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig2
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl9
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp61
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h21
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp146
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h7
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp14
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h12
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp40
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.h4
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.cpp6
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.h1
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj18
-rw-r--r--WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm2
-rw-r--r--autotools/symbols.filter2
1182 files changed, 38231 insertions, 10892 deletions
diff --git a/JavaScriptCore/API/APICast.h b/JavaScriptCore/API/APICast.h
index ba00d02..4294d3d 100644
--- a/JavaScriptCore/API/APICast.h
+++ b/JavaScriptCore/API/APICast.h
@@ -111,8 +111,8 @@ inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v)
if (!v)
return 0;
if (!v.isCell())
- return reinterpret_cast<JSValueRef>(asCell(JSC::jsAPIValueWrapper(exec, v)));
- return reinterpret_cast<JSValueRef>(asCell(v));
+ return reinterpret_cast<JSValueRef>(JSC::jsAPIValueWrapper(exec, v).asCell());
+ return reinterpret_cast<JSValueRef>(v.asCell());
#else
UNUSED_PARAM(exec);
return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v));
diff --git a/JavaScriptCore/API/JSValueRef.cpp b/JavaScriptCore/API/JSValueRef.cpp
index c22e8d8..b8dd7c6 100644
--- a/JavaScriptCore/API/JSValueRef.cpp
+++ b/JavaScriptCore/API/JSValueRef.cpp
@@ -219,7 +219,7 @@ JSValueRef JSValueMakeNumber(JSContextRef ctx, double value)
if (isnan(value))
value = NaN;
- return toRef(exec, jsNumber(exec, value));
+ return toRef(exec, jsNumber(value));
}
JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string)
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 95bf475..7b935d4 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,771 @@
+2010-10-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ REGRESSION: r69429-r69611: Crash in JSC::Interpreter::privateExecute
+ https://bugs.webkit.org/show_bug.cgi?id=47573
+
+ I think the interpreter portion of this was introduced by
+ an incorrect but silent merge when I updated prior to committing.
+ The JIT change is basically just a correctness fix, but it is
+ needed to prevent the testcase from asserting in debug builds.
+
+ The basic problem is incorrectly setting the activation object
+ on an arguments object. The crash was due to us setting a null
+ activation in the interpreter, in the jit we were setting the
+ activation of a strict mode arguments object.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * wtf/Platform.h:
+
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Roben and David Kilzer.
+
+ Fix and cleanup of build systems
+ https://bugs.webkit.org/show_bug.cgi?id=48342
+
+ * Configurations/FeatureDefines.xcconfig: Add missing ENABLE_FULLSCREEN_API
+
+2010-10-28 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Darin Adler.
+
+ Include stddef.h unconditionally in Assertions.h
+ https://bugs.webkit.org/show_bug.cgi?id=48573
+
+ There is no reason to have stddef.h include be MSVC-only.
+
+ * wtf/Assertions.h:
+
+2010-10-28 Herczeg Zoltan <zherczeg@webkit.org>
+
+ Rubber stamped by Csaba Osztrogonác.
+
+ Try to fix interpreter build.
+
+ Needed parentheses around assignment to avoid GCC warning after
+ http://trac.webkit.org/changeset/70703
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+
+2010-10-28 Peter Varga <pvarga@inf.u-szeged.hu>
+
+ Reviewed by Csaba Osztrogonác.
+
+ resetAssertionMatches() is an unused function in YARR Interpreter
+ https://bugs.webkit.org/show_bug.cgi?id=48503
+
+ The resetAssertionMatches() function is removed from YARR Interpreter
+ because it's never called.
+
+ * yarr/RegexInterpreter.cpp:
+ (JSC::Yarr::Interpreter::resetMatches):
+
+2010-10-28 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Wrong instruction form for BKPT
+ https://bugs.webkit.org/show_bug.cgi?id=48427
+
+ One '0' is missing from BKPT instruction.
+ Thanks for Jacob Bramley for reporting this error.
+
+ * assembler/ARMAssembler.h:
+
+2010-10-28 Xan Lopez <xlopez@igalia.com>
+
+ Try to fix Snow Leopard build.
+
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::testPrototype):
+
+2010-10-28 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Oliver Hunt.
+
+ Do not have two different asCell APIs in JSValue
+ https://bugs.webkit.org/show_bug.cgi?id=47979
+
+ Remove JSCell* asCell(JSValue) in favor of only using
+ JSValue::asCell().
+
+ * API/APICast.h:
+ (toRef):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::testPrototype):
+ * jit/JITStubs.cpp:
+ (JSC::JITThunks::tryCachePutByID):
+ (JSC::JITThunks::tryCacheGetByID):
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/GetterSetter.h:
+ (JSC::asGetterSetter):
+ * runtime/JSByteArray.h:
+ (JSC::asByteArray):
+ * runtime/JSCell.h:
+ (JSC::JSCell::getCallData):
+ (JSC::JSCell::getConstructData):
+ * runtime/JSString.h:
+ (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
+ (JSC::asString):
+ * runtime/JSValue.h:
+ * runtime/Operations.cpp:
+ (JSC::jsIsObjectType):
+ * runtime/Operations.h:
+ (JSC::normalizePrototypeChain):
+ * runtime/Protect.h:
+ (JSC::gcProtect):
+ (JSC::gcUnprotect):
+
+2010-10-27 Chao-ying Fu <fu@mips.com>
+
+ Reviewed by Oliver Hunt.
+
+ Support emit_op_mod() for MIPS on JSVALUE32_64
+ https://bugs.webkit.org/show_bug.cgi?id=46511
+
+ This patch uses MIPS div instructions for op_mod to improve performance.
+
+ * jit/JITArithmetic32_64.cpp:
+ (JSC::JIT::emit_op_mod):
+
+2010-10-27 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed build correction.
+
+ * wtf/Platform.h: Make sure ACCELERATED_COMPOSITING is
+ turned off in the WinCairo port. This isn't supported (yet.)
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Chris Marrin.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48279
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-10-27 Brian Weinstein <bweinstein@apple.com>
+
+ Windows build fix.
+
+ * jit/JITStubs.cpp:
+ (JSC::jitThrow):
+
+2010-10-27 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 48365 - Remove output parameters from JITStackFrame
+
+ The JIT stub functions presently use the stackframe to provide a couple of additional return values.
+ * In the case of uncaught exceptions the exception value is returned on the stackframe.exception property.
+ * In the case of caught exceptions the updated value for the callFrame register is returned on the stackframe.callFrame property.
+
+ Change exception returns such that exceptions are always returned on JSGlobalData::exception.
+ Change op_catch such that the new CallFrame value is returned from op_throw / vm_throw in regT0.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * debugger/Debugger.cpp:
+ (JSC::evaluateInGlobalCallFrame):
+ * debugger/DebuggerCallFrame.cpp:
+ (JSC::DebuggerCallFrame::evaluate):
+ * interpreter/CachedCall.h:
+ (JSC::CachedCall::CachedCall):
+ (JSC::CachedCall::call):
+ * interpreter/CallFrame.h:
+ (JSC::ExecState::exception):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::callEval):
+ (JSC::Interpreter::Interpreter):
+ (JSC::Interpreter::execute):
+ (JSC::Interpreter::executeCall):
+ (JSC::Interpreter::executeConstruct):
+ (JSC::Interpreter::prepareForRepeatCall):
+ (JSC::Interpreter::privateExecute):
+ * interpreter/Interpreter.h:
+ * jit/JITCode.h:
+ (JSC::JITCode::execute):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_catch):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_catch):
+ * jit/JITStubs.cpp:
+ (JSC::ctiTrampoline):
+ (JSC::jitThrow):
+ (JSC::DEFINE_STUB_FUNCTION):
+ * jit/JITStubs.h:
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncFilter):
+ (JSC::arrayProtoFuncMap):
+ (JSC::arrayProtoFuncEvery):
+ (JSC::arrayProtoFuncForEach):
+ (JSC::arrayProtoFuncSome):
+ (JSC::arrayProtoFuncReduce):
+ (JSC::arrayProtoFuncReduceRight):
+ * runtime/CallData.cpp:
+ (JSC::call):
+ * runtime/Completion.cpp:
+ (JSC::evaluate):
+ * runtime/ConstructData.cpp:
+ (JSC::construct):
+ * runtime/ExceptionHelpers.cpp:
+ (JSC::createErrorForInvalidGlobalAssignment):
+ (JSC::throwOutOfMemoryError):
+ (JSC::throwStackOverflowError):
+ * runtime/ExceptionHelpers.h:
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::sort):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::globalFuncEval):
+ * runtime/StringPrototype.cpp:
+ (JSC::stringProtoFuncReplace):
+
+2010-10-27 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48060
+ Speed up op_jeq_null and op_jneq_null.
+
+ For both opcodes the NullTag and UndefinedTag are checked to control the
+ jump. These values can be simply checked by AboveOrEqual or Below
+ condition if they are the two highest unsigned integers from JSValue's
+ Tag field.
+
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_jeq_null):
+ (JSC::JIT::emit_op_jneq_null):
+ * runtime/JSValue.h:
+
+2010-10-25 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41948
+ REGRESSION(r60392): Registerfile can be unwound too far following an exception
+
+ SunSpider reports no change.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::throwException): Walk the stack to calculate the high
+ water mark currently in use. It's not safe to assume that the current
+ CallFrame's high water mark is the highest high water mark because
+ calls do not always set up at the end of a CallFrame. A large caller
+ CallFrame can encompass a small callee CallFrame.
+
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::privateCompileCTINativeCall):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::privateCompileCTINativeCall): Make sure to set a 0 CodeBlock
+ in the CallFrame of a host call, like the Interpreter does, instead of
+ leaving the CodeBlock field uninitialized. The backtracing code requires
+ a valid CodeBlock field in each CallFrame.
+
+2010-10-27 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ Add cmn to branch32(reg, imm) on ARM
+ https://bugs.webkit.org/show_bug.cgi?id=48062
+
+ The conditional comparison can be done with cmn if the imm value is
+ negative and can fit into the cmn instruction.
+
+ * assembler/MacroAssemblerARM.h:
+ (JSC::MacroAssemblerARM::branch32):
+
+2010-10-26 Oliver Hunt <oliver@apple.com>
+
+ Interpreter build fix.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+
+2010-10-25 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Remove exec and globalData arguments from jsNumber
+ https://bugs.webkit.org/show_bug.cgi?id=48270
+
+ Remove the now unused exec and globalData arguments from jsNumber
+ and mechanically update all users of jsNumber.
+
+ * API/JSValueRef.cpp:
+ (JSValueMakeNumber):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitLoad):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::ArrayNode::emitBytecode):
+ * jit/JITArithmetic.cpp:
+ (JSC::JIT::emit_op_mod):
+ * jit/JITArithmetic32_64.cpp:
+ (JSC::JIT::emit_op_mod):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_jfalse):
+ (JSC::JIT::emit_op_jtrue):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * jsc.cpp:
+ (functionRun):
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::getOwnPropertySlot):
+ (JSC::Arguments::getOwnPropertyDescriptor):
+ * runtime/ArrayConstructor.cpp:
+ (JSC::ArrayConstructor::ArrayConstructor):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncPop):
+ (JSC::arrayProtoFuncPush):
+ (JSC::arrayProtoFuncShift):
+ (JSC::arrayProtoFuncSplice):
+ (JSC::arrayProtoFuncUnShift):
+ (JSC::arrayProtoFuncFilter):
+ (JSC::arrayProtoFuncMap):
+ (JSC::arrayProtoFuncEvery):
+ (JSC::arrayProtoFuncForEach):
+ (JSC::arrayProtoFuncSome):
+ (JSC::arrayProtoFuncReduce):
+ (JSC::arrayProtoFuncReduceRight):
+ (JSC::arrayProtoFuncIndexOf):
+ (JSC::arrayProtoFuncLastIndexOf):
+ * runtime/BooleanConstructor.cpp:
+ (JSC::BooleanConstructor::BooleanConstructor):
+ * runtime/CachedTranscendentalFunction.h:
+ (JSC::CachedTranscendentalFunction::operator()):
+ * runtime/DateConstructor.cpp:
+ (JSC::DateConstructor::DateConstructor):
+ (JSC::dateParse):
+ (JSC::dateNow):
+ (JSC::dateUTC):
+ * runtime/DateInstance.cpp:
+ (JSC::DateInstance::DateInstance):
+ * runtime/DatePrototype.cpp:
+ (JSC::dateProtoFuncGetFullYear):
+ (JSC::dateProtoFuncGetUTCFullYear):
+ (JSC::dateProtoFuncGetMonth):
+ (JSC::dateProtoFuncGetUTCMonth):
+ (JSC::dateProtoFuncGetDate):
+ (JSC::dateProtoFuncGetUTCDate):
+ (JSC::dateProtoFuncGetDay):
+ (JSC::dateProtoFuncGetUTCDay):
+ (JSC::dateProtoFuncGetHours):
+ (JSC::dateProtoFuncGetUTCHours):
+ (JSC::dateProtoFuncGetMinutes):
+ (JSC::dateProtoFuncGetUTCMinutes):
+ (JSC::dateProtoFuncGetSeconds):
+ (JSC::dateProtoFuncGetUTCSeconds):
+ (JSC::dateProtoFuncGetMilliSeconds):
+ (JSC::dateProtoFuncGetUTCMilliseconds):
+ (JSC::dateProtoFuncGetTimezoneOffset):
+ (JSC::dateProtoFuncSetTime):
+ (JSC::setNewValueFromTimeArgs):
+ (JSC::setNewValueFromDateArgs):
+ (JSC::dateProtoFuncSetYear):
+ (JSC::dateProtoFuncGetYear):
+ * runtime/Error.cpp:
+ (JSC::addErrorSourceInfo):
+ (JSC::addErrorDivotInfo):
+ * runtime/ErrorConstructor.cpp:
+ (JSC::ErrorConstructor::ErrorConstructor):
+ * runtime/FunctionConstructor.cpp:
+ (JSC::FunctionConstructor::FunctionConstructor):
+ * runtime/FunctionPrototype.cpp:
+ (JSC::FunctionPrototype::FunctionPrototype):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ * runtime/JSByteArray.cpp:
+ (JSC::JSByteArray::JSByteArray):
+ * runtime/JSByteArray.h:
+ (JSC::JSByteArray::getIndex):
+ * runtime/JSFunction.cpp:
+ (JSC::JSFunction::JSFunction):
+ (JSC::JSFunction::lengthGetter):
+ (JSC::JSFunction::getOwnPropertyDescriptor):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::reset):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::globalFuncParseInt):
+ (JSC::globalFuncParseFloat):
+ * runtime/JSNumberCell.h:
+ (JSC::JSValue::JSValue):
+ (JSC::jsNaN):
+ (JSC::JSValue::toJSNumber):
+ * runtime/JSONObject.cpp:
+ (JSC::unwrapBoxedPrimitive):
+ (JSC::PropertyNameForFunctionCall::value):
+ (JSC::JSONStringify):
+ * runtime/JSString.cpp:
+ (JSC::JSString::getStringPropertyDescriptor):
+ * runtime/JSString.h:
+ (JSC::JSString::getStringPropertySlot):
+ * runtime/JSValue.h:
+ (JSC::jsDoubleNumber):
+ (JSC::jsNumber):
+ (JSC::jsNaN):
+ (JSC::JSValue::JSValue):
+ (JSC::JSValue::toJSNumber):
+ * runtime/LiteralParser.cpp:
+ (JSC::LiteralParser::parse):
+ * runtime/MathObject.cpp:
+ (JSC::MathObject::MathObject):
+ (JSC::mathProtoFuncAbs):
+ (JSC::mathProtoFuncACos):
+ (JSC::mathProtoFuncASin):
+ (JSC::mathProtoFuncATan):
+ (JSC::mathProtoFuncATan2):
+ (JSC::mathProtoFuncCeil):
+ (JSC::mathProtoFuncCos):
+ (JSC::mathProtoFuncExp):
+ (JSC::mathProtoFuncFloor):
+ (JSC::mathProtoFuncLog):
+ (JSC::mathProtoFuncMax):
+ (JSC::mathProtoFuncMin):
+ (JSC::mathProtoFuncPow):
+ (JSC::mathProtoFuncRandom):
+ (JSC::mathProtoFuncRound):
+ (JSC::mathProtoFuncSin):
+ (JSC::mathProtoFuncSqrt):
+ (JSC::mathProtoFuncTan):
+ * runtime/NativeErrorConstructor.cpp:
+ (JSC::NativeErrorConstructor::NativeErrorConstructor):
+ * runtime/NumberConstructor.cpp:
+ (JSC::NumberConstructor::NumberConstructor):
+ (JSC::numberConstructorNaNValue):
+ (JSC::numberConstructorNegInfinity):
+ (JSC::numberConstructorPosInfinity):
+ (JSC::numberConstructorMaxValue):
+ (JSC::numberConstructorMinValue):
+ (JSC::constructWithNumberConstructor):
+ (JSC::callNumberConstructor):
+ * runtime/NumberPrototype.cpp:
+ (JSC::NumberPrototype::NumberPrototype):
+ * runtime/ObjectConstructor.cpp:
+ (JSC::ObjectConstructor::ObjectConstructor):
+ * runtime/Operations.cpp:
+ (JSC::jsAddSlowCase):
+ * runtime/Operations.h:
+ (JSC::jsAdd):
+ * runtime/PrototypeFunction.cpp:
+ (JSC::PrototypeFunction::PrototypeFunction):
+ * runtime/RegExpConstructor.cpp:
+ (JSC::RegExpConstructor::RegExpConstructor):
+ (JSC::RegExpMatchesArray::fillArrayInstance):
+ * runtime/RegExpObject.cpp:
+ (JSC::regExpObjectLastIndex):
+ * runtime/StringConstructor.cpp:
+ (JSC::StringConstructor::StringConstructor):
+ * runtime/StringPrototype.cpp:
+ (JSC::StringPrototype::StringPrototype):
+ (JSC::stringProtoFuncReplace):
+ (JSC::stringProtoFuncCharCodeAt):
+ (JSC::stringProtoFuncIndexOf):
+ (JSC::stringProtoFuncLastIndexOf):
+ (JSC::stringProtoFuncSearch):
+ (JSC::stringProtoFuncLocaleCompare):
+
+2010-10-25 David Tapuska <dtapuska@rim.com>
+
+ Reviewed by David Kilzer.
+
+ Enable VFP if our compiler settings indicated we had a hardware
+ VFP.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46096
+
+ * assembler/MacroAssemblerARM.cpp:
+ (JSC::isVFPPresent):
+
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70451.
+ http://trac.webkit.org/changeset/70451
+ https://bugs.webkit.org/show_bug.cgi?id=48249
+
+ Broke set-unloaded-frame-location.html under Qt (Requested by
+ caseq on #webkit).
+
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * wtf/text/TextPosition.h: Removed.
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Replace _countof with WTF_ARRAY_LENGTH
+ https://bugs.webkit.org/show_bug.cgi?id=48229
+
+ * wtf/Platform.h:
+
+2010-10-25 Peter Rybin <peter.rybin@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ HTML parser should provide script column position within HTML document to JavaScript engine
+ https://bugs.webkit.org/show_bug.cgi?id=45271
+
+ Adds TextPosition* classes -- a structure that stores line/column/generation
+ level coordinates inside text document. Adds *BasedNumber classes -- typesafe int
+ wrappers that emphasize whether int number is used as zero-based or
+ one-based.
+
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * wtf/text/TextPosition.h: Added.
+ (WTF::TextPosition::TextPosition):
+ (WTF::TextPosition::minimumPosition):
+ (WTF::TextPosition::belowRangePosition):
+ (WTF::ZeroBasedNumber::fromZeroBasedInt):
+ (WTF::ZeroBasedNumber::ZeroBasedNumber):
+ (WTF::ZeroBasedNumber::zeroBasedInt):
+ (WTF::ZeroBasedNumber::base):
+ (WTF::ZeroBasedNumber::belowBase):
+ (WTF::OneBasedNumber::fromOneBasedInt):
+ (WTF::OneBasedNumber::OneBasedNumber):
+ (WTF::OneBasedNumber::oneBasedInt):
+ (WTF::OneBasedNumber::convertAsZeroBasedInt):
+ (WTF::OneBasedNumber::convertToZeroBased):
+ (WTF::OneBasedNumber::base):
+ (WTF::OneBasedNumber::belowBase):
+ (WTF::toZeroBasedTextPosition):
+ (WTF::toOneBasedTextPosition):
+ (WTF::ZeroBasedNumber::convertToOneBased):
+
+2010-10-24 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by David Kilzer.
+
+ Check endianness with __BIG_ENDIAN in RVCT.
+ https://bugs.webkit.org/show_bug.cgi?id=46122
+
+ RVCT defines __BIG_ENDIAN if compiling for a big-endian target.
+
+ * wtf/Platform.h:
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Rubber-stamped by Dave Kilzer.
+
+ Removed empty directories.
+
+ * JavaScriptCore: Removed.
+ * JavaScriptCore/runtime: Removed.
+
+2010-10-24 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed, fix typo of last build fix.
+
+ * wtf/DateMath.cpp:
+
+2010-10-24 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed build fix for chromium.
+
+ * wtf/DateMath.cpp: Added missing include.
+
+2010-10-24 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Add WTF_ARRAY_LENGTH macro to WTF
+ https://bugs.webkit.org/show_bug.cgi?id=32828
+
+ Unify the different implementations and usages.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * runtime/DatePrototype.cpp:
+ (JSC::formatLocaleDate):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::reset):
+ * runtime/JSONObject.cpp:
+ (JSC::Stringifier::appendQuotedString):
+ (JSC::Stringifier::toJSON):
+ (JSC::Stringifier::appendStringifiedValue):
+ * runtime/UString.cpp:
+ (JSC::UString::number):
+ * wtf/DateMath.cpp:
+ (WTF::parseDateFromNullTerminatedCharacters):
+ * wtf/StdLibExtras.h:
+
+2010-10-24 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Filter example Chiseled from SVG Wow! is slow
+ https://bugs.webkit.org/show_bug.cgi?id=48174
+
+ Added 'using WTF::ByteArray;' at the end of ByteArray.h
+
+ * wtf/ByteArray.h:
+
+2010-10-24 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Inline WTF::bitwise_cast and fix style
+ https://bugs.webkit.org/show_bug.cgi?id=48208
+
+ * wtf/StdLibExtras.h:
+ (WTF::bitwise_cast):
+ (WTF::bitCount):
+
+2010-10-23 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Sam Weinig.
+
+ Unify globalData APIs
+ https://bugs.webkit.org/show_bug.cgi?id=47969
+
+ Make JSGlobalObject::globalData return a reference and adapt
+ callers. This unifies the API with the existing
+ CallFrame::globalData, which also returns a reference.
+
+ * debugger/Debugger.cpp:
+ (JSC::evaluateInGlobalCallFrame):
+ * interpreter/CallFrame.h:
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::dumpRegisters):
+ * jsc.cpp:
+ (runWithScripts):
+ * parser/JSParser.cpp:
+ (JSC::jsParse):
+ * parser/Parser.cpp:
+ (JSC::Parser::parse):
+ * parser/Parser.h:
+ (JSC::Parser::parse):
+ * runtime/Error.cpp:
+ (JSC::createError):
+ (JSC::createEvalError):
+ (JSC::createRangeError):
+ (JSC::createReferenceError):
+ (JSC::createSyntaxError):
+ (JSC::createTypeError):
+ (JSC::createURIError):
+ * runtime/FunctionConstructor.cpp:
+ (JSC::constructFunction):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::~JSGlobalObject):
+ (JSC::JSGlobalObject::markChildren):
+ * runtime/JSGlobalObject.h:
+ (JSC::JSGlobalObject::globalData):
+
+2010-10-23 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r70369.
+ http://trac.webkit.org/changeset/70369
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ Caused weird artifacts in expected results.
+
+ * wtf/Platform.h:
+
+2010-10-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Crashes randomly in cairo_scaled_font_destroy
+ https://bugs.webkit.org/show_bug.cgi?id=46794
+
+ Make PlatformRefPtr aware of hashTableDeletedValue. When PlatformRefPtr
+ goes away this should probably be handled in the future via some special
+ hooks in RefCounted (or its contained type).
+
+ * wtf/PlatformRefPtr.h:
+ (WTF::PlatformRefPtr::~PlatformRefPtr):
+ (WTF::PlatformRefPtr::clear):
+ (WTF::::operator):
+
+2010-10-22 Adam Roben <aroben@apple.com>
+
+ Remove the QuartzCorePresent.h mechanism
+
+ This header was used to detect whether QuartzCore headers were present
+ on the system. Everyone should have these headers now so we no longer
+ need to detect.
+
+ Reviewed by Sam Weinig.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Remove
+ code to generate QuartzCorePresent.h.
+
+ * wtf/Platform.h: Stop including QuartzCorePresent.h on Windows and
+ collapse all USE_ACCELERATED_COMPOSITING settings into one #ifdef.
+
+2010-10-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r70290.
+ http://trac.webkit.org/changeset/70290
+ https://bugs.webkit.org/show_bug.cgi?id=48111
+
+ Undelete Android build files.
+
+ * Android.mk: Added.
+
+2010-10-22 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ JSC interpreter regressions after r69940
+ https://bugs.webkit.org/show_bug.cgi?id=47839
+
+ Wrong "if": It should test whether the result exists,
+ and not the opposite. It is an interpreter bug, hence
+ the bots does not capture it.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::resolveBase):
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ Remove Android build system
+ https://bugs.webkit.org/show_bug.cgi?id=48111
+
+ * Android.mk: Removed.
+
+2010-10-21 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Add a String constructor which takes AECHAR*
+ https://bugs.webkit.org/show_bug.cgi?id=45043
+
+ Add String(const AECHAR*) constructor for convenience.
+
+ * wtf/text/WTFString.h:
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Use GCharsetConverter instead of g_iconv in TextCodecGtk
+ https://bugs.webkit.org/show_bug.cgi?id=47896
+
+ * wtf/gobject/GTypedefs.h:
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r70174.
+ http://trac.webkit.org/changeset/70174
+ https://bugs.webkit.org/show_bug.cgi?id=41948
+
+ This patch reverts a change that causes
+ http/tests/xmlhttprequest/origin-whitelisting-removal.html to crash.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::throwException):
+
2010-10-20 Simon Fraser <simon.fraser@apple.com>
Fix the EFL build.
diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 4c698ce..d08fadf 100644
--- a/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -75,6 +75,7 @@ ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME));
ENABLE_FILTERS_macosx = ENABLE_FILTERS;
ENABLE_FILE_SYSTEM = ;
+ENABLE_FULLSCREEN_API = ENABLE_FULLSCREEN_API;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME));
@@ -108,6 +109,8 @@ ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT;
ENABLE_SVG_USE = ENABLE_SVG_USE;
ENABLE_VIDEO = ENABLE_VIDEO;
+ENABLE_WEB_AUDIO = ;
+
ENABLE_WEB_SOCKETS = $(ENABLE_WEB_SOCKETS_$(REAL_PLATFORM_NAME));
ENABLE_WEB_SOCKETS_macosx = ENABLE_WEB_SOCKETS;
@@ -121,4 +124,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh
index 85c3152..fafe5c8 100755
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh
@@ -1,15 +1,5 @@
#!/usr/bin/bash
-# Determine if we have QuartzCore so we can turn on
-QUARTZCORE_H_PATH=$(cygpath -u "${WEBKITLIBRARIESDIR}/include/QuartzCore/QuartzCore.h")
-QUARTZCOREPRESENT_H_PATH=$(cygpath -u "${WEBKITOUTPUTDIR}/include/private/QuartzCorePresent.h")
-if test \( ! -f "${QUARTZCOREPRESENT_H_PATH}" \) -o \( -f "${QUARTZCORE_H_PATH}" -a \( "${QUARTZCORE_H_PATH}" -nt "${QUARTZCOREPRESENT_H_PATH}" \) \)
-then
- mkdir -p "$(dirname "${QUARTZCOREPRESENT_H_PATH}")"
- test ! -f "${QUARTZCORE_H_PATH}"
- echo "#define QUARTZCORE_PRESENT $?" > "${QUARTZCOREPRESENT_H_PATH}"
-fi
-
# Determine whether we have the versioned ICU 4.0 or the unversioned ICU 4.4
UNVERSIONED_ICU_LIB_PATH=$(cygpath -u "${WEBKITLIBRARIESDIR}/lib/libicuuc.lib")
ICUVERSION_H_PATH=$(cygpath -u "${WEBKITOUTPUTDIR}/include/private/ICUVersion.h")
diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h
index dfa726a..900f655 100644
--- a/JavaScriptCore/assembler/ARMAssembler.h
+++ b/JavaScriptCore/assembler/ARMAssembler.h
@@ -165,7 +165,7 @@ namespace JSC {
VMRS_APSR = 0x0ef1fa10,
#if WTF_ARM_ARCH_AT_LEAST(5)
CLZ = 0x016f0f10,
- BKPT = 0xe120070,
+ BKPT = 0xe1200070,
BLX = 0x012fff30,
#endif
#if WTF_ARM_ARCH_AT_LEAST(7)
@@ -206,7 +206,7 @@ namespace JSC {
enum {
padForAlign8 = 0x00,
padForAlign16 = 0x0000,
- padForAlign32 = 0xee120070,
+ padForAlign32 = 0xe12fff7f // 'bkpt 0xffff' instruction.
};
static const ARMWord INVALID_IMM = 0xf0000000;
diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.cpp b/JavaScriptCore/assembler/MacroAssemblerARM.cpp
index b5b20fa..2db5df1 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARM.cpp
+++ b/JavaScriptCore/assembler/MacroAssemblerARM.cpp
@@ -57,7 +57,11 @@ static bool isVFPPresent()
}
#endif
+#if (COMPILER(RVCT) && defined(__TARGET_FPU_VFP)) || (COMPILER(GCC) && defined(__VFP_FP__))
+ return true;
+#else
return false;
+#endif
}
const bool MacroAssemblerARM::s_isVFPPresent = isVFPPresent();
diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.h b/JavaScriptCore/assembler/MacroAssemblerARM.h
index 5de8b34..49c87c0 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -400,8 +400,13 @@ public:
if (right.m_isPointer) {
m_assembler.ldr_un_imm(ARMRegisters::S0, right.m_value);
m_assembler.cmp_r(left, ARMRegisters::S0);
- } else
- m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
+ } else {
+ ARMWord tmp = m_assembler.getOp2(-right.m_value);
+ if (tmp != ARMAssembler::INVALID_IMM)
+ m_assembler.cmn_r(left, tmp);
+ else
+ m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
+ }
return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
}
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index f34c38c..87f0beb 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -1080,10 +1080,10 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number)
// FIXME: Our hash tables won't hold infinity, so we make a new JSNumberCell each time.
// Later we can do the extra work to handle that like the other cases.
if (number == HashTraits<double>::emptyValue() || HashTraits<double>::isDeletedValue(number))
- return emitLoad(dst, jsNumber(globalData(), number));
+ return emitLoad(dst, jsNumber(number));
JSValue& valueInMap = m_numberMap.add(number, JSValue()).first->second;
if (!valueInMap)
- valueInMap = jsNumber(globalData(), number);
+ valueInMap = jsNumber(number);
return emitLoad(dst, valueInMap);
}
diff --git a/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 449cae9..f282542 100644
--- a/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -208,7 +208,7 @@ RegisterID* ArrayNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds
}
if (m_elision) {
- RegisterID* value = generator.emitLoad(0, jsNumber(generator.globalData(), m_elision + length));
+ RegisterID* value = generator.emitLoad(0, jsNumber(m_elision + length));
generator.emitPutById(array.get(), generator.propertyNames().length, value);
}
diff --git a/JavaScriptCore/debugger/Debugger.cpp b/JavaScriptCore/debugger/Debugger.cpp
index 17dfdf7..472a03a 100644
--- a/JavaScriptCore/debugger/Debugger.cpp
+++ b/JavaScriptCore/debugger/Debugger.cpp
@@ -106,7 +106,14 @@ JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSG
if (error)
return error;
- return globalObject->globalData()->interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception);
+ JSGlobalData& globalData = globalObject->globalData();
+ JSValue result = globalData.interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain());
+ if (globalData.exception) {
+ exception = globalData.exception;
+ globalData.exception = JSValue();
+ }
+ ASSERT(result);
+ return result;
}
} // namespace JSC
diff --git a/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index c98c7cc..a5897c5 100644
--- a/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -93,7 +93,14 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c
if (error)
return error;
- return m_callFrame->scopeChain()->globalData->interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception);
+ JSGlobalData& globalData = m_callFrame->globalData();
+ JSValue result = globalData.interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain());
+ if (globalData.exception) {
+ exception = globalData.exception;
+ globalData.exception = JSValue();
+ }
+ ASSERT(result);
+ return result;
}
} // namespace JSC
diff --git a/JavaScriptCore/interpreter/CachedCall.h b/JavaScriptCore/interpreter/CachedCall.h
index eb48a03..dfbe658 100644
--- a/JavaScriptCore/interpreter/CachedCall.h
+++ b/JavaScriptCore/interpreter/CachedCall.h
@@ -34,21 +34,20 @@
namespace JSC {
class CachedCall : public Noncopyable {
public:
- CachedCall(CallFrame* callFrame, JSFunction* function, int argCount, JSValue* exception)
+ CachedCall(CallFrame* callFrame, JSFunction* function, int argCount)
: m_valid(false)
, m_interpreter(callFrame->interpreter())
- , m_exception(exception)
, m_globalObjectScope(callFrame, function->scope().globalObject())
{
ASSERT(!function->isHostFunction());
- m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argCount, function->scope().node(), exception);
- m_valid = !*exception;
+ m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argCount, function->scope().node());
+ m_valid = !callFrame->hadException();
}
JSValue call()
{
ASSERT(m_valid);
- return m_interpreter->execute(m_closure, m_exception);
+ return m_interpreter->execute(m_closure);
}
void setThis(JSValue v) { m_closure.setArgument(0, v); }
void setArgument(int n, JSValue v) { m_closure.setArgument(n + 1, v); }
@@ -69,7 +68,6 @@ namespace JSC {
private:
bool m_valid;
Interpreter* m_interpreter;
- JSValue* m_exception;
DynamicGlobalObjectScope m_globalObjectScope;
CallFrameClosure m_closure;
};
diff --git a/JavaScriptCore/interpreter/CallFrame.h b/JavaScriptCore/interpreter/CallFrame.h
index bde9786..56709f3 100644
--- a/JavaScriptCore/interpreter/CallFrame.h
+++ b/JavaScriptCore/interpreter/CallFrame.h
@@ -63,9 +63,6 @@ namespace JSC {
return scopeChain()->globalThis;
}
- // FIXME: Elsewhere, we use JSGlobalData* rather than JSGlobalData&.
- // We should make this more uniform and either use a reference everywhere
- // or a pointer everywhere.
JSGlobalData& globalData() const
{
ASSERT(scopeChain()->globalData);
@@ -79,7 +76,6 @@ namespace JSC {
void clearException() { globalData().exception = JSValue(); }
JSValue exception() const { return globalData().exception; }
- JSValue* exceptionSlot() { return &globalData().exception; }
bool hadException() const { return globalData().exception; }
const CommonIdentifiers& propertyNames() const { return *globalData().propertyNames; }
diff --git a/JavaScriptCore/interpreter/Interpreter.cpp b/JavaScriptCore/interpreter/Interpreter.cpp
index 632571d..68be9fa 100644
--- a/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/JavaScriptCore/interpreter/Interpreter.cpp
@@ -283,7 +283,7 @@ NEVER_INLINE void Interpreter::resolveBase(CallFrame* callFrame, Instruction* vP
bool isStrictPut = vPC[3].u.operand;
Identifier ident = callFrame->codeBlock()->identifier(property);
JSValue result = JSC::resolveBase(callFrame, ident, callFrame->scopeChain(), isStrictPut);
- if (!result) {
+ if (result) {
callFrame->r(dst) = result;
ASSERT(callFrame->r(dst).jsValue());
} else
@@ -383,7 +383,7 @@ static NEVER_INLINE bool isInvalidParamForInstanceOf(CallFrame* callFrame, CodeB
}
#endif
-NEVER_INLINE JSValue Interpreter::callEval(CallFrame* callFrame, RegisterFile* registerFile, Register* argv, int argc, int registerOffset, JSValue& exceptionValue)
+NEVER_INLINE JSValue Interpreter::callEval(CallFrame* callFrame, RegisterFile* registerFile, Register* argv, int argc, int registerOffset)
{
if (argc < 2)
return jsUndefined();
@@ -407,13 +407,14 @@ NEVER_INLINE JSValue Interpreter::callEval(CallFrame* callFrame, RegisterFile* r
}
ScopeChainNode* scopeChain = callFrame->scopeChain();
+ JSValue exceptionValue;
RefPtr<EvalExecutable> eval = codeBlock->evalCodeCache().get(callFrame, codeBlock->isStrictMode(), programSource, scopeChain, exceptionValue);
- JSValue result = jsUndefined();
- if (eval)
- result = callFrame->globalData().interpreter->execute(eval.get(), callFrame, callFrame->r(codeBlock->thisRegister()).jsValue().toThisObject(callFrame), callFrame->registers() - registerFile->start() + registerOffset, scopeChain, &exceptionValue);
+ ASSERT(!eval == exceptionValue);
+ if (UNLIKELY(!eval))
+ return throwError(callFrame, exceptionValue);
- return result;
+ return callFrame->globalData().interpreter->execute(eval.get(), callFrame, callFrame->r(codeBlock->thisRegister()).jsValue().toThisObject(callFrame), callFrame->registers() - registerFile->start() + registerOffset, scopeChain);
}
Interpreter::Interpreter()
@@ -421,7 +422,7 @@ Interpreter::Interpreter()
, m_reentryDepth(0)
{
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
- privateExecute(InitializeAndReturn, 0, 0, 0);
+ privateExecute(InitializeAndReturn, 0, 0);
for (int i = 0; i < numOpcodeIDs; ++i)
m_opcodeIDTable.add(m_opcodeTable[i], static_cast<OpcodeID>(i));
@@ -448,7 +449,7 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
printf("-----------------------------------------------------------------------------\n");
CodeBlock* codeBlock = callFrame->codeBlock();
- RegisterFile* registerFile = &callFrame->scopeChain()->globalObject->globalData()->interpreter->registerFile();
+ RegisterFile* registerFile = &callFrame->scopeChain()->globalObject->globalData().interpreter->registerFile();
const Register* it;
const Register* end;
JSValue v;
@@ -676,8 +677,8 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV
}
// Shrink the JS stack, in case stack overflow made it huge.
- Register* highWaterMark = callFrame->registers() + callFrame->codeBlock()->m_numCalleeRegisters;
- for (CallFrame* callerFrame = callFrame->callerFrame()->removeHostCallFrameFlag(); callerFrame; callerFrame = callerFrame->callerFrame()->removeHostCallFrameFlag()) {
+ Register* highWaterMark = 0;
+ for (CallFrame* callerFrame = callFrame; callerFrame; callerFrame = callerFrame->callerFrame()->removeHostCallFrameFlag()) {
CodeBlock* codeBlock = callerFrame->codeBlock();
if (!codeBlock)
continue;
@@ -701,30 +702,34 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV
return handler;
}
-JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue* exception)
+static inline JSValue checkedReturn(JSValue returnValue)
+{
+ ASSERT(returnValue);
+ return returnValue;
+}
+
+static inline JSObject* checkedReturn(JSObject* returnValue)
+{
+ ASSERT(returnValue);
+ return returnValue;
+}
+
+JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj)
{
ASSERT(!scopeChain->globalData->exception);
- if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
- if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
- *exception = createStackOverflowError(callFrame);
- return jsNull();
- }
- }
+ if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
+ return checkedReturn(throwStackOverflowError(callFrame));
JSObject* error = program->compile(callFrame, scopeChain);
- if (error) {
- *exception = error;
- return jsNull();
- }
+ if (error)
+ return checkedReturn(throwError(callFrame, error));
CodeBlock* codeBlock = &program->generatedBytecode();
Register* oldEnd = m_registerFile.end();
Register* newEnd = oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
- if (!m_registerFile.grow(newEnd)) {
- *exception = createStackOverflowError(callFrame);
- return jsNull();
- }
+ if (!m_registerFile.grow(newEnd))
+ return checkedReturn(throwStackOverflowError(callFrame));
JSGlobalObject* lastGlobalObject = m_registerFile.globalObject();
JSGlobalObject* globalObject = callFrame->dynamicGlobalObject();
@@ -751,10 +756,10 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, S
m_reentryDepth++;
#if ENABLE(JIT)
if (callFrame->globalData().canUseJIT())
- result = program->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
+ result = program->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData);
else
#endif
- result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ result = privateExecute(Normal, &m_registerFile, newCallFrame);
m_reentryDepth--;
}
@@ -767,28 +772,22 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, S
m_registerFile.shrink(oldEnd);
- return result;
+ return checkedReturn(result);
}
-JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args, JSValue* exception)
+JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args)
{
ASSERT(!callFrame->hadException());
- if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
- if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
- *exception = createStackOverflowError(callFrame);
- return jsNull();
- }
- }
+ if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
+ return checkedReturn(throwStackOverflowError(callFrame));
Register* oldEnd = m_registerFile.end();
int argCount = 1 + args.size(); // implicit "this" parameter
size_t registerOffset = argCount + RegisterFile::CallFrameHeaderSize;
- if (!m_registerFile.grow(oldEnd + registerOffset)) {
- *exception = createStackOverflowError(callFrame);
- return jsNull();
- }
+ if (!m_registerFile.grow(oldEnd + registerOffset))
+ return checkedReturn(throwStackOverflowError(callFrame));
CallFrame* newCallFrame = CallFrame::create(oldEnd);
size_t dst = 0;
@@ -802,17 +801,15 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
JSObject* compileError = callData.js.functionExecutable->compileForCall(callFrame, callDataScopeChain);
if (UNLIKELY(!!compileError)) {
- *exception = compileError;
m_registerFile.shrink(oldEnd);
- return jsNull();
+ return checkedReturn(throwError(callFrame, compileError));
}
CodeBlock* newCodeBlock = &callData.js.functionExecutable->generatedBytecodeForCall();
newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
if (UNLIKELY(!newCallFrame)) {
- *exception = createStackOverflowError(callFrame);
m_registerFile.shrink(oldEnd);
- return jsNull();
+ return checkedReturn(throwStackOverflowError(callFrame));
}
newCallFrame->init(newCodeBlock, 0, callDataScopeChain, callFrame->addHostCallFrameFlag(), argCount, function);
@@ -830,10 +827,10 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
m_reentryDepth++;
#if ENABLE(JIT)
if (callFrame->globalData().canUseJIT())
- result = callData.js.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData, exception);
+ result = callData.js.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData);
else
#endif
- result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ result = privateExecute(Normal, &m_registerFile, newCallFrame);
m_reentryDepth--;
}
@@ -841,7 +838,7 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
(*profiler)->didExecute(newCallFrame, function);
m_registerFile.shrink(oldEnd);
- return result;
+ return checkedReturn(result);
}
ASSERT(callType == CallTypeHost);
@@ -865,28 +862,22 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
(*profiler)->didExecute(newCallFrame, function);
m_registerFile.shrink(oldEnd);
- return result;
+ return checkedReturn(result);
}
-JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* constructor, ConstructType constructType, const ConstructData& constructData, const ArgList& args, JSValue* exception)
+JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* constructor, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
{
ASSERT(!callFrame->hadException());
- if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
- if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
- *exception = createStackOverflowError(callFrame);
- return 0;
- }
- }
+ if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
+ return checkedReturn(throwStackOverflowError(callFrame));
Register* oldEnd = m_registerFile.end();
int argCount = 1 + args.size(); // implicit "this" parameter
size_t registerOffset = argCount + RegisterFile::CallFrameHeaderSize;
- if (!m_registerFile.grow(oldEnd + registerOffset)) {
- *exception = createStackOverflowError(callFrame);
- return 0;
- }
+ if (!m_registerFile.grow(oldEnd + registerOffset))
+ return checkedReturn(throwStackOverflowError(callFrame));
CallFrame* newCallFrame = CallFrame::create(oldEnd);
size_t dst = 0;
@@ -899,17 +890,15 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
JSObject* compileError = constructData.js.functionExecutable->compileForConstruct(callFrame, constructDataScopeChain);
if (UNLIKELY(!!compileError)) {
- *exception = compileError;
m_registerFile.shrink(oldEnd);
- return 0;
+ return checkedReturn(throwError(callFrame, compileError));
}
CodeBlock* newCodeBlock = &constructData.js.functionExecutable->generatedBytecodeForConstruct();
newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
if (UNLIKELY(!newCallFrame)) {
- *exception = createStackOverflowError(callFrame);
m_registerFile.shrink(oldEnd);
- return 0;
+ return checkedReturn(throwStackOverflowError(callFrame));
}
newCallFrame->init(newCodeBlock, 0, constructDataScopeChain, callFrame->addHostCallFrameFlag(), argCount, constructor);
@@ -927,10 +916,10 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
m_reentryDepth++;
#if ENABLE(JIT)
if (callFrame->globalData().canUseJIT())
- result = constructData.js.functionExecutable->generatedJITCodeForConstruct().execute(&m_registerFile, newCallFrame, constructDataScopeChain->globalData, exception);
+ result = constructData.js.functionExecutable->generatedJITCodeForConstruct().execute(&m_registerFile, newCallFrame, constructDataScopeChain->globalData);
else
#endif
- result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ result = privateExecute(Normal, &m_registerFile, newCallFrame);
m_reentryDepth--;
}
@@ -941,7 +930,7 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
if (callFrame->hadException())
return 0;
ASSERT(result.isObject());
- return asObject(result);
+ return checkedReturn(asObject(result));
}
ASSERT(constructType == ConstructTypeHost);
@@ -968,16 +957,16 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
if (callFrame->hadException())
return 0;
ASSERT(result.isObject());
- return asObject(result);
+ return checkedReturn(asObject(result));
}
-CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionExecutable, CallFrame* callFrame, JSFunction* function, int argCount, ScopeChainNode* scopeChain, JSValue* exception)
+CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionExecutable, CallFrame* callFrame, JSFunction* function, int argCount, ScopeChainNode* scopeChain)
{
ASSERT(!scopeChain->globalData->exception);
if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
- *exception = createStackOverflowError(callFrame);
+ throwStackOverflowError(callFrame);
return CallFrameClosure();
}
}
@@ -986,7 +975,7 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionE
int argc = 1 + argCount; // implicit "this" parameter
if (!m_registerFile.grow(oldEnd + argc)) {
- *exception = createStackOverflowError(callFrame);
+ throwStackOverflowError(callFrame);
return CallFrameClosure();
}
@@ -997,7 +986,7 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionE
JSObject* error = FunctionExecutable->compileForCall(callFrame, scopeChain);
if (error) {
- *exception = error;
+ throwError(callFrame, error);
m_registerFile.shrink(oldEnd);
return CallFrameClosure();
}
@@ -1005,17 +994,16 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionE
newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
if (UNLIKELY(!newCallFrame)) {
- *exception = createStackOverflowError(callFrame);
+ throwStackOverflowError(callFrame);
m_registerFile.shrink(oldEnd);
return CallFrameClosure();
}
- // a 0 codeBlock indicates a built-in caller
newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argc, function);
CallFrameClosure result = { callFrame, newCallFrame, function, FunctionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argc };
return result;
}
-JSValue Interpreter::execute(CallFrameClosure& closure, JSValue* exception)
+JSValue Interpreter::execute(CallFrameClosure& closure)
{
closure.resetCallFrame();
Profiler** profiler = Profiler::enabledProfilerReference();
@@ -1031,20 +1019,20 @@ JSValue Interpreter::execute(CallFrameClosure& closure, JSValue* exception)
#if ENABLE(INTERPRETER)
if (closure.newCallFrame->globalData().canUseJIT())
#endif
- result = closure.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, closure.newCallFrame, closure.globalData, exception);
+ result = closure.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, closure.newCallFrame, closure.globalData);
#if ENABLE(INTERPRETER)
else
#endif
#endif
#if ENABLE(INTERPRETER)
- result = privateExecute(Normal, &m_registerFile, closure.newCallFrame, exception);
+ result = privateExecute(Normal, &m_registerFile, closure.newCallFrame);
#endif
m_reentryDepth--;
}
if (*profiler)
(*profiler)->didExecute(closure.oldCallFrame, closure.function);
- return result;
+ return checkedReturn(result);
}
void Interpreter::endRepeatCall(CallFrameClosure& closure)
@@ -1052,34 +1040,26 @@ void Interpreter::endRepeatCall(CallFrameClosure& closure)
m_registerFile.shrink(closure.oldEnd);
}
-JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception)
+JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain)
{
JSObject* compileError = eval->compile(callFrame, scopeChain);
- if (UNLIKELY(!!compileError)) {
- *exception = compileError;
- return jsNull();
- }
- return execute(eval, callFrame, thisObj, m_registerFile.size() + eval->generatedBytecode().m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
+ if (UNLIKELY(!!compileError))
+ return checkedReturn(throwError(callFrame, compileError));
+ return execute(eval, callFrame, thisObj, m_registerFile.size() + eval->generatedBytecode().m_numParameters + RegisterFile::CallFrameHeaderSize, scopeChain);
}
-JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, int globalRegisterOffset, ScopeChainNode* scopeChain, JSValue* exception)
+JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObject* thisObj, int globalRegisterOffset, ScopeChainNode* scopeChain)
{
ASSERT(!scopeChain->globalData->exception);
- if (m_reentryDepth >= MaxSmallThreadReentryDepth) {
- if (m_reentryDepth >= callFrame->globalData().maxReentryDepth) {
- *exception = createStackOverflowError(callFrame);
- return jsNull();
- }
- }
+ if (m_reentryDepth >= MaxSmallThreadReentryDepth && m_reentryDepth >= callFrame->globalData().maxReentryDepth)
+ return checkedReturn(throwStackOverflowError(callFrame));
DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
JSObject* compileError = eval->compile(callFrame, scopeChain);
- if (UNLIKELY(!!compileError)) {
- *exception = compileError;
- return jsNull();
- }
+ if (UNLIKELY(!!compileError))
+ return checkedReturn(throwError(callFrame, compileError));
EvalCodeBlock* codeBlock = &eval->generatedBytecode();
JSObject* variableObject;
@@ -1121,15 +1101,13 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
Register* oldEnd = m_registerFile.end();
Register* newEnd = m_registerFile.start() + globalRegisterOffset + codeBlock->m_numCalleeRegisters;
if (!m_registerFile.grow(newEnd)) {
- *exception = createStackOverflowError(callFrame);
if (pushedScope)
scopeChain->pop();
- return jsNull();
+ return checkedReturn(throwStackOverflowError(callFrame));
}
CallFrame* newCallFrame = CallFrame::create(m_registerFile.start() + globalRegisterOffset);
- // a 0 codeBlock indicates a built-in caller
ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->m_numParameters, 0);
newCallFrame->r(newCallFrame->hostThisRegister()) = JSValue(thisObj);
@@ -1151,13 +1129,13 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
#if ENABLE(INTERPRETER)
if (callFrame->globalData().canUseJIT())
#endif
- result = eval->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData, exception);
+ result = eval->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData);
#if ENABLE(INTERPRETER)
else
#endif
#endif
#if ENABLE(INTERPRETER)
- result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ result = privateExecute(Normal, &m_registerFile, newCallFrame);
#endif
m_reentryDepth--;
}
@@ -1168,7 +1146,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
m_registerFile.shrink(oldEnd);
if (pushedScope)
scopeChain->pop();
- return result;
+ return checkedReturn(result);
}
NEVER_INLINE void Interpreter::debug(CallFrame* callFrame, DebugHookID debugHookID, int firstLine, int lastLine)
@@ -1227,7 +1205,7 @@ NEVER_INLINE void Interpreter::tryCachePutByID(CallFrame* callFrame, CodeBlock*
return;
}
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = baseCell->structure();
if (structure->isUncacheableDictionary()) {
@@ -1317,7 +1295,7 @@ NEVER_INLINE void Interpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock*
return;
}
- Structure* structure = asCell(baseValue)->structure();
+ Structure* structure = baseValue.asCell()->structure();
if (structure->isUncacheableDictionary()) {
vPC[0] = getOpcode(op_get_by_id_generic);
@@ -1437,7 +1415,7 @@ NEVER_INLINE void Interpreter::uncacheGetByID(CodeBlock* codeBlock, Instruction*
#endif // ENABLE(INTERPRETER)
-JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue* exception)
+JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame)
{
// One-time initialization of our address tables. We have to put this code
// here because our labels are only in scope inside this function.
@@ -1445,7 +1423,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
#define LIST_OPCODE_LABEL(id, length) &&id,
static Opcode labels[] = { FOR_EACH_OPCODE_ID(LIST_OPCODE_LABEL) };
- for (size_t i = 0; i < sizeof(labels) / sizeof(Opcode); ++i)
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(labels); ++i)
m_opcodeTable[i] = labels[i];
#undef LIST_OPCODE_LABEL
#endif // ENABLE(COMPUTED_GOTO_INTERPRETER)
@@ -1463,7 +1441,6 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
#if !ENABLE(INTERPRETER)
UNUSED_PARAM(registerFile);
UNUSED_PARAM(callFrame);
- UNUSED_PARAM(exception);
return JSValue();
#else
@@ -1656,7 +1633,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
NEXT_INSTRUCTION();
}
- callFrame->r(dst) = jsBoolean(!src.isCell() || !asCell(src)->structure()->typeInfo().masqueradesAsUndefined());
+ callFrame->r(dst) = jsBoolean(!src.isCell() || !src.asCell()->structure()->typeInfo().masqueradesAsUndefined());
vPC += OPCODE_LENGTH(op_neq_null);
NEXT_INSTRUCTION();
}
@@ -1737,9 +1714,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
int srcDst = vPC[1].u.operand;
JSValue v = callFrame->r(srcDst).jsValue();
if (v.isInt32() && v.asInt32() < INT_MAX)
- callFrame->r(srcDst) = jsNumber(callFrame, v.asInt32() + 1);
+ callFrame->r(srcDst) = jsNumber(v.asInt32() + 1);
else {
- JSValue result = jsNumber(callFrame, v.toNumber(callFrame) + 1);
+ JSValue result = jsNumber(v.toNumber(callFrame) + 1);
CHECK_FOR_EXCEPTION();
callFrame->r(srcDst) = result;
}
@@ -1756,9 +1733,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
int srcDst = vPC[1].u.operand;
JSValue v = callFrame->r(srcDst).jsValue();
if (v.isInt32() && v.asInt32() > INT_MIN)
- callFrame->r(srcDst) = jsNumber(callFrame, v.asInt32() - 1);
+ callFrame->r(srcDst) = jsNumber(v.asInt32() - 1);
else {
- JSValue result = jsNumber(callFrame, v.toNumber(callFrame) - 1);
+ JSValue result = jsNumber(v.toNumber(callFrame) - 1);
CHECK_FOR_EXCEPTION();
callFrame->r(srcDst) = result;
}
@@ -1777,12 +1754,12 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
int srcDst = vPC[2].u.operand;
JSValue v = callFrame->r(srcDst).jsValue();
if (v.isInt32() && v.asInt32() < INT_MAX) {
- callFrame->r(srcDst) = jsNumber(callFrame, v.asInt32() + 1);
+ callFrame->r(srcDst) = jsNumber(v.asInt32() + 1);
callFrame->r(dst) = v;
} else {
JSValue number = callFrame->r(srcDst).jsValue().toJSNumber(callFrame);
CHECK_FOR_EXCEPTION();
- callFrame->r(srcDst) = jsNumber(callFrame, number.uncheckedGetNumber() + 1);
+ callFrame->r(srcDst) = jsNumber(number.uncheckedGetNumber() + 1);
callFrame->r(dst) = number;
}
@@ -1800,12 +1777,12 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
int srcDst = vPC[2].u.operand;
JSValue v = callFrame->r(srcDst).jsValue();
if (v.isInt32() && v.asInt32() > INT_MIN) {
- callFrame->r(srcDst) = jsNumber(callFrame, v.asInt32() - 1);
+ callFrame->r(srcDst) = jsNumber(v.asInt32() - 1);
callFrame->r(dst) = v;
} else {
JSValue number = callFrame->r(srcDst).jsValue().toJSNumber(callFrame);
CHECK_FOR_EXCEPTION();
- callFrame->r(srcDst) = jsNumber(callFrame, number.uncheckedGetNumber() - 1);
+ callFrame->r(srcDst) = jsNumber(number.uncheckedGetNumber() - 1);
callFrame->r(dst) = number;
}
@@ -1843,9 +1820,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
int dst = vPC[1].u.operand;
JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
if (src.isInt32() && (src.asInt32() & 0x7fffffff)) // non-zero and no overflow
- callFrame->r(dst) = jsNumber(callFrame, -src.asInt32());
+ callFrame->r(dst) = jsNumber(-src.asInt32());
else {
- JSValue result = jsNumber(callFrame, -src.toNumber(callFrame));
+ JSValue result = jsNumber(-src.toNumber(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -1864,7 +1841,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | (src2.asInt32() & 0xc0000000))) // no overflow
- callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() + src2.asInt32());
+ callFrame->r(dst) = jsNumber(src1.asInt32() + src2.asInt32());
else {
JSValue result = jsAdd(callFrame, src1, src2);
CHECK_FOR_EXCEPTION();
@@ -1883,9 +1860,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | src2.asInt32() >> 15)) // no overflow
- callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() * src2.asInt32());
+ callFrame->r(dst) = jsNumber(src1.asInt32() * src2.asInt32());
else {
- JSValue result = jsNumber(callFrame, src1.toNumber(callFrame) * src2.toNumber(callFrame));
+ JSValue result = jsNumber(src1.toNumber(callFrame) * src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -1904,7 +1881,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue();
JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue();
- JSValue result = jsNumber(callFrame, dividend.toNumber(callFrame) / divisor.toNumber(callFrame));
+ JSValue result = jsNumber(dividend.toNumber(callFrame) / divisor.toNumber(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
@@ -1923,7 +1900,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue();
if (dividend.isInt32() && divisor.isInt32() && divisor.asInt32() != 0) {
- JSValue result = jsNumber(callFrame, dividend.asInt32() % divisor.asInt32());
+ JSValue result = jsNumber(dividend.asInt32() % divisor.asInt32());
ASSERT(result);
callFrame->r(dst) = result;
vPC += OPCODE_LENGTH(op_mod);
@@ -1934,7 +1911,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
// order of argument evaluation is not guaranteed.
double d1 = dividend.toNumber(callFrame);
double d2 = divisor.toNumber(callFrame);
- JSValue result = jsNumber(callFrame, fmod(d1, d2));
+ JSValue result = jsNumber(fmod(d1, d2));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
vPC += OPCODE_LENGTH(op_mod);
@@ -1951,9 +1928,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
if (src1.isInt32() && src2.isInt32() && !(src1.asInt32() | (src2.asInt32() & 0xc0000000))) // no overflow
- callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() - src2.asInt32());
+ callFrame->r(dst) = jsNumber(src1.asInt32() - src2.asInt32());
else {
- JSValue result = jsNumber(callFrame, src1.toNumber(callFrame) - src2.toNumber(callFrame));
+ JSValue result = jsNumber(src1.toNumber(callFrame) - src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -1972,9 +1949,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue shift = callFrame->r(vPC[3].u.operand).jsValue();
if (val.isInt32() && shift.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, val.asInt32() << (shift.asInt32() & 0x1f));
+ callFrame->r(dst) = jsNumber(val.asInt32() << (shift.asInt32() & 0x1f));
else {
- JSValue result = jsNumber(callFrame, (val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f));
+ JSValue result = jsNumber((val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -1994,9 +1971,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue shift = callFrame->r(vPC[3].u.operand).jsValue();
if (val.isInt32() && shift.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, val.asInt32() >> (shift.asInt32() & 0x1f));
+ callFrame->r(dst) = jsNumber(val.asInt32() >> (shift.asInt32() & 0x1f));
else {
- JSValue result = jsNumber(callFrame, (val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
+ JSValue result = jsNumber((val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -2015,9 +1992,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue val = callFrame->r(vPC[2].u.operand).jsValue();
JSValue shift = callFrame->r(vPC[3].u.operand).jsValue();
if (val.isUInt32() && shift.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, val.asInt32() >> (shift.asInt32() & 0x1f));
+ callFrame->r(dst) = jsNumber(val.asInt32() >> (shift.asInt32() & 0x1f));
else {
- JSValue result = jsNumber(callFrame, (val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
+ JSValue result = jsNumber((val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -2036,9 +2013,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
if (src1.isInt32() && src2.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() & src2.asInt32());
+ callFrame->r(dst) = jsNumber(src1.asInt32() & src2.asInt32());
else {
- JSValue result = jsNumber(callFrame, src1.toInt32(callFrame) & src2.toInt32(callFrame));
+ JSValue result = jsNumber(src1.toInt32(callFrame) & src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -2057,9 +2034,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
if (src1.isInt32() && src2.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() ^ src2.asInt32());
+ callFrame->r(dst) = jsNumber(src1.asInt32() ^ src2.asInt32());
else {
- JSValue result = jsNumber(callFrame, src1.toInt32(callFrame) ^ src2.toInt32(callFrame));
+ JSValue result = jsNumber(src1.toInt32(callFrame) ^ src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -2078,9 +2055,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
if (src1.isInt32() && src2.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, src1.asInt32() | src2.asInt32());
+ callFrame->r(dst) = jsNumber(src1.asInt32() | src2.asInt32());
else {
- JSValue result = jsNumber(callFrame, src1.toInt32(callFrame) | src2.toInt32(callFrame));
+ JSValue result = jsNumber(src1.toInt32(callFrame) | src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -2097,9 +2074,9 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
int dst = vPC[1].u.operand;
JSValue src = callFrame->r(vPC[2].u.operand).jsValue();
if (src.isInt32())
- callFrame->r(dst) = jsNumber(callFrame, ~src.asInt32());
+ callFrame->r(dst) = jsNumber(~src.asInt32());
else {
- JSValue result = jsNumber(callFrame, ~src.toInt32(callFrame));
+ JSValue result = jsNumber(~src.toInt32(callFrame));
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
}
@@ -2515,7 +2492,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2546,7 +2523,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2585,7 +2562,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2630,7 +2607,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2711,7 +2688,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2760,7 +2737,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2803,7 +2780,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2860,7 +2837,7 @@ skip_id_custom_self:
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2915,7 +2892,7 @@ skip_id_custom_self:
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -2965,7 +2942,7 @@ skip_id_custom_self:
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(isJSArray(globalData, baseValue))) {
int dst = vPC[1].u.operand;
- callFrame->r(dst) = jsNumber(callFrame, asArray(baseValue)->length());
+ callFrame->r(dst) = jsNumber(asArray(baseValue)->length());
vPC += OPCODE_LENGTH(op_get_array_length);
NEXT_INSTRUCTION();
}
@@ -2985,7 +2962,7 @@ skip_id_custom_self:
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(isJSString(globalData, baseValue))) {
int dst = vPC[1].u.operand;
- callFrame->r(dst) = jsNumber(callFrame, asString(baseValue)->length());
+ callFrame->r(dst) = jsNumber(asString(baseValue)->length());
vPC += OPCODE_LENGTH(op_get_string_length);
NEXT_INSTRUCTION();
}
@@ -3041,7 +3018,7 @@ skip_id_custom_self:
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* oldStructure = vPC[4].u.structure;
Structure* newStructure = vPC[5].u.structure;
@@ -3093,7 +3070,7 @@ skip_id_custom_self:
JSValue baseValue = callFrame->r(base).jsValue();
if (LIKELY(baseValue.isCell())) {
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = vPC[4].u.structure;
if (LIKELY(baseCell->structure() == structure)) {
@@ -3203,7 +3180,7 @@ skip_id_custom_self:
CHECK_FOR_EXCEPTION();
callFrame->r(dst) = result;
} else
- callFrame->r(dst) = jsNumber(callFrame, callFrame->argumentCount());
+ callFrame->r(dst) = jsNumber(callFrame->argumentCount());
vPC += OPCODE_LENGTH(op_get_arguments_length);
NEXT_INSTRUCTION();
@@ -3820,8 +3797,8 @@ skip_id_custom_self:
JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject;
if (thisValue == globalObject && funcVal == globalObject->evalFunction()) {
- JSValue result = callEval(callFrame, registerFile, argv, argCount, registerOffset, exceptionValue);
- if (exceptionValue)
+ JSValue result = callEval(callFrame, registerFile, argv, argCount, registerOffset);
+ if ((exceptionValue = globalData->exception))
goto vm_throw;
functionReturnValue = result;
@@ -4087,14 +4064,13 @@ skip_id_custom_self:
if (activationValue) {
asActivation(activationValue)->copyRegisters();
- if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue())
- asArguments(argumentsValue)->setActivation(asActivation(activationValue));
- } else if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue())
- asArguments(argumentsValue)->copyRegisters();
-
- if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) {
+ if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) {
+ if (!codeBlock->isStrictMode())
+ asArguments(argumentsValue)->setActivation(asActivation(activationValue));
+ }
+ } else if (JSValue argumentsValue = callFrame->r(unmodifiedArgumentsRegister(arguments)).jsValue()) {
if (!codeBlock->isStrictMode())
- asArguments(argumentsValue)->setActivation(asActivation(activationValue));
+ asArguments(argumentsValue)->copyRegisters();
}
vPC += OPCODE_LENGTH(op_tear_off_activation);
@@ -4601,10 +4577,8 @@ skip_id_custom_self:
exceptionValue = callFrame->r(ex).jsValue();
handler = throwException(callFrame, exceptionValue, vPC - codeBlock->instructions().begin(), true);
- if (!handler) {
- *exception = exceptionValue;
- return jsNull();
- }
+ if (!handler)
+ return throwError(callFrame, exceptionValue);
codeBlock = callFrame->codeBlock();
vPC = codeBlock->instructions().begin() + handler->target;
@@ -4771,10 +4745,8 @@ skip_id_custom_self:
exceptionValue = createInterruptedExecutionException(globalData);
}
handler = throwException(callFrame, exceptionValue, vPC - codeBlock->instructions().begin(), false);
- if (!handler) {
- *exception = exceptionValue;
- return jsNull();
- }
+ if (!handler)
+ return throwError(callFrame, exceptionValue);
codeBlock = callFrame->codeBlock();
vPC = codeBlock->instructions().begin() + handler->target;
diff --git a/JavaScriptCore/interpreter/Interpreter.h b/JavaScriptCore/interpreter/Interpreter.h
index 50f07b3..2bc403e 100644
--- a/JavaScriptCore/interpreter/Interpreter.h
+++ b/JavaScriptCore/interpreter/Interpreter.h
@@ -93,11 +93,11 @@ namespace JSC {
}
bool isOpcode(Opcode);
-
- JSValue execute(ProgramExecutable*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue* exception);
- JSValue executeCall(CallFrame*, JSObject* function, CallType, const CallData&, JSValue thisValue, const ArgList&, JSValue* exception);
- JSObject* executeConstruct(CallFrame*, JSObject* function, ConstructType, const ConstructData&, const ArgList&, JSValue* exception);
- JSValue execute(EvalExecutable* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue* exception);
+
+ JSValue execute(ProgramExecutable*, CallFrame*, ScopeChainNode*, JSObject* thisObj);
+ JSValue executeCall(CallFrame*, JSObject* function, CallType, const CallData&, JSValue thisValue, const ArgList&);
+ JSObject* executeConstruct(CallFrame*, JSObject* function, ConstructType, const ConstructData&, const ArgList&);
+ JSValue execute(EvalExecutable* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain);
JSValue retrieveArguments(CallFrame*, JSFunction*) const;
JSValue retrieveCaller(CallFrame*, JSFunction*) const;
@@ -107,7 +107,7 @@ namespace JSC {
SamplingTool* sampler() { return m_sampler.get(); }
- NEVER_INLINE JSValue callEval(CallFrame*, RegisterFile*, Register* argv, int argc, int registerOffset, JSValue& exceptionValue);
+ NEVER_INLINE JSValue callEval(CallFrame*, RegisterFile*, Register* argv, int argc, int registerOffset);
NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset, bool);
NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine);
@@ -117,11 +117,11 @@ namespace JSC {
private:
enum ExecutionFlag { Normal, InitializeAndReturn };
- CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, JSFunction*, int argCount, ScopeChainNode*, JSValue* exception);
+ CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, JSFunction*, int argCount, ScopeChainNode*);
void endRepeatCall(CallFrameClosure&);
- JSValue execute(CallFrameClosure&, JSValue* exception);
+ JSValue execute(CallFrameClosure&);
- JSValue execute(EvalExecutable*, CallFrame*, JSObject* thisObject, int globalRegisterOffset, ScopeChainNode*, JSValue* exception);
+ JSValue execute(EvalExecutable*, CallFrame*, JSObject* thisObject, int globalRegisterOffset, ScopeChainNode*);
#if ENABLE(INTERPRETER)
NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue& exceptionValue);
@@ -144,7 +144,7 @@ namespace JSC {
static CallFrame* findFunctionCallFrame(CallFrame*, JSFunction*);
- JSValue privateExecute(ExecutionFlag, RegisterFile*, CallFrame*, JSValue* exception);
+ JSValue privateExecute(ExecutionFlag, RegisterFile*, CallFrame*);
void dumpCallFrame(CallFrame*);
void dumpRegisters(CallFrame*);
diff --git a/JavaScriptCore/jit/JITArithmetic.cpp b/JavaScriptCore/jit/JITArithmetic.cpp
index d4fa12f..f0a049a 100644
--- a/JavaScriptCore/jit/JITArithmetic.cpp
+++ b/JavaScriptCore/jit/JITArithmetic.cpp
@@ -888,7 +888,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
emitJumpSlowCaseIfNotImmediateInteger(regT0);
emitJumpSlowCaseIfNotImmediateInteger(regT2);
- addSlowCase(branchPtr(Equal, regT2, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0)))));
+ addSlowCase(branchPtr(Equal, regT2, ImmPtr(JSValue::encode(jsNumber(0)))));
m_assembler.cdq();
m_assembler.idivl_r(regT2);
emitFastArithReTagImmediate(regT1, regT0);
diff --git a/JavaScriptCore/jit/JITArithmetic32_64.cpp b/JavaScriptCore/jit/JITArithmetic32_64.cpp
index e53af77..e0b31f0 100644
--- a/JavaScriptCore/jit/JITArithmetic32_64.cpp
+++ b/JavaScriptCore/jit/JITArithmetic32_64.cpp
@@ -1293,7 +1293,7 @@ void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>
/* ------------------------------ BEGIN: OP_MOD ------------------------------ */
-#if CPU(X86) || CPU(X86_64)
+#if CPU(X86) || CPU(X86_64) || CPU(MIPS)
void JIT::emit_op_mod(Instruction* currentInstruction)
{
@@ -1301,34 +1301,47 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
unsigned op1 = currentInstruction[2].u.operand;
unsigned op2 = currentInstruction[3].u.operand;
+#if CPU(X86) || CPU(X86_64)
+ // Make sure registers are correct for x86 IDIV instructions.
+ ASSERT(regT0 == X86Registers::eax);
+ ASSERT(regT1 == X86Registers::edx);
+ ASSERT(regT2 == X86Registers::ecx);
+ ASSERT(regT3 == X86Registers::ebx);
+#endif
+
if (isOperandConstantImmediateInt(op2) && getConstantOperand(op2).asInt32() != 0) {
- emitLoad(op1, X86Registers::edx, X86Registers::eax);
- move(Imm32(getConstantOperand(op2).asInt32()), X86Registers::ecx);
- addSlowCase(branch32(NotEqual, X86Registers::edx, Imm32(JSValue::Int32Tag)));
+ emitLoad(op1, regT1, regT0);
+ move(Imm32(getConstantOperand(op2).asInt32()), regT2);
+ addSlowCase(branch32(NotEqual, regT1, Imm32(JSValue::Int32Tag)));
if (getConstantOperand(op2).asInt32() == -1)
- addSlowCase(branch32(Equal, X86Registers::eax, Imm32(0x80000000))); // -2147483648 / -1 => EXC_ARITHMETIC
+ addSlowCase(branch32(Equal, regT0, Imm32(0x80000000))); // -2147483648 / -1 => EXC_ARITHMETIC
} else {
- emitLoad2(op1, X86Registers::edx, X86Registers::eax, op2, X86Registers::ebx, X86Registers::ecx);
- addSlowCase(branch32(NotEqual, X86Registers::edx, Imm32(JSValue::Int32Tag)));
- addSlowCase(branch32(NotEqual, X86Registers::ebx, Imm32(JSValue::Int32Tag)));
+ emitLoad2(op1, regT1, regT0, op2, regT3, regT2);
+ addSlowCase(branch32(NotEqual, regT1, Imm32(JSValue::Int32Tag)));
+ addSlowCase(branch32(NotEqual, regT3, Imm32(JSValue::Int32Tag)));
- addSlowCase(branch32(Equal, X86Registers::eax, Imm32(0x80000000))); // -2147483648 / -1 => EXC_ARITHMETIC
- addSlowCase(branch32(Equal, X86Registers::ecx, Imm32(0))); // divide by 0
+ addSlowCase(branch32(Equal, regT0, Imm32(0x80000000))); // -2147483648 / -1 => EXC_ARITHMETIC
+ addSlowCase(branch32(Equal, regT2, Imm32(0))); // divide by 0
}
- move(X86Registers::eax, X86Registers::ebx); // Save dividend payload, in case of 0.
+ move(regT0, regT3); // Save dividend payload, in case of 0.
+#if CPU(X86) || CPU(X86_64)
m_assembler.cdq();
- m_assembler.idivl_r(X86Registers::ecx);
+ m_assembler.idivl_r(regT2);
+#elif CPU(MIPS)
+ m_assembler.div(regT0, regT2);
+ m_assembler.mfhi(regT1);
+#endif
// If the remainder is zero and the dividend is negative, the result is -0.
- Jump storeResult1 = branchTest32(NonZero, X86Registers::edx);
- Jump storeResult2 = branchTest32(Zero, X86Registers::ebx, Imm32(0x80000000)); // not negative
- emitStore(dst, jsNumber(m_globalData, -0.0));
+ Jump storeResult1 = branchTest32(NonZero, regT1);
+ Jump storeResult2 = branchTest32(Zero, regT3, Imm32(0x80000000)); // not negative
+ emitStore(dst, jsNumber(-0.0));
Jump end = jump();
storeResult1.link(this);
storeResult2.link(this);
- emitStoreInt32(dst, X86Registers::edx, (op1 == dst || op2 == dst));
+ emitStoreInt32(dst, regT1, (op1 == dst || op2 == dst));
end.link(this);
}
@@ -1355,7 +1368,7 @@ void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>
stubCall.call(dst);
}
-#else // CPU(X86) || CPU(X86_64)
+#else // CPU(X86) || CPU(X86_64) || CPU(MIPS)
void JIT::emit_op_mod(Instruction* currentInstruction)
{
diff --git a/JavaScriptCore/jit/JITCode.h b/JavaScriptCore/jit/JITCode.h
index 5d889b5..7346fd5 100644
--- a/JavaScriptCore/jit/JITCode.h
+++ b/JavaScriptCore/jit/JITCode.h
@@ -72,9 +72,10 @@ namespace JSC {
}
// Execute the code!
- inline JSValue execute(RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValue* exception)
+ inline JSValue execute(RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData)
{
- return JSValue::decode(ctiTrampoline(m_ref.m_code.executableAddress(), registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData));
+ JSValue result = JSValue::decode(ctiTrampoline(m_ref.m_code.executableAddress(), registerFile, callFrame, 0, Profiler::enabledProfilerReference(), globalData));
+ return globalData->exception ? jsNull() : result;
}
void* start()
diff --git a/JavaScriptCore/jit/JITInlineMethods.h b/JavaScriptCore/jit/JITInlineMethods.h
index 0fe9929..7611151 100644
--- a/JavaScriptCore/jit/JITInlineMethods.h
+++ b/JavaScriptCore/jit/JITInlineMethods.h
@@ -186,7 +186,7 @@ ALWAYS_INLINE void JIT::restoreReturnAddressBeforeReturn(Address address)
ALWAYS_INLINE void JIT::restoreArgumentReference()
{
move(stackPointerRegister, firstArgumentRegister);
- poke(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*));
+ poke(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
}
ALWAYS_INLINE void JIT::restoreArgumentReferenceForTrampoline()
diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp
index a468c18..1528b76 100644
--- a/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/JavaScriptCore/jit/JITOpcodes.cpp
@@ -198,6 +198,8 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
int executableOffsetToFunction = isConstruct ? OBJECT_OFFSETOF(NativeExecutable, m_constructor) : OBJECT_OFFSETOF(NativeExecutable, m_function);
Label nativeCallThunk = align();
+
+ emitPutImmediateToCallFrameHeader(0, RegisterFile::CodeBlock);
#if CPU(X86_64)
// Load caller frame's scope chain into this callframe so that whatever we call can
@@ -711,7 +713,7 @@ void JIT::emit_op_jfalse(Instruction* currentInstruction)
unsigned target = currentInstruction[2].u.operand;
emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
- addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0)))), target);
+ addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(0)))), target);
Jump isNonZero = emitJumpIfImmediateInteger(regT0);
addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsBoolean(false)))), target);
@@ -831,7 +833,7 @@ void JIT::emit_op_jtrue(Instruction* currentInstruction)
unsigned target = currentInstruction[2].u.operand;
emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
- Jump isZero = branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0))));
+ Jump isZero = branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(0))));
addJump(emitJumpIfImmediateInteger(regT0), target);
addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsBoolean(true)))), target);
@@ -1062,7 +1064,10 @@ void JIT::emit_op_push_new_scope(Instruction* currentInstruction)
void JIT::emit_op_catch(Instruction* currentInstruction)
{
killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code.
- peek(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*));
+ move(regT0, callFrameRegister);
+ peek(regT3, OBJECT_OFFSETOF(struct JITStackFrame, globalData) / sizeof(void*));
+ loadPtr(Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception)), regT0);
+ storePtr(ImmPtr(JSValue::encode(JSValue())), Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception)));
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
@@ -1284,7 +1289,7 @@ void JIT::emit_op_create_this(Instruction* currentInstruction)
void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
{
- peek(regT1, OBJECT_OFFSETOF(JITStackFrame, enabledProfilerReference) / sizeof (void*));
+ peek(regT1, OBJECT_OFFSETOF(JITStackFrame, enabledProfilerReference) / sizeof(void*));
Jump noProfiler = branchTestPtr(Zero, Address(regT1));
JITStubCall stubCall(this, cti_op_profile_will_call);
@@ -1296,7 +1301,7 @@ void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
{
- peek(regT1, OBJECT_OFFSETOF(JITStackFrame, enabledProfilerReference) / sizeof (void*));
+ peek(regT1, OBJECT_OFFSETOF(JITStackFrame, enabledProfilerReference) / sizeof(void*));
Jump noProfiler = branchTestPtr(Zero, Address(regT1));
JITStubCall stubCall(this, cti_op_profile_did_call);
diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp
index c3b7ac2..0a3d69d 100644
--- a/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -198,6 +198,8 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
Label nativeCallThunk = align();
+ emitPutImmediateToCallFrameHeader(0, RegisterFile::CodeBlock);
+
#if CPU(X86)
// Load caller frame's scope chain into this callframe so that whatever we call can
// get to its global data.
@@ -312,6 +314,8 @@ JIT::CodePtr JIT::privateCompileCTINativeCall(PassRefPtr<ExecutablePool> executa
Call nativeCall;
Label nativeCallThunk = align();
+ emitPutImmediateToCallFrameHeader(0, RegisterFile::CodeBlock);
+
#if CPU(X86)
// Load caller frame's scope chain into this callframe so that whatever we call can
// get to its global data.
@@ -923,11 +927,8 @@ void JIT::emit_op_jeq_null(Instruction* currentInstruction)
// Now handle the immediate cases - undefined & null
isImmediate.link(this);
- set32(Equal, regT1, Imm32(JSValue::NullTag), regT2);
- set32(Equal, regT1, Imm32(JSValue::UndefinedTag), regT1);
- or32(regT2, regT1);
-
- addJump(branchTest32(NonZero, regT1), target);
+ ASSERT((JSValue::UndefinedTag + 1 == JSValue::NullTag) && !(JSValue::NullTag + 1));
+ addJump(branch32(AboveOrEqual, regT1, Imm32(JSValue::UndefinedTag)), target);
wasNotImmediate.link(this);
}
@@ -950,11 +951,8 @@ void JIT::emit_op_jneq_null(Instruction* currentInstruction)
// Now handle the immediate cases - undefined & null
isImmediate.link(this);
- set32(Equal, regT1, Imm32(JSValue::NullTag), regT2);
- set32(Equal, regT1, Imm32(JSValue::UndefinedTag), regT1);
- or32(regT2, regT1);
-
- addJump(branchTest32(Zero, regT1), target);
+ ASSERT((JSValue::UndefinedTag + 1 == JSValue::NullTag) && !(JSValue::NullTag + 1));
+ addJump(branch32(Below, regT1, Imm32(JSValue::UndefinedTag)), target);
wasNotImmediate.link(this);
}
@@ -1388,15 +1386,17 @@ void JIT::emit_op_push_new_scope(Instruction* currentInstruction)
void JIT::emit_op_catch(Instruction* currentInstruction)
{
- unsigned exception = currentInstruction[1].u.operand;
-
- // This opcode only executes after a return from cti_op_throw.
-
- // cti_op_throw may have taken us to a call frame further up the stack; reload
- // the call frame pointer to adjust.
- peek(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
+ // cti_op_throw returns the callFrame for the handler.
+ move(regT0, callFrameRegister);
// Now store the exception returned by cti_op_throw.
+ loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(struct JITStackFrame, globalData)), regT3);
+ load32(Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
+ load32(Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
+ store32(Imm32(JSValue().payload()), Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
+ store32(Imm32(JSValue().tag()), Address(regT3, OBJECT_OFFSETOF(JSGlobalData, exception) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
+
+ unsigned exception = currentInstruction[1].u.operand;
emitStore(exception, regT1, regT0);
map(m_bytecodeOffset + OPCODE_LENGTH(op_catch), exception, regT1, regT0);
}
diff --git a/JavaScriptCore/jit/JITPropertyAccess.cpp b/JavaScriptCore/jit/JITPropertyAccess.cpp
index 2edc860..1b95eec 100644
--- a/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -585,10 +585,10 @@ void JIT::testPrototype(JSValue prototype, JumpList& failureCases)
// values. In the non X86_64 case, the generated code is slightly more efficient because it uses
// two less instructions and doesn't require any scratch registers.
#if CPU(X86_64)
- move(ImmPtr(asCell(prototype)->structure()), regT3);
- failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(prototype)->m_structure), regT3));
+ move(ImmPtr(prototype.asCell()->structure()), regT3);
+ failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&prototype.asCell()->m_structure), regT3));
#else
- failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(prototype)->m_structure), ImmPtr(asCell(prototype)->structure())));
+ failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&prototype.asCell()->m_structure), ImmPtr(prototype.asCell()->structure())));
#endif
}
diff --git a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index f6280ef..710a155 100644
--- a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -595,10 +595,10 @@ void JIT::testPrototype(JSValue prototype, JumpList& failureCases)
// values. In the non X86_64 case, the generated code is slightly more efficient because it uses
// two less instructions and doesn't require any scratch registers.
#if CPU(X86_64)
- move(ImmPtr(asCell(prototype)->structure()), regT3);
- failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(prototype)->m_structure), regT3));
+ move(ImmPtr(prototype.asCell()->structure()), regT3);
+ failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&prototype.asCell()->m_structure), regT3));
#else
- failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(prototype)->m_structure), ImmPtr(asCell(prototype)->structure())));
+ failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&prototype.asCell()->m_structure), ImmPtr(prototype.asCell()->structure())));
#endif
}
diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp
index 8340211..c69a828 100644
--- a/JavaScriptCore/jit/JITStubs.cpp
+++ b/JavaScriptCore/jit/JITStubs.cpp
@@ -147,12 +147,7 @@ HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"movl %esp, %ecx" "\n"
"call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
- "addl $0x3c, %esp" "\n"
- "popl %ebx" "\n"
- "popl %edi" "\n"
- "popl %esi" "\n"
- "popl %ebp" "\n"
- "ret" "\n"
+ "int3" "\n"
);
asm (
@@ -209,14 +204,7 @@ HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"movq %rsp, %rdi" "\n"
"call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
- "addq $0x48, %rsp" "\n"
- "popq %rbx" "\n"
- "popq %r15" "\n"
- "popq %r14" "\n"
- "popq %r13" "\n"
- "popq %r12" "\n"
- "popq %rbp" "\n"
- "ret" "\n"
+ "int3" "\n"
);
asm (
@@ -261,7 +249,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x50, JITStackFrame_code_
extern "C" {
- __declspec(naked) EncodedJSValue ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue* exception, Profiler**, JSGlobalData*)
+ __declspec(naked) EncodedJSValue ctiTrampoline(void* code, RegisterFile*, CallFrame*, void* /*unused1*/, Profiler**, JSGlobalData*)
{
__asm {
push ebp;
@@ -373,12 +361,7 @@ HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"movl %esp, %ecx" "\n"
"call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
- "addl $0x1c, %esp" "\n"
- "popl %ebx" "\n"
- "popl %edi" "\n"
- "popl %esi" "\n"
- "popl %ebp" "\n"
- "ret" "\n"
+ "int3" "\n"
);
asm (
@@ -442,14 +425,7 @@ HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"movq %rsp, %rdi" "\n"
"call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n"
- "addq $0x78, %rsp" "\n"
- "popq %rbx" "\n"
- "popq %r15" "\n"
- "popq %r14" "\n"
- "popq %r13" "\n"
- "popq %r12" "\n"
- "popq %rbp" "\n"
- "ret" "\n"
+ "int3" "\n"
);
asm (
@@ -508,7 +484,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_s
extern "C" {
- __declspec(naked) EncodedJSValue ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue* exception, Profiler**, JSGlobalData*)
+ __declspec(naked) EncodedJSValue ctiTrampoline(void* code, RegisterFile*, CallFrame*, void* /*unused1*/, Profiler**, JSGlobalData*)
{
__asm {
push ebp;
@@ -763,7 +739,7 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
#elif COMPILER(RVCT) && CPU(ARM_TRADITIONAL)
-__asm EncodedJSValue ctiTrampoline(void*, RegisterFile*, CallFrame*, JSValue*, Profiler**, JSGlobalData*)
+__asm EncodedJSValue ctiTrampoline(void*, RegisterFile*, CallFrame*, void* /*unused1*/, Profiler**, JSGlobalData*)
{
ARM
stmdb sp!, {r1-r3}
@@ -872,7 +848,7 @@ NEVER_INLINE void JITThunks::tryCachePutByID(CallFrame* callFrame, CodeBlock* co
return;
}
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = baseCell->structure();
if (structure->isUncacheableDictionary()) {
@@ -940,7 +916,7 @@ NEVER_INLINE void JITThunks::tryCacheGetByID(CallFrame* callFrame, CodeBlock* co
return;
}
- JSCell* baseCell = asCell(baseValue);
+ JSCell* baseCell = baseValue.asCell();
Structure* structure = baseCell->structure();
if (structure->isUncacheableDictionary()) {
@@ -1087,6 +1063,25 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD
} \
} while (0)
+struct ExceptionHandler {
+ void* catchRoutine;
+ CallFrame* callFrame;
+};
+static ExceptionHandler jitThrow(JSGlobalData* globalData, CallFrame* callFrame, JSValue exceptionValue, ReturnAddressPtr faultLocation, bool explicitThrow)
+{
+ ASSERT(exceptionValue);
+
+ unsigned vPCIndex = callFrame->codeBlock()->bytecodeOffset(callFrame, faultLocation);
+ globalData->exception = JSValue();
+ HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex, explicitThrow); // This may update callFrame & exceptionValue!
+ globalData->exception = exceptionValue;
+
+ void* catchRoutine = handler ? handler->nativeCode.executableAddress() : FunctionPtr(ctiOpThrowNotCaught).value();
+ ASSERT(catchRoutine);
+ ExceptionHandler exceptionHandler = { catchRoutine, callFrame };
+ return exceptionHandler;
+}
+
#if CPU(ARM_THUMB2)
#define DEFINE_STUB_FUNCTION(rtype, op) \
@@ -1342,7 +1337,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_add)
double left = 0.0, right;
if (v1.getNumber(left) && v2.getNumber(right))
- return JSValue::encode(jsNumber(stackFrame.globalData, left + right));
+ return JSValue::encode(jsNumber(left + right));
// All other cases are pretty uncommon
JSValue result = jsAddSlowCase(callFrame, v1, v2);
@@ -1357,7 +1352,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_pre_inc)
JSValue v = stackFrame.args[0].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, v.toNumber(callFrame) + 1);
+ JSValue result = jsNumber(v.toNumber(callFrame) + 1);
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -1380,18 +1375,21 @@ DEFINE_STUB_FUNCTION(int, timeout_check)
return timeoutChecker.ticksUntilNextCheck();
}
-DEFINE_STUB_FUNCTION(void, register_file_check)
+DEFINE_STUB_FUNCTION(void*, register_file_check)
{
STUB_INIT_STACK_FRAME(stackFrame);
+ CallFrame* callFrame = stackFrame.callFrame;
- if (LIKELY(stackFrame.registerFile->grow(&stackFrame.callFrame->registers()[stackFrame.callFrame->codeBlock()->m_numCalleeRegisters])))
- return;
+ if (UNLIKELY(!stackFrame.registerFile->grow(&callFrame->registers()[callFrame->codeBlock()->m_numCalleeRegisters]))) {
+ // Rewind to the previous call frame because op_call already optimistically
+ // moved the call frame forward.
+ CallFrame* oldCallFrame = callFrame->callerFrame();
+ ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), ReturnAddressPtr(oldCallFrame->returnPC()), false);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ callFrame = handler.callFrame;
+ }
- // Rewind to the previous call frame because op_call already optimistically
- // moved the call frame forward.
- CallFrame* oldCallFrame = stackFrame.callFrame->callerFrame();
- stackFrame.callFrame = oldCallFrame;
- throwStackOverflowError(oldCallFrame, stackFrame.globalData, ReturnAddressPtr(oldCallFrame->returnPC()), STUB_RETURN_ADDRESS);
+ return callFrame;
}
DEFINE_STUB_FUNCTION(int, op_loop_if_lesseq)
@@ -1563,7 +1561,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_method_check)
JSObject* slotBaseObject;
if (baseValue.isCell()
&& slot.isCacheableValue()
- && !(structure = asCell(baseValue)->structure())->isUncacheableDictionary()
+ && !(structure = baseValue.asCell()->structure())->isUncacheableDictionary()
&& (slotBaseObject = asObject(slot.slotBase()))->getPropertySpecificValue(callFrame, ident, specific)
&& specific
) {
@@ -1637,7 +1635,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_self_fail)
if (baseValue.isCell()
&& slot.isCacheable()
- && !asCell(baseValue)->structure()->isUncacheableDictionary()
+ && !baseValue.asCell()->structure()->isUncacheableDictionary()
&& slot.slotBase() == baseValue) {
CodeBlock* codeBlock = callFrame->codeBlock();
@@ -1658,7 +1656,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_self_fail)
}
if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) {
stubInfo->u.getByIdSelfList.listSize++;
- JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), ident, slot, slot.cachedOffset());
+ JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, baseValue.asCell()->structure(), ident, slot, slot.cachedOffset());
if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_generic));
@@ -1742,12 +1740,12 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list)
CHECK_FOR_EXCEPTION();
- if (!baseValue.isCell() || !slot.isCacheable() || asCell(baseValue)->structure()->isDictionary()) {
+ if (!baseValue.isCell() || !slot.isCacheable() || baseValue.asCell()->structure()->isDictionary()) {
ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail));
return JSValue::encode(result);
}
- Structure* structure = asCell(baseValue)->structure();
+ Structure* structure = baseValue.asCell()->structure();
CodeBlock* codeBlock = callFrame->codeBlock();
StructureStubInfo* stubInfo = &codeBlock->getStubInfo(STUB_RETURN_ADDRESS);
@@ -1758,8 +1756,8 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list)
if (slot.slotBase() == baseValue)
ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail));
- else if (slot.slotBase() == asCell(baseValue)->structure()->prototypeForLookup(callFrame)) {
- ASSERT(!asCell(baseValue)->structure()->isDictionary());
+ else if (slot.slotBase() == baseValue.asCell()->structure()->prototypeForLookup(callFrame)) {
+ ASSERT(!baseValue.asCell()->structure()->isDictionary());
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
if (slotBaseObject->structure()->isDictionary()) {
@@ -1776,7 +1774,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_id_proto_list)
ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full));
}
} else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase(), propertyName, offset)) {
- ASSERT(!asCell(baseValue)->structure()->isDictionary());
+ ASSERT(!baseValue.asCell()->structure()->isDictionary());
int listIndex;
PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
@@ -1913,10 +1911,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_mul)
double left;
double right;
if (src1.getNumber(left) && src2.getNumber(right))
- return JSValue::encode(jsNumber(stackFrame.globalData, left * right));
+ return JSValue::encode(jsNumber(left * right));
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, src1.toNumber(callFrame) * src2.toNumber(callFrame));
+ JSValue result = jsNumber(src1.toNumber(callFrame) * src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -1994,9 +1992,9 @@ DEFINE_STUB_FUNCTION(void*, op_call_arityCheck)
if (!stackFrame.registerFile->grow(newEnd)) {
// Rewind to the previous call frame because op_call already optimistically
// moved the call frame forward.
- stackFrame.callFrame = oldCallFrame;
- throwStackOverflowError(oldCallFrame, stackFrame.globalData, pc, STUB_RETURN_ADDRESS);
- return 0;
+ ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc, false);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ return handler.callFrame;
}
Register* argv = r - RegisterFile::CallFrameHeaderSize - numParameters - argCount;
@@ -2009,9 +2007,9 @@ DEFINE_STUB_FUNCTION(void*, op_call_arityCheck)
if (!stackFrame.registerFile->grow(newEnd)) {
// Rewind to the previous call frame because op_call already optimistically
// moved the call frame forward.
- stackFrame.callFrame = oldCallFrame;
- throwStackOverflowError(oldCallFrame, stackFrame.globalData, pc, STUB_RETURN_ADDRESS);
- return 0;
+ ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc, false);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ return handler.callFrame;
}
Register* argv = r - RegisterFile::CallFrameHeaderSize - omittedArgCount;
@@ -2053,9 +2051,9 @@ DEFINE_STUB_FUNCTION(void*, op_construct_arityCheck)
if (!stackFrame.registerFile->grow(newEnd)) {
// Rewind to the previous call frame because op_call already optimistically
// moved the call frame forward.
- stackFrame.callFrame = oldCallFrame;
- throwStackOverflowError(oldCallFrame, stackFrame.globalData, pc, STUB_RETURN_ADDRESS);
- return 0;
+ ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc, false);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ return handler.callFrame;
}
Register* argv = r - RegisterFile::CallFrameHeaderSize - numParameters - argCount;
@@ -2068,9 +2066,9 @@ DEFINE_STUB_FUNCTION(void*, op_construct_arityCheck)
if (!stackFrame.registerFile->grow(newEnd)) {
// Rewind to the previous call frame because op_call already optimistically
// moved the call frame forward.
- stackFrame.callFrame = oldCallFrame;
- throwStackOverflowError(oldCallFrame, stackFrame.globalData, pc, STUB_RETURN_ADDRESS);
- return 0;
+ ExceptionHandler handler = jitThrow(stackFrame.globalData, oldCallFrame, createStackOverflowError(oldCallFrame), pc, false);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ return handler.callFrame;
}
Register* argv = r - RegisterFile::CallFrameHeaderSize - omittedArgCount;
@@ -2188,17 +2186,16 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_NotJSFunction)
throwStackOverflowError(previousCallFrame, stackFrame.globalData, callFrame->returnPC(), STUB_RETURN_ADDRESS);
VM_THROW_EXCEPTION();
}
+
callFrame->init(0, static_cast<Instruction*>((STUB_RETURN_ADDRESS).value()), previousCallFrame->scopeChain(), previousCallFrame, argCount, asObject(funcVal));
- stackFrame.callFrame = callFrame;
EncodedJSValue returnValue;
{
SamplingTool::HostCallRecord callRecord(CTI_SAMPLER);
returnValue = callData.native.function(callFrame);
}
- stackFrame.callFrame = previousCallFrame;
- CHECK_FOR_EXCEPTION();
+ CHECK_FOR_EXCEPTION_AT_END();
return returnValue;
}
@@ -2234,8 +2231,10 @@ DEFINE_STUB_FUNCTION(void, op_tear_off_activation)
ASSERT(stackFrame.callFrame->codeBlock()->needsFullScopeChain());
JSValue activationValue = stackFrame.args[0].jsValue();
if (!activationValue) {
- if (JSValue v = stackFrame.args[1].jsValue())
- asArguments(v)->copyRegisters();
+ if (JSValue v = stackFrame.args[1].jsValue()) {
+ if (!stackFrame.callFrame->codeBlock()->isStrictMode())
+ asArguments(v)->copyRegisters();
+ }
return;
}
JSActivation* activation = asActivation(stackFrame.args[0].jsValue());
@@ -2336,16 +2335,14 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
}
callFrame->init(0, static_cast<Instruction*>((STUB_RETURN_ADDRESS).value()), previousCallFrame->scopeChain(), previousCallFrame, argCount, asObject(constrVal));
- stackFrame.callFrame = callFrame;
EncodedJSValue returnValue;
{
SamplingTool::HostCallRecord callRecord(CTI_SAMPLER);
returnValue = constructData.native.function(callFrame);
}
- stackFrame.callFrame = previousCallFrame;
- CHECK_FOR_EXCEPTION();
+ CHECK_FOR_EXCEPTION_AT_END();
return returnValue;
}
@@ -2370,10 +2367,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_get_by_val)
if (LIKELY(baseValue.isCell() && subscript.isString())) {
Identifier propertyName(callFrame, asString(subscript)->value(callFrame));
- PropertySlot slot(asCell(baseValue));
+ PropertySlot slot(baseValue.asCell());
// JSString::value may have thrown, but we shouldn't find a property with a null identifier,
// so we should miss this case and wind up in the CHECK_FOR_EXCEPTION_AT_END, below.
- if (asCell(baseValue)->fastGetOwnPropertySlot(callFrame, propertyName, slot)) {
+ if (baseValue.asCell()->fastGetOwnPropertySlot(callFrame, propertyName, slot)) {
JSValue result = slot.getValue(callFrame, propertyName);
CHECK_FOR_EXCEPTION();
return JSValue::encode(result);
@@ -2475,10 +2472,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_sub)
double left;
double right;
if (src1.getNumber(left) && src2.getNumber(right))
- return JSValue::encode(jsNumber(stackFrame.globalData, left - right));
+ return JSValue::encode(jsNumber(left - right));
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, src1.toNumber(callFrame) - src2.toNumber(callFrame));
+ JSValue result = jsNumber(src1.toNumber(callFrame) - src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -2685,10 +2682,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_negate)
double v;
if (src.getNumber(v))
- return JSValue::encode(jsNumber(stackFrame.globalData, -v));
+ return JSValue::encode(jsNumber(-v));
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, -src.toNumber(callFrame));
+ JSValue result = jsNumber(-src.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -2808,10 +2805,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_div)
double left;
double right;
if (src1.getNumber(left) && src2.getNumber(right))
- return JSValue::encode(jsNumber(stackFrame.globalData, left / right));
+ return JSValue::encode(jsNumber(left / right));
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, src1.toNumber(callFrame) / src2.toNumber(callFrame));
+ JSValue result = jsNumber(src1.toNumber(callFrame) / src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -2823,7 +2820,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_pre_dec)
JSValue v = stackFrame.args[0].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, v.toNumber(callFrame) - 1);
+ JSValue result = jsNumber(v.toNumber(callFrame) - 1);
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -2891,7 +2888,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_post_inc)
JSValue number = v.toJSNumber(callFrame);
CHECK_FOR_EXCEPTION_AT_END();
- callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(stackFrame.globalData, number.uncheckedGetNumber() + 1);
+ callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(number.uncheckedGetNumber() + 1);
return JSValue::encode(number);
}
@@ -2906,14 +2903,14 @@ DEFINE_STUB_FUNCTION(int, op_eq)
start:
if (src2.isUndefined()) {
return src1.isNull() ||
- (src1.isCell() && asCell(src1)->structure()->typeInfo().masqueradesAsUndefined()) ||
- src1.isUndefined();
+ (src1.isCell() && src1.asCell()->structure()->typeInfo().masqueradesAsUndefined())
+ || src1.isUndefined();
}
if (src2.isNull()) {
return src1.isUndefined() ||
- (src1.isCell() && asCell(src1)->structure()->typeInfo().masqueradesAsUndefined()) ||
- src1.isNull();
+ (src1.isCell() && src1.asCell()->structure()->typeInfo().masqueradesAsUndefined())
+ || src1.isNull();
}
if (src1.isInt32()) {
@@ -2949,12 +2946,12 @@ DEFINE_STUB_FUNCTION(int, op_eq)
}
if (src1.isUndefined())
- return src2.isCell() && asCell(src2)->structure()->typeInfo().masqueradesAsUndefined();
+ return src2.isCell() && src2.asCell()->structure()->typeInfo().masqueradesAsUndefined();
if (src1.isNull())
- return src2.isCell() && asCell(src2)->structure()->typeInfo().masqueradesAsUndefined();
+ return src2.isCell() && src2.asCell()->structure()->typeInfo().masqueradesAsUndefined();
- JSCell* cell1 = asCell(src1);
+ JSCell* cell1 = src1.asCell();
if (cell1->isString()) {
if (src2.isInt32())
@@ -2969,7 +2966,7 @@ DEFINE_STUB_FUNCTION(int, op_eq)
if (src2.isFalse())
return jsToNumber(static_cast<JSString*>(cell1)->value(stackFrame.callFrame)) == 0.0;
- JSCell* cell2 = asCell(src2);
+ JSCell* cell2 = src2.asCell();
if (cell2->isString())
return static_cast<JSString*>(cell1)->value(stackFrame.callFrame) == static_cast<JSString*>(cell2)->value(stackFrame.callFrame);
@@ -3019,7 +3016,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_lshift)
JSValue shift = stackFrame.args[1].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, (val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f));
+ JSValue result = jsNumber((val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3033,7 +3030,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitand)
ASSERT(!src1.isInt32() || !src2.isInt32());
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, src1.toInt32(callFrame) & src2.toInt32(callFrame));
+ JSValue result = jsNumber(src1.toInt32(callFrame) & src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3046,7 +3043,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_rshift)
JSValue shift = stackFrame.args[1].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, (val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
+ JSValue result = jsNumber((val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
@@ -3060,7 +3057,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitnot)
ASSERT(!src.isInt32());
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, ~src.toInt32(callFrame));
+ JSValue result = jsNumber(~src.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3134,7 +3131,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_mod)
CallFrame* callFrame = stackFrame.callFrame;
double d = dividendValue.toNumber(callFrame);
- JSValue result = jsNumber(stackFrame.globalData, fmod(d, divisorValue.toNumber(callFrame)));
+ JSValue result = jsNumber(fmod(d, divisorValue.toNumber(callFrame)));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3160,7 +3157,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_post_dec)
JSValue number = v.toJSNumber(callFrame);
CHECK_FOR_EXCEPTION_AT_END();
- callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(stackFrame.globalData, number.uncheckedGetNumber() - 1);
+ callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(number.uncheckedGetNumber() - 1);
return JSValue::encode(number);
}
@@ -3172,7 +3169,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_urshift)
JSValue shift = stackFrame.args[1].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, (val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
+ JSValue result = jsNumber((val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3186,7 +3183,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitxor)
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, src1.toInt32(callFrame) ^ src2.toInt32(callFrame));
+ JSValue result = jsNumber(src1.toInt32(callFrame) ^ src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3207,7 +3204,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitor)
CallFrame* callFrame = stackFrame.callFrame;
- JSValue result = jsNumber(stackFrame.globalData, src1.toInt32(callFrame) | src2.toInt32(callFrame));
+ JSValue result = jsNumber(src1.toInt32(callFrame) | src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
@@ -3232,43 +3229,20 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_eval)
JSGlobalObject* globalObject = callFrame->scopeChain()->globalObject;
if (baseValue == globalObject && funcVal == globalObject->evalFunction()) {
- JSValue exceptionValue;
- JSValue result = interpreter->callEval(callFrame, registerFile, argv, argCount, registerOffset, exceptionValue);
- if (UNLIKELY(exceptionValue)) {
- stackFrame.globalData->exception = exceptionValue;
- VM_THROW_EXCEPTION_AT_END();
- }
+ JSValue result = interpreter->callEval(callFrame, registerFile, argv, argCount, registerOffset);
+ CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
return JSValue::encode(JSValue());
}
-DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)
+DEFINE_STUB_FUNCTION(void*, op_throw)
{
STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
- CodeBlock* codeBlock = callFrame->codeBlock();
-
- unsigned vPCIndex = codeBlock->bytecodeOffset(callFrame, STUB_RETURN_ADDRESS);
-
- JSValue exceptionValue = stackFrame.args[0].jsValue();
- ASSERT(exceptionValue);
-
- HandlerInfo* handler = stackFrame.globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex, true);
-
- if (!handler) {
- *stackFrame.exception = exceptionValue;
- STUB_SET_RETURN_ADDRESS(FunctionPtr(ctiOpThrowNotCaught).value());
- return JSValue::encode(jsNull());
- }
-
- stackFrame.callFrame = callFrame;
- void* catchRoutine = handler->nativeCode.executableAddress();
- ASSERT(catchRoutine);
- STUB_SET_RETURN_ADDRESS(catchRoutine);
- return JSValue::encode(exceptionValue);
+ ExceptionHandler handler = jitThrow(stackFrame.globalData, stackFrame.callFrame, stackFrame.args[0].jsValue(), STUB_RETURN_ADDRESS, true);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ return handler.callFrame;
}
DEFINE_STUB_FUNCTION(JSPropertyNameIterator*, op_get_pnames)
@@ -3617,32 +3591,13 @@ DEFINE_STUB_FUNCTION(void, op_debug)
stackFrame.globalData->interpreter->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
}
-DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
+DEFINE_STUB_FUNCTION(void*, vm_throw)
{
STUB_INIT_STACK_FRAME(stackFrame);
-
- CallFrame* callFrame = stackFrame.callFrame;
- CodeBlock* codeBlock = callFrame->codeBlock();
JSGlobalData* globalData = stackFrame.globalData;
-
- unsigned vPCIndex = codeBlock->bytecodeOffset(callFrame, globalData->exceptionLocation);
-
- JSValue exceptionValue = globalData->exception;
- ASSERT(exceptionValue);
- globalData->exception = JSValue();
-
- HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex, false);
-
- if (!handler) {
- *stackFrame.exception = exceptionValue;
- return JSValue::encode(jsNull());
- }
-
- stackFrame.callFrame = callFrame;
- void* catchRoutine = handler->nativeCode.executableAddress();
- ASSERT(catchRoutine);
- STUB_SET_RETURN_ADDRESS(catchRoutine);
- return JSValue::encode(exceptionValue);
+ ExceptionHandler handler = jitThrow(globalData, stackFrame.callFrame, globalData->exception, globalData->exceptionLocation, false);
+ STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
+ return handler.callFrame;
}
DEFINE_STUB_FUNCTION(EncodedJSValue, to_object)
diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h
index b91a074..c27ee52 100644
--- a/JavaScriptCore/jit/JITStubs.h
+++ b/JavaScriptCore/jit/JITStubs.h
@@ -97,7 +97,7 @@ namespace JSC {
void* code;
RegisterFile* registerFile;
CallFrame* callFrame;
- JSValue* exception;
+ void* unused1;
Profiler** enabledProfilerReference;
JSGlobalData* globalData;
@@ -133,7 +133,7 @@ namespace JSC {
void* code;
RegisterFile* registerFile;
CallFrame* callFrame;
- JSValue* exception;
+ void* unused1;
Profiler** enabledProfilerReference;
JSGlobalData* globalData;
@@ -161,7 +161,7 @@ namespace JSC {
// These arguments passed in r1..r3 (r0 contained the entry code pointed, which is not preserved)
RegisterFile* registerFile;
CallFrame* callFrame;
- JSValue* exception;
+ void* unused1;
// These arguments passed on the stack.
Profiler** enabledProfilerReference;
@@ -189,7 +189,7 @@ namespace JSC {
RegisterFile* registerFile;
CallFrame* callFrame;
- JSValue* exception;
+ void* unused1;
// These arguments passed on the stack.
Profiler** enabledProfilerReference;
@@ -221,7 +221,7 @@ namespace JSC {
// These arguments passed in a1..a3 (a0 contained the entry code pointed, which is not preserved)
RegisterFile* registerFile;
CallFrame* callFrame;
- JSValue* exception;
+ void* unused1;
// These arguments passed on the stack.
Profiler** enabledProfilerReference;
@@ -252,7 +252,7 @@ namespace JSC {
extern "C" void ctiVMThrowTrampoline();
extern "C" void ctiOpThrowNotCaught();
- extern "C" EncodedJSValue ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue* exception, Profiler**, JSGlobalData*);
+ extern "C" EncodedJSValue ctiTrampoline(void* code, RegisterFile*, CallFrame*, void* /*unused1*/, Profiler**, JSGlobalData*);
class JITThunks {
public:
@@ -348,13 +348,11 @@ extern "C" {
EncodedJSValue JIT_STUB cti_op_strcat(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_stricteq(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_sub(STUB_ARGS_DECLARATION);
- EncodedJSValue JIT_STUB cti_op_throw(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_to_jsnumber(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_to_primitive(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_typeof(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_op_urshift(STUB_ARGS_DECLARATION);
EncodedJSValue JIT_STUB cti_to_object(STUB_ARGS_DECLARATION);
- EncodedJSValue JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_new_array(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_new_error(STUB_ARGS_DECLARATION);
JSObject* JIT_STUB cti_op_new_func(STUB_ARGS_DECLARATION);
@@ -395,7 +393,6 @@ extern "C" {
void JIT_STUB cti_op_ret_scopeChain(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_tear_off_activation(STUB_ARGS_DECLARATION);
void JIT_STUB cti_op_tear_off_arguments(STUB_ARGS_DECLARATION);
- void JIT_STUB cti_register_file_check(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_op_call_arityCheck(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_op_construct_arityCheck(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_op_call_jitCompile(STUB_ARGS_DECLARATION);
@@ -403,8 +400,11 @@ extern "C" {
void* JIT_STUB cti_op_switch_char(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_op_switch_imm(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_op_switch_string(STUB_ARGS_DECLARATION);
+ void* JIT_STUB cti_op_throw(STUB_ARGS_DECLARATION);
+ void* JIT_STUB cti_register_file_check(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_vm_lazyLinkCall(STUB_ARGS_DECLARATION);
void* JIT_STUB cti_vm_lazyLinkConstruct(STUB_ARGS_DECLARATION);
+ void* JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION);
} // extern "C"
} // namespace JSC
diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp
index d756a0c..16647ec 100644
--- a/JavaScriptCore/jsc.cpp
+++ b/JavaScriptCore/jsc.cpp
@@ -220,7 +220,7 @@ EncodedJSValue JSC_HOST_CALL functionRun(ExecState* exec)
evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName));
stopWatch.stop();
- return JSValue::encode(jsNumber(globalObject->globalExec(), stopWatch.getElapsedMS()));
+ return JSValue::encode(jsNumber(stopWatch.getElapsedMS()));
}
EncodedJSValue JSC_HOST_CALL functionLoad(ExecState* exec)
@@ -368,7 +368,7 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scr
if (dump)
BytecodeGenerator::setDumpsGeneratedCode(true);
- JSGlobalData* globalData = globalObject->globalData();
+ JSGlobalData& globalData = globalObject->globalData();
#if ENABLE(SAMPLING_FLAGS)
SamplingFlags::start();
@@ -386,7 +386,7 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scr
fileName = "[Command Line]";
}
- globalData->startSampling();
+ globalData.startSampling();
Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script, fileName));
success = success && completion.complType() != Throw;
@@ -397,19 +397,19 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scr
printf("End: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
}
- globalData->stopSampling();
+ globalData.stopSampling();
globalObject->globalExec()->clearException();
}
#if ENABLE(SAMPLING_FLAGS)
SamplingFlags::stop();
#endif
- globalData->dumpSampleData(globalObject->globalExec());
+ globalData.dumpSampleData(globalObject->globalExec());
#if ENABLE(SAMPLING_COUNTERS)
AbstractSamplingCounter::dump();
#endif
#if ENABLE(REGEXP_TRACING)
- globalData->dumpRegExpTrace();
+ globalData.dumpRegExpTrace();
#endif
return success;
}
diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp
index 0338210..4b7fcb2 100644
--- a/JavaScriptCore/parser/JSParser.cpp
+++ b/JavaScriptCore/parser/JSParser.cpp
@@ -485,7 +485,7 @@ private:
int jsParse(JSGlobalObject* lexicalGlobalObject, FunctionParameters* parameters, JSParserStrictness strictness, JSParserMode parserMode, const SourceCode* source)
{
- JSParser parser(lexicalGlobalObject->globalData()->lexer, lexicalGlobalObject->globalData(), parameters, strictness == JSParseStrict, parserMode == JSParseFunctionCode, source->provider());
+ JSParser parser(lexicalGlobalObject->globalData().lexer, &lexicalGlobalObject->globalData(), parameters, strictness == JSParseStrict, parserMode == JSParseFunctionCode, source->provider());
return parser.parseProgram(lexicalGlobalObject);
}
diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp
index 33b5213..49ce848 100644
--- a/JavaScriptCore/parser/Parser.cpp
+++ b/JavaScriptCore/parser/Parser.cpp
@@ -52,7 +52,7 @@ void Parser::parse(JSGlobalObject* lexicalGlobalObject, FunctionParameters* para
*errLine = -1;
*errMsg = UString();
- Lexer& lexer = *lexicalGlobalObject->globalData()->lexer;
+ Lexer& lexer = *lexicalGlobalObject->globalData().lexer;
lexer.setCode(*m_source, m_arena);
int parseError = jsParse(lexicalGlobalObject, parameters, strictness, mode, m_source);
diff --git a/JavaScriptCore/parser/Parser.h b/JavaScriptCore/parser/Parser.h
index f5bbcb8..6549067 100644
--- a/JavaScriptCore/parser/Parser.h
+++ b/JavaScriptCore/parser/Parser.h
@@ -84,12 +84,12 @@ namespace JSC {
m_source = &source;
if (ParsedNode::scopeIsFunction)
- lexicalGlobalObject->globalData()->lexer->setIsReparsing();
+ lexicalGlobalObject->globalData().lexer->setIsReparsing();
parse(lexicalGlobalObject, parameters, strictness, ParsedNode::isFunctionNode ? JSParseFunctionCode : JSParseProgramCode, &errLine, &errMsg);
RefPtr<ParsedNode> result;
if (m_sourceElements) {
- result = ParsedNode::create(lexicalGlobalObject->globalData(),
+ result = ParsedNode::create(&lexicalGlobalObject->globalData(),
m_sourceElements,
m_varDeclarations ? &m_varDeclarations->data : 0,
m_funcDeclarations ? &m_funcDeclarations->data : 0,
@@ -108,7 +108,7 @@ namespace JSC {
if (isFunctionBodyNode(static_cast<ParsedNode*>(0)))
*exception = createStackOverflowError(lexicalGlobalObject);
else
- *exception = addErrorInfo(lexicalGlobalObject->globalData(), createSyntaxError(lexicalGlobalObject, errMsg), errLine, source);
+ *exception = addErrorInfo(&lexicalGlobalObject->globalData(), createSyntaxError(lexicalGlobalObject, errMsg), errLine, source);
}
m_arena.reset();
diff --git a/JavaScriptCore/runtime/Arguments.cpp b/JavaScriptCore/runtime/Arguments.cpp
index 5c5e522..39886a8 100644
--- a/JavaScriptCore/runtime/Arguments.cpp
+++ b/JavaScriptCore/runtime/Arguments.cpp
@@ -191,7 +191,7 @@ bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyNa
}
if (propertyName == exec->propertyNames().length && LIKELY(!d->overrodeLength)) {
- slot.setValue(jsNumber(exec, d->numArguments));
+ slot.setValue(jsNumber(d->numArguments));
return true;
}
@@ -222,7 +222,7 @@ bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& prop
}
if (propertyName == exec->propertyNames().length && LIKELY(!d->overrodeLength)) {
- descriptor.setDescriptor(jsNumber(exec, d->numArguments), DontEnum);
+ descriptor.setDescriptor(jsNumber(d->numArguments), DontEnum);
return true;
}
diff --git a/JavaScriptCore/runtime/ArrayConstructor.cpp b/JavaScriptCore/runtime/ArrayConstructor.cpp
index e5d0dac..632d466 100644
--- a/JavaScriptCore/runtime/ArrayConstructor.cpp
+++ b/JavaScriptCore/runtime/ArrayConstructor.cpp
@@ -45,7 +45,7 @@ ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject
putDirectWithoutTransition(exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
// ES5
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum);
diff --git a/JavaScriptCore/runtime/ArrayPrototype.cpp b/JavaScriptCore/runtime/ArrayPrototype.cpp
index 6002ebb..ab0c3d4 100644
--- a/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -379,12 +379,12 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPop(ExecState* exec)
JSValue result;
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (length == 0) {
- putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
+ putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
result = jsUndefined();
} else {
result = thisObj->get(exec, length - 1);
thisObj->deleteProperty(exec, length - 1);
- putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length - 1));
+ putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - 1));
}
return JSValue::encode(result);
}
@@ -395,7 +395,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec)
if (isJSArray(&exec->globalData(), thisValue) && exec->argumentCount() == 1) {
JSArray* array = asArray(thisValue);
array->push(exec, exec->argument(0));
- return JSValue::encode(jsNumber(exec, array->length()));
+ return JSValue::encode(jsNumber(array->length()));
}
JSObject* thisObj = thisValue.toThisObject(exec);
@@ -403,8 +403,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec)
for (unsigned n = 0; n < exec->argumentCount(); n++)
thisObj->put(exec, length + n, exec->argument(n));
length += exec->argumentCount();
- putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
- return JSValue::encode(jsNumber(exec, length));
+ putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
+ return JSValue::encode(jsNumber(length));
}
EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec)
@@ -438,7 +438,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (length == 0) {
- putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
+ putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
result = jsUndefined();
} else {
result = thisObj->get(exec, 0);
@@ -453,7 +453,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
}
thisObj->deleteProperty(exec, length - 1);
}
- putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length - 1));
+ putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - 1));
}
return JSValue::encode(result);
}
@@ -600,7 +600,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
for (unsigned k = 0; k < additionalArgs; ++k)
thisObj->put(exec, k + begin, exec->argument(k + 2));
- putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length - deleteCount + additionalArgs));
+ putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - deleteCount + additionalArgs));
return JSValue::encode(result);
}
@@ -625,7 +625,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncUnShift(ExecState* exec)
}
for (unsigned k = 0; k < nrArgs; ++k)
thisObj->put(exec, k, exec->argument(k));
- JSValue result = jsNumber(exec, length + nrArgs);
+ JSValue result = jsNumber(length + nrArgs);
putProperty(exec, thisObj, exec->propertyNames().length, result);
return JSValue::encode(result);
}
@@ -649,14 +649,14 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
if (callType == CallTypeJS && isJSArray(&exec->globalData(), thisObj)) {
JSFunction* f = asFunction(function);
JSArray* array = asArray(thisObj);
- CachedCall cachedCall(exec, f, 3, exec->exceptionSlot());
+ CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
if (!array->canGetIndex(k))
break;
JSValue v = array->getIndex(k);
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, v);
- cachedCall.setArgument(1, jsNumber(exec, k));
+ cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
@@ -677,7 +677,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(v);
- eachArguments.append(jsNumber(exec, k));
+ eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
JSValue result = call(exec, function, callType, callData, applyThis, eachArguments);
@@ -707,14 +707,14 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
if (callType == CallTypeJS && isJSArray(&exec->globalData(), thisObj)) {
JSFunction* f = asFunction(function);
JSArray* array = asArray(thisObj);
- CachedCall cachedCall(exec, f, 3, exec->exceptionSlot());
+ CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
if (UNLIKELY(!array->canGetIndex(k)))
break;
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
- cachedCall.setArgument(1, jsNumber(exec, k));
+ cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
resultArray->JSArray::put(exec, k, cachedCall.call());
@@ -730,7 +730,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(v);
- eachArguments.append(jsNumber(exec, k));
+ eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
JSValue result = call(exec, function, callType, callData, applyThis, eachArguments);
@@ -764,14 +764,14 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec)
if (callType == CallTypeJS && isJSArray(&exec->globalData(), thisObj)) {
JSFunction* f = asFunction(function);
JSArray* array = asArray(thisObj);
- CachedCall cachedCall(exec, f, 3, exec->exceptionSlot());
+ CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
if (UNLIKELY(!array->canGetIndex(k)))
break;
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
- cachedCall.setArgument(1, jsNumber(exec, k));
+ cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
if (!result.toBoolean(cachedCall.newCallFrame(exec)))
@@ -787,7 +787,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(slot.getValue(exec, k));
- eachArguments.append(jsNumber(exec, k));
+ eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments).toBoolean(exec);
@@ -818,14 +818,14 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncForEach(ExecState* exec)
if (callType == CallTypeJS && isJSArray(&exec->globalData(), thisObj)) {
JSFunction* f = asFunction(function);
JSArray* array = asArray(thisObj);
- CachedCall cachedCall(exec, f, 3, exec->exceptionSlot());
+ CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
if (UNLIKELY(!array->canGetIndex(k)))
break;
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
- cachedCall.setArgument(1, jsNumber(exec, k));
+ cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
cachedCall.call();
@@ -838,7 +838,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncForEach(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(slot.getValue(exec, k));
- eachArguments.append(jsNumber(exec, k));
+ eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
call(exec, function, callType, callData, applyThis, eachArguments);
@@ -865,14 +865,14 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSome(ExecState* exec)
if (callType == CallTypeJS && isJSArray(&exec->globalData(), thisObj)) {
JSFunction* f = asFunction(function);
JSArray* array = asArray(thisObj);
- CachedCall cachedCall(exec, f, 3, exec->exceptionSlot());
+ CachedCall cachedCall(exec, f, 3);
for (; k < length && !exec->hadException(); ++k) {
if (UNLIKELY(!array->canGetIndex(k)))
break;
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
- cachedCall.setArgument(1, jsNumber(exec, k));
+ cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
if (result.toBoolean(cachedCall.newCallFrame(exec)))
@@ -886,7 +886,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSome(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(slot.getValue(exec, k));
- eachArguments.append(jsNumber(exec, k));
+ eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments).toBoolean(exec);
@@ -935,7 +935,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec)
}
if (callType == CallTypeJS && array) {
- CachedCall cachedCall(exec, asFunction(function), 4, exec->exceptionSlot());
+ CachedCall cachedCall(exec, asFunction(function), 4);
for (; i < length && !exec->hadException(); ++i) {
cachedCall.setThis(jsNull());
cachedCall.setArgument(0, rv);
@@ -945,7 +945,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec)
else
break; // length has been made unsafe while we enumerate fallback to slow path
cachedCall.setArgument(1, v);
- cachedCall.setArgument(2, jsNumber(exec, i));
+ cachedCall.setArgument(2, jsNumber(i));
cachedCall.setArgument(3, array);
rv = cachedCall.call();
}
@@ -961,7 +961,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(rv);
eachArguments.append(prop);
- eachArguments.append(jsNumber(exec, i));
+ eachArguments.append(jsNumber(i));
eachArguments.append(thisObj);
rv = call(exec, function, callType, callData, jsNull(), eachArguments);
@@ -1005,7 +1005,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec)
}
if (callType == CallTypeJS && array) {
- CachedCall cachedCall(exec, asFunction(function), 4, exec->exceptionSlot());
+ CachedCall cachedCall(exec, asFunction(function), 4);
for (; i < length && !exec->hadException(); ++i) {
unsigned idx = length - i - 1;
cachedCall.setThis(jsNull());
@@ -1013,7 +1013,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec)
if (UNLIKELY(!array->canGetIndex(idx)))
break; // length has been made unsafe while we enumerate fallback to slow path
cachedCall.setArgument(1, array->getIndex(idx));
- cachedCall.setArgument(2, jsNumber(exec, idx));
+ cachedCall.setArgument(2, jsNumber(idx));
cachedCall.setArgument(3, array);
rv = cachedCall.call();
}
@@ -1030,7 +1030,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(rv);
eachArguments.append(prop);
- eachArguments.append(jsNumber(exec, idx));
+ eachArguments.append(jsNumber(idx));
eachArguments.append(thisObj);
rv = call(exec, function, callType, callData, jsNull(), eachArguments);
@@ -1053,10 +1053,10 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncIndexOf(ExecState* exec)
if (!e)
continue;
if (JSValue::strictEqual(exec, searchElement, e))
- return JSValue::encode(jsNumber(exec, index));
+ return JSValue::encode(jsNumber(index));
}
- return JSValue::encode(jsNumber(exec, -1));
+ return JSValue::encode(jsNumber(-1));
}
EncodedJSValue JSC_HOST_CALL arrayProtoFuncLastIndexOf(ExecState* exec)
@@ -1067,7 +1067,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncLastIndexOf(ExecState* exec)
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (!length)
- return JSValue::encode(jsNumber(exec, -1));
+ return JSValue::encode(jsNumber(-1));
unsigned index = length - 1;
JSValue fromValue = exec->argument(1);
@@ -1076,7 +1076,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncLastIndexOf(ExecState* exec)
if (fromDouble < 0) {
fromDouble += length;
if (fromDouble < 0)
- return JSValue::encode(jsNumber(exec, -1));
+ return JSValue::encode(jsNumber(-1));
}
if (fromDouble < length)
index = static_cast<unsigned>(fromDouble);
@@ -1089,10 +1089,10 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncLastIndexOf(ExecState* exec)
if (!e)
continue;
if (JSValue::strictEqual(exec, searchElement, e))
- return JSValue::encode(jsNumber(exec, index));
+ return JSValue::encode(jsNumber(index));
} while (index--);
- return JSValue::encode(jsNumber(exec, -1));
+ return JSValue::encode(jsNumber(-1));
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/BooleanConstructor.cpp b/JavaScriptCore/runtime/BooleanConstructor.cpp
index 953bddc..0167e03 100644
--- a/JavaScriptCore/runtime/BooleanConstructor.cpp
+++ b/JavaScriptCore/runtime/BooleanConstructor.cpp
@@ -34,7 +34,7 @@ BooleanConstructor::BooleanConstructor(ExecState* exec, JSGlobalObject* globalOb
putDirectWithoutTransition(exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
}
// ECMA 15.6.2
diff --git a/JavaScriptCore/runtime/CachedTranscendentalFunction.h b/JavaScriptCore/runtime/CachedTranscendentalFunction.h
index 04f7f62..67c7af8 100644
--- a/JavaScriptCore/runtime/CachedTranscendentalFunction.h
+++ b/JavaScriptCore/runtime/CachedTranscendentalFunction.h
@@ -56,18 +56,18 @@ public:
fastFree(m_cache);
}
- JSValue operator() (ExecState* exec, double operand)
+ JSValue operator() (double operand)
{
if (UNLIKELY(!m_cache))
initialize();
CacheEntry* entry = &m_cache[hash(operand)];
if (entry->operand == operand)
- return jsDoubleNumber(exec, entry->result);
+ return jsDoubleNumber(entry->result);
double result = orignalFunction(operand);
entry->operand = operand;
entry->result = result;
- return jsDoubleNumber(exec, result);
+ return jsDoubleNumber(result);
}
private:
diff --git a/JavaScriptCore/runtime/CallData.cpp b/JavaScriptCore/runtime/CallData.cpp
index 2b9302a..018e2ca 100644
--- a/JavaScriptCore/runtime/CallData.cpp
+++ b/JavaScriptCore/runtime/CallData.cpp
@@ -35,7 +35,7 @@ namespace JSC {
JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData& callData, JSValue thisValue, const ArgList& args)
{
ASSERT(callType == CallTypeJS || callType == CallTypeHost);
- return exec->interpreter()->executeCall(exec, asObject(functionObject), callType, callData, thisValue, args, exec->exceptionSlot());
+ return exec->interpreter()->executeCall(exec, asObject(functionObject), callType, callData, thisValue, args);
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/Completion.cpp b/JavaScriptCore/runtime/Completion.cpp
index 9af5171..eeb8b0d 100644
--- a/JavaScriptCore/runtime/Completion.cpp
+++ b/JavaScriptCore/runtime/Completion.cpp
@@ -59,10 +59,12 @@ Completion evaluate(ExecState* exec, ScopeChain& scopeChain, const SourceCode& s
JSObject* thisObj = (!thisValue || thisValue.isUndefinedOrNull()) ? exec->dynamicGlobalObject() : thisValue.toObject(exec);
- JSValue exception;
- JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain.node(), thisObj, &exception);
+ JSValue result = exec->interpreter()->execute(program.get(), exec, scopeChain.node(), thisObj);
+
+ if (exec->hadException()) {
+ JSValue exception = exec->exception();
+ exec->clearException();
- if (exception) {
ComplType exceptionType = Throw;
if (exception.isObject())
exceptionType = asObject(exception)->exceptionType();
diff --git a/JavaScriptCore/runtime/ConstructData.cpp b/JavaScriptCore/runtime/ConstructData.cpp
index 0d27e25..5da2a91 100644
--- a/JavaScriptCore/runtime/ConstructData.cpp
+++ b/JavaScriptCore/runtime/ConstructData.cpp
@@ -36,7 +36,7 @@ namespace JSC {
JSObject* construct(ExecState* exec, JSValue constructorObject, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
{
ASSERT(constructType == ConstructTypeJS || constructType == ConstructTypeHost);
- return exec->interpreter()->executeConstruct(exec, asObject(constructorObject), constructType, constructData, args, exec->exceptionSlot());
+ return exec->interpreter()->executeConstruct(exec, asObject(constructorObject), constructType, constructData, args);
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/DateConstructor.cpp b/JavaScriptCore/runtime/DateConstructor.cpp
index 49e0405..dcbe12d 100644
--- a/JavaScriptCore/runtime/DateConstructor.cpp
+++ b/JavaScriptCore/runtime/DateConstructor.cpp
@@ -67,7 +67,7 @@ DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject,
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 7, exec->propertyNames().UTC, dateUTC), DontEnum);
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 0, exec->propertyNames().now, dateNow), DontEnum);
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 7), ReadOnly | DontEnum | DontDelete);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(7), ReadOnly | DontEnum | DontDelete);
}
// ECMA 15.9.3
@@ -159,12 +159,12 @@ CallType DateConstructor::getCallData(CallData& callData)
static EncodedJSValue JSC_HOST_CALL dateParse(ExecState* exec)
{
- return JSValue::encode(jsNumber(exec, parseDate(exec, exec->argument(0).toString(exec))));
+ return JSValue::encode(jsNumber(parseDate(exec, exec->argument(0).toString(exec))));
}
-static EncodedJSValue JSC_HOST_CALL dateNow(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL dateNow(ExecState*)
{
- return JSValue::encode(jsNumber(exec, jsCurrentTime()));
+ return JSValue::encode(jsNumber(jsCurrentTime()));
}
static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState* exec)
@@ -186,7 +186,7 @@ static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState* exec)
|| (n >= 5 && isnan(doubleArguments[4]))
|| (n >= 6 && isnan(doubleArguments[5]))
|| (n >= 7 && isnan(doubleArguments[6])))
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
GregorianDateTime t;
int year = JSC::toInt32(doubleArguments[0]);
@@ -197,7 +197,7 @@ static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState* exec)
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))));
+ return JSValue::encode(jsNumber(timeClip(gregorianDateTimeToMS(exec, t, ms, true))));
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/DateInstance.cpp b/JavaScriptCore/runtime/DateInstance.cpp
index b43b183..8562e2d 100644
--- a/JavaScriptCore/runtime/DateInstance.cpp
+++ b/JavaScriptCore/runtime/DateInstance.cpp
@@ -34,22 +34,22 @@ namespace JSC {
const ClassInfo DateInstance::info = {"Date", 0, 0, 0};
-DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr<Structure> structure)
+DateInstance::DateInstance(ExecState*, NonNullPassRefPtr<Structure> structure)
: JSWrapperObject(structure)
{
- setInternalValue(jsNaN(exec));
+ setInternalValue(jsNaN());
}
-DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr<Structure> structure, double time)
+DateInstance::DateInstance(ExecState*, NonNullPassRefPtr<Structure> structure, double time)
: JSWrapperObject(structure)
{
- setInternalValue(jsNumber(exec, timeClip(time)));
+ setInternalValue(jsNumber(timeClip(time)));
}
DateInstance::DateInstance(ExecState* exec, double time)
: JSWrapperObject(exec->lexicalGlobalObject()->dateStructure())
{
- setInternalValue(jsNumber(exec, timeClip(time)));
+ setInternalValue(jsNumber(timeClip(time)));
}
const GregorianDateTime* DateInstance::calculateGregorianDateTime(ExecState* exec) const
diff --git a/JavaScriptCore/runtime/DatePrototype.cpp b/JavaScriptCore/runtime/DatePrototype.cpp
index 4983f29..085cb33 100644
--- a/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/JavaScriptCore/runtime/DatePrototype.cpp
@@ -182,7 +182,7 @@ static JSCell* formatLocaleDate(ExecState* exec, DateInstance*, double timeInMil
// We truncate the string returned from CFDateFormatter if it's absurdly long (> 200 characters).
// That's not great error handling, but it just won't happen so it doesn't matter.
UChar buffer[200];
- const size_t bufferLength = sizeof(buffer) / sizeof(buffer[0]);
+ const size_t bufferLength = WTF_ARRAY_LENGTH(buffer);
size_t length = CFStringGetLength(string);
ASSERT(length <= bufferLength);
if (length > bufferLength)
@@ -585,8 +585,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, 1900 + gregorianDateTime->year));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(1900 + gregorianDateTime->year));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec)
@@ -599,8 +599,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, 1900 + gregorianDateTime->year));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(1900 + gregorianDateTime->year));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncToGMTString(ExecState* exec)
@@ -631,8 +631,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->month));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->month));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec)
@@ -645,8 +645,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->month));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->month));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec)
@@ -659,8 +659,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->monthDay));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->monthDay));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec)
@@ -673,8 +673,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->monthDay));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->monthDay));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec)
@@ -687,8 +687,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->weekDay));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->weekDay));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec)
@@ -701,8 +701,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->weekDay));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->weekDay));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec)
@@ -715,8 +715,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->hour));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->hour));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec)
@@ -729,8 +729,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->hour));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->hour));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec)
@@ -743,8 +743,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->minute));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->minute));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec)
@@ -757,8 +757,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->minute));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->minute));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec)
@@ -771,8 +771,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->second));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->second));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec)
@@ -785,8 +785,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTimeUTC(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, gregorianDateTime->second));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(gregorianDateTime->second));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMilliSeconds(ExecState* exec)
@@ -798,11 +798,11 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMilliSeconds(ExecState* exec)
DateInstance* thisDateObj = asDateInstance(thisValue);
double milli = thisDateObj->internalNumber();
if (isnan(milli))
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
double secs = floor(milli / msPerSecond);
double ms = milli - secs * msPerSecond;
- return JSValue::encode(jsNumber(exec, ms));
+ return JSValue::encode(jsNumber(ms));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCMilliseconds(ExecState* exec)
@@ -814,11 +814,11 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCMilliseconds(ExecState* exec)
DateInstance* thisDateObj = asDateInstance(thisValue);
double milli = thisDateObj->internalNumber();
if (isnan(milli))
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
double secs = floor(milli / msPerSecond);
double ms = milli - secs * msPerSecond;
- return JSValue::encode(jsNumber(exec, ms));
+ return JSValue::encode(jsNumber(ms));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec)
@@ -831,8 +831,8 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, -gregorianDateTime->utcOffset / minutesPerHour));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(-gregorianDateTime->utcOffset / minutesPerHour));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncSetTime(ExecState* exec)
@@ -844,7 +844,7 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncSetTime(ExecState* exec)
DateInstance* thisDateObj = asDateInstance(thisValue);
double milli = timeClip(exec->argument(0).toNumber(exec));
- JSValue result = jsNumber(exec, milli);
+ JSValue result = jsNumber(milli);
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -859,7 +859,7 @@ static EncodedJSValue setNewValueFromTimeArgs(ExecState* exec, int numArgsToUse,
double milli = thisDateObj->internalNumber();
if (!exec->argumentCount() || isnan(milli)) {
- JSValue result = jsNaN(exec);
+ JSValue result = jsNaN();
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -871,17 +871,17 @@ static EncodedJSValue setNewValueFromTimeArgs(ExecState* exec, int numArgsToUse,
? thisDateObj->gregorianDateTimeUTC(exec)
: thisDateObj->gregorianDateTime(exec);
if (!other)
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
GregorianDateTime gregorianDateTime;
gregorianDateTime.copyFrom(*other);
if (!fillStructuresUsingTimeArgs(exec, numArgsToUse, &ms, &gregorianDateTime)) {
- JSValue result = jsNaN(exec);
+ JSValue result = jsNaN();
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
- JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC));
+ JSValue result = jsNumber(gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC));
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -894,7 +894,7 @@ static EncodedJSValue setNewValueFromDateArgs(ExecState* exec, int numArgsToUse,
DateInstance* thisDateObj = asDateInstance(thisValue);
if (!exec->argumentCount()) {
- JSValue result = jsNaN(exec);
+ JSValue result = jsNaN();
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -911,17 +911,17 @@ static EncodedJSValue setNewValueFromDateArgs(ExecState* exec, int numArgsToUse,
? thisDateObj->gregorianDateTimeUTC(exec)
: thisDateObj->gregorianDateTime(exec);
if (!other)
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
gregorianDateTime.copyFrom(*other);
}
if (!fillStructuresUsingDateArgs(exec, numArgsToUse, &ms, &gregorianDateTime)) {
- JSValue result = jsNaN(exec);
+ JSValue result = jsNaN();
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
- JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC));
+ JSValue result = jsNumber(gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC));
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -1018,7 +1018,7 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec)
DateInstance* thisDateObj = asDateInstance(thisValue);
if (!exec->argumentCount()) {
- JSValue result = jsNaN(exec);
+ JSValue result = jsNaN();
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -1040,13 +1040,13 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec)
double year = exec->argument(0).toIntegerPreserveNaN(exec);
if (!isfinite(year)) {
- JSValue result = jsNaN(exec);
+ JSValue result = jsNaN();
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
gregorianDateTime.year = toInt32((year > 99 || year < 0) ? year - 1900 : year);
- JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, false));
+ JSValue result = jsNumber(gregorianDateTimeToMS(exec, gregorianDateTime, ms, false));
thisDateObj->setInternalValue(result);
return JSValue::encode(result);
}
@@ -1061,10 +1061,10 @@ EncodedJSValue JSC_HOST_CALL dateProtoFuncGetYear(ExecState* exec)
const GregorianDateTime* gregorianDateTime = thisDateObj->gregorianDateTime(exec);
if (!gregorianDateTime)
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
// NOTE: IE returns the full year even in getYear.
- return JSValue::encode(jsNumber(exec, gregorianDateTime->year));
+ return JSValue::encode(jsNumber(gregorianDateTime->year));
}
EncodedJSValue JSC_HOST_CALL dateProtoFuncToJSON(ExecState* exec)
diff --git a/JavaScriptCore/runtime/Error.cpp b/JavaScriptCore/runtime/Error.cpp
index e35424b..fd97beb 100644
--- a/JavaScriptCore/runtime/Error.cpp
+++ b/JavaScriptCore/runtime/Error.cpp
@@ -45,43 +45,43 @@ static const char* expressionEndOffsetPropertyName = "expressionEndOffset";
JSObject* createError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->errorStructure(), message);
}
JSObject* createEvalError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->evalErrorConstructor()->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->evalErrorConstructor()->errorStructure(), message);
}
JSObject* createRangeError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->rangeErrorConstructor()->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->rangeErrorConstructor()->errorStructure(), message);
}
JSObject* createReferenceError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->referenceErrorConstructor()->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->referenceErrorConstructor()->errorStructure(), message);
}
JSObject* createSyntaxError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->syntaxErrorConstructor()->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->syntaxErrorConstructor()->errorStructure(), message);
}
JSObject* createTypeError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->typeErrorConstructor()->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->typeErrorConstructor()->errorStructure(), message);
}
JSObject* createURIError(JSGlobalObject* globalObject, const UString& message)
{
ASSERT(!message.isEmpty());
- return ErrorInstance::create(globalObject->globalData(), globalObject->URIErrorConstructor()->errorStructure(), message);
+ return ErrorInstance::create(&globalObject->globalData(), globalObject->URIErrorConstructor()->errorStructure(), message);
}
JSObject* createError(ExecState* exec, const UString& message)
@@ -125,19 +125,19 @@ static void addErrorSourceInfo(JSGlobalData* globalData, JSObject* error, int li
const UString& sourceURL = source.provider()->url();
if (line != -1)
- error->putWithAttributes(globalData, Identifier(globalData, linePropertyName), jsNumber(globalData, line), ReadOnly | DontDelete);
+ error->putWithAttributes(globalData, Identifier(globalData, linePropertyName), jsNumber(line), ReadOnly | DontDelete);
if (sourceID != -1)
- error->putWithAttributes(globalData, Identifier(globalData, sourceIdPropertyName), jsNumber(globalData, (double)sourceID), ReadOnly | DontDelete);
+ error->putWithAttributes(globalData, Identifier(globalData, sourceIdPropertyName), jsNumber((double)sourceID), ReadOnly | DontDelete);
if (!sourceURL.isNull())
error->putWithAttributes(globalData, Identifier(globalData, sourceURLPropertyName), jsString(globalData, sourceURL), ReadOnly | DontDelete);
}
static void addErrorDivotInfo(JSGlobalData* globalData, JSObject* error, int divotPoint, int startOffset, int endOffset, bool withCaret)
{
- error->putWithAttributes(globalData, Identifier(globalData, expressionBeginOffsetPropertyName), jsNumber(globalData, divotPoint - startOffset), ReadOnly | DontDelete);
- error->putWithAttributes(globalData, Identifier(globalData, expressionEndOffsetPropertyName), jsNumber(globalData, divotPoint + endOffset), ReadOnly | DontDelete);
+ error->putWithAttributes(globalData, Identifier(globalData, expressionBeginOffsetPropertyName), jsNumber(divotPoint - startOffset), ReadOnly | DontDelete);
+ error->putWithAttributes(globalData, Identifier(globalData, expressionEndOffsetPropertyName), jsNumber(divotPoint + endOffset), ReadOnly | DontDelete);
if (withCaret)
- error->putWithAttributes(globalData, Identifier(globalData, expressionCaretOffsetPropertyName), jsNumber(globalData, divotPoint), ReadOnly | DontDelete);
+ error->putWithAttributes(globalData, Identifier(globalData, expressionCaretOffsetPropertyName), jsNumber(divotPoint), ReadOnly | DontDelete);
}
JSObject* addErrorInfo(JSGlobalData* globalData, JSObject* error, int line, const SourceCode& source)
diff --git a/JavaScriptCore/runtime/ErrorConstructor.cpp b/JavaScriptCore/runtime/ErrorConstructor.cpp
index a0874d4..4326a4d 100644
--- a/JavaScriptCore/runtime/ErrorConstructor.cpp
+++ b/JavaScriptCore/runtime/ErrorConstructor.cpp
@@ -34,7 +34,7 @@ ErrorConstructor::ErrorConstructor(ExecState* exec, JSGlobalObject* globalObject
{
// ECMA 15.11.3.1 Error.prototype
putDirectWithoutTransition(exec->propertyNames().prototype, errorPrototype, DontEnum | DontDelete | ReadOnly);
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), DontDelete | ReadOnly | DontEnum);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum);
}
// ECMA 15.9.3
diff --git a/JavaScriptCore/runtime/ExceptionHelpers.cpp b/JavaScriptCore/runtime/ExceptionHelpers.cpp
index a1e28d1..5fbaa18 100644
--- a/JavaScriptCore/runtime/ExceptionHelpers.cpp
+++ b/JavaScriptCore/runtime/ExceptionHelpers.cpp
@@ -187,14 +187,19 @@ JSObject* createNotAnObjectError(ExecState* exec, JSNotAnObjectErrorStub* error,
return exception;
}
-JSValue throwOutOfMemoryError(ExecState* exec)
+JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const UString& propertyName)
+{
+ return createReferenceError(exec, makeUString("Strict mode forbids implicit creation of global property '", propertyName, "'"));
+}
+
+JSObject* throwOutOfMemoryError(ExecState* exec)
{
return throwError(exec, createError(exec, "Out of memory"));
}
-JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const UString& propertyName)
+JSObject* throwStackOverflowError(ExecState* exec)
{
- return createReferenceError(exec, makeUString("Strict mode forbids implicit creation of global property '", propertyName, "'"));
-}
+ return throwError(exec, createStackOverflowError(exec));
+}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/ExceptionHelpers.h b/JavaScriptCore/runtime/ExceptionHelpers.h
index 9b6f1f2..a7b2ca7 100644
--- a/JavaScriptCore/runtime/ExceptionHelpers.h
+++ b/JavaScriptCore/runtime/ExceptionHelpers.h
@@ -53,9 +53,11 @@ namespace JSC {
JSObject* createNotAConstructorError(ExecState*, JSValue, unsigned bytecodeOffset, CodeBlock*);
JSValue createNotAFunctionError(ExecState*, JSValue, unsigned bytecodeOffset, CodeBlock*);
JSObject* createNotAnObjectError(ExecState*, JSNotAnObjectErrorStub*, unsigned bytecodeOffset, CodeBlock*);
- JSValue throwOutOfMemoryError(ExecState*);
JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const UString&);
+ JSObject* throwOutOfMemoryError(ExecState*);
+ JSObject* throwStackOverflowError(ExecState*);
+
} // namespace JSC
#endif // ExceptionHelpers_h
diff --git a/JavaScriptCore/runtime/FunctionConstructor.cpp b/JavaScriptCore/runtime/FunctionConstructor.cpp
index 9b59720..45b4802 100644
--- a/JavaScriptCore/runtime/FunctionConstructor.cpp
+++ b/JavaScriptCore/runtime/FunctionConstructor.cpp
@@ -43,7 +43,7 @@ FunctionConstructor::FunctionConstructor(ExecState* exec, JSGlobalObject* global
putDirectWithoutTransition(exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly);
// Number of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
}
static EncodedJSValue JSC_HOST_CALL constructWithFunctionConstructor(ExecState* exec)
@@ -97,7 +97,7 @@ JSObject* constructFunction(ExecState* exec, const ArgList& args, const Identifi
}
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
- JSGlobalData* globalData = globalObject->globalData();
+ JSGlobalData& globalData = globalObject->globalData();
SourceCode source = makeSource(program, sourceURL, lineNumber);
JSObject* exception = 0;
RefPtr<FunctionExecutable> function = FunctionExecutable::fromGlobalCode(functionName, exec, exec->dynamicGlobalObject()->debugger(), source, &exception);
@@ -106,7 +106,7 @@ JSObject* constructFunction(ExecState* exec, const ArgList& args, const Identifi
return throwError(exec, exception);
}
- ScopeChain scopeChain(globalObject, globalData, globalObject, exec->globalThisValue());
+ ScopeChain scopeChain(globalObject, &globalData, globalObject, exec->globalThisValue());
return new (exec) JSFunction(exec, function, scopeChain.node());
}
diff --git a/JavaScriptCore/runtime/FunctionPrototype.cpp b/JavaScriptCore/runtime/FunctionPrototype.cpp
index ef42cdc..cd7739d 100644
--- a/JavaScriptCore/runtime/FunctionPrototype.cpp
+++ b/JavaScriptCore/runtime/FunctionPrototype.cpp
@@ -41,7 +41,7 @@ static EncodedJSValue JSC_HOST_CALL functionProtoFuncCall(ExecState*);
FunctionPrototype::FunctionPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure)
: InternalFunction(&exec->globalData(), globalObject, structure, exec->propertyNames().nullIdentifier)
{
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
}
void FunctionPrototype::addFunctionProperties(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeFunctionStructure, NativeFunctionWrapper** callFunction, NativeFunctionWrapper** applyFunction)
diff --git a/JavaScriptCore/runtime/GetterSetter.h b/JavaScriptCore/runtime/GetterSetter.h
index 27ffbe7..e7b1938 100644
--- a/JavaScriptCore/runtime/GetterSetter.h
+++ b/JavaScriptCore/runtime/GetterSetter.h
@@ -64,8 +64,8 @@ namespace JSC {
inline GetterSetter* asGetterSetter(JSValue value)
{
- ASSERT(asCell(value)->isGetterSetter());
- return static_cast<GetterSetter*>(asCell(value));
+ ASSERT(value.asCell()->isGetterSetter());
+ return static_cast<GetterSetter*>(value.asCell());
}
diff --git a/JavaScriptCore/runtime/JSArray.cpp b/JavaScriptCore/runtime/JSArray.cpp
index dae807f..b8b92f4 100644
--- a/JavaScriptCore/runtime/JSArray.cpp
+++ b/JavaScriptCore/runtime/JSArray.cpp
@@ -278,7 +278,7 @@ bool JSArray::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot
bool JSArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
if (propertyName == exec->propertyNames().length) {
- slot.setValue(jsNumber(exec, length()));
+ slot.setValue(jsNumber(length()));
return true;
}
@@ -293,7 +293,7 @@ bool JSArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName
bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
if (propertyName == exec->propertyNames().length) {
- descriptor.setDescriptor(jsNumber(exec, length()), DontDelete | DontEnum);
+ descriptor.setDescriptor(jsNumber(length()), DontDelete | DontEnum);
return true;
}
@@ -1085,7 +1085,7 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
tree.abstractor().m_nodes.grow(nodeCount);
if (callType == CallTypeJS)
- tree.abstractor().m_cachedCall = adoptPtr(new CachedCall(exec, asFunction(compareFunction), 2, exec->exceptionSlot()));
+ tree.abstractor().m_cachedCall = adoptPtr(new CachedCall(exec, asFunction(compareFunction), 2));
if (!tree.abstractor().m_nodes.begin()) {
throwOutOfMemoryError(exec);
diff --git a/JavaScriptCore/runtime/JSByteArray.cpp b/JavaScriptCore/runtime/JSByteArray.cpp
index 88519cf..6af9d75 100644
--- a/JavaScriptCore/runtime/JSByteArray.cpp
+++ b/JavaScriptCore/runtime/JSByteArray.cpp
@@ -40,7 +40,7 @@ JSByteArray::JSByteArray(ExecState* exec, NonNullPassRefPtr<Structure> structure
, m_storage(storage)
, m_classInfo(classInfo)
{
- putDirect(exec->globalData().propertyNames->length, jsNumber(exec, m_storage->length()), ReadOnly | DontDelete);
+ putDirect(exec->globalData().propertyNames->length, jsNumber(m_storage->length()), ReadOnly | DontDelete);
}
#if !ASSERT_DISABLED
diff --git a/JavaScriptCore/runtime/JSByteArray.h b/JavaScriptCore/runtime/JSByteArray.h
index e9a6c64..44bae2d 100644
--- a/JavaScriptCore/runtime/JSByteArray.h
+++ b/JavaScriptCore/runtime/JSByteArray.h
@@ -36,10 +36,10 @@ namespace JSC {
friend class JSGlobalData;
public:
bool canAccessIndex(unsigned i) { return i < m_storage->length(); }
- JSValue getIndex(ExecState* exec, unsigned i)
+ JSValue getIndex(ExecState*, unsigned i)
{
ASSERT(canAccessIndex(i));
- return jsNumber(exec, m_storage->data()[i]);
+ return jsNumber(m_storage->data()[i]);
}
void setIndex(unsigned i, int value)
@@ -106,7 +106,7 @@ namespace JSC {
JSByteArray* asByteArray(JSValue value);
inline JSByteArray* asByteArray(JSValue value)
{
- return static_cast<JSByteArray*>(asCell(value));
+ return static_cast<JSByteArray*>(value.asCell());
}
inline bool isJSByteArray(JSGlobalData* globalData, JSValue v) { return v.isCell() && v.asCell()->vptr() == globalData->jsByteArrayVPtr; }
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 1a7f8b2..7d4929d 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -216,14 +216,14 @@ namespace JSC {
inline CallType getCallData(JSValue value, CallData& callData)
{
- CallType result = value.isCell() ? asCell(value)->getCallData(callData) : CallTypeNone;
+ CallType result = value.isCell() ? value.asCell()->getCallData(callData) : CallTypeNone;
ASSERT(result == CallTypeNone || value.isValidCallee());
return result;
}
inline ConstructType getConstructData(JSValue value, ConstructData& constructData)
{
- ConstructType result = value.isCell() ? asCell(value)->getConstructData(constructData) : ConstructTypeNone;
+ ConstructType result = value.isCell() ? value.asCell()->getConstructData(constructData) : ConstructTypeNone;
ASSERT(result == ConstructTypeNone || value.isValidCallee());
return result;
}
diff --git a/JavaScriptCore/runtime/JSFunction.cpp b/JavaScriptCore/runtime/JSFunction.cpp
index fdaa509..0697fc3 100644
--- a/JavaScriptCore/runtime/JSFunction.cpp
+++ b/JavaScriptCore/runtime/JSFunction.cpp
@@ -74,7 +74,7 @@ JSFunction::JSFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPas
, m_scopeChain(globalObject->globalScopeChain())
{
putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);
- putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
}
#endif
@@ -87,7 +87,7 @@ JSFunction::JSFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPas
{
putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);
#if ENABLE(JIT)
- putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
#else
UNUSED_PARAM(length);
UNUSED_PARAM(func);
@@ -192,11 +192,11 @@ JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, const Identi
return exec->interpreter()->retrieveCaller(exec, thisObj);
}
-JSValue JSFunction::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, const Identifier&)
{
JSFunction* thisObj = asFunction(slotBase);
ASSERT(!thisObj->isHostFunction());
- return jsNumber(exec, thisObj->jsExecutable()->parameterCount());
+ return jsNumber(thisObj->jsExecutable()->parameterCount());
}
bool JSFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
@@ -266,7 +266,7 @@ bool JSFunction::getOwnPropertyDescriptor(ExecState* exec, const Identifier& pro
}
if (propertyName == exec->propertyNames().length) {
- descriptor.setDescriptor(jsNumber(exec, jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete);
+ descriptor.setDescriptor(jsNumber(jsExecutable()->parameterCount()), ReadOnly | DontEnum | DontDelete);
return true;
}
diff --git a/JavaScriptCore/runtime/JSGlobalObject.cpp b/JavaScriptCore/runtime/JSGlobalObject.cpp
index 903e573..a8fb7bf 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -116,7 +116,7 @@ JSGlobalObject::~JSGlobalObject()
for (HashSet<GlobalCodeBlock*>::const_iterator it = codeBlocks().begin(); it != end; ++it)
(*it)->clearGlobalObject();
- RegisterFile& registerFile = globalData()->interpreter->registerFile();
+ RegisterFile& registerFile = globalData().interpreter->registerFile();
if (registerFile.clearGlobalObject(this))
registerFile.setNumGlobals(0);
d()->destructor(d());
@@ -301,13 +301,13 @@ void JSGlobalObject::reset(JSValue prototype)
// Set global values.
GlobalPropertyInfo staticGlobals[] = {
GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete),
- GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete | ReadOnly),
- GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete | ReadOnly),
+ GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(), DontEnum | DontDelete | ReadOnly),
+ GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(Inf), DontEnum | DontDelete | ReadOnly),
GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete | ReadOnly),
GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete)
};
- addStaticGlobals(staticGlobals, sizeof(staticGlobals) / sizeof(GlobalPropertyInfo));
+ addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
// Set global functions.
@@ -349,9 +349,9 @@ void JSGlobalObject::markChildren(MarkStack& markStack)
for (HashSet<GlobalCodeBlock*>::const_iterator it = codeBlocks().begin(); it != end; ++it)
(*it)->markAggregate(markStack);
- RegisterFile& registerFile = globalData()->interpreter->registerFile();
+ RegisterFile& registerFile = globalData().interpreter->registerFile();
if (registerFile.globalObject() == this)
- registerFile.markGlobals(markStack, &globalData()->heap);
+ registerFile.markGlobals(markStack, &globalData().heap);
markIfNeeded(markStack, d()->regExpConstructor);
markIfNeeded(markStack, d()->errorConstructor);
diff --git a/JavaScriptCore/runtime/JSGlobalObject.h b/JavaScriptCore/runtime/JSGlobalObject.h
index 36fa70b..93a1b88 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/JavaScriptCore/runtime/JSGlobalObject.h
@@ -276,7 +276,7 @@ namespace JSC {
void resetPrototype(JSValue prototype);
- JSGlobalData* globalData() { return d()->globalData.get(); }
+ JSGlobalData& globalData() { return *d()->globalData.get(); }
JSGlobalObjectData* d() const { return static_cast<JSGlobalObjectData*>(JSVariableObject::d); }
static PassRefPtr<Structure> createStructure(JSValue prototype)
diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index ed06fa5..284806e 100644
--- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -455,7 +455,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncEval(ExecState* exec)
if (error)
return throwVMError(exec, error);
- return JSValue::encode(exec->interpreter()->execute(eval.get(), exec, thisObject, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain().node(), exec->exceptionSlot()));
+ return JSValue::encode(exec->interpreter()->execute(eval.get(), exec, thisObject, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain().node()));
}
EncodedJSValue JSC_HOST_CALL globalFuncParseInt(ExecState* exec)
@@ -464,7 +464,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncParseInt(ExecState* exec)
int32_t radix = exec->argument(1).toInt32(exec);
if (radix != 0 && radix != 10)
- return JSValue::encode(jsNumber(exec, parseInt(value.toString(exec), radix)));
+ return JSValue::encode(jsNumber(parseInt(value.toString(exec), radix)));
if (value.isInt32())
return JSValue::encode(value);
@@ -472,18 +472,18 @@ EncodedJSValue JSC_HOST_CALL globalFuncParseInt(ExecState* exec)
if (value.isDouble()) {
double d = value.asDouble();
if (isfinite(d))
- return JSValue::encode(jsNumber(exec, (d > 0) ? floor(d) : ceil(d)));
+ return JSValue::encode(jsNumber((d > 0) ? floor(d) : ceil(d)));
if (isnan(d) || isinf(d))
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, 0));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(0));
}
- return JSValue::encode(jsNumber(exec, parseInt(value.toString(exec), radix)));
+ return JSValue::encode(jsNumber(parseInt(value.toString(exec), radix)));
}
EncodedJSValue JSC_HOST_CALL globalFuncParseFloat(ExecState* exec)
{
- return JSValue::encode(jsNumber(exec, parseFloat(exec->argument(0).toString(exec))));
+ return JSValue::encode(jsNumber(parseFloat(exec->argument(0).toString(exec))));
}
EncodedJSValue JSC_HOST_CALL globalFuncIsNaN(ExecState* exec)
diff --git a/JavaScriptCore/runtime/JSNumberCell.h b/JavaScriptCore/runtime/JSNumberCell.h
index a25c531..0040067 100644
--- a/JavaScriptCore/runtime/JSNumberCell.h
+++ b/JavaScriptCore/runtime/JSNumberCell.h
@@ -36,81 +36,60 @@ namespace JSC {
extern const double Inf;
#if USE(JSVALUE64)
- ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, ExecState*, double d)
+ ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
{
*this = JSImmediate::fromNumberOutsideIntegerRange(d);
}
- inline JSValue::JSValue(ExecState*, double d)
+ inline JSValue::JSValue(double d)
{
JSValue v = JSImmediate::from(d);
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(ExecState*, int i)
+ inline JSValue::JSValue(int i)
{
JSValue v = JSImmediate::from(i);
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(ExecState*, unsigned i)
+ inline JSValue::JSValue(unsigned i)
{
JSValue v = JSImmediate::from(i);
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(ExecState*, long i)
+ inline JSValue::JSValue(long i)
{
JSValue v = JSImmediate::from(i);
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(ExecState*, unsigned long i)
+ inline JSValue::JSValue(unsigned long i)
{
JSValue v = JSImmediate::from(i);
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(ExecState*, long long i)
+ inline JSValue::JSValue(long long i)
{
JSValue v = JSImmediate::from(static_cast<double>(i));
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(ExecState*, unsigned long long i)
+ inline JSValue::JSValue(unsigned long long i)
{
JSValue v = JSImmediate::from(static_cast<double>(i));
ASSERT(v);
*this = v;
}
- inline JSValue::JSValue(JSGlobalData*, double d)
- {
- JSValue v = JSImmediate::from(d);
- ASSERT(v);
- *this = v;
- }
-
- inline JSValue::JSValue(JSGlobalData*, int i)
- {
- JSValue v = JSImmediate::from(i);
- ASSERT(v);
- *this = v;
- }
-
- inline JSValue::JSValue(JSGlobalData*, unsigned i)
- {
- JSValue v = JSImmediate::from(i);
- ASSERT(v);
- *this = v;
- }
-
inline bool JSValue::isDouble() const
{
return JSImmediate::isDouble(asValue());
@@ -136,45 +115,40 @@ namespace JSC {
#if USE(JSVALUE64)
- inline JSValue::JSValue(ExecState*, char i)
+ inline JSValue::JSValue(char i)
{
ASSERT(JSImmediate::from(i));
*this = JSImmediate::from(i);
}
- inline JSValue::JSValue(ExecState*, unsigned char i)
+ inline JSValue::JSValue(unsigned char i)
{
ASSERT(JSImmediate::from(i));
*this = JSImmediate::from(i);
}
- inline JSValue::JSValue(ExecState*, short i)
+ inline JSValue::JSValue(short i)
{
ASSERT(JSImmediate::from(i));
*this = JSImmediate::from(i);
}
- inline JSValue::JSValue(ExecState*, unsigned short i)
+ inline JSValue::JSValue(unsigned short i)
{
ASSERT(JSImmediate::from(i));
*this = JSImmediate::from(i);
}
- inline JSValue jsNaN(ExecState* exec)
- {
- return jsNumber(exec, NaN);
- }
-
- inline JSValue jsNaN(JSGlobalData* globalData)
+ inline JSValue jsNaN()
{
- return jsNumber(globalData, NaN);
+ return jsNumber(NaN);
}
// --- JSValue inlines ----------------------------
ALWAYS_INLINE JSValue JSValue::toJSNumber(ExecState* exec) const
{
- return isNumber() ? asValue() : jsNumber(exec, this->toNumber(exec));
+ return isNumber() ? asValue() : jsNumber(this->toNumber(exec));
}
inline bool JSValue::getNumber(double &result) const
diff --git a/JavaScriptCore/runtime/JSONObject.cpp b/JavaScriptCore/runtime/JSONObject.cpp
index 0794189..b5477a1 100644
--- a/JavaScriptCore/runtime/JSONObject.cpp
+++ b/JavaScriptCore/runtime/JSONObject.cpp
@@ -133,7 +133,7 @@ static inline JSValue unwrapBoxedPrimitive(ExecState* exec, JSValue value)
return value;
JSObject* object = asObject(value);
if (object->inherits(&NumberObject::info))
- return jsNumber(exec, object->toNumber(exec));
+ return jsNumber(object->toNumber(exec));
if (object->inherits(&StringObject::info))
return jsString(exec, object->toString(exec));
if (object->inherits(&BooleanObject::info))
@@ -189,7 +189,7 @@ JSValue PropertyNameForFunctionCall::value(ExecState* exec) const
if (m_identifier)
m_value = jsString(exec, m_identifier->ustring());
else
- m_value = jsNumber(exec, m_number);
+ m_value = jsNumber(m_number);
}
return m_value;
}
@@ -329,7 +329,7 @@ void Stringifier::appendQuotedString(UStringBuilder& builder, const UString& val
static const char hexDigits[] = "0123456789abcdef";
UChar ch = data[i];
UChar hex[] = { '\\', 'u', hexDigits[(ch >> 12) & 0xF], hexDigits[(ch >> 8) & 0xF], hexDigits[(ch >> 4) & 0xF], hexDigits[ch & 0xF] };
- builder.append(hex, sizeof(hex) / sizeof(UChar));
+ builder.append(hex, WTF_ARRAY_LENGTH(hex));
break;
}
}
@@ -357,7 +357,7 @@ inline JSValue Stringifier::toJSON(JSValue value, const PropertyNameForFunctionC
return value;
JSValue list[] = { propertyName.value(m_exec) };
- ArgList args(list, sizeof(list) / sizeof(JSValue));
+ ArgList args(list, WTF_ARRAY_LENGTH(list));
return call(m_exec, object, callType, callData, value, args);
}
@@ -371,7 +371,7 @@ Stringifier::StringifyResult Stringifier::appendStringifiedValue(UStringBuilder&
// Call the replacer function.
if (m_replacerCallType != CallTypeNone) {
JSValue list[] = { propertyName.value(m_exec), value };
- ArgList args(list, sizeof(list) / sizeof(JSValue));
+ ArgList args(list, WTF_ARRAY_LENGTH(list));
value = call(m_exec, m_replacer, m_replacerCallType, m_replacerCallData, holder, args);
if (m_exec->hadException())
return StringifyFailed;
@@ -868,7 +868,7 @@ EncodedJSValue JSC_HOST_CALL JSONProtoFuncStringify(ExecState* exec)
UString JSONStringify(ExecState* exec, JSValue value, unsigned indent)
{
- JSValue result = Stringifier(exec, jsNull(), jsNumber(exec, indent)).stringify(value);
+ JSValue result = Stringifier(exec, jsNull(), jsNumber(indent)).stringify(value);
if (result.isUndefinedOrNull())
return UString();
return result.getString(exec);
diff --git a/JavaScriptCore/runtime/JSString.cpp b/JavaScriptCore/runtime/JSString.cpp
index bc0120f..340a898 100644
--- a/JavaScriptCore/runtime/JSString.cpp
+++ b/JavaScriptCore/runtime/JSString.cpp
@@ -236,7 +236,7 @@ bool JSString::getOwnPropertySlot(ExecState* exec, const Identifier& propertyNam
bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
if (propertyName == exec->propertyNames().length) {
- descriptor.setDescriptor(jsNumber(exec, m_length), DontEnum | DontDelete | ReadOnly);
+ descriptor.setDescriptor(jsNumber(m_length), DontEnum | DontDelete | ReadOnly);
return true;
}
diff --git a/JavaScriptCore/runtime/JSString.h b/JavaScriptCore/runtime/JSString.h
index 12ced10..4d81a2f 100644
--- a/JavaScriptCore/runtime/JSString.h
+++ b/JavaScriptCore/runtime/JSString.h
@@ -379,8 +379,8 @@ namespace JSC {
void appendValueInConstructAndIncrementLength(ExecState* exec, unsigned& index, JSValue v)
{
if (v.isString()) {
- ASSERT(asCell(v)->isString());
- JSString* s = static_cast<JSString*>(asCell(v));
+ ASSERT(v.asCell()->isString());
+ JSString* s = static_cast<JSString*>(v.asCell());
ASSERT(s->fiberCount() == 1);
appendStringInConstruct(index, s);
m_length += s->length();
@@ -451,8 +451,8 @@ namespace JSC {
inline JSString* asString(JSValue value)
{
- ASSERT(asCell(value)->isString());
- return static_cast<JSString*>(asCell(value));
+ ASSERT(value.asCell()->isString());
+ return static_cast<JSString*>(value.asCell());
}
inline JSString* jsEmptyString(JSGlobalData* globalData)
@@ -559,7 +559,7 @@ namespace JSC {
ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
if (propertyName == exec->propertyNames().length) {
- slot.setValue(jsNumber(exec, m_length));
+ slot.setValue(jsNumber(m_length));
return true;
}
diff --git a/JavaScriptCore/runtime/JSValue.h b/JavaScriptCore/runtime/JSValue.h
index b5dcbec..cad9662 100644
--- a/JavaScriptCore/runtime/JSValue.h
+++ b/JavaScriptCore/runtime/JSValue.h
@@ -101,21 +101,18 @@ namespace JSC {
JSValue(const JSCell* ptr);
// Numbers
- JSValue(EncodeAsDoubleTag, ExecState*, double);
- JSValue(ExecState*, double);
- JSValue(ExecState*, char);
- JSValue(ExecState*, unsigned char);
- JSValue(ExecState*, short);
- JSValue(ExecState*, unsigned short);
- JSValue(ExecState*, int);
- JSValue(ExecState*, unsigned);
- JSValue(ExecState*, long);
- JSValue(ExecState*, unsigned long);
- JSValue(ExecState*, long long);
- JSValue(ExecState*, unsigned long long);
- JSValue(JSGlobalData*, double);
- JSValue(JSGlobalData*, int);
- JSValue(JSGlobalData*, unsigned);
+ JSValue(EncodeAsDoubleTag, double);
+ explicit JSValue(double);
+ explicit JSValue(char);
+ explicit JSValue(unsigned char);
+ explicit JSValue(short);
+ explicit JSValue(unsigned short);
+ explicit JSValue(int);
+ explicit JSValue(unsigned);
+ explicit JSValue(long);
+ explicit JSValue(unsigned long);
+ explicit JSValue(long long);
+ explicit JSValue(unsigned long long);
operator bool() const;
bool operator==(const JSValue& other) const;
@@ -226,12 +223,12 @@ namespace JSC {
JSObject* synthesizeObject(ExecState*) const;
#if USE(JSVALUE32_64)
- enum { Int32Tag = 0xffffffff };
- enum { CellTag = 0xfffffffe };
- enum { TrueTag = 0xfffffffd };
- enum { FalseTag = 0xfffffffc };
- enum { NullTag = 0xfffffffb };
- enum { UndefinedTag = 0xfffffffa };
+ enum { NullTag = 0xffffffff };
+ enum { UndefinedTag = 0xfffffffe };
+ enum { Int32Tag = 0xfffffffd };
+ enum { CellTag = 0xfffffffc };
+ enum { TrueTag = 0xfffffffb };
+ enum { FalseTag = 0xfffffffa };
enum { EmptyValueTag = 0xfffffff9 };
enum { DeletedValueTag = 0xfffffff8 };
@@ -294,79 +291,64 @@ namespace JSC {
return b ? JSValue(JSValue::JSTrue) : JSValue(JSValue::JSFalse);
}
- ALWAYS_INLINE JSValue jsDoubleNumber(ExecState* exec, double d)
+ ALWAYS_INLINE JSValue jsDoubleNumber(double d)
{
- return JSValue(JSValue::EncodeAsDouble, exec, d);
+ return JSValue(JSValue::EncodeAsDouble, d);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, double d)
+ ALWAYS_INLINE JSValue jsNumber(double d)
{
- return JSValue(exec, d);
+ return JSValue(d);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, char i)
+ ALWAYS_INLINE JSValue jsNumber(char i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned char i)
+ ALWAYS_INLINE JSValue jsNumber(unsigned char i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, short i)
+ ALWAYS_INLINE JSValue jsNumber(short i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned short i)
+ ALWAYS_INLINE JSValue jsNumber(unsigned short i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, int i)
+ ALWAYS_INLINE JSValue jsNumber(int i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned i)
+ ALWAYS_INLINE JSValue jsNumber(unsigned i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, long i)
+ ALWAYS_INLINE JSValue jsNumber(long i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned long i)
+ ALWAYS_INLINE JSValue jsNumber(unsigned long i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, long long i)
+ ALWAYS_INLINE JSValue jsNumber(long long i)
{
- return JSValue(exec, i);
+ return JSValue(i);
}
- ALWAYS_INLINE JSValue jsNumber(ExecState* exec, unsigned long long i)
+ ALWAYS_INLINE JSValue jsNumber(unsigned long long i)
{
- return JSValue(exec, i);
- }
-
- ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, double d)
- {
- return JSValue(globalData, d);
- }
-
- ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, int i)
- {
- return JSValue(globalData, i);
- }
-
- ALWAYS_INLINE JSValue jsNumber(JSGlobalData* globalData, unsigned i)
- {
- return JSValue(globalData, i);
+ return JSValue(i);
}
inline bool operator==(const JSValue a, const JSCell* b) { return a == JSValue(b); }
@@ -375,14 +357,6 @@ namespace JSC {
inline bool operator!=(const JSValue a, const JSCell* b) { return a != JSValue(b); }
inline bool operator!=(const JSCell* a, const JSValue b) { return JSValue(a) != b; }
- // FIXME: We should deprecate this and just use JSValue::asCell() instead.
- JSCell* asCell(JSValue);
-
- inline JSCell* asCell(JSValue value)
- {
- return value.asCell();
- }
-
ALWAYS_INLINE int32_t JSValue::toInt32(ExecState* exec) const
{
if (isInt32())
@@ -397,9 +371,9 @@ namespace JSC {
}
#if USE(JSVALUE32_64)
- inline JSValue jsNaN(ExecState* exec)
+ inline JSValue jsNaN()
{
- return JSValue(exec, nonInlineNaN());
+ return JSValue(nonInlineNaN());
}
// JSValue member functions.
@@ -573,115 +547,90 @@ namespace JSC {
return reinterpret_cast<JSCell*>(u.asBits.payload);
}
- ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, ExecState*, double d)
+ ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
{
u.asDouble = d;
}
- inline JSValue::JSValue(ExecState* exec, double d)
+ inline JSValue::JSValue(double d)
{
const int32_t asInt32 = static_cast<int32_t>(d);
if (asInt32 != d || (!asInt32 && signbit(d))) { // true for -0.0
u.asDouble = d;
return;
}
- *this = JSValue(exec, static_cast<int32_t>(d));
+ *this = JSValue(static_cast<int32_t>(d));
}
- inline JSValue::JSValue(ExecState* exec, char i)
+ inline JSValue::JSValue(char i)
{
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, unsigned char i)
+ inline JSValue::JSValue(unsigned char i)
{
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, short i)
+ inline JSValue::JSValue(short i)
{
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, unsigned short i)
+ inline JSValue::JSValue(unsigned short i)
{
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState*, int i)
+ inline JSValue::JSValue(int i)
{
u.asBits.tag = Int32Tag;
u.asBits.payload = i;
}
- inline JSValue::JSValue(ExecState* exec, unsigned i)
+ inline JSValue::JSValue(unsigned i)
{
if (static_cast<int32_t>(i) < 0) {
- *this = JSValue(exec, static_cast<double>(i));
+ *this = JSValue(static_cast<double>(i));
return;
}
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, long i)
+ inline JSValue::JSValue(long i)
{
if (static_cast<int32_t>(i) != i) {
- *this = JSValue(exec, static_cast<double>(i));
+ *this = JSValue(static_cast<double>(i));
return;
}
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, unsigned long i)
+ inline JSValue::JSValue(unsigned long i)
{
if (static_cast<uint32_t>(i) != i) {
- *this = JSValue(exec, static_cast<double>(i));
+ *this = JSValue(static_cast<double>(i));
return;
}
- *this = JSValue(exec, static_cast<uint32_t>(i));
+ *this = JSValue(static_cast<uint32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, long long i)
+ inline JSValue::JSValue(long long i)
{
if (static_cast<int32_t>(i) != i) {
- *this = JSValue(exec, static_cast<double>(i));
+ *this = JSValue(static_cast<double>(i));
return;
}
- *this = JSValue(exec, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<int32_t>(i));
}
- inline JSValue::JSValue(ExecState* exec, unsigned long long i)
+ inline JSValue::JSValue(unsigned long long i)
{
if (static_cast<uint32_t>(i) != i) {
- *this = JSValue(exec, static_cast<double>(i));
- return;
- }
- *this = JSValue(exec, static_cast<uint32_t>(i));
- }
-
- inline JSValue::JSValue(JSGlobalData* globalData, double d)
- {
- const int32_t asInt32 = static_cast<int32_t>(d);
- if (asInt32 != d || (!asInt32 && signbit(d))) { // true for -0.0
- u.asDouble = d;
- return;
- }
- *this = JSValue(globalData, static_cast<int32_t>(d));
- }
-
- inline JSValue::JSValue(JSGlobalData*, int i)
- {
- u.asBits.tag = Int32Tag;
- u.asBits.payload = i;
- }
-
- inline JSValue::JSValue(JSGlobalData* globalData, unsigned i)
- {
- if (static_cast<int32_t>(i) < 0) {
- *this = JSValue(globalData, static_cast<double>(i));
+ *this = JSValue(static_cast<double>(i));
return;
}
- *this = JSValue(globalData, static_cast<int32_t>(i));
+ *this = JSValue(static_cast<uint32_t>(i));
}
inline bool JSValue::isNumber() const
@@ -722,7 +671,7 @@ namespace JSC {
ALWAYS_INLINE JSValue JSValue::toJSNumber(ExecState* exec) const
{
- return isNumber() ? asValue() : jsNumber(exec, this->toNumber(exec));
+ return isNumber() ? asValue() : jsNumber(this->toNumber(exec));
}
inline bool JSValue::getNumber(double& result) const
diff --git a/JavaScriptCore/runtime/LiteralParser.cpp b/JavaScriptCore/runtime/LiteralParser.cpp
index f1df15f..ed69f4d 100644
--- a/JavaScriptCore/runtime/LiteralParser.cpp
+++ b/JavaScriptCore/runtime/LiteralParser.cpp
@@ -393,7 +393,7 @@ JSValue LiteralParser::parse(ParserState initialState)
case TokNumber: {
Lexer::LiteralParserToken numberToken = m_lexer.currentToken();
m_lexer.next();
- lastValue = jsNumber(m_exec, numberToken.numberToken);
+ lastValue = jsNumber(numberToken.numberToken);
break;
}
case TokNull:
diff --git a/JavaScriptCore/runtime/MathObject.cpp b/JavaScriptCore/runtime/MathObject.cpp
index 8d2ae2d..080d7d2 100644
--- a/JavaScriptCore/runtime/MathObject.cpp
+++ b/JavaScriptCore/runtime/MathObject.cpp
@@ -89,14 +89,14 @@ const ClassInfo MathObject::info = { "Math", 0, 0, ExecState::mathTable };
MathObject::MathObject(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure)
: JSObjectWithGlobalObject(globalObject, structure)
{
- putDirectWithoutTransition(Identifier(exec, "E"), jsNumber(exec, exp(1.0)), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "LN2"), jsNumber(exec, log(2.0)), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "LN10"), jsNumber(exec, log(10.0)), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "LOG2E"), jsNumber(exec, 1.0 / log(2.0)), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "LOG10E"), jsNumber(exec, 1.0 / log(10.0)), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "PI"), jsNumber(exec, piDouble), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "SQRT1_2"), jsNumber(exec, sqrt(0.5)), DontDelete | DontEnum | ReadOnly);
- putDirectWithoutTransition(Identifier(exec, "SQRT2"), jsNumber(exec, sqrt(2.0)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "E"), jsNumber(exp(1.0)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "LN2"), jsNumber(log(2.0)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "LN10"), jsNumber(log(10.0)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "LOG2E"), jsNumber(1.0 / log(2.0)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "LOG10E"), jsNumber(1.0 / log(10.0)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "PI"), jsNumber(piDouble), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "SQRT1_2"), jsNumber(sqrt(0.5)), DontDelete | DontEnum | ReadOnly);
+ putDirectWithoutTransition(Identifier(exec, "SQRT2"), jsNumber(sqrt(2.0)), DontDelete | DontEnum | ReadOnly);
}
// ECMA 15.8
@@ -115,54 +115,54 @@ bool MathObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& pro
EncodedJSValue JSC_HOST_CALL mathProtoFuncAbs(ExecState* exec)
{
- return JSValue::encode(jsNumber(exec, fabs(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsNumber(fabs(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncACos(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, acos(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(acos(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncASin(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, asin(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(asin(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncATan(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, atan(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(atan(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState* exec)
{
double arg0 = exec->argument(0).toNumber(exec);
double arg1 = exec->argument(1).toNumber(exec);
- return JSValue::encode(jsDoubleNumber(exec, atan2(arg0, arg1)));
+ return JSValue::encode(jsDoubleNumber(atan2(arg0, arg1)));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncCeil(ExecState* exec)
{
- return JSValue::encode(jsNumber(exec, ceil(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsNumber(ceil(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncCos(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, cos(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(cos(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncExp(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, exp(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(exp(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncFloor(ExecState* exec)
{
- return JSValue::encode(jsNumber(exec, floor(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsNumber(floor(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncLog(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, log(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(log(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncMax(ExecState* exec)
@@ -178,7 +178,7 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncMax(ExecState* exec)
if (val > result || (val == 0 && result == 0 && !signbit(val)))
result = val;
}
- return JSValue::encode(jsNumber(exec, result));
+ return JSValue::encode(jsNumber(result));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncMin(ExecState* exec)
@@ -194,7 +194,7 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncMin(ExecState* exec)
if (val < result || (val == 0 && result == 0 && signbit(val)))
result = val;
}
- return JSValue::encode(jsNumber(exec, result));
+ return JSValue::encode(jsNumber(result));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncPow(ExecState* exec)
@@ -205,37 +205,37 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncPow(ExecState* exec)
double arg2 = exec->argument(1).toNumber(exec);
if (isnan(arg2))
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNaN());
if (isinf(arg2) && fabs(arg) == 1)
- return JSValue::encode(jsNaN(exec));
- return JSValue::encode(jsNumber(exec, pow(arg, arg2)));
+ return JSValue::encode(jsNaN());
+ return JSValue::encode(jsNumber(pow(arg, arg2)));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, exec->lexicalGlobalObject()->weakRandomNumber()));
+ return JSValue::encode(jsDoubleNumber(exec->lexicalGlobalObject()->weakRandomNumber()));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncRound(ExecState* exec)
{
double arg = exec->argument(0).toNumber(exec);
double integer = ceil(arg);
- return JSValue::encode(jsNumber(exec, integer - (integer - arg > 0.5)));
+ return JSValue::encode(jsNumber(integer - (integer - arg > 0.5)));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncSin(ExecState* exec)
{
- return JSValue::encode(exec->globalData().cachedSin(exec, exec->argument(0).toNumber(exec)));
+ return JSValue::encode(exec->globalData().cachedSin(exec->argument(0).toNumber(exec)));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncSqrt(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, sqrt(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(sqrt(exec->argument(0).toNumber(exec))));
}
EncodedJSValue JSC_HOST_CALL mathProtoFuncTan(ExecState* exec)
{
- return JSValue::encode(jsDoubleNumber(exec, tan(exec->argument(0).toNumber(exec))));
+ return JSValue::encode(jsDoubleNumber(tan(exec->argument(0).toNumber(exec))));
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/NativeErrorConstructor.cpp b/JavaScriptCore/runtime/NativeErrorConstructor.cpp
index 31f9bc3..eb508eb 100644
--- a/JavaScriptCore/runtime/NativeErrorConstructor.cpp
+++ b/JavaScriptCore/runtime/NativeErrorConstructor.cpp
@@ -37,7 +37,7 @@ NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, JSGlobalObject*
{
NativeErrorPrototype* prototype = new (exec) NativeErrorPrototype(exec, globalObject, prototypeStructure, nameAndMessage, this);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5
+ putDirect(exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5
putDirect(exec->propertyNames().prototype, prototype, DontDelete | ReadOnly | DontEnum);
m_errorStructure = ErrorInstance::createStructure(prototype);
}
diff --git a/JavaScriptCore/runtime/NumberConstructor.cpp b/JavaScriptCore/runtime/NumberConstructor.cpp
index a197952..5369ca0 100644
--- a/JavaScriptCore/runtime/NumberConstructor.cpp
+++ b/JavaScriptCore/runtime/NumberConstructor.cpp
@@ -61,7 +61,7 @@ NumberConstructor::NumberConstructor(ExecState* exec, JSGlobalObject* globalObje
putDirectWithoutTransition(exec->propertyNames().prototype, numberPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
}
bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
@@ -74,29 +74,29 @@ bool NumberConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifi
return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, descriptor);
}
-static JSValue numberConstructorNaNValue(ExecState* exec, JSValue, const Identifier&)
+static JSValue numberConstructorNaNValue(ExecState*, JSValue, const Identifier&)
{
- return jsNaN(exec);
+ return jsNaN();
}
-static JSValue numberConstructorNegInfinity(ExecState* exec, JSValue, const Identifier&)
+static JSValue numberConstructorNegInfinity(ExecState*, JSValue, const Identifier&)
{
- return jsNumber(exec, -Inf);
+ return jsNumber(-Inf);
}
-static JSValue numberConstructorPosInfinity(ExecState* exec, JSValue, const Identifier&)
+static JSValue numberConstructorPosInfinity(ExecState*, JSValue, const Identifier&)
{
- return jsNumber(exec, Inf);
+ return jsNumber(Inf);
}
-static JSValue numberConstructorMaxValue(ExecState* exec, JSValue, const Identifier&)
+static JSValue numberConstructorMaxValue(ExecState*, JSValue, const Identifier&)
{
- return jsNumber(exec, 1.7976931348623157E+308);
+ return jsNumber(1.7976931348623157E+308);
}
-static JSValue numberConstructorMinValue(ExecState* exec, JSValue, const Identifier&)
+static JSValue numberConstructorMinValue(ExecState*, JSValue, const Identifier&)
{
- return jsNumber(exec, 5E-324);
+ return jsNumber(5E-324);
}
// ECMA 15.7.1
@@ -104,7 +104,7 @@ static EncodedJSValue JSC_HOST_CALL constructWithNumberConstructor(ExecState* ex
{
NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure());
double n = exec->argumentCount() ? exec->argument(0).toNumber(exec) : 0;
- object->setInternalValue(jsNumber(exec, n));
+ object->setInternalValue(jsNumber(n));
return JSValue::encode(object);
}
@@ -117,7 +117,7 @@ ConstructType NumberConstructor::getConstructData(ConstructData& constructData)
// ECMA 15.7.2
static EncodedJSValue JSC_HOST_CALL callNumberConstructor(ExecState* exec)
{
- return JSValue::encode(jsNumber(exec, !exec->argumentCount() ? 0 : exec->argument(0).toNumber(exec)));
+ return JSValue::encode(jsNumber(!exec->argumentCount() ? 0 : exec->argument(0).toNumber(exec)));
}
CallType NumberConstructor::getCallData(CallData& callData)
diff --git a/JavaScriptCore/runtime/NumberPrototype.cpp b/JavaScriptCore/runtime/NumberPrototype.cpp
index 4a2ca74..0b86c00 100644
--- a/JavaScriptCore/runtime/NumberPrototype.cpp
+++ b/JavaScriptCore/runtime/NumberPrototype.cpp
@@ -49,7 +49,7 @@ static EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState*);
NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, Structure* prototypeFunctionStructure)
: NumberObject(structure)
{
- setInternalValue(jsNumber(exec, 0));
+ setInternalValue(jsNumber(0));
// The constructor will be added later, after NumberConstructor has been constructed
diff --git a/JavaScriptCore/runtime/ObjectConstructor.cpp b/JavaScriptCore/runtime/ObjectConstructor.cpp
index b1f9d70..ca3dcd7 100644
--- a/JavaScriptCore/runtime/ObjectConstructor.cpp
+++ b/JavaScriptCore/runtime/ObjectConstructor.cpp
@@ -50,7 +50,7 @@ ObjectConstructor::ObjectConstructor(ExecState* exec, JSGlobalObject* globalObje
putDirectWithoutTransition(exec->propertyNames().prototype, objectPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().getPrototypeOf, objectConstructorGetPrototypeOf), DontEnum);
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 2, exec->propertyNames().getOwnPropertyDescriptor, objectConstructorGetOwnPropertyDescriptor), DontEnum);
diff --git a/JavaScriptCore/runtime/Operations.cpp b/JavaScriptCore/runtime/Operations.cpp
index cf236bf..f129a80 100644
--- a/JavaScriptCore/runtime/Operations.cpp
+++ b/JavaScriptCore/runtime/Operations.cpp
@@ -55,7 +55,7 @@ NEVER_INLINE JSValue jsAddSlowCase(CallFrame* callFrame, JSValue v1, JSValue v2)
if (p2.isString())
return jsString(callFrame, p1.toString(callFrame), asString(p2));
- return jsNumber(callFrame, p1.toNumber(callFrame) + p2.toNumber(callFrame));
+ return jsNumber(p1.toNumber(callFrame) + p2.toNumber(callFrame));
}
JSValue jsTypeStringForValue(CallFrame* callFrame, JSValue v)
@@ -85,7 +85,7 @@ bool jsIsObjectType(JSValue v)
if (!v.isCell())
return v.isNull();
- JSType type = asCell(v)->structure()->typeInfo().type();
+ JSType type = v.asCell()->structure()->typeInfo().type();
if (type == NumberType || type == StringType)
return false;
if (type == ObjectType) {
diff --git a/JavaScriptCore/runtime/Operations.h b/JavaScriptCore/runtime/Operations.h
index 9226953..1252345 100644
--- a/JavaScriptCore/runtime/Operations.h
+++ b/JavaScriptCore/runtime/Operations.h
@@ -398,7 +398,7 @@ namespace JSC {
{
double left = 0.0, right;
if (v1.getNumber(left) && v2.getNumber(right))
- return jsNumber(callFrame, left + right);
+ return jsNumber(left + right);
if (v1.isString()) {
return v2.isString()
@@ -412,7 +412,7 @@ namespace JSC {
inline size_t normalizePrototypeChain(CallFrame* callFrame, JSValue base, JSValue slotBase, const Identifier& propertyName, size_t& slotOffset)
{
- JSCell* cell = asCell(base);
+ JSCell* cell = base.asCell();
size_t count = 0;
while (slotBase != cell) {
@@ -424,7 +424,7 @@ namespace JSC {
if (v.isNull())
return 0;
- cell = asCell(v);
+ cell = v.asCell();
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
@@ -449,7 +449,7 @@ namespace JSC {
if (v.isNull())
return count;
- base = asCell(v);
+ base = v.asCell();
// Since we're accessing a prototype in a loop, it's a good bet that it
// should not be treated as a dictionary.
diff --git a/JavaScriptCore/runtime/Protect.h b/JavaScriptCore/runtime/Protect.h
index a0d5443..06cf97f 100644
--- a/JavaScriptCore/runtime/Protect.h
+++ b/JavaScriptCore/runtime/Protect.h
@@ -52,13 +52,13 @@ namespace JSC {
inline void gcProtect(JSValue value)
{
if (value && value.isCell())
- gcProtect(asCell(value));
+ gcProtect(value.asCell());
}
inline void gcUnprotect(JSValue value)
{
if (value && value.isCell())
- gcUnprotect(asCell(value));
+ gcUnprotect(value.asCell());
}
// FIXME: Share more code with RefPtr template? The only differences are the ref/deref operation
diff --git a/JavaScriptCore/runtime/PrototypeFunction.cpp b/JavaScriptCore/runtime/PrototypeFunction.cpp
index b0bf2bd..3529080 100644
--- a/JavaScriptCore/runtime/PrototypeFunction.cpp
+++ b/JavaScriptCore/runtime/PrototypeFunction.cpp
@@ -37,7 +37,7 @@ PrototypeFunction::PrototypeFunction(ExecState* exec, JSGlobalObject* globalObje
, m_function(function)
{
ASSERT_ARG(function, function);
- putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
}
PrototypeFunction::PrototypeFunction(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> prototypeFunctionStructure, int length, const Identifier& name, NativeFunction function)
@@ -45,7 +45,7 @@ PrototypeFunction::PrototypeFunction(ExecState* exec, JSGlobalObject* globalObje
, m_function(function)
{
ASSERT_ARG(function, function);
- putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
}
CallType PrototypeFunction::getCallData(CallData& callData)
diff --git a/JavaScriptCore/runtime/RegExpConstructor.cpp b/JavaScriptCore/runtime/RegExpConstructor.cpp
index b9aa587..21ca170 100644
--- a/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -103,7 +103,7 @@ RegExpConstructor::RegExpConstructor(ExecState* exec, JSGlobalObject* globalObje
putDirectWithoutTransition(exec->propertyNames().prototype, regExpPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly | DontDelete | DontEnum);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(2), ReadOnly | DontDelete | DontEnum);
}
RegExpMatchesArray::RegExpMatchesArray(ExecState* exec, RegExpConstructorPrivate* data)
@@ -142,7 +142,7 @@ void RegExpMatchesArray::fillArrayInstance(ExecState* exec)
}
PutPropertySlot slot;
- JSArray::put(exec, exec->propertyNames().index, jsNumber(exec, d->lastOvector()[0]), slot);
+ JSArray::put(exec, exec->propertyNames().index, jsNumber(d->lastOvector()[0]), slot);
JSArray::put(exec, exec->propertyNames().input, jsString(exec, d->input), slot);
delete d;
diff --git a/JavaScriptCore/runtime/RegExpObject.cpp b/JavaScriptCore/runtime/RegExpObject.cpp
index 7d14814..7fda5b1 100644
--- a/JavaScriptCore/runtime/RegExpObject.cpp
+++ b/JavaScriptCore/runtime/RegExpObject.cpp
@@ -101,9 +101,9 @@ JSValue regExpObjectSource(ExecState* exec, JSValue slotBase, const Identifier&)
return jsString(exec, asRegExpObject(slotBase)->regExp()->pattern());
}
-JSValue regExpObjectLastIndex(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue regExpObjectLastIndex(ExecState*, JSValue slotBase, const Identifier&)
{
- return jsNumber(exec, asRegExpObject(slotBase)->lastIndex());
+ return jsNumber(asRegExpObject(slotBase)->lastIndex());
}
void RegExpObject::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
diff --git a/JavaScriptCore/runtime/StringConstructor.cpp b/JavaScriptCore/runtime/StringConstructor.cpp
index 159386d..101650c 100644
--- a/JavaScriptCore/runtime/StringConstructor.cpp
+++ b/JavaScriptCore/runtime/StringConstructor.cpp
@@ -62,7 +62,7 @@ StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObje
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum);
#endif
// no. of arguments for constructor
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
}
// ECMA 15.5.2
diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp
index 37436f9..b5ea8fa 100644
--- a/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/JavaScriptCore/runtime/StringPrototype.cpp
@@ -136,7 +136,7 @@ StringPrototype::StringPrototype(ExecState* exec, JSGlobalObject* globalObject,
{
putAnonymousValue(0, globalObject);
// The constructor will be added later, after StringConstructor has been built
- putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum);
+ putDirectWithoutTransition(exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
}
bool StringPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
@@ -326,7 +326,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
// reg->numSubpatterns() + 1 for pattern args, + 2 for match start and sourceValue
int argCount = reg->numSubpatterns() + 1 + 2;
JSFunction* func = asFunction(replacement);
- CachedCall cachedCall(exec, func, argCount, exec->exceptionSlot());
+ CachedCall cachedCall(exec, func, argCount);
if (exec->hadException())
return JSValue::encode(jsNull());
while (true) {
@@ -351,7 +351,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
cachedCall.setArgument(i, jsSubstring(exec, source, matchStart, matchLen));
}
- cachedCall.setArgument(i++, jsNumber(exec, completeMatchStart));
+ cachedCall.setArgument(i++, jsNumber(completeMatchStart));
cachedCall.setArgument(i++, sourceVal);
cachedCall.setThis(exec->globalThisValue());
@@ -398,7 +398,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
args.append(jsSubstring(exec, source, matchStart, matchLen));
}
- args.append(jsNumber(exec, completeMatchStart));
+ args.append(jsNumber(completeMatchStart));
args.append(sourceVal);
replacements.append(call(exec, replacement, callType, callData, exec->globalThisValue(), args).toString(exec));
@@ -454,7 +454,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
if (callType != CallTypeNone) {
MarkedArgumentBuffer args;
args.append(jsSubstring(exec, source, matchPos, matchLen));
- args.append(jsNumber(exec, matchPos));
+ args.append(jsNumber(matchPos));
args.append(sourceVal);
replacementString = call(exec, replacement, callType, callData, exec->globalThisValue(), args).toString(exec);
@@ -510,13 +510,13 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncCharCodeAt(ExecState* exec)
if (a0.isUInt32()) {
uint32_t i = a0.asUInt32();
if (i < len)
- return JSValue::encode(jsNumber(exec, s.characters()[i]));
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNumber(s.characters()[i]));
+ return JSValue::encode(jsNaN());
}
double dpos = a0.toInteger(exec);
if (dpos >= 0 && dpos < len)
- return JSValue::encode(jsNumber(exec, s[static_cast<int>(dpos)]));
- return JSValue::encode(jsNaN(exec));
+ return JSValue::encode(jsNumber(s[static_cast<int>(dpos)]));
+ return JSValue::encode(jsNaN());
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncConcat(ExecState* exec)
@@ -560,8 +560,8 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncIndexOf(ExecState* exec)
size_t result = s.find(u2, pos);
if (result == notFound)
- return JSValue::encode(jsNumber(exec, -1));
- return JSValue::encode(jsNumber(exec, result));
+ return JSValue::encode(jsNumber(-1));
+ return JSValue::encode(jsNumber(result));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncLastIndexOf(ExecState* exec)
@@ -589,8 +589,8 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLastIndexOf(ExecState* exec)
size_t result = s.reverseFind(u2, static_cast<unsigned>(dpos));
if (result == notFound)
- return JSValue::encode(jsNumber(exec, -1));
- return JSValue::encode(jsNumber(exec, result));
+ return JSValue::encode(jsNumber(-1));
+ return JSValue::encode(jsNumber(result));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
@@ -672,7 +672,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
int pos;
int matchLength = 0;
regExpConstructor->performMatch(reg.get(), u, 0, pos, matchLength);
- return JSValue::encode(jsNumber(exec, pos));
+ return JSValue::encode(jsNumber(pos));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncSlice(ExecState* exec)
@@ -909,7 +909,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec)
EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec)
{
if (exec->argumentCount() < 1)
- return JSValue::encode(jsNumber(exec, 0));
+ return JSValue::encode(jsNumber(0));
JSValue thisValue = exec->hostThisValue();
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
@@ -917,7 +917,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec)
UString s = thisValue.toThisString(exec);
JSValue a0 = exec->argument(0);
- return JSValue::encode(jsNumber(exec, localeCompare(s, a0.toString(exec))));
+ return JSValue::encode(jsNumber(localeCompare(s, a0.toString(exec))));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncBig(ExecState* exec)
diff --git a/JavaScriptCore/runtime/UString.cpp b/JavaScriptCore/runtime/UString.cpp
index 17cd9b6..b3cd40c 100644
--- a/JavaScriptCore/runtime/UString.cpp
+++ b/JavaScriptCore/runtime/UString.cpp
@@ -90,7 +90,7 @@ UString::UString(const char* characters)
UString UString::number(int i)
{
UChar buf[1 + sizeof(i) * 3];
- UChar* end = buf + sizeof(buf) / sizeof(UChar);
+ UChar* end = buf + WTF_ARRAY_LENGTH(buf);
UChar* p = end;
if (i == 0)
@@ -119,7 +119,7 @@ UString UString::number(int i)
UString UString::number(long long i)
{
UChar buf[1 + sizeof(i) * 3];
- UChar* end = buf + sizeof(buf) / sizeof(UChar);
+ UChar* end = buf + WTF_ARRAY_LENGTH(buf);
UChar* p = end;
if (i == 0)
@@ -152,7 +152,7 @@ UString UString::number(long long i)
UString UString::number(unsigned u)
{
UChar buf[sizeof(u) * 3];
- UChar* end = buf + sizeof(buf) / sizeof(UChar);
+ UChar* end = buf + WTF_ARRAY_LENGTH(buf);
UChar* p = end;
if (u == 0)
@@ -170,7 +170,7 @@ UString UString::number(unsigned u)
UString UString::number(long l)
{
UChar buf[1 + sizeof(l) * 3];
- UChar* end = buf + sizeof(buf) / sizeof(UChar);
+ UChar* end = buf + WTF_ARRAY_LENGTH(buf);
UChar* p = end;
if (l == 0)
diff --git a/JavaScriptCore/wtf/Assertions.h b/JavaScriptCore/wtf/Assertions.h
index c4e015d..2907d04 100644
--- a/JavaScriptCore/wtf/Assertions.h
+++ b/JavaScriptCore/wtf/Assertions.h
@@ -44,9 +44,9 @@
#include "Platform.h"
-#if COMPILER(MSVC)
#include <stddef.h>
-#else
+
+#if !COMPILER(MSVC)
#include <inttypes.h>
#endif
diff --git a/JavaScriptCore/wtf/ByteArray.h b/JavaScriptCore/wtf/ByteArray.h
index f4d34a4..bdec630 100644
--- a/JavaScriptCore/wtf/ByteArray.h
+++ b/JavaScriptCore/wtf/ByteArray.h
@@ -97,6 +97,8 @@ namespace WTF {
unsigned char m_data[];
#endif
};
-}
+} // namespace WTF
+
+using WTF::ByteArray;
#endif
diff --git a/JavaScriptCore/wtf/DateMath.cpp b/JavaScriptCore/wtf/DateMath.cpp
index d005859..f3627e6 100644
--- a/JavaScriptCore/wtf/DateMath.cpp
+++ b/JavaScriptCore/wtf/DateMath.cpp
@@ -76,6 +76,7 @@
#include "ASCIICType.h"
#include "CurrentTime.h"
#include "MathExtras.h"
+#include "StdLibExtras.h"
#include "StringExtras.h"
#include <algorithm>
@@ -950,7 +951,7 @@ static double parseDateFromNullTerminatedCharacters(const char* dateString, bool
}
haveTZ = true;
} else {
- for (int i = 0; i < int(sizeof(known_zones) / sizeof(KnownZone)); i++) {
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(known_zones); ++i) {
if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) {
offset = known_zones[i].tzOffset;
dateString += strlen(known_zones[i].tzName);
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 9895824..ac4ef5a 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -210,7 +210,7 @@
|| defined(_ARM_)
#define WTF_CPU_ARM 1
-#if defined(__ARMEB__)
+#if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN))
#define WTF_CPU_BIG_ENDIAN 1
#elif !defined(__ARM_EABI__) \
@@ -563,11 +563,6 @@
#define _INC_ASSERT /* disable "assert.h" */
#define assert(x)
-/* _countof is only included in CE6; for CE5 we need to define it ourself */
-#ifndef _countof
-#define _countof(x) (sizeof(x) / sizeof((x)[0]))
-#endif
-
#endif /* OS(WINCE) && !PLATFORM(QT) */
#if PLATFORM(QT)
@@ -1079,6 +1074,7 @@
#define WTF_USE_ATSUI 1
#define WTF_USE_CORE_TEXT 0
#endif
+<<<<<<< HEAD
/* Accelerated compositing */
#if !defined(BUILDING_ON_TIGER)
@@ -1096,17 +1092,13 @@
#if PLATFORM(QT)
#define WTF_USE_ACCELERATED_COMPOSITING 1
+=======
+>>>>>>> webkit.org at r70949
#endif
-/* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
- with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
- off in one place. */
-#if PLATFORM(WIN) && !OS(WINCE)
-#include "QuartzCorePresent.h"
-#if QUARTZCORE_PRESENT
+/* Accelerated compositing */
+#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) &&!defined(WIN_CAIRO))
#define WTF_USE_ACCELERATED_COMPOSITING 1
-#define ENABLE_3D_RENDERING 1
-#endif
#endif
#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS)
diff --git a/JavaScriptCore/wtf/PlatformRefPtr.h b/JavaScriptCore/wtf/PlatformRefPtr.h
index 8ac16cb..f99ec9b 100644
--- a/JavaScriptCore/wtf/PlatformRefPtr.h
+++ b/JavaScriptCore/wtf/PlatformRefPtr.h
@@ -62,7 +62,8 @@ public:
~PlatformRefPtr()
{
- if (T* ptr = m_ptr)
+ T* ptr = m_ptr;
+ if (ptr && ptr != hashTableDeletedValue())
derefPlatformPtr(ptr);
}
@@ -70,7 +71,7 @@ public:
{
T* ptr = m_ptr;
m_ptr = 0;
- if (ptr)
+ if (ptr && ptr != hashTableDeletedValue())
derefPlatformPtr(ptr);
}
@@ -110,7 +111,7 @@ template <typename T> inline PlatformRefPtr<T>& PlatformRefPtr<T>::operator=(con
refPlatformPtr(optr);
T* ptr = m_ptr;
m_ptr = optr;
- if (ptr)
+ if (ptr && ptr != hashTableDeletedValue())
derefPlatformPtr(ptr);
return *this;
}
@@ -121,7 +122,7 @@ template <typename T> inline PlatformRefPtr<T>& PlatformRefPtr<T>::operator=(T*
if (optr)
refPlatformPtr(optr);
m_ptr = optr;
- if (ptr)
+ if (ptr && ptr != hashTableDeletedValue())
derefPlatformPtr(ptr);
return *this;
}
diff --git a/JavaScriptCore/wtf/StdLibExtras.h b/JavaScriptCore/wtf/StdLibExtras.h
index d594c17..fd7ada2 100644
--- a/JavaScriptCore/wtf/StdLibExtras.h
+++ b/JavaScriptCore/wtf/StdLibExtras.h
@@ -87,29 +87,33 @@ TypePtr reinterpret_cast_ptr(const void* ptr)
namespace WTF {
- /*
- * C++'s idea of a reinterpret_cast lacks sufficient cojones.
- */
- template<typename TO, typename FROM>
- TO bitwise_cast(FROM from)
- {
- COMPILE_ASSERT(sizeof(TO) == sizeof(FROM), WTF_bitwise_cast_sizeof_casted_types_is_equal);
- union {
- FROM from;
- TO to;
- } u;
- u.from = from;
- return u.to;
- }
+/*
+ * C++'s idea of a reinterpret_cast lacks sufficient cojones.
+ */
+template<typename TO, typename FROM>
+inline TO bitwise_cast(FROM from)
+{
+ COMPILE_ASSERT(sizeof(TO) == sizeof(FROM), WTF_bitwise_cast_sizeof_casted_types_is_equal);
+ union {
+ FROM from;
+ TO to;
+ } u;
+ u.from = from;
+ return u.to;
+}
- // Returns a count of the number of bits set in 'bits'.
- inline size_t bitCount(unsigned bits)
- {
- bits = bits - ((bits >> 1) & 0x55555555);
- bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
- return (((bits + (bits >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
- }
+// Returns a count of the number of bits set in 'bits'.
+inline size_t bitCount(unsigned bits)
+{
+ bits = bits - ((bits >> 1) & 0x55555555);
+ bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
+ return (((bits + (bits >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
+}
+
+// Macro that returns a compile time constant with the length of an array, but gives an error if passed a non-array.
+template<typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))[Size];
+#define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array))
} // namespace WTF
-#endif
+#endif // WTF_StdLibExtras_h
diff --git a/JavaScriptCore/wtf/gobject/GTypedefs.h b/JavaScriptCore/wtf/gobject/GTypedefs.h
index b1600c2..76d1b1a 100644
--- a/JavaScriptCore/wtf/gobject/GTypedefs.h
+++ b/JavaScriptCore/wtf/gobject/GTypedefs.h
@@ -38,6 +38,7 @@ typedef void* gpointer;
typedef struct _GAsyncResult GAsyncResult;
typedef struct _GCancellable GCancellable;
+typedef struct _GCharsetConverter GCharsetConverter;
typedef struct _GCond GCond;
typedef struct _GDir GDir;
typedef struct _GdkAtom* GdkAtom;
diff --git a/JavaScriptCore/wtf/text/WTFString.h b/JavaScriptCore/wtf/text/WTFString.h
index 8a4a6c7..e9d6ae4 100644
--- a/JavaScriptCore/wtf/text/WTFString.h
+++ b/JavaScriptCore/wtf/text/WTFString.h
@@ -50,6 +50,14 @@ class wxString;
class BString;
#endif
+#if PLATFORM(BREWMP)
+// AECHAR is defined in AEEStdDef.h, but don't include it here to avoid conflicts.
+#ifndef _AECHAR_DEFINED
+typedef uint16 AECHAR;
+#define _AECHAR_DEFINED
+#endif
+#endif
+
namespace WTF {
class CString;
@@ -297,6 +305,10 @@ public:
operator BString() const;
#endif
+#if PLATFORM(BREWMP)
+ String(const AECHAR*);
+#endif
+
static String fromUTF8(const char*, size_t);
static String fromUTF8(const char*);
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp
index 33f3c89..ec96636 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.cpp
+++ b/JavaScriptCore/yarr/RegexInterpreter.cpp
@@ -591,13 +591,6 @@ public:
unsigned count = term.atom.parenthesesDisjunction->m_numSubpatterns;
context->restoreOutput(output, firstSubpatternId, count);
}
- void resetAssertionMatches(ByteTerm& term)
- {
- unsigned firstSubpatternId = term.atom.subpatternId;
- unsigned count = term.atom.parenthesesDisjunction->m_numSubpatterns;
- for (unsigned i = 0; i < (count << 1); ++i)
- output[(firstSubpatternId << 1) + i] = -1;
- }
bool parenthesesDoBacktrack(ByteTerm& term, BackTrackInfoParentheses* backTrack)
{
while (backTrack->matchAmount) {
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index 4da0a9b..c7b2dce 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,28 @@
+2010-10-25 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Remove exec and globalData arguments from jsNumber
+ https://bugs.webkit.org/show_bug.cgi?id=48270
+
+ Don't pass exec to jsNumber
+
+ * JSUtils.cpp:
+ (JSObjectKJSValue):
+ * UserObjectImp.cpp:
+ (UserObjectImp::toPrimitive):
+
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70451.
+ http://trac.webkit.org/changeset/70451
+ https://bugs.webkit.org/show_bug.cgi?id=48249
+
+ Broke set-unloaded-frame-location.html under Qt (Requested by
+ caseq on #webkit).
+
+ * ForwardingHeaders/wtf/text/TextPosition.h: Removed.
+
2010-10-16 Patrick Gansterer <paroga@webkit.org>
Reviewed by Adam Barth.
diff --git a/JavaScriptGlue/JSUtils.cpp b/JavaScriptGlue/JSUtils.cpp
index 5c85475..581999c 100644
--- a/JavaScriptGlue/JSUtils.cpp
+++ b/JavaScriptGlue/JSUtils.cpp
@@ -164,7 +164,7 @@ JSValue JSObjectKJSValue(JSUserObject* ptr)
{
double num;
CFNumberGetValue((CFNumberRef)cfType, kCFNumberDoubleType, &num);
- result = jsNumber(getThreadGlobalExecState(), num);
+ result = jsNumber(num);
handled = true;
}
else if (typeID == CFBooleanGetTypeID())
diff --git a/JavaScriptGlue/UserObjectImp.cpp b/JavaScriptGlue/UserObjectImp.cpp
index 2176f16..1728a7e 100644
--- a/JavaScriptGlue/UserObjectImp.cpp
+++ b/JavaScriptGlue/UserObjectImp.cpp
@@ -190,7 +190,7 @@ JSValue UserObjectImp::toPrimitive(ExecState *exec, JSType) const
} else if (cfType == CFNumberGetTypeID()) {
double d = 0.0;
CFNumberGetValue((CFNumberRef)cfValue, kCFNumberDoubleType, &d);
- result = jsNumber(exec, d);
+ result = jsNumber(d);
} else if (cfType == CFURLGetTypeID()) {
CFURLRef absURL = CFURLCopyAbsoluteURL((CFURLRef)cfValue);
if (absURL) {
diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js
index 3536a89..c14d513 100644
--- a/LayoutTests/fast/js/resources/js-test-pre.js
+++ b/LayoutTests/fast/js/resources/js-test-pre.js
@@ -219,6 +219,24 @@ function shouldBeUndefined(_a)
testFailed(_a + " should be undefined. Was " + _av);
}
+function shouldBeDefined(_a)
+{
+ var exception;
+ var _av;
+ try {
+ _av = eval(_a);
+ } catch (e) {
+ exception = e;
+ }
+
+ if (exception)
+ testFailed(_a + " should be defined. Threw exception " + exception);
+ else if (_av !== undefined)
+ testPassed(_a + " is defined.");
+ else
+ testFailed(_a + " should be defined. Was " + _av);
+}
+
function shouldBeGreaterThanOrEqual(_a, _b) {
if (typeof _a != "string" || typeof _b != "string")
debug("WARN: shouldBeGreaterThanOrEqual expects string arguments");
diff --git a/LayoutTests/storage/indexeddb/constants-expected.txt b/LayoutTests/storage/indexeddb/constants-expected.txt
index 15a2df7..8f53b56 100644
--- a/LayoutTests/storage/indexeddb/constants-expected.txt
+++ b/LayoutTests/storage/indexeddb/constants-expected.txt
@@ -8,7 +8,7 @@ PASS webkitIDBKeyRange.LEFT_OPEN is 1
PASS webkitIDBKeyRange.RIGHT_OPEN is 2
PASS webkitIDBKeyRange.LEFT_BOUND is 4
PASS webkitIDBKeyRange.RIGHT_BOUND is 8
-PASS webkitIDBDatabaseException.UNKNOWN_ERR is 0
+PASS webkitIDBDatabaseException.UNKNOWN_ERR is 1
PASS webkitIDBDatabaseException.NON_TRANSIENT_ERR is 1
PASS webkitIDBDatabaseException.NOT_FOUND_ERR is 2
PASS webkitIDBDatabaseException.CONSTRAINT_ERR is 3
diff --git a/LayoutTests/storage/indexeddb/constants.html b/LayoutTests/storage/indexeddb/constants.html
index 813fe7a..9cdf4c4 100644
--- a/LayoutTests/storage/indexeddb/constants.html
+++ b/LayoutTests/storage/indexeddb/constants.html
@@ -22,7 +22,7 @@ function test()
shouldBe("webkitIDBKeyRange.LEFT_BOUND", "4");
shouldBe("webkitIDBKeyRange.RIGHT_BOUND", "8");
- shouldBe("webkitIDBDatabaseException.UNKNOWN_ERR", "0");
+ shouldBe("webkitIDBDatabaseException.UNKNOWN_ERR", "1");
shouldBe("webkitIDBDatabaseException.NON_TRANSIENT_ERR", "1");
shouldBe("webkitIDBDatabaseException.NOT_FOUND_ERR", "2");
shouldBe("webkitIDBDatabaseException.CONSTRAINT_ERR", "3");
diff --git a/LayoutTests/storage/indexeddb/database-quota-expected.txt b/LayoutTests/storage/indexeddb/database-quota-expected.txt
index b6ea505..91d3ac7 100644
--- a/LayoutTests/storage/indexeddb/database-quota-expected.txt
+++ b/LayoutTests/storage/indexeddb/database-quota-expected.txt
@@ -68,1035 +68,7 @@ trans = db.transaction()
Creating 'data' which contains 64K of data
PASS data.length is 65536
store = trans.objectStore('test123')
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Success event fired:
-PASS 'result' in event is true
-PASS 'code' in event is false
-PASS 'message' in event is false
-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 'readyState' in event.target is true
-PASS event.target.readyState is event.target.DONE
-
-store = event.source
-store.add({x: data}, dataAdded)
-Error function called: (0) Error writing data to stable storage.
+Error function called: (1) Error writing data to stable storage.
Error event fired:
PASS 'result' in event is false
PASS 'code' in event is true
@@ -1108,7 +80,7 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS Adding data failed due to quota error. Data added was: 5120 KB
+PASS Adding data failed due to quota error. Data added was about 5 MB
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/database-quota.html b/LayoutTests/storage/indexeddb/database-quota.html
index 45ce709..aefe6b1 100644
--- a/LayoutTests/storage/indexeddb/database-quota.html
+++ b/LayoutTests/storage/indexeddb/database-quota.html
@@ -90,17 +90,15 @@ function checkQuotaEnforcing()
function addData()
{
if (dataAdded < 5 * 1024 * 1024) {
- if (dataAdded > 0) {
- verifySuccessEvent(event);
- store = evalAndLog("store = event.source");
- }
+ if (dataAdded > 0)
+ store = event.source;
} else {
testFailed("added more than quota");
done();
return;
}
dataAdded += 65536;
- result = evalAndLog("store.add({x: data}, dataAdded)");
+ result = store.add({x: data}, dataAdded);
result.onsuccess = addData;
result.onerror = logError;
}
@@ -113,7 +111,7 @@ function logError()
function testComplete()
{
- testPassed("Adding data failed due to quota error. Data added was: " + dataAdded / 1024 + " KB");
+ testPassed("Adding data failed due to quota error. Data added was about " + Math.round(dataAdded / 1024 / 1024) + " MB");
done();
}
diff --git a/LayoutTests/storage/indexeddb/duplicates-expected.txt b/LayoutTests/storage/indexeddb/duplicates-expected.txt
new file mode 100644
index 0000000..2ea8c36
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/duplicates-expected.txt
@@ -0,0 +1,541 @@
+Verify that you can put the same data in 2 different databases without uniqueness constraints firing.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name', 'description')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+db.createObjectStore('storeName', null)
+store.createIndex('indexName', 'x')
+store.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 '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 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+indexObject.getKey('value')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is "key"
+indexObject.get('value')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.x is "value"
+PASS event.result.y is "zzz"
+indexObject.getKey('does not exist')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+indexObject.get('does not exist')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+indexObject.openKeyCursor()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value"
+PASS event.result.value is "key"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value2"
+PASS event.result.value is "key2"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is true
+indexObject.openCursor()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value"
+PASS event.result.value.x is "value"
+PASS event.result.value.y is "zzz"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value2"
+PASS event.result.value.x is "value2"
+PASS event.result.value.y is "zzz2"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is true
+webkitIndexedDB.open('name2', 'description2')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+db.createObjectStore('storeName', null)
+store.createIndex('indexName', 'x')
+store.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 '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 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+indexObject.getKey('value')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is "key"
+indexObject.get('value')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.x is "value"
+PASS event.result.y is "zzz"
+indexObject.getKey('does not exist')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+indexObject.get('does not exist')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+indexObject.openKeyCursor()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value"
+PASS event.result.value is "key"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value2"
+PASS event.result.value is "key2"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is true
+indexObject.openCursor()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value"
+PASS event.result.value.x is "value"
+PASS event.result.value.y is "zzz"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is false
+PASS event.result.key is "value2"
+PASS event.result.value.x is "value2"
+PASS event.result.value.y is "zzz2"
+event.result.continue()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+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 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result === null is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/duplicates.html b/LayoutTests/storage/indexeddb/duplicates.html
new file mode 100644
index 0000000..70cf8c4
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/duplicates.html
@@ -0,0 +1,213 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Verify that you can put the same data in 2 different databases without uniqueness constraints firing.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+testCount = 0;
+function test()
+{
+ if (testCount++ == 0)
+ result = evalAndLog("webkitIndexedDB.open('name', 'description')");
+ else
+ result = evalAndLog("webkitIndexedDB.open('name2', 'description2')");
+ verifyResult(result);
+ result.onsuccess = setVersion;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersion()
+{
+ verifySuccessEvent(event);
+ db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = deleteExisting;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteExisting()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+
+ deleteAllObjectStores(db, createIndex);
+}
+
+function createIndex()
+{
+ window.store = evalAndLog("db.createObjectStore('storeName', null)");
+ window.indexObject = evalAndLog("store.createIndex('indexName', 'x')");
+ addData();
+}
+
+function addData()
+{
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ verifyResult(result);
+ result.onsuccess = addMore;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addMore()
+{
+ verifySuccessEvent(event);
+
+ result = evalAndLog("event.source.add({x: 'value2', y: 'zzz2'}, 'key2')");
+ verifyResult(result);
+ result.onsuccess = getData;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getData()
+{
+ verifySuccessEvent(event);
+
+ result = evalAndLog("indexObject.getKey('value')");
+ verifyResult(result);
+ result.onsuccess = getObjectData;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getObjectData()
+{
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result", "key");
+
+ result = evalAndLog("indexObject.get('value')");
+ verifyResult(result);
+ result.onsuccess = getDataFail;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getDataFail()
+{
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result.x", "value");
+ shouldBeEqualToString("event.result.y", "zzz");
+
+ result = evalAndLog("indexObject.getKey('does not exist')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = getObjectDataFail;
+}
+
+function getObjectDataFail()
+{
+ verifyErrorEvent(event);
+ shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+
+ result = evalAndLog("indexObject.get('does not exist')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = openKeyCursor;
+}
+
+function openKeyCursor()
+{
+ verifyErrorEvent(event);
+ shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+
+ window.result = evalAndLog("indexObject.openKeyCursor()");
+ verifyResult(result);
+ result.onsuccess = cursor1Continue;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function cursor1Continue()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value");
+ shouldBeEqualToString("event.result.value", "key");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = cursor1Continue2;
+}
+
+function cursor1Continue2()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value2");
+ shouldBeEqualToString("event.result.value", "key2");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = openObjectCursor;
+}
+
+function openObjectCursor()
+{
+ verifySuccessEvent(event);
+ shouldBeTrue("event.result === null");
+
+ window.result = evalAndLog("indexObject.openCursor()");
+ verifyResult(result);
+ result.onsuccess = cursor2Continue;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function cursor2Continue()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value");
+ shouldBeEqualToString("event.result.value.x", "value");
+ shouldBeEqualToString("event.result.value.y", "zzz");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = cursor2Continue2;
+}
+
+function cursor2Continue2()
+{
+ verifySuccessEvent(event);
+ shouldBeFalse("event.result === null");
+ shouldBeEqualToString("event.result.key", "value2");
+ shouldBeEqualToString("event.result.value.x", "value2");
+ shouldBeEqualToString("event.result.value.y", "zzz2");
+
+ // We re-use the last result object.
+ evalAndLog("event.result.continue()");
+ verifyResult(window.result);
+ window.result.onsuccess = last;
+}
+
+function last()
+{
+ verifySuccessEvent(event);
+ shouldBeTrue("event.result === null");
+
+ if (testCount == 1)
+ test();
+ else
+ done();
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/index-basics-expected.txt b/LayoutTests/storage/indexeddb/index-basics-expected.txt
index 0869d95..f886a19 100644
--- a/LayoutTests/storage/indexeddb/index-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/index-basics-expected.txt
@@ -300,6 +300,10 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.result === null is true
+Passing an invalid key into indexObject.get().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into indexObject.getKey().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/index-basics.html b/LayoutTests/storage/indexeddb/index-basics.html
index f7257f1..7a16c3a 100644
--- a/LayoutTests/storage/indexeddb/index-basics.html
+++ b/LayoutTests/storage/indexeddb/index-basics.html
@@ -219,6 +219,21 @@ function last()
verifySuccessEvent(event);
shouldBeTrue("event.result === null");
+ try {
+ debug("Passing an invalid key into indexObject.get().");
+ indexObject.get([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into indexObject.getKey().");
+ indexObject.getKey([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
done();
}
diff --git a/LayoutTests/storage/indexeddb/index-cursor-expected.txt b/LayoutTests/storage/indexeddb/index-cursor-expected.txt
index 88b96ff..bc01070 100644
--- a/LayoutTests/storage/indexeddb/index-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/index-cursor-expected.txt
@@ -2058,6 +2058,44 @@ PASS event.result.key is testData[7]
PASS event.result.value is expectedIndex
PASS event.result.key is testData[6]
PASS event.result is null
+
+Next test: null key path sorted ascending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result is null
+
+Next test: null key path sorted descending.
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[7]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[6]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[5]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[4]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[3]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[2]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[1]
+PASS event.result.value is expectedIndex
+PASS event.result.key is testData[0]
+PASS event.result is null
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/index-cursor.html b/LayoutTests/storage/indexeddb/index-cursor.html
index 5aab4f8..6a9d1ac 100644
--- a/LayoutTests/storage/indexeddb/index-cursor.html
+++ b/LayoutTests/storage/indexeddb/index-cursor.html
@@ -107,7 +107,7 @@ function scheduleTests()
function runNextTest()
{
if (!scheduledTests.length) {
- done();
+ testNullKeyRange();
return;
}
@@ -226,6 +226,38 @@ function cursorIteration()
event.result.continue();
}
+window.nullKeyRangeStep = 0;
+function testNullKeyRange()
+{
+ window.lower = 0;
+ window.lowerIsOpen = false;
+ window.upper = testData.length-1;
+ window.upperIsOpen = false;
+
+ str = "Next test: null key path ";
+ if (window.nullKeyRangeStep == 0) {
+ str += "sorted ascending.";
+ window.ascending = true;
+ window.expectedIndex = lower;
+ window.nullKeyRangeStep = 1;
+ } else if (window.nullKeyRangeStep == 1) {
+ str += "sorted descending.";
+ window.ascending = false;
+ window.expectedIndex = upper;
+ window.nullKeyRangeStep = 2;
+ } else {
+ done();
+ return;
+ }
+
+ debug("");
+ debug(str);
+
+ var request = indexObject.openKeyCursor(null, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
+ request.onsuccess = cursorIteration;
+ request.onerror = unexpectedErrorCallback;
+}
+
openDatabase(); // The first step.
var successfullyParsed = true;
diff --git a/LayoutTests/storage/indexeddb/keyrange-expected.txt b/LayoutTests/storage/indexeddb/keyrange-expected.txt
index 8d6bf86..1a7dfff 100644
--- a/LayoutTests/storage/indexeddb/keyrange-expected.txt
+++ b/LayoutTests/storage/indexeddb/keyrange-expected.txt
@@ -141,6 +141,18 @@ PASS keyRange.left is 'aaf'
PASS keyRange.right is 'abf'
PASS leftFlags is keyRange.LEFT_OPEN | keyRange.LEFT_BOUND
PASS rightFlags is keyRange.RIGHT_OPEN | keyRange.RIGHT_BOUND
+Passing an invalid key into only([])
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into rightBound([])
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into leftBound([])
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into bound(null, [])
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into bound([],null)
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into bound([], [])
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/keyrange.html b/LayoutTests/storage/indexeddb/keyrange.html
index c3885fc..48708d9 100644
--- a/LayoutTests/storage/indexeddb/keyrange.html
+++ b/LayoutTests/storage/indexeddb/keyrange.html
@@ -112,6 +112,53 @@ function test()
checkBoundKeyRange("'aae'", "'abe'", true, false);
checkBoundKeyRange("'aaf'", "'abf'", true, true);
+ try {
+ debug("Passing an invalid key into only([])");
+ webkitIDBKeyRange.only([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into rightBound([])");
+ webkitIDBKeyRange.rightBound([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into leftBound([])");
+ webkitIDBKeyRange.leftBound([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into bound(null, [])");
+ webkitIDBKeyRange.bound(null, []);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into bound([],null)");
+ webkitIDBKeyRange.bound([], null);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into bound([], [])");
+ webkitIDBKeyRange.bound([], []);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
}
test();
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index d22e6f0..e0c9770 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -43,7 +43,7 @@ PASS event.target.readyState is event.target.DONE
trans = event.result
PASS trans !== null is true
Deleted all object stores.
-creatObjectStore():
+createObjectStore():
store = db.createObjectStore('storeName', null)
storeNames = db.objectStores
PASS store.name is "storeName"
@@ -176,6 +176,15 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.result is null
+store = event.source
+Passing an invalid key into store.get().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into store.remove().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into store.add().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Passing an invalid key into store.put().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 9730db8..005247e 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -47,7 +47,7 @@ function setVersionSuccess()
function createObjectStore()
{
- debug("creatObjectStore():");
+ debug("createObjectStore():");
window.store = evalAndLog("store = db.createObjectStore('storeName', null)");
var storeNames = evalAndLog("storeNames = db.objectStores");
@@ -195,6 +195,40 @@ function removeSuccess()
debug("removeSuccess():");
verifySuccessEvent(event);
shouldBeNull("event.result");
+ var store = evalAndLog("store = event.source");
+
+ try {
+ debug("Passing an invalid key into store.get().");
+ store.get([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into store.remove().");
+ store.remove([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into store.add().");
+ store.add(null, []);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
+ try {
+ debug("Passing an invalid key into store.put().");
+ store.put(null, []);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+
done();
}
diff --git a/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt b/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt
index 881fe92..1493a80 100644
--- a/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-cursor-expected.txt
@@ -854,6 +854,26 @@ PASS event.result is null
Next test: lower bound is 6; upper bound is 6; sorted descending.
PASS event.result.key is testData[6]
PASS event.result is null
+
+Next test: null key path sorted ascending.
+PASS event.result.key is testData[0]
+PASS event.result.key is testData[1]
+PASS event.result.key is testData[2]
+PASS event.result.key is testData[3]
+PASS event.result.key is testData[4]
+PASS event.result.key is testData[5]
+PASS event.result.key is testData[6]
+PASS event.result is null
+
+Next test: null key path sorted descending.
+PASS event.result.key is testData[6]
+PASS event.result.key is testData[5]
+PASS event.result.key is testData[4]
+PASS event.result.key is testData[3]
+PASS event.result.key is testData[2]
+PASS event.result.key is testData[1]
+PASS event.result.key is testData[0]
+PASS event.result is null
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/objectstore-cursor.html b/LayoutTests/storage/indexeddb/objectstore-cursor.html
index d9ad805..d0d786b 100644
--- a/LayoutTests/storage/indexeddb/objectstore-cursor.html
+++ b/LayoutTests/storage/indexeddb/objectstore-cursor.html
@@ -105,7 +105,7 @@ function scheduleTests()
function runNextTest()
{
if (!scheduledTests.length) {
- done();
+ testNullKeyRange();
return;
}
@@ -164,8 +164,7 @@ function runNextTest()
else
keyRange = webkitIDBKeyRange.rightBound(testData[upper], upperIsOpen);
- // FIXME: Should be webkitIDBCursor.NEXT : webkitIDBCursor.PREV, but we can't do that yet.
- var request = objectStore.openCursor(keyRange, ascending ? 0 : 2);
+ var request = objectStore.openCursor(keyRange, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
request.onsuccess = cursorIteration;
request.onerror = unexpectedErrorCallback;
}
@@ -204,6 +203,38 @@ function cursorIteration()
event.result.continue();
}
+window.nullKeyRangeStep = 0;
+function testNullKeyRange()
+{
+ window.lower = 0;
+ window.lowerIsOpen = false;
+ window.upper = testData.length-1;
+ window.upperIsOpen = false;
+
+ str = "Next test: null key path ";
+ if (window.nullKeyRangeStep == 0) {
+ str += "sorted ascending.";
+ window.ascending = true;
+ window.expectedIndex = lower;
+ window.nullKeyRangeStep = 1;
+ } else if (window.nullKeyRangeStep == 1) {
+ str += "sorted descending.";
+ window.ascending = false;
+ window.expectedIndex = upper;
+ window.nullKeyRangeStep = 2;
+ } else {
+ done();
+ return;
+ }
+
+ debug("");
+ debug(str);
+
+ var request = objectStore.openCursor(null, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
+ request.onsuccess = cursorIteration;
+ request.onerror = unexpectedErrorCallback;
+}
+
openDatabase(); // The first step.
var successfullyParsed = true;
diff --git a/LayoutTests/storage/indexeddb/open-cursor-expected.txt b/LayoutTests/storage/indexeddb/open-cursor-expected.txt
index 1bca527..c3c1a8d 100644
--- a/LayoutTests/storage/indexeddb/open-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/open-cursor-expected.txt
@@ -72,6 +72,9 @@ PASS event.result.direction is 0
PASS event.result.key is 'myKey'
PASS event.result.value is 'myValue'
+Passing an invalid key into .continue().
+PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+
Opening an empty cursor.
objectStore.openCursor(keyRange)
PASS 'onsuccess' in result is true
diff --git a/LayoutTests/storage/indexeddb/open-cursor.html b/LayoutTests/storage/indexeddb/open-cursor.html
index ec62f2c..815c01b 100644
--- a/LayoutTests/storage/indexeddb/open-cursor.html
+++ b/LayoutTests/storage/indexeddb/open-cursor.html
@@ -41,6 +41,14 @@ function cursorSuccess()
shouldBe("event.result.key", "'myKey'");
shouldBe("event.result.value", "'myValue'");
debug("");
+ try {
+ debug("Passing an invalid key into .continue().");
+ event.result.continue([]);
+ testFailed("No exception thrown");
+ } catch (e) {
+ testPassed("Caught exception: " + e.toString());
+ }
+ debug("");
openEmptyCursor();
}
diff --git a/LayoutTests/storage/indexeddb/tutorial-expected.txt b/LayoutTests/storage/indexeddb/tutorial-expected.txt
new file mode 100644
index 0000000..1e424ef
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/tutorial-expected.txt
@@ -0,0 +1,2 @@
+All done!
+
diff --git a/LayoutTests/storage/indexeddb/tutorial.html b/LayoutTests/storage/indexeddb/tutorial.html
new file mode 100644
index 0000000..2e7e41f
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/tutorial.html
@@ -0,0 +1,433 @@
+<html><title>IndexedDB Tutorial</title>
+<script>
+
+// This is a tutorial that highlights many of the features of IndexedDB along witha number of
+// caveats that currently exist in Chromium/WebKit but which will hopefully be improved upon
+// over time.
+//
+// The latest version of the spec can be found here:
+// http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html but note that there are quite a
+// few bugs currently opened against it and some major unresolved issues (like whether dynamic
+// transactions should be in for v1). Many of the bugs are filed here:
+// http://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&component=Indexed+Database+API&longdesc_type=allwordssubstr&longdesc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailtype1=substring&email1=&emailtype2=substring&email2=&bug_id_type=anyexact&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&known_name=IndexedDB&query_based_on=IndexedDB&field0-0-0=noop&type0-0-0=noop&value0-0-0=
+// Discussion happens on public-webapps@w3.org
+//
+// Although not user friendly, additional capabilities and example code can be found in the
+// tests for IndexedDB which are here:
+// http://trac.webkit.org/browser/trunk/LayoutTests/storage/indexeddb
+//
+// This document is currently maintained by Jeremy Orlow <jorlow@chromium.org>
+
+
+// This is not an ideal layout test since it doesn't verify things as thoroughly as it could,
+// but adding such content would make it much more cluttered and thus wouldn't serve its primary
+// goal of teaching people IndexedDB. That said, it does have a good amount of coverage and
+// serves as a living document describing what's expected to work and how within WebKit so it
+// seems well worth having checked in.
+if (window.layoutTestController)
+ layoutTestController.dumpAsText(true);
+
+
+function setup()
+{
+ // As this API is still experimental, it's being shipped behind vendor specific prefixes.
+ if ('webkitIndexedDB' in window) {
+ indexedDB = webkitIndexedDB;
+ IDBCursor = webkitIDBCursor;
+ IDBKeyRange = webkitIDBKeyRange;
+ IDBTransaction = webkitIDBTransaction;
+ }
+
+ // This tutorial assumes that Mozilla and WebKit match each other which isn't true at the
+ // moment, but we can hope it'll become true over time.
+ if ('moz_indexedDB' in window) {
+ indexedDB = moz_indexedDB;
+ // Not implemented by them yet. I'm just guessing what they'll be.
+ IDBCursor = moz_IDBCursor;
+ IDBKeyRange = moz_IDBKeyRange;
+ IDBTransaction = moz_IDBTransaction;
+ }
+}
+
+function log(txt)
+{
+ document.write(txt + "<br>");
+}
+
+function logError(txt)
+{
+ log("<font color=red>" + txt + "</font>");
+}
+
+function start()
+{
+ setup();
+
+ // This is an example of one of the many asynchronous commands in IndexedDB's async interface.
+ // Each returns an IDBRequest object which has "success" and "error" event handlers. You can use
+ // "addEventListener" if you'd like, but I'm using the simpler = syntax. Only one or the other
+ // will fire. You're guaranteed that they won't fire until control is returned from JavaScript
+ // execution.
+ var request = indexedDB.open("myDB", "This is a description of the database."); // Chromium/WebKit doesn't yet require the description, but it will soon.
+ request.onsuccess = onOpen;
+ request.onerror = unexpectedError;
+}
+
+function unexpectedError()
+{
+ // If an asynchronous call results in an error, an "error" event will fire on the IDBRequest
+ // object that was returned and the event's code and message attributes will be populated with
+ // the correct values.
+ logError("Error " + event.code + ": " + event.message);
+
+ // Unfortunately, Chromium/WebKit do not implicitly abort a transaction when an error occurs
+ // within one of its async operations. In the future, when an error occurs and the event is
+ // not canceled, the transaction will be aborted.
+ if (currentTransaction)
+ currentTransaction.abort();
+}
+
+function onOpen()
+{
+ // If an asynchronous call results in success, a "success" event will fire on the IDBRequest
+ // object that was returned and the call's result will be placed in the event's "result"
+ // attribute. In some cases, the expected result will be null.
+ window.db = event.result;
+
+ // The IDBDatabase object has a "version" attribute. This can only be set by calling
+ // "setVersion" on the database and supplying a new version. This also starts a new
+ // transaction which is very special. There are many details and gotchas surrounding
+ // setVersion which we'll get into later.
+ if (db.version == "1.0") {
+ // We could skip setting up the object stores and indexes if this were a real application
+ // that wasn't going to change things without changing the version number. But since this
+ // is both a tutorial and a living document, we'll go on and set things up every time we run.
+ }
+ var request = db.setVersion("1.0");
+ request.onsuccess = onSetVersion;
+ request.onerror = unexpectedError;
+}
+
+function onSetVersion()
+{
+ // We are now in a setVersion transaction. Such a transaction is the only place where one
+ // can add or remove indexes and objectStores. The result (property of event) is an
+ // IDBTransaction object that has "complete", "abort", and "timeout" event handlers which tell
+ // us when the transaction has committed, aborted, or timed out.
+ window.currentTransaction = event.result;
+ currentTransaction.oncomplete = onSetVersionComplete;
+ currentTransaction.onabort = unexpectedAbort;
+
+ // Delete existing object stores.
+ while (db.objectStores.length)
+ db.removeObjectStore(db.objectStores[0]);
+
+ // Now that we have a blank slate, let's create an objectStore. An objectStore is simply an
+ // ordered mapping of keys to values. We can iterate through ranges of keys or do individual
+ // lookups. ObjectStores don't have any schema.
+ //
+ // Keys can be integers, strings, or null. (The spec also defines dates and there's talk of
+ // handling arrays, but these are not implemented yet in Chromium/WebKit.) Values can be
+ // anything supported by the structured clone algorithm
+ // (http://dev.w3.org/html5/spec/Overview.html#internal-structured-cloning-algorithm) which
+ // is a superset of what can be expressed in JSON. (Note that Chromium/WebKit does not fully
+ // implement the structured clone algorithm yet, but it definitely handles anything JSON
+ // serializable.)
+ //
+ // There are two types of objectStores: ones where the path is supplied manually every time a
+ // value is inserted and those with a "key path". A keyPath is essentially a JavaScript
+ // expression that is evaluated on every value to extract a key. For example, if you pass in
+ // the value of "{fname: 'john', lname: 'doe', address: {street: 'Buckingham Palace", number:
+ // 76}, siblings: ["Nancy", "Marcus"], id: 22}" and an objectStore has a keyPath of "id" then
+ // 22 will be the key for this value. In objectStores, each key must be unique.
+ //
+ // Note that the exact syntax allowed for keyPaths is not yet well specified, but
+ // Chromium/WebKit currently allows paths that are multiple levels deep within an object and
+ // allows that to be intermixed with array dereferences. So, for example, a key path of
+ // "address.number" or "siblings[0]" would be legal (provided every entry had an address with
+ // a number attribute and at least one sibling). You can even go wild and say
+ // "foo[0][2].bar[0].baz.test[1][2][3]". It's possible this will change in the future though.
+ //
+ // If you set autoIncrement (the third optional parameter), IndexedDB will generate a key
+ // for your entry automatically. And if you have a keyPath set, it'll set the value at
+ // the location of the keyPath _in the database_ (i.e. it will not modify the value you pass
+ // in to put/add). Unfortunately autoIncrement is not yet implemented in Chromium/WebKit.
+ //
+ // Let's now create an objectStore for people. We'll supply a key path in this case.
+ var objectStore = db.createObjectStore("people", "id");
+
+ // Notice that it returned synchronously. The rule of thumb is that any call that touches (in
+ // any way) keys or values is asynchronous and any other call (besides setVersion and open) are
+ // asynchronous.
+ //
+ // Now let's create some indexes. Indexes allow you to create other keys via key paths which
+ // will also point to a particular value in an objectStore. In this example, we'll create
+ // indexes for a persons first and last name. Indexes can optionally be specified to not be
+ // unique, which is good in the case of names. The first parameter is the name of the index.
+ // Second is the key path. The third specifies uniqueness.
+ var fname = objectStore.createIndex("fname", "fname", false);
+ var lname = objectStore.createIndex("lname", "lname", false);
+
+ // Note that if you wanted to delete these indexes, you can either call objectStore.removeIndex
+ // or simply delete the objectStores that own the indexes. (Note that removeObjectStore and
+ // removeIndex may be changed to deleteObjectStore and deleteIndex in the future.)
+ //
+ // If we wanted to, we could populate the objectStore with some data here or do anything else
+ // allowed in a normal (i.e. non-setVersion) transaction. This is useful so that data migrations
+ // can be atomic with changes to the objectStores/indexes.
+ //
+ // Because we haven't actually made any new asynchronous requests, this transaction will
+ // start committing as soon as we leave this function. This will cause oncomplete event handler
+ // for the transaction will fire shortly after. IndexedDB transactions commit whenever control is
+ // returned from JavaScript with no further work being queued up against the transaction. This
+ // means one cannot call setTimeout, do an XHR, or anything like that and expect my transaction
+ // to still be around when that completes.
+
+}
+
+function unexpectedAbort()
+{
+ logError("A transaction aborted unexpectedly!");
+}
+
+function onSetVersionComplete()
+{
+ // Lets create a new transaction and then not schedule any work on it to watch it abort itself.
+ // Transactions (besides those created with setVersion) are created synchronously. All three
+ // parameters are optional for transaction.
+ //
+ // The first specifies which object stores to lock. The spec specifies "dynamic transactions"
+ // which don't require this and which have finer grained locks, but no one yet supports this and
+ // it may even be dropped from the first version of the spec, so I don't suggest you rely on it.
+ // Chromium/WebKit also does not yet support anything finer grained than database level locking,
+ // so in this tutorial we'll just pass in the empty array which means "lock the world".
+ //
+ // The second parameter specifies the locking mode. The default is READ_ONLY (i.e. a shared lock).
+ // That's fine for this case, but later we'll ask for IDBTransaction.READ_WRITE. At the moment,
+ // Chromium/WebKit pretends every transaction is READ_WRITE, which is kind of bad. (Note that
+ // SNAPSHOT_READ will soon be removed from the spec.)
+ //
+ // The last parameter is the timeout length. At the moment, Chromium/WebKit defaults to 0 which
+ // means never, but it's possible we'll change this in the future, so set it if you really care.
+ window.currentTransaction = db.transaction([], IDBTransaction.READ_WRITE, 0);
+ currentTransaction.oncomplete = unexpectedComplete;
+ currentTransaction.onabort = onTransactionAborted;
+
+ // Verify that "people" is the only object store in existance. The objectStores attribute is
+ // a DOMStringList which is somewhat like an array.
+ var objectStoreList = db.objectStores;
+ if (objectStoreList.length != 1
+ || !objectStoreList.contains("people")
+ || objectStoreList.item(0) != "people"
+ || objectStoreList[0] != "people") {
+ logError("Something went wrong.");
+ }
+
+ // Let's grab a handle to the objectStore. This handle is tied to the transaction that creates
+ // it and thus becomes invalid once this transaction completes.
+ var objectStore = currentTransaction.objectStore("people");
+ if (!objectStore)
+ logError("Something went wrong.");
+
+ // If we try to grab an objectStore that doesn't exist, IndexedDB throws an exception.
+ try {
+ currentTransaction.objectStore("x");
+ logError("Something went wrong.");
+ } catch (e) {
+ // Note that the error messages in exceptions are mostly lies at the moment. The reason is
+ // that the spec re-uses exception codes for existing exceptions and there's no way we can
+ // disambiguate between the two. The best work-around at the moment is to look at
+ // http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#the-idbdatabaseexception-interface
+ // to figure out what the number corresponds to. We will try to resolve this soon in spec-land.
+ }
+
+ // Verify that fname and lname are the only indexes in existance.
+ if (objectStore.indexNames.length != 2)
+ logError("Something went wrong.");
+
+ // Note that no async actions were ever queued up agianst our transaction, so it'll abort once
+ // we leave this context.
+}
+
+function unexpectedComplete()
+{
+ logError("A transaction committed unexpectedly!");
+}
+
+function onTransactionAborted()
+{
+ // Now let's make a real transaction and a person to our objectStore.
+ window.currentTransaction = db.transaction(["people"], IDBTransaction.READ_WRITE, 0);
+ currentTransaction.onabort = unexpectedAbort;
+
+ var people = currentTransaction.objectStore("people");
+ var request = people.put({fname: 'John', lname: 'Doe', id: 1}); // If our objectStore didn't have a key path, the second parameter would have been the key.
+ request.onsuccess = onPutSuccess;
+ request.onerror = unexpectedError;
+
+ // While we're at it, why not add a few more? Multiple queued up async commands will be executed
+ // sequentially (though there is talk of prioritizing cursor.continue--see discussion below). Since
+ // we don't care about the individual commands' successes, we'll only bother with on error handlers.
+ //
+ // Remember that our implementation of unexpectedError should abort the "currentTransaction" in the
+ // case of an error. (Though no error should occur in this case.)
+ people.put({fname: 'Jane', lname: 'Doe', id: 2}).onerror = unexpectedError;
+ people.put({fname: 'Philip', lname: 'Fry', id: 3}).onerror = unexpectedError;
+
+ // Not shown here are the .remove method (which is soon to be renamed .delete) and .add (which is
+ // like .put except that it fires an onerror if the element already exists).
+}
+
+function onPutSuccess()
+{
+ // Result is the key used for the put.
+ if (event.result !== 1)
+ logError("Something went wrong.");
+
+ // We should be able to request the transaction via event.transaction from within any event handler
+ // (like this one) but this is not yet implemented in Chromium/WebKit. As a work-around, we use the
+ // global "currentTransaction" variable we set above.
+ currentTransaction.oncomplete = onPutTransactionComplete;
+}
+
+function onPutTransactionComplete()
+{
+ // OK, now let's query the people objectStore in a couple different ways. First up, let's try get.
+ // It simply takes in a key and returns a request whose result will be the value.
+ window.currentTransaction = db.transaction(["people"], IDBTransaction.READ_WRITE, 0);
+ currentTransaction.onabort = unexpectedAbort;
+
+ var people = currentTransaction.objectStore("people");
+ var request = people.get(1);
+ request.onsuccess = onGetSuccess;
+ request.onerror = unexpectedError;
+
+ // Note that multiple objectStore (or index) method calls will return different objects (that still
+ // refer to the same objectStore/index on disk).
+ people.someProperty = true;
+ if (currentTransaction.objectStore("people").someProperty)
+ logError("Something went wrong.");
+}
+
+function onGetSuccess()
+{
+ if (event.result.fname !== "John")
+ logError("Something went wrong.");
+
+ // Events have a .source attribute which is the object that fired the event. In this case, it's our
+ // "people" objectStore object.
+ var people = event.source;
+
+ // Now let's try opening a cursor from id 1 (exclusive/open) to id 3 (inclusive/closed). This means
+ // we'll get the objects for ids 2 and 3. You can also create cursors that are only right or only
+ // left bounded or ommit the bound in order to grab all objects. You can also specify a direction
+ // which can be IDBCursor.NEXT (default) for the cursor to move forward, NEXT_NO_DUPLICATE to only
+ // return unique entires (only applies to indexes with unique set to false), PREV to move backwards,
+ // and PREV_NO_DUPLICATE.
+ var keyRange = IDBKeyRange.bound(1, 3, true, false);
+ var request = people.openCursor(keyRange, IDBCursor.NEXT);
+ request.onsuccess = onObjectStoreCursor;
+ request.onerror = unexpectedError;
+}
+
+function onObjectStoreCursor()
+{
+ // The result of openCursor is an IDBCursor object or null if there are no (more--see below)
+ // records left.
+ var cursor = event.result;
+ if (cursor === null) {
+ cursorComplete(event.source); // The soruce is still an objectStore.
+ return;
+ }
+
+ // We could use these values if we wanted to.
+ var key = cursor.key;
+ var value = cursor.value;
+
+ // cursor.count is probably going to be removed.
+ // cursor.update and .remove are not yet implemented in Chromium/WebKit.
+
+ // cursor.continue will reuse the same request object as what openCursor returned. In the future,
+ // we MAY prioritize .continue() calls ahead of all other async operations queued up. This will
+ // introduce a level of non-determinism but should speed things up. Mozilla has already implemented
+ // this non-standard behavior, from what I've head.
+ event.result.continue();
+}
+
+function cursorComplete(objectStore)
+{
+ // While still in the same transaction, let's now do a lookup on the lname index.
+ var lname = objectStore.index("lname");
+
+ // Note that the spec has not been updated yet, but instead of get and getObject, we now
+ // have getKey and get. The former returns the objectStore's key that corresponds to the key
+ // in the index. get returns the objectStore's value that corresponds to the key in the
+ // index.
+ var request = lname.getKey("Doe");
+ request.onsuccess = onIndexGetSuccess;
+ request.onerror = unexpectedError;
+}
+
+function onIndexGetSuccess()
+{
+ // Because we did "getKey" the result is the objectStore's key.
+ if (event.result !== 1)
+ logError("Something went wrong.");
+
+ // Similarly, indexes have openCursor and openKeyCursor. We'll try a few of them with various
+ // different IDBKeyRanges just to demonstrate how to use them, but we won't bother to handle
+ // the onsuccess conditions.
+ var lname = event.source;
+ lname.openCursor(IDBKeyRange.leftBound("Doe", false), IDBCursor.NEXT_NO_DUPLICATE);
+ lname.openCursor(null, IDBCursor.PREV_NO_DUPLICATE);
+ lname.openCursor(IDBKeyRange.rightBound("ZZZZ"));
+ lname.openCursor(IDBKeyRange.only("Doe"), IDBCursor.PREV);
+ lname.openCursor();
+ lname.openKeyCursor();
+
+ // We should be able to request the transaction via event.transaction from within any event handler
+ // (like this one) but this is not yet implemented in Chromium/WebKit. As a work-around, we use the
+ // global "currentTransaction" variable we set above.
+ currentTransaction.oncomplete = onAllDone;
+}
+
+function onAllDone()
+{
+ log("Everything worked!");
+}
+
+// The way setVersion is supposed to work:
+// To keep things simple to begin with, objectStores and indexes can only be created in a setVersion
+// transaction and one can only run if no other connections are open to the database. This is designed
+// to save app developers from having an older verison of a web page that expects a certain set of
+// objectStores and indexes from breaking in odd ways when things get changed out from underneith it.
+// In the future, we'll probably add a more advanced mechanism, but this is it for now.
+// Because a setVersion transaction could stall out nearly forever until the user closes windows,
+// we've added a "blocked" event to the request object returned by setVersion. This will fire if the
+// setVersion transaction can't begin because other windows have an open connection. The app can then
+// either pop something up telling the user to close windows or it can tell the other windows to call
+// .close() on their database handle. .close() halts any new transactions from starting and waits for
+// the existing ones to finish. It then closes the connection and any indexedDB calls afterwards are
+// invalid (they'll probably throw, but this isn't specified yet). We may specify .close() to return
+// an IDBRequest object so that we can fire the onsuccess when the close completes.
+// Once inside a setVersion transaction, you can do anything you'd like. The one connection which
+// was allowed to stay open to complete the setVersion transaction will stay alive. Multiple
+// setVersion transactions can be queued up at once and will fire in the order queued (though
+// this obviously only works if they're queued in the same page).
+//
+// The current status of setVersion in Chromium/WebKit:
+// In Chromium/WebKit we currently don't enforce the "all connections must be closed before a
+// setVersion transaction starts" rule. We also don't implement database.close() or have a blocked
+// event on the request .setVersion() returns.
+//
+// The current status of workers:
+// Chromium/WebKit do not yet support workers using IndexedDB. Support for the async interface
+// will likely come before the sync interface. For now, a work-around is using postMessage to tell
+// the page what to do on the worker's behalf in an ad-hoc manner. Anything that can be serialized
+// to disk can be serialized for postMessage.
+
+</script>
+<body onload="start()">
+Please view source for more information on what this is doing and why...<br><br>
+</body>
+</html>
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index 080ad2d..db414ab 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -204,6 +204,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/fileapi/%.cpp : $(intermediates)/
# HTML
GEN := \
$(intermediates)/html/JSDOMFormData.h \
+ $(intermediates)/html/JSDOMSettableTokenList.h \
$(intermediates)/html/JSDOMTokenList.h \
$(intermediates)/html/JSDataGridColumn.h \
$(intermediates)/html/JSDataGridColumnList.h \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 38d55fd..b8e48ae 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -146,6 +146,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
GEN := \
$(intermediates)/bindings/V8Blob.h \
$(intermediates)/bindings/V8BlobBuilder.h \
+<<<<<<< HEAD
$(intermediates)/bindings/V8DOMFileSystem.h \
$(intermediates)/bindings/V8DOMFileSystemSync.h \
$(intermediates)/bindings/V8DirectoryEntry.h \
@@ -159,6 +160,12 @@ GEN := \
$(intermediates)/bindings/V8EntryCallback.h \
$(intermediates)/bindings/V8EntrySync.h \
$(intermediates)/bindings/V8ErrorCallback.h \
+=======
+ $(intermediates)/bindings/V8DOMTokenList.h \
+ $(intermediates)/bindings/V8DOMSettableTokenList.h \
+ $(intermediates)/bindings/V8DataGridColumn.h \
+ $(intermediates)/bindings/V8DataGridColumnList.h \
+>>>>>>> webkit.org at r70949
$(intermediates)/bindings/V8File.h \
$(intermediates)/bindings/V8FileCallback.h \
$(intermediates)/bindings/V8FileEntry.h \
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index fee0094..80e9516 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -88,10 +88,15 @@ 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/JSDOMSettableTokenList.cpp \
+ bindings/js/JSDOMTokenList.cpp \
+>>>>>>> webkit.org at r70949
bindings/js/JSDOMWindowBase.cpp \
bindings/js/JSDOMWindowCustom.cpp \
bindings/js/JSDOMWindowShell.cpp \
@@ -110,7 +115,11 @@ LOCAL_SRC_FILES += \
bindings/js/JSEventListener.cpp \
bindings/js/JSEventTarget.cpp \
bindings/js/JSExceptionBase.cpp \
+<<<<<<< HEAD
bindings/js/JSFloat32ArrayCustom.cpp \
+=======
+ bindings/js/JSFileReaderCustom.cpp \
+>>>>>>> webkit.org at r70949
bindings/js/JSGeolocationCustom.cpp \
bindings/js/JSHTMLAllCollectionCustom.cpp \
bindings/js/JSHTMLAppletElementCustom.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index bbc8bdc..eadb310 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -287,12 +287,18 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/BaseTextInputType.cpp \
html/ButtonInputType.cpp \
html/CheckboxInputType.cpp \
+ html/ClassList.cpp \
html/CollectionCache.cpp \
html/parser/CSSPreloadScanner.cpp \
html/ColorInputType.cpp \
html/DOMFormData.cpp \
+<<<<<<< HEAD
html/DOMTokenList.cpp \
html/DateComponents.cpp \
+=======
+ html/DOMSettableTokenList.cpp \
+ html/DOMTokenList.cpp \
+>>>>>>> webkit.org at r70949
html/DateInputType.cpp \
html/DateTimeInputType.cpp \
html/DateTimeLocalInputType.cpp \
@@ -462,6 +468,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
page/Settings.cpp \
page/SpatialNavigation.cpp \
page/SpeechInput.cpp \
+ page/SpeechInputResult.cpp \
page/SuspendableTimer.cpp \
page/Timing.cpp \
page/UserContentURLPattern.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 42e344a..30fd99d 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -207,6 +207,7 @@ SET(WebCore_IDL_FILES
html/DataGridColumn.idl
html/DataGridColumnList.idl
html/DOMFormData.idl
+ html/DOMSettableTokenList.idl
html/DOMTokenList.idl
html/HTMLAllCollection.idl
html/HTMLAnchorElement.idl
@@ -619,6 +620,7 @@ SET(WebCore_SOURCES
bindings/js/JSEventSourceCustom.cpp
bindings/js/JSEventTarget.cpp
bindings/js/JSExceptionBase.cpp
+ bindings/js/JSFileReaderCustom.cpp
bindings/js/JSGeolocationCustom.cpp
bindings/js/JSHistoryCustom.cpp
bindings/js/JSIDBAnyCustom.cpp
@@ -924,6 +926,7 @@ SET(WebCore_SOURCES
editing/SplitElementCommand.cpp
editing/SplitTextNodeCommand.cpp
editing/SplitTextNodeContainingElementCommand.cpp
+ editing/TextCheckingHelper.cpp
editing/TextIterator.cpp
editing/TypingCommand.cpp
editing/UnlinkCommand.cpp
@@ -949,14 +952,18 @@ SET(WebCore_SOURCES
history/PageCache.cpp
html/AsyncImageResizer.cpp
+ html/BaseButtonInputType.cpp
+ html/BaseCheckableInputType.cpp
html/BaseDateAndTimeInputType.cpp
html/BaseTextInputType.cpp
html/ButtonInputType.cpp
html/CheckboxInputType.cpp
+ html/ClassList.cpp
html/CollectionCache.cpp
html/ColorInputType.cpp
html/DOMDataGridDataSource.cpp
html/DOMFormData.cpp
+ html/DOMSettableTokenList.cpp
html/DOMTokenList.cpp
html/DataGridColumn.cpp
html/DataGridColumnList.cpp
@@ -1590,6 +1597,7 @@ SET(WebCore_SOURCES
IF (ENABLE_BLOB)
LIST(APPEND WebCore_SOURCES
fileapi/FileReader.cpp
+ fileapi/FileReaderLoader.cpp
fileapi/FileThread.cpp
fileapi/FileStreamProxy.cpp
platform/FileStream.cpp
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index e44dfd4..3397bc2 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -102,6 +102,7 @@ IF (WTF_USE_SOUP)
platform/network/soup/ResourceRequestSoup.cpp
platform/network/soup/ResourceResponseSoup.cpp
platform/network/soup/SocketStreamHandleSoup.cpp
+ platform/network/soup/SoupURIUtils.cpp
platform/network/soup/cache/soup-directory-input-stream.c
platform/network/soup/cache/soup-http-input-stream.c
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 83f63cc..44714b7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,6988 @@
+2010-10-29 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove RenderTextControl::setSelectionRange
+ https://bugs.webkit.org/show_bug.cgi?id=47870
+
+ Made RenderTextControl::setSelectionRange a global function.
+ Removed setSelectionStart, setSelectionEnd, and select from RenderTextControl.
+
+ No new tests are added since there is no behavioral change.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::setSelectedTextRange): Calls setSelectedTextRange.
+ * dom/InputElement.cpp:
+ (WebCore::InputElement::updateSelectionRange): Ditto.
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionStart): Ditto.
+ (WebCore::HTMLTextFormControlElement::setSelectionEnd): Ditto.
+ (WebCore::HTMLTextFormControlElement::select): Ditto.
+ (WebCore::HTMLTextFormControlElement::setSelectionRange): Ditto.
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::hasVisibleTextArea): Added.
+ (WebCore::setSelectionRange): See above.
+ * rendering/RenderTextControl.h:
+
+2010-10-29 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Andreas Kling.
+
+ [GTK] Crash in TextEncoding.cpp when using glib unicode
+ https://bugs.webkit.org/show_bug.cgi?id=48521
+
+ When the conversion to UTF-8 fails, try to encode the original string
+ without normalizing. Fixes tests cases:
+ fast/url/anchor.html
+ fast/url/query.html
+ fast/url/standard-url.html
+
+ * platform/text/TextEncoding.cpp:
+ (WebCore::TextEncoding::encode):
+
+2010-10-29 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ TextureMapperGL get the driver info log but do not use it
+ https://bugs.webkit.org/show_bug.cgi?id=48247
+
+ Remove the call to glGetProgramInfoLog().
+
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::TexmapShaderInfo::createShaderProgram):
+
+2010-10-29 Benjamin Kalman <kalman@google.com>
+
+ Reviewed by Tony Chang.
+
+ Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
+ https://bugs.webkit.org/show_bug.cgi?id=48658
+
+ * WebCore.exp.in: Update is{Start,End}OfParagraph symbols.
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::doApply): Cross editability boundaries when determining whether to insert placeholder.
+ * editing/visible_units.cpp: Allow editability boundary to be crossed in {start,end,isStart,isEnd}OfParagraph.
+ (WebCore::startOfParagraph): Also, avoid returning a position where renderer can't accept caret, like in endOfParagraph.
+ (WebCore::endOfParagraph):
+ (WebCore::isStartOfParagraph):
+ (WebCore::isEndOfParagraph):
+ * editing/visible_units.h: Ditto.
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: last active panel is not restored upon opening inspector.
+ https://bugs.webkit.org/show_bug.cgi?id=48668
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::inspect):
+ (WebCore::InspectorController::showPanel):
+ (WebCore::InspectorController::disconnectFrontend):
+ (WebCore::InspectorController::populateScriptObjects):
+ * inspector/InspectorController.h:
+ * inspector/InspectorState.cpp:
+ (WebCore::InspectorState::InspectorState):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ * inspector/front-end/inspector.js:
+ (WebInspector.set currentPanel):
+ (WebInspector.doLoadedDone.onPopulateScriptObjects):
+ (WebInspector.doLoadedDone):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+
+2010-10-28 Michael Nordman <michaeln@google.com>
+
+ Reviewed by ap.
+
+ [Chrome] Fix an appcache regression introduced in r69226
+ https://bugs.webkit.org/show_bug.cgi?id=48592
+ Define a new ApplicationCacheHost method for the specific case of main resource redirect handling.
+
+ Tests: the existing layout test applies
+
+ * loader/MainResourceLoader.cpp: use the newly introduced method
+ (WebCore::MainResourceLoader::willSendRequest):
+ * loader/appcache/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
+ * loader/appcache/ApplicationCacheHost.h:
+
+2010-10-29 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Navigating to a .wav file creates a plugin document but should create a media document
+ https://bugs.webkit.org/show_bug.cgi?id=48546
+ <rdar://problem/8606105>
+
+ Test: media/media-can-play-wav-audio.html
+
+ * platform/MIMETypeRegistry.cpp: Add mapping from ".wav" to "audio/x-wav".
+
+2010-10-29 Aaron Colwell <acolwell@chromium.org>
+
+ Reviewed by James Robinson.
+
+ Created helper method WebCore::PlatformContextSkia::getNormalizedAlpha()
+ to centralize alpha rounding & clipping logic.
+ https://bugs.webkit.org/show_bug.cgi?id=48094
+
+ Test: media/video-canvas-alpha.html
+
+ * platform/graphics/skia/ImageSkia.cpp:
+ (WebCore::paintSkBitmap):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::getNormalizedAlpha):
+ * platform/graphics/skia/PlatformContextSkia.h:
+
+2010-10-29 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ ASSERT when SVGAnimatedProperty instance is assigned to multiple elements.
+ https://bugs.webkit.org/show_bug.cgi?id=48555
+
+ Test: svg/custom/insertItemBefore-from-non-list-origin.svg
+
+ * bindings/scripts/CodeGeneratorJS.pm: Include SVGAnimatedPropertyTearOff.h instead of SVGPropertyTearOff.h
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/properties/SVGAnimatedListPropertyTearOff.h:
+ (WebCore::SVGAnimatedListPropertyTearOff::isAnimatedListTearOff): Return true.
+ (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList): Devirtualize function.
+ * svg/properties/SVGAnimatedProperty.h:
+ (WebCore::SVGAnimatedProperty::isAnimatedListTearOff): Return false.
+ * svg/properties/SVGListPropertyTearOff.h:
+ (WebCore::SVGListPropertyTearOff::removeItemFromListIfNeeded): Only try to remove the passed item from its list, if its actually a list and not just a SVGAnimatedProperty.
+
+2010-10-29 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48444
+
+ Fix the dirty rect checks in RenderBoxLineList, InlineFlowBox, InlineTextBox. They were still assuming horizontal-tb writing-mode.
+ This patch makes the checks directionally abstract and also refactors the checks in RenderLineBoxList to share code.
+
+ No tests yet, since the invalidation code for inlines still assumes horizontal-tb. That will be fixed in a follow-up bug,
+ and then repaint tests will be easy to write.
+
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::adjustForFlippedBlocksWritingMode):
+ * rendering/InlineBox.h:
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paint):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::convertFromFlippedWritingMode):
+ * rendering/RenderBox.h:
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::rangeIntersectsDirtyRect):
+ (WebCore::RenderLineBoxList::anyLineIntersectsDirtyRect):
+ (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
+ (WebCore::RenderLineBoxList::paint):
+ (WebCore::RenderLineBoxList::hitTest):
+ * rendering/RenderLineBoxList.h:
+
+2010-10-29 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Cleanup createGlobalImageFileDescriptor in ClipboardWin
+ https://bugs.webkit.org/show_bug.cgi?id=48189
+
+ * platform/win/ClipboardWin.cpp:
+ (WebCore::createGlobalURLContent):
+ (WebCore::createGlobalUrlFileDescriptor):
+ (WebCore::ClipboardWin::writeURL):
+
+2010-10-29 Dmitry Titov <dimich@chromium.org>
+
+ [Chromium clang] Unreviewed fix removing compiler warning.
+ If GIFImageReader is a struct, don't call it a class.
+
+ * platform/image-decoders/gif/GIFImageDecoder.h:
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Fix the world (d'oh!)
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ * html/HTMLFrameSetElement.cpp:
+ (WebCore::HTMLFrameSetElement::insertedIntoDocument):
+ (WebCore::HTMLFrameSetElement::removedFromDocument):
+ Call base class version.
+
+2010-10-29 Jian Li <jianli@chromium.org>
+
+ Unreviewed. Fix chromium build break.
+
+ * bindings/v8/custom/V8FileReaderCustom.cpp:
+ (WebCore::V8FileReader::resultAccessorGetter):
+
+2010-10-29 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Support readAsArrayBuffer in FileReader and FileReaderSync
+ https://bugs.webkit.org/show_bug.cgi?id=47691
+
+ Merge the similar code in FileReader and FileReaderSync into
+ FileReaderLoader.
+
+ Test cases have been added to read-file-test-cases.js.
+
+ * Android.jscbindings.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/v8/custom/V8FileReaderCustom.cpp: Added.
+ * fileapi/FileReader.cpp:
+ (WebCore::FileReader::FileReader):
+ (WebCore::FileReader::readAsArrayBuffer):
+ (WebCore::FileReader::readAsBinaryString):
+ (WebCore::FileReader::readAsText):
+ (WebCore::FileReader::readAsDataURL):
+ (WebCore::FileReader::readInternal):
+ (WebCore::FileReader::doAbort):
+ (WebCore::FileReader::terminate):
+ (WebCore::FileReader::start):
+ (WebCore::FileReader::didStartLoading):
+ (WebCore::FileReader::didReceiveData):
+ (WebCore::FileReader::didFinishLoading):
+ (WebCore::FileReader::didFail):
+ (WebCore::FileReader::fireEvent):
+ (WebCore::FileReader::arrayBufferResult):
+ (WebCore::FileReader::stringResult):
+ * fileapi/FileReader.h:
+ (WebCore::FileReader::readType):
+ * fileapi/FileReader.idl:
+ * fileapi/FileReaderLoader.cpp: Added.
+ * fileapi/FileReaderLoader.h: Added.
+ * fileapi/FileReaderLoaderClient.h: Added.
+ * fileapi/FileReaderSync.cpp:
+ (WebCore::FileReaderSync::FileReaderSync):
+ (WebCore::FileReaderSync::readAsArrayBuffer):
+ (WebCore::FileReaderSync::readAsBinaryString):
+ (WebCore::FileReaderSync::readAsText):
+ (WebCore::FileReaderSync::readAsDataURL):
+ (WebCore::FileReaderSync::startLoading):
+ * fileapi/FileReaderSync.h:
+ * fileapi/FileReaderSync.idl:
+ * html/canvas/ArrayBuffer.cpp:
+ (WebCore::ArrayBuffer::create):
+ * html/canvas/ArrayBuffer.h:
+ * loader/ThreadableLoaderClient.h:
+
+2010-10-29 Tony Chang <tony@chromium.org>
+
+ Unreviewed, rolling out r70850.
+ http://trac.webkit.org/changeset/70850
+ https://bugs.webkit.org/show_bug.cgi?id=45640
+
+ chromium and qt pixel test regressions
+
+ * dom/Document.cpp:
+ * dom/Document.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::invalidateRect):
+ (WebCore::FrameView::repaintContentRectangle):
+ (WebCore::FrameView::doDeferredRepaints):
+ * page/FrameView.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintContents):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayer):
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ This can change in two cases, when document changes, and when frame is navigated to another
+ document.
+
+ * dom/Document.cpp: (WebCore::Document::documentDidBecomeActive): Update the client when
+ a document is restored from page cache.
+
+ * loader/FrameLoaderClient.h: Added a new client call to notify client.
+
+ * html/HTMLFrameSetElement.h:
+ * html/HTMLFrameSetElement.cpp:
+ (WebCore::HTMLFrameSetElement::insertedIntoDocument):
+ (WebCore::HTMLFrameSetElement::removedFromDocument):
+ Update the client when document changes, potentially becoming a frameset. Per WebCore
+ definition, a document is a frameset when it has a FRAMESET element as direct child of
+ document element (it may also have body elements).
+
+ * loader/EmptyClients.h: (WebCore::EmptyFrameLoaderClient::dispatchDidBecomeFrameset):
+ Added an empty implementation.
+
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed fix. Touch WebCorePrefix.h to fix incremental build failure after r70878.
+
+ * WebCorePrefix.h:
+
+2010-10-29 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Handle surrogate pairs in TextBreakIteratorGtk
+ https://bugs.webkit.org/show_bug.cgi?id=48227
+
+ TextBreakIteratorGtk uses UTF-8 because it's what pango expects, but we
+ need to return indices for the given input string that are in UTF-16.
+ The number of characters is the same for both UTF-16 and UTF-8 except when
+ the input string contains surrogate pairs. We need to keep both, the
+ index for the UTF-8 string to be used internally, and the index for the
+ UTF-16 string to be used as return value of the iterator interface. It
+ fixes test fast/forms/textarea-maxlength.html
+
+ * platform/text/gtk/TextBreakIteratorGtk.cpp:
+ (WebCore::CharacterIterator::getText):
+ (WebCore::CharacterIterator::getLength):
+ (WebCore::CharacterIterator::getSize):
+ (WebCore::CharacterIterator::getIndex):
+ (WebCore::CharacterIterator::getUTF16Index):
+ (WebCore::CharacterIterator::getUTF16Length):
+ (WebCore::CharacterIterator::characterSize):
+ (WebCore::CharacterIterator::setText):
+ (WebCore::CharacterIterator::setIndex):
+ (WebCore::CharacterIterator::setUTF16Index):
+ (WebCore::CharacterIterator::first):
+ (WebCore::CharacterIterator::last):
+ (WebCore::CharacterIterator::next):
+ (WebCore::CharacterIterator::previous):
+ (WebCore::setUpIterator):
+ (WebCore::textBreakFirst):
+ (WebCore::textBreakLast):
+ (WebCore::textBreakNext):
+ (WebCore::textBreakPrevious):
+ (WebCore::textBreakPreceding):
+ (WebCore::textBreakFollowing):
+ (WebCore::textBreakCurrent):
+ (WebCore::isTextBreak):
+
+2010-10-29 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: [REGRESSION] Addition of a new (blank) style property does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48631
+
+ Test: inspector/styles-add-blank-property.html
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertiesSection.prototype.addNewBlankProperty):
+ (WebInspector.ComputedStylePropertiesSection.prototype.onpopulate):
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add close button to network view, make tests pass for
+ resource manager on all ports.
+ https://bugs.webkit.org/show_bug.cgi?id=48628
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::frameDetachedFromParent):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::markResourceAsCached):
+ (WebCore::InspectorController::didReceiveResponse):
+ (WebCore::InspectorController::didReceiveContentLength):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::scriptImported):
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceTreeModel.prototype.didCommitLoadForFrame):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.addResourceToFrame):
+ * inspector/front-end/inspector.js:
+ (WebInspector._createPanels):
+ * inspector/front-end/networkPanel.css:
+ (.network-close-button):
+
+2010-10-29 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAnimatedEnumeration/Integer to the new SVGAnimatedPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48623
+
+ Besides converting SVGAnimatedEnumeration/Integer to the new animated property tear off concept, fix support
+ for multiple wrappers within the new concept, which was broken - covered by existing svg/dynamic-updates/ tests.
+
+ Replace all 'extern char[]' usage when using the multiple wrappers macro, by static AtomicStrings.
+
+ * GNUmakefile.am: Add SVGAnimatedEnumeration.h / SVGAnimatedInteger.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Recognize SVGAnimatedEnumeration / SVGAnimatedInteger as animated types using the new concept.
+ * bindings/scripts/CodeGeneratorObjC.pm: Touched, to force regenerating ObjC bindings, dependency tracking is obviously broken.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedBoolean/Enumeration/Integer handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAnimatedEnumeration.h: Added.
+ * svg/SVGAnimatedEnumeration.idl:
+ * svg/SVGAnimatedInteger.h: Added.
+ * svg/SVGClipPathElement.h: Adapted all code to create new style animated property tear offs for long & int types.
+ * svg/SVGComponentTransferFunctionElement.h:
+ * svg/SVGFEBlendElement.h:
+ * svg/SVGFEColorMatrixElement.h:
+ * svg/SVGFECompositeElement.h:
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Replaced extern[] char hack using a static AtomicString.
+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Ditto.
+ * svg/SVGFEDiffuseLightingElement.h:
+ * svg/SVGFEDisplacementMapElement.h:
+ * svg/SVGFEGaussianBlurElement.cpp:
+ (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Ditto.
+ (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Ditto.
+ * svg/SVGFEGaussianBlurElement.h:
+ * svg/SVGFEMorphologyElement.h:
+ * svg/SVGFESpecularLightingElement.cpp:
+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Ditto.
+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Ditto.
+ * svg/SVGFESpecularLightingElement.h:
+ * svg/SVGFETurbulenceElement.cpp:
+ (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Ditto.
+ (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Ditto.
+ * svg/SVGFETurbulenceElement.h:
+ * svg/SVGFilterElement.cpp:
+ (WebCore::SVGFilterElement::filterResXIdentifier): Ditto.
+ (WebCore::SVGFilterElement::filterResYIdentifier): Ditto.
+ * svg/SVGFilterElement.h:
+ * svg/SVGGradientElement.h:
+ * svg/SVGMarkerElement.cpp:
+ (WebCore::SVGMarkerElement::orientTypeIdentifier): Ditto.
+ (WebCore::SVGMarkerElement::orientAngleIdentifier): Ditto.
+ * svg/SVGMarkerElement.h:
+ * svg/SVGMaskElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGTextContentElement.h:
+ * svg/SVGTextPathElement.h:
+ * svg/properties/SVGAnimatedPropertyMacros.h: Add new macro for multiple wrappers using static properties.
+
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Make GraphicsContext cheaper to construct
+ https://bugs.webkit.org/show_bug.cgi?id=48626
+
+ Do less unnecessary things when creating the Qt GraphicsContext:
+ - Don't create a black QBrush that's immediately discarded.
+ - Don't call setPlatform*(), set the painter brush and pen directly.
+ - Call setRenderHints() once instead of multiple setRenderHint().
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::GraphicsContext):
+
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] GraphicsLayer: Don't notifySyncRequired() more than necessary
+ https://bugs.webkit.org/show_bug.cgi?id=48624
+
+ Don't queue multiple meta method invocations for notifySyncRequired()
+
+ 4% speedup on <http://ariya.github.com/clock.htm>
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::GraphicsLayerQtImpl):
+ (WebCore::GraphicsLayerQtImpl::notifySyncRequired):
+ (WebCore::GraphicsLayerQtImpl::notifyChange):
+
+2010-10-29 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Chris Marrin.
+
+ drawArrays/drawElements with first/offset out of range but size==0 should generate no error
+ https://bugs.webkit.org/show_bug.cgi?id=48601
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::drawArrays):
+ (WebCore::WebGLRenderingContext::drawElements):
+
+2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use the nearest
+ language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show,
+ http://codereview.chromium.org/3595018/show and
+ https://bugs.webkit.org/show_bug.cgi?id=47420.
+
+ Test: fast/speech/input-text-language-tag.html
+
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-29 Mads Ager <ager@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [V8] The DateExtension cannot handle overwritten Date
+ https://bugs.webkit.org/show_bug.cgi?id=48621
+
+ Check that the Date property is an object before attempting to get
+ hidden properties from it.
+
+ Test: fast/dom/Window/slow-unload-handler-overwritten-date.html
+
+ * bindings/v8/DateExtension.cpp:
+ (WebCore::DateExtension::setAllowSleep):
+
+2010-10-27 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAnimatedBoolean to the new SVGAnimatedPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48469
+
+ Convert the next SVG animated primitive type to use the SVGAnimatedPropertyTearOff concept: SVGAnimatedBoolean.
+ Added new test verifying that StrictTypeChecking is enabled for SVGAnimatedBooleans. It also tests that this type is "static", see LayoutTests/ChangeLog for details.
+
+ Add support for StrictTypeChecking for boolean types.
+
+ Test: svg/dom/SVGExternalResourcesRequired.html
+
+ * GNUmakefile.am: Add SVGAnimatedBoolean.h and SVGAnimatedStaticPropertyTearOff.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Add SVGAnimatedBoolean to the new style svg animated bindings list.
+ * bindings/scripts/CodeGeneratorJS.pm: Add StrictTypeChecking support for boolean types.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto. Only generate kit() usage for new style animated types, if the wrapped type needs a tear off.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Remove SVGAnimatedBoolean handling.
+ * svg/SVGAElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_STATIC_PROPERTY_NEW/ for boolean types everywhere. Include SVGAnimatedPropertyMacros.h where needed.
+ * svg/SVGAnimatedBoolean.h: Added.
+ * svg/SVGAnimatedBoolean.idl:
+ * svg/SVGAnimationElement.h:
+ * svg/SVGCircleElement.h:
+ * svg/SVGClipPathElement.h:
+ * svg/SVGCursorElement.h:
+ * svg/SVGDefsElement.h:
+ * svg/SVGEllipseElement.h:
+ * svg/SVGExternalResourcesRequired.cpp:
+ * svg/SVGExternalResourcesRequired.h:
+ (WebCore::SVGExternalResourcesRequired::~SVGExternalResourcesRequired):
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEImageElement.h:
+ * svg/SVGFilterElement.h:
+ * svg/SVGFontElement.h:
+ * svg/SVGForeignObjectElement.h:
+ * svg/SVGGElement.h:
+ * svg/SVGGradientElement.h:
+ * svg/SVGImageElement.h:
+ * svg/SVGLineElement.h:
+ * svg/SVGMPathElement.h:
+ * svg/SVGMarkerElement.h:
+ * svg/SVGMaskElement.h:
+ * svg/SVGPathElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGPolyElement.h:
+ * svg/SVGRectElement.h:
+ * svg/SVGSVGElement.h:
+ * svg/SVGScriptElement.h:
+ * svg/SVGSwitchElement.h:
+ * svg/SVGSymbolElement.h:
+ * svg/SVGTextContentElement.h:
+ * svg/SVGUseElement.h:
+ * svg/SVGViewElement.h:
+ * svg/properties/SVGAnimatedListPropertyTearOff.h: Moved RefPtr<SVGProperty> m_baseVal/m_animVal from SVGAnimatedProperty, as SVGAnimatedStaticPropertyTearOff doesn't need them.
+ * svg/properties/SVGAnimatedProperty.h: Remove m_baseVal/m_animVal.
+ (WebCore::SVGAnimatedProperty::commitChange): New method to share code between the SVGAnimated*PropertyTearOff classes.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Add new DECLARE_ANIMATED_STATIC_PROPERTY_NEW macro which creates SVGAnimatedStaticPropertyTearOff types.
+ * svg/properties/SVGAnimatedPropertyTearOff.h: Moved RefPtr<SVGProperty> m_baseVal/m_animVal from SVGAnimatedProperty, as SVGAnimatedStaticPropertyTearOff doesn't need them.
+ * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Added.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal): Directly returns the stored m_property as reference, no tear off is created.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::animVal): Ditto.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::setBaseVal): Directly updates the stored m_property reference, and invalidates the SVG attributes.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::setAnimVal): Not implemented.
+ (WebCore::SVGAnimatedStaticPropertyTearOff::create):
+ (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
+ * svg/properties/SVGListPropertyTearOff.h:
+ (WebCore::SVGListPropertyTearOff::commitChange): Share code, use SVGAnimatedProperty::commitChange.
+ * svg/properties/SVGPropertyTearOff.h:
+ (WebCore::SVGPropertyTearOff::commitChange): Ditto.
+
+2010-10-28 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ <meter min=0 max=100 value=100> should be optimum.
+ https://bugs.webkit.org/show_bug.cgi?id=48613
+
+ Changed to make the condition inclusive for better case consistently.
+ - Values on the border between optimum and subsequntial go optimum.
+ - Values on the border between suboptimal and even-less-than-good go suboptimal.
+
+ Test: fast/dom/HTMLMeterElement/meter-boundary-values.html
+
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::gaugeRegion):
+
+2010-10-29 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Kent Tamura.
+
+ [HTML5] Add DOMSettableTokenList
+ https://bugs.webkit.org/show_bug.cgi?id=47810
+
+ Adds DOMSettableTokenList interface to support <output> element.
+ The DOMTokenList interface was refactored since its was tightly coupled
+ with HTMLElement.classList property.
+
+ * Android.derived.jscbindings.mk: Added JSDOMSettableTokenList.h file.
+ * Android.derived.v8bindings.mk: Added V8DOMSettableTokenList.h file.
+ * Android.jscbindings.mk: Added JSDOMSettableTokenList.cpp file.
+ * Android.mk: Added ClassList.cpp file.
+ * CMakeLists.txt: Added DOMSettableTokenList.{cpp,idl} and ClassList.cpp files.
+ * DerivedSources.cpp: Added JSDOMSettableTokenList.cpp file.
+ * DerivedSources.make: Added DOMSettableTokenList entry.
+ * GNUmakefile.am: Added JSDOMSettableTokenList.{h,cpp} and ClassList.{h,cpp} files.
+ * WebCore.gypi: Added DOMSettableTokenList.{h,cpp,idl}, V8DOMSettableTokenListCustom.cpp and ClassList.{h,cpp} files.
+ * WebCore.pri: Added DOMSettableTokenList.idl file.
+ * WebCore.pro: Added V8DOMSettableTokenListCustom.cpp, ClassList.{h,cpp} and DOMSettableTokenList.{h,cpp} files.
+ * WebCore.vcproj/WebCore.vcproj: Added JSDOMSettableTokenList.{h,cpp}, ClassList.{h,cpp} and DOMSettableTokenList.{h,cpp} files.
+ * WebCore.xcodeproj/project.pbxproj: Added ClassList.{h,cpp}, DOMSettabletokenList.{h,cpp} and JSDOMSettableTokenList.{h,cpp}
+ * bindings/gobject/GNUmakefile.am: Added WebKitDOMDOMSettableTokenList.{h,cpp} and WebKitDOMDOMSettableTokenListPrivate.cpp files.
+ * bindings/scripts/CodeGeneratorJS.pm: Modified IndexGetterReturnsStrings() returns 1 for DOMSettableTokenList.
+ * bindings/v8/custom/V8DOMSettableTokenListCustom.cpp: Added.
+ (WebCore::V8DOMSettableTokenList::indexedPropertyGetter):
+ * dom/Element.cpp: Replaced DOMTokenList to ClassList.
+ (WebCore::Element::classList):
+ * dom/ElementRareData.h: ditto.
+ * dom/SpaceSplitString.cpp: Added add() and remove() functions.
+ (WebCore::SpaceSplitStringData::add):
+ (WebCore::SpaceSplitStringData::remove):
+ (WebCore::SpaceSplitString::add):
+ (WebCore::SpaceSplitString::remove):
+ * dom/SpaceSplitString.h: Added add() and remove() functions.
+ * dom/StyledElement.cpp: Replaced DOMTokenList to ClassList.
+ (WebCore::StyledElement::classAttributeChanged):
+ * dom/StyledElement.h: ditto.
+ * html/ClassList.cpp: Added, mostly from original DOMTokenList.cpp.
+ (WebCore::ClassList::ClassList):
+ (WebCore::ClassList::ref):
+ (WebCore::ClassList::deref):
+ (WebCore::ClassList::length):
+ (WebCore::ClassList::item):
+ (WebCore::ClassList::contains):
+ (WebCore::ClassList::containsInternal):
+ (WebCore::ClassList::add):
+ (WebCore::ClassList::addInternal):
+ (WebCore::ClassList::remove):
+ (WebCore::ClassList::removeInternal):
+ (WebCore::ClassList::toggle):
+ (WebCore::ClassList::toString):
+ (WebCore::ClassList::reset):
+ (WebCore::ClassList::classNames):
+ * html/ClassList.h: Added, mostly from original DOMTokenList.h.
+ (WebCore::ClassList::create):
+ (WebCore::ClassList::element):
+ * html/DOMSettableTokenList.cpp: Added.
+ (WebCore::DOMSettableTokenList::DOMSettableTokenList):
+ (WebCore::DOMSettableTokenList::~DOMSettableTokenList):
+ (WebCore::DOMSettableTokenList::item):
+ (WebCore::DOMSettableTokenList::contains):
+ (WebCore::DOMSettableTokenList::add):
+ (WebCore::DOMSettableTokenList::addInternal):
+ (WebCore::DOMSettableTokenList::remove):
+ (WebCore::DOMSettableTokenList::removeInternal):
+ (WebCore::DOMSettableTokenList::toggle):
+ (WebCore::DOMSettableTokenList::setValue):
+ * html/DOMSettableTokenList.h: Added.
+ (WebCore::DOMSettableTokenList::create):
+ (WebCore::DOMSettableTokenList::ref):
+ (WebCore::DOMSettableTokenList::deref):
+ (WebCore::DOMSettableTokenList::length):
+ (WebCore::DOMSettableTokenList::toString):
+ (WebCore::DOMSettableTokenList::value):
+ * html/DOMSettableTokenList.idl: Added.
+ * html/DOMTokenList.cpp: Refactored to be an abstract interface for both of ClassList and DOMSettableTokenList.
+ (WebCore::DOMTokenList::validateToken): Changed to be a static member function of DOMTokenList.
+ (WebCore::DOMTokenList::addToken): Added, mostly from original DOMTokenList::addInternal().
+ (WebCore::DOMTokenList::removeToken): Added, mostly from original DOMTokenList::removeInternal().
+ * html/DOMTokenList.h: Refactored to be an abstract interface for both of ClassList and DOMSettableTokenList.
+ (WebCore::DOMTokenList::~DOMTokenList):
+ (WebCore::DOMTokenList::element):
+ * page/DOMWindow.cpp: Added an entry for DOMSettableTokenList.
+ * page/DOMWindow.idl: ditto.
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: make legacy resource tracking optional in the native code,
+ make cookeis work against new resource manager.
+ https://bugs.webkit.org/show_bug.cgi?id=48532
+
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::resourceStyleSheetText):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::~InspectorController):
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+ (WebCore::InspectorController::populateScriptObjects):
+ (WebCore::InspectorController::unbindAllResources):
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::frameDetachedFromParent):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::markResourceAsCached):
+ (WebCore::InspectorController::didReceiveResponse):
+ (WebCore::InspectorController::didReceiveContentLength):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::scriptImported):
+ (WebCore::InspectorController::setResourceTrackingEnabled):
+ (WebCore::InspectorController::getCookies):
+ (WebCore::InspectorController::deleteCookie):
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ (WebCore::InspectorController::breakpointsSettingKey):
+ (WebCore::InspectorController::getResourceContent):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::updateScriptObject):
+ (WebCore::InspectorResource::markFailed):
+ * inspector/InspectorResource.h:
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::populateObjectWithFrameResources):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._updateWithCookies):
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ (WebInspector.Resource.prototype._checkWarning):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype._updateResourceWithResponse):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ * inspector/front-end/inspector.js:
+ (WebInspector.forAllResources):
+ (WebInspector.updateResource):
+
+2010-10-29 MORITA Hajime <morrita@google.com>
+
+ Unreviewed attempt for fixing build break for http://trac.webkit.org/changeset/70847
+
+ * editing/EditingAllInOne.cpp:
+
+2010-10-29 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Support RegExp in V8 implementation of SerializedScriptValue
+ https://bugs.webkit.org/show_bug.cgi?id=44809
+
+ Add RegExp serialization/deserialization now that V8 provides API access
+ to the RegExp type.
+
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::ZigZag::Writer::writeRegExp):
+ (WebCore::ZigZag::Serializer::writeRegExp):
+ (WebCore::ZigZag::Serializer::doSerialize):
+ (WebCore::ZigZag::Reader::read):
+ (WebCore::ZigZag::Reader::readRegExp):
+
+2010-10-13 MORITA Hajime <morrita@google.com>
+
+ Reviewed by David Hyatt.
+
+ Navigating dark background websites results in blinding white flashes between pages.
+ https://bugs.webkit.org/show_bug.cgi?id=45640
+
+ This FOUC is caused by an early layout request before the <body> is ready,
+ and the page's background style given for <body>, instead of <html>.
+ So many sites have such stylesheets that we should care them.
+
+ - Some DOM operation such as 'element.offsetLeft' causes page layout.
+ - The page layout results page repaint
+ - The page page repaint makes a white screen. because there is nothing to paint
+ before <body> is available.
+
+ This change:
+ - extracted existing FOUC check on RenderBlock and RenderLayer to
+ Document::mayCauseFlashOfUnstyledContent(),
+ - checked <body> availability on mayCauseFlashOfUnstyledContent(), and
+ - added FOUC guards before requesting reapint on FrameView.
+
+ No new tests. The data loading speed matters and it cannot be
+ captured by DRT.
+
+ * dom/Document.cpp:
+ (WebCore::Document::mayCauseFlashOfUnstyledContent): Added.
+ * dom/Document.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::invalidateRect): Added a guard.
+ (WebCore::FrameView::repaintContentRectangle): Added a guard.
+ (WebCore::FrameView::doDeferredRepaints): Added a guard.
+ (WebCore::FrameView::shouldUpdate): Added.
+ * page/FrameView.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintContents): Replaced FOUC check to use mayCauseFlashOfUnstyledContent
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayer): Replaced FOUC check to use mayCauseFlashOfUnstyledContent
+
+2010-10-29 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48618
+
+ Backgrounds should clip to the border radius properly for vertical lines. The code that does this still assumes horizontal lines.
+ The testcase to cover this used nested spans, which also exposed a bug in the propagation of the vertical bit through the line
+ box tree.
+
+ Added fast/blockflow/border-radius-clipping-vertical-lr.html.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::createLineBoxes):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
+2010-10-26 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Refactoring: Spellchecking related static functions could form a class
+ https://bugs.webkit.org/show_bug.cgi?id=48287
+
+ Extracted spellcheck related static functions to TextCheckingHelper class,
+ which has EditorClient and Range as its member.
+
+ No new tests. Just a refactoring.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * editing/Editor.cpp:
+ (WebCore::Editor::advanceToNextMisspelling):
+ (WebCore::Editor::isSelectionUngrammatical):
+ (WebCore::Editor::guessesForUngrammaticalSelection):
+ (WebCore::Editor::guessesForMisspelledOrUngrammaticalSelection):
+ (WebCore::Editor::markMisspellingsAfterTypingToPosition):
+ (WebCore::Editor::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::markMisspellings):
+ (WebCore::Editor::markBadGrammar):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ (WebCore::Editor::changeBackToReplacedString):
+ * editing/Editor.h:
+ * editing/TextCheckingHelper.cpp: Added.
+ (WebCore::TextCheckingHelper::TextCheckingHelper):
+ (WebCore::TextCheckingHelper::~TextCheckingHelper):
+ (WebCore::TextCheckingHelper::paragraphAlignedRange):
+ (WebCore::TextCheckingHelper::findFirstMisspelling):
+ (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
+ (WebCore::TextCheckingHelper::findFirstGrammarDetail):
+ (WebCore::TextCheckingHelper::findFirstBadGrammar):
+ (WebCore::TextCheckingHelper::isUngrammatical):
+ (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
+ (WebCore::TextCheckingHelper::markAllMisspellings):
+ (WebCore::TextCheckingHelper::markAllBadGrammar):
+ * editing/TextCheckingHelper.h: Added.
+
+2010-10-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel, Peter Kasting, and Darin Fisher.
+ (Eric reviewed the CoreGraphics interactions, Peter reviewed the image
+ decoder interaction, and Darin Fisher SGTMed the policy decision.)
+
+ [chromium] Chromium Mac should use WebKit's image decoders
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ This patch teaches WebKit's image decoders how to talk to CoreGraphics.
+ This patch doesn't handle color profiles, but that will come in a
+ subsequent patch.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::createImage):
+ * platform/graphics/ImageSource.h:
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/cg: Added.
+ * platform/image-decoders/cg/ImageDecoderCG.cpp: Added.
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-28 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] GObject bindings generator issues
+ https://bugs.webkit.org/show_bug.cgi?id=48135
+
+ GObject code generator must not generate conditional API's. This
+ patch also adds an alternative return value for non-void
+ conditional methods. With this change the conditionalMethods hack
+ is no longer needed.
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+
+2010-10-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48569
+
+ Box shadows on vertical inlines don't paint properly. Fix the paintBoxShadow method to treat the edges to include as
+ logical (so that top/bottom are used instead of left/right for vertical lines). In order to make my box-shadow tests
+ work I had to fix a bug in the transform code of InlineTextBox that was causing the baselines of vertical lines to
+ be wrong.
+
+ Added fast/blockflow/box-shadow-* tests
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBoxShadow):
+ * rendering/RenderBoxModelObject.h:
+
+2010-10-28 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ iframes forced into slow scrolling mode by containing RenderLayer sometimes
+ https://bugs.webkit.org/show_bug.cgi?id=48570
+
+ Only performs the overlap test for RenderLayers that paint themselves. This
+ prevents marking RenderWidgets as being overlapped unnecessarily.
+
+ Test: fast/repaint/iframe-scroll-repaint.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::paintLayer):
+
+2010-10-28 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70814.
+ http://trac.webkit.org/changeset/70814
+ https://bugs.webkit.org/show_bug.cgi?id=48612
+
+ Caused media/controls-drag-timebar.html to fail on multiple
+ platforms (Requested by aroben on #webkit).
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seek):
+ * platform/graphics/MediaPlayer.cpp:
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+ * platform/graphics/win/QTMovie.cpp:
+ * platform/graphics/win/QTMovie.h:
+
+2010-10-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <rdar://problem/8597430> Crash triggered by incremental layout of block truncated by line-clamp
+ https://bugs.webkit.org/show_bug.cgi?id=48602
+
+ Test: fast/flexbox/line-clamp-crash.html
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::applyLineClamp): Even if the child needs layout, call clearTruncation(),
+ since layout itself may be partial and not touch the truncated line (but touch its markup box).
+
+2010-10-28 Jian Li <jianli@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ [chromium] UUID generation does not work in Linux that has sandbox
+ turned on
+ https://bugs.webkit.org/show_bug.cgi?id=48571
+
+ This is because we cannot access /proc when sandbox is on. The fix is to
+ use random numbers to construct UUID.
+
+ * platform/UUID.cpp:
+ (WebCore::createCanonicalUUIDString):
+
+2010-10-28 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Editing a word with misspell or autocorrection underline should remove the underline when the editing changes the word.
+ https://bugs.webkit.org/show_bug.cgi?id=48078
+ <rdar://problem/8579155>
+
+ Tests: platform/mac/editing/spelling/editing-multiple-words-with-markers.html
+ platform/mac/editing/spelling/editing-word-with-marker-1.html
+ platform/mac/editing/spelling/editing-word-with-marker-2.html
+
+ This patch is part of on-going improvement of autocorrection feature on Mac OS X. When an editing
+ occurs, if it affects words (by deleting/inserting characters, spliting word, merging words) that
+ have Spelling and/or CorrectionIndicator markers, we want to remove the markers. If subsequntial
+ spelling checking finds spelling error in newlly formed words, it will add the markers back in.
+
+ * dom/DocumentMarker.h: Changed MarkerType to bit masks to make search multiple types easier.
+
+ * dom/DocumentMarkerController.cpp: Refactored two removeMarkers() methods to support remove
+ markers with specific type from a node.
+ (WebCore::DocumentMarkerController::removeMarkers): Changed signature to remove marker with specific type.
+ (WebCore::DocumentMarkerController::removeMarkersFromMarkerMapVectorPair): Refactoring.
+ (WebCore::DocumentMarkerController::hasMarkers): Convenience method to search markers in range.
+
+ * dom/DocumentMarkerController.h: Added new methods and matched new signature of removeMarkers().
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::respondToChangedContents): Remove existing markers if the change formed new word.
+ (WebCore::Editor::cut): Remove markers on words that will be modified by this editing.
+ (WebCore::Editor::paste): Ditto.
+ (WebCore::Editor::pasteAsPlainText): Ditto.
+ (WebCore::Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited): Main logic for removing
+ markers on words affected by editing.
+
+ * editing/Editor.h: Added removeSpellAndCorrectionMarkersFromWordsToBeEdited(). Added
+ REMOVE_MARKERS_UPON_EDITING and SUPPORT_AUTOCORRECTION_PANEL macro to improve readability.
+
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::insertText): Remove markers on words that will be modified by this editing.
+ (WebCore::TypingCommand::deleteKeyPressed): Ditto.
+ (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
+
+2010-10-28 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ Part of <https://bugs.webkit.org/show_bug.cgi?id=45980>
+ userscripts/user-script-*-document.html tests are flaky on Windows
+
+ In WebFrameLoaderClient::committedLoad on Windows, we call through to PluginStream::didRecieveData
+ if our manual loader is a plugin stream, and we can call didRecieveData with a 0 length.
+
+ We shouldn't ASSERT that length is 0, because code paths exists where we call it with a 0 length.
+
+ This is tested by re-enabling user-script-plugin-document.html on Windows.
+
+ * plugins/PluginStream.cpp:
+ (WebCore::PluginStream::didReceiveData):
+
+2010-10-28 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ [Chromium] History related tests REGRESSED after r70723
+ https://bugs.webkit.org/show_bug.cgi?id=48513
+
+ Remove backItem(), forwardItem() and currentItem() from the Chromium
+ BackForwardList implementation, since they can use the base class
+ behavior now (which call itemAtIndex with -1, 1, and 0 respectively).
+
+ * history/BackForwardList.h:
+ * history/BackForwardListChromium.cpp:
+
+2010-10-28 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ chrome.dll!WebCore::Node::shadowAncestorNode ReadAV@NULL (98643190851b5662363449cc7303d8a5)
+ https://bugs.webkit.org/show_bug.cgi?id=47888
+
+ The crash was caused by the while loop in ApplyStyleCommand::fixRangeAndApplyInlineStyle
+ not considering the case where startNode is the root editable element.
+ Fixed the bug by not entering the loop when startNode is the editable root.
+
+ Test: editing/style/fix-range-from-root-editable-crash.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
+
+2010-10-28 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Build fix, some wrong changes slipped into the previous patch.
+ No new tests: build fix.
+
+ * platform/graphics/GraphicsLayer.h:
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::BitmapTextureGL::setContentsToImage):
+ * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+ (WebCore::TextureMapperNode::uploadTextureFromContent):
+ (WebCore::TextureMapperNode::paintRecursive):
+ * platform/qt/QWebPageClient.h:
+ (QWebPageClient::setRootGraphicsLayer):
+
+2010-10-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by James Robinson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48568
+
+ Backgrounds don't work right with vertical RenderInlines. Make background painting
+ do the right thing for vertical strips.
+
+ Added fast/blockflow/background-* tests
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintFillLayer):
+
+2010-10-28 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Seeking by very small increment doesn't generate 'seeked' event
+ https://bugs.webkit.org/show_bug.cgi?id=48530
+
+ Test: media/video-seek-by-small-increment.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::seek): Ask the media engine for its closest time value so we can
+ avoid asking it to seek to the current time.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::mediaTimeForTimeValue): New.
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::mediaTimeForTimeValue): Ditto.
+
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+ (WebCore::MediaPlayerPrivate::mediaTimeForTimeValue): Return the closest value in the movie's time scale.
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue): Ditto
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+
+ * platform/graphics/win/QTMovie.cpp:
+ (QTMovie::timeScale): Return the movie's time scale.
+ * platform/graphics/win/QTMovie.h:
+
+2010-10-28 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48443
+
+ Border images don't work right with vertical RenderInlines. Make border/mask/background painting
+ do the right thing for vertical strips.
+
+ Added fast/blockflow/border-image-* tests.
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ (WebCore::InlineFlowBox::paintMask):
+
+2010-10-28 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Port ContextMenuItemWin.cpp to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=48407
+
+ * platform/win/ContextMenuItemWin.cpp:
+
+2010-10-28 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ queryCommandValue should fall back to queryCommandState
+ https://bugs.webkit.org/show_bug.cgi?id=48479
+
+ Added a fallback to Command::value so that commands with a state function without a value function
+ returns the value returned by the state function as a string.
+
+ * editing/EditorCommand.cpp:
+ (WebCore::Editor::Command::value):
+
+2010-10-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Rolling out r70800.
+
+2010-10-28 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48551
+ HTMLDocument::isFrameSet() should not depend on renderer
+
+ No change in functionality, so no new tests.
+
+ * html/HTMLDocument.cpp: (WebCore::HTMLDocument::isFrameSet): Omit the check for renderer.
+
+ * rendering/RenderLayer.h: Removed unneeded includes and forward declarations.
+
+2010-10-28 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: make legacy resource tracking optional in the native code,
+ make cookeis work against new resource manager.
+ https://bugs.webkit.org/show_bug.cgi?id=48532
+
+ * inspector/InspectorCSSStore.cpp:
+ (WebCore::InspectorCSSStore::resourceStyleSheetText):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::~InspectorController):
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+ (WebCore::InspectorController::populateScriptObjects):
+ (WebCore::InspectorController::unbindAllResources):
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::frameDetachedFromParent):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::willSendRequest):
+ (WebCore::InspectorController::markResourceAsCached):
+ (WebCore::InspectorController::didReceiveResponse):
+ (WebCore::InspectorController::didReceiveContentLength):
+ (WebCore::InspectorController::didFinishLoading):
+ (WebCore::InspectorController::didFailLoading):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::scriptImported):
+ (WebCore::InspectorController::setResourceTrackingEnabled):
+ (WebCore::InspectorController::getCookies):
+ (WebCore::InspectorController::deleteCookie):
+ (WebCore::InspectorController::didCreateWebSocket):
+ (WebCore::InspectorController::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorController::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorController::didCloseWebSocket):
+ (WebCore::InspectorController::breakpointsSettingKey):
+ (WebCore::InspectorController::getResourceContent):
+ * inspector/InspectorController.h:
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::updateScriptObject):
+ (WebCore::InspectorResource::markFailed):
+ * inspector/InspectorResource.h:
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::populateObjectWithFrameResources):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype._mimeTypeIsConsistentWithType):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype._updateResourceWithResponse):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ * inspector/front-end/inspector.js:
+ (WebInspector.updateResource):
+
+2010-10-28 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: fix pausing on next JavaScript statement
+ https://bugs.webkit.org/show_bug.cgi?id=48534
+
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
+ (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+ (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
+ (WebCore::InspectorDebuggerAgent::pause):
+ (WebCore::InspectorDebuggerAgent::didPause):
+ * inspector/InspectorDebuggerAgent.h:
+
+2010-10-28 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by David Hyatt.
+
+ Fix for Bug 14550 - Non-layout style change does not update nested first-letter
+ https://bugs.webkit.org/show_bug.cgi?id=14550
+
+ If a render text fragment is accompanied by a first letter, update the
+ first letter's style when the fragment's style is changed.
+
+ Test: fast/css/first-letter-nested.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::styleDidChange): Stop calling updateFirstLetter
+ from here.
+ * rendering/RenderBlock.h: Make updateFirstLetter accessbile from
+ RenderTextFragment.
+ * rendering/RenderTextFragment.cpp:
+ (WebCore::RenderTextFragment::styleDidChange): If appropriate, update
+ first letter after removing stale cached pseudo style.
+ (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter): Helper
+ to get the block for the first letter.
+ * rendering/RenderTextFragment.h:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::removeCachedPseudoStyle): Remove the specified
+ pseudo style from cache.
+ * rendering/style/RenderStyle.h:
+
+2010-10-28 Benoit Jacob <bjacob@mozilla.com>
+
+ Reviewed by Kenneth Russell.
+
+ Ensure that WebGL stencil buffers are correctly initialized
+ https://bugs.webkit.org/show_bug.cgi?id=48351
+
+ * html/canvas/WebGLFramebuffer.cpp:
+ (WebCore::WebGLFramebuffer::initializeRenderbuffers):
+
+2010-10-28 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
+
+ Ensure that when selecting an item from a <select> element, it accounts for <optgroups>.
+
+ Test: platform/mac/accessibility/select-element-selection-with-optgroups.html
+
+ * accessibility/AccessibilityListBoxOption.cpp:
+ (WebCore::AccessibilityListBoxOption::setSelected):
+
+2010-10-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ No longer soft-link zlib
+ https://bugs.webkit.org/show_bug.cgi?id=48004
+
+ * platform/graphics/WOFFFileFormat.cpp:
+ (WebCore::convertWOFFToSfnt): Removed Windows-speciific code to soft-link
+ zlib.
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Work around a Mac driver bug in generateMipmap
+ https://bugs.webkit.org/show_bug.cgi?id=48489
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::generateMipmap): Make sure minFilter is set to NEAREST_MIPMAP_LINEAR before generateMipmap, and after the call, set it back to the original value.
+ * html/canvas/WebGLTexture.h:
+ (WebCore::WebGLTexture::getMinFilter): Return the cached minFilter value.
+
+2010-10-28 Mikhail Naganov <mnaganov@chromium.org>
+
+ [Chromium clang] Unreviewed. Fix forward declaration of 'struct FileMetadata'.
+
+ See http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Linux%20Debug%20Clang/builds/753/steps/compile/logs/stdio
+
+ * fileapi/FileSystemCallbacks.h:
+ * platform/AsyncFileSystemCallbacks.h:
+
+2010-10-28 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Bring backend-frontend message format to follow the protocol specification
+ https://bugs.webkit.org/show_bug.cgi?id=48406
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getStyles):
+ (WebCore::InspectorDOMAgent::applyStyleText):
+ (WebCore::InspectorDOMAgent::buildObjectForStyle):
+ (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
+ (WebCore::InspectorDOMAgent::buildObjectForStyleSheet):
+ (WebCore::InspectorDOMAgent::buildObjectForRule):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback):
+ (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun):
+ * inspector/front-end/CSSStyleModel.js:
+ (WebInspector.CSSStyleModel.parseRuleArrayPayload):
+ (WebInspector.CSSStyleModel.prototype.getStylesAsync):
+ (WebInspector.CSSStyleModel.prototype.getComputedStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.getInlineStyleAsync):
+ (WebInspector.CSSStyleModel.prototype.setCSSText):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.CSSStyleDeclaration):
+ (WebInspector.CSSStyleDeclaration.parsePayload):
+ (WebInspector.CSSStyleDeclaration.prototype.get allProperties):
+ (WebInspector.CSSStyleDeclaration.prototype.getLiveProperty):
+ (WebInspector.CSSStyleDeclaration.prototype.getPropertyValue):
+ (WebInspector.CSSStyleDeclaration.prototype.getPropertyPriority):
+ (WebInspector.CSSStyleDeclaration.prototype.getPropertyShorthand):
+ (WebInspector.CSSStyleDeclaration.prototype.isPropertyImplicit):
+ (WebInspector.CSSStyleDeclaration.prototype.getShorthandValue):
+ (WebInspector.CSSStyleDeclaration.prototype.getShorthandPriority):
+ (WebInspector.CSSStyleDeclaration.prototype.appendProperty):
+ (WebInspector.CSSStyleDeclaration.prototype.propertyAt):
+ (WebInspector.CSSRule):
+ (WebInspector.CSSRule.parsePayload):
+ (WebInspector.CSSRule.prototype.get isUserAgent):
+ (WebInspector.CSSRule.prototype.get isUser):
+ (WebInspector.CSSRule.prototype.get isViaInspector):
+ (WebInspector.CSSRule.prototype.get isRegular):
+ (WebInspector.CSSProperty):
+ (WebInspector.CSSProperty.parsePayload):
+ (WebInspector.CSSProperty.prototype.get propertyText):
+ (WebInspector.CSSProperty.prototype.get isLive):
+ (WebInspector.CSSProperty.prototype.get active):
+ (WebInspector.CSSProperty.prototype.get styleBased):
+ (WebInspector.CSSProperty.prototype.get inactive):
+ (WebInspector.CSSProperty.prototype.get disabled):
+ (WebInspector.CSSProperty.prototype.setText):
+ (WebInspector.CSSProperty.prototype.setValue):
+ (WebInspector.CSSProperty.prototype.setDisabled.callback):
+ (WebInspector.CSSProperty.prototype.setDisabled):
+ * inspector/front-end/MetricsSidebarPane.js:
+ (WebInspector.MetricsSidebarPane.prototype.update.callback):
+ (WebInspector.MetricsSidebarPane.prototype.update.inlineStyleCallback):
+ (WebInspector.MetricsSidebarPane.prototype.update):
+ (WebInspector.MetricsSidebarPane.prototype._update):
+ (WebInspector.MetricsSidebarPane.prototype.editingCommitted.callback):
+ (WebInspector.MetricsSidebarPane.prototype.editingCommitted.setEnabledValueCallback):
+ (WebInspector.MetricsSidebarPane.prototype.editingCommitted):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype.update):
+ (WebInspector.StylesSidebarPane.prototype._rebuildUpdate):
+ (WebInspector.StylesSidebarPane.prototype._refreshStyleRules):
+ (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules):
+ (WebInspector.StylesSidebarPane.prototype._markUsedProperties):
+ (WebInspector.StylesSidebarPane.prototype._containsInherited):
+ (WebInspector.StylePropertiesSection):
+ (WebInspector.StylePropertiesSection.prototype.isPropertyInherited):
+ (WebInspector.StylePropertiesSection.prototype.isPropertyOverloaded):
+ (WebInspector.StylePropertiesSection.prototype.onpopulate):
+ (WebInspector.StylePropertiesSection.prototype.addNewBlankProperty):
+ (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.successCallback):
+ (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted):
+ (WebInspector.ComputedStylePropertiesSection.prototype._isPropertyInherited):
+ (WebInspector.ComputedStylePropertiesSection.prototype.onpopulate):
+ (WebInspector.ComputedStylePropertiesSection.prototype.rebuildComputedTrace):
+ (WebInspector.StylePropertyTreeElement):
+ (WebInspector.StylePropertyTreeElement.prototype.get disabled):
+ (WebInspector.StylePropertyTreeElement.prototype.get name):
+ (WebInspector.StylePropertyTreeElement.prototype.get priority):
+ (WebInspector.StylePropertyTreeElement.prototype.get value):
+ (WebInspector.StylePropertyTreeElement.prototype.get parsedOk):
+ (WebInspector.StylePropertyTreeElement.prototype):
+ (WebInspector.StylePropertyTreeElement.prototype.):
+
+2010-10-27 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ WebKit needs to expose an Element::spellcheck attribute to javascript.
+ https://bugs.webkit.org/show_bug.cgi?id=25536
+
+ Published Element.spellcheck property on IDL, implemented it.
+
+ Tests: editing/spelling/spelling-attribute-change.html
+ fast/dom/HTMLElement/spellcheck.html
+
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::spellcheck):
+ (WebCore::HTMLElement::setSpellcheck):
+ * html/HTMLElement.h:
+ * html/HTMLElement.idl:
+
+2010-10-27 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: make debugger work against new resource manager.
+ https://bugs.webkit.org/show_bug.cgi?id=48376
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::identifierForInitialRequest):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::identifierForInitialRequest):
+ * inspector/InspectorResourceAgent.h:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set content):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype._updateResourceWithRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceManager.prototype._processCachedResources):
+ (WebInspector.ResourceManager.prototype._addFramesRecursively):
+ (WebInspector.ResourceManager.prototype.resourceForURL):
+ (WebInspector.ResourceManager.prototype.addConsoleMessage):
+ (WebInspector.ResourceManager.prototype.clearConsoleMessages):
+ (WebInspector.ResourceManager.prototype.forAllResources):
+ (WebInspector.ResourceManager.prototype._bindResourceURL):
+ (WebInspector.ResourceManager.prototype._unbindResourceURL):
+ (WebInspector.ResourceManager.getContent):
+ (WebInspector.ResourceTreeModel):
+ (WebInspector.ResourceTreeModel.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceTreeModel.prototype.addResourceToFrame):
+ (WebInspector.ResourceTreeModel.prototype._clearResources):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.addOrUpdateFrame):
+ * inspector/front-end/networkPanel.css:
+ (.network.panel .resources-dividers):
+
+2010-10-28 Andy Estes <aestes@apple.com>
+
+ One more Qt fix due to r70754.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::hasValidClassId):
+
+2010-10-28 Pascal Massimino <pascal.massimino@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ fix setSize() call flow: it was only called the first
+ time (when onlySize is true)
+ Bug URL: https://bugs.webkit.org/show_bug.cgi?id=48494
+
+ Testing: difficult to exercise the bug, as it requires
+ some manual flow (change tab, scroll,...)
+
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+ (WebCore::WEBPImageDecoder::decode):
+ fix: call setSize() even when onlySize is false
+
+2010-10-28 Andy Estes <aestes@apple.com>
+
+ Fix the Qt build after r70754.
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::hasValidClassId):
+ (WebCore::HTMLObjectElement::updateWidget):
+ * html/HTMLObjectElement.h:
+
+2010-10-28 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Fix a test failure introduced in r70748 by supporting Qt's non-standard
+ use of classid.
+ https://bugs.webkit.org/show_bug.cgi?id=45679
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::objectHasSupportedClassId): Return true if the object's
+ serviceType is 'application/x-qt-plugin'.
+ (WebCore::HTMLObjectElement::updateWidget): Do not render fallback
+ content if a non-empty classid is specified for a Qt plugin object.
+
+2010-10-28 Ivan Krstić <ike@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Remove unused experimental proxied panel interface.
+ <rdar://problem/7237059>
+
+ * WebCore.exp.in:
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+
+2010-10-27 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Barth.
+
+ r66156 broke AtlasCT library, formerly affected http://map.d.co.il/
+ https://bugs.webkit.org/show_bug.cgi?id=45679
+
+ This patch removes WebKit's map of classid values to MIME types. It also
+ changes the behavior of object elements to render fallback content when
+ a non-empty classid attribute is specified, which is the behavior HTML5
+ specifies when a UA encounters a classid it doesn't understand.
+
+ Test: fast/replaced/object-with-non-empty-classid-triggers-fallback.html
+
+ * html/HTMLObjectElement.cpp: Remove serviceTypeForClassId(),
+ createClassIdToTypeMap(), and the ClassIdToTypeMap typedef.
+ (WebCore::HTMLObjectElement::updateWidget): Do not call
+ serviceTypeForClassId() when there is no type attribute, and render
+ fallback content if the classid attribute is non-empty.
+
+2010-10-27 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Metadata queries should return full file info, not just modification time
+ https://bugs.webkit.org/show_bug.cgi?id=48098
+
+ LayoutTests that use this functionality via WorkerAsyncFileWriter are in review.
+
+ Build file changes to add FileMetadata.
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ The rest of the changes here just pass the new FileMetadata object through calls that used to take a modification time.
+ * platform/FileMetadata.h: Added.
+ (WebCore::FileMetadata::FileMetadata):
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::FileSystemCallbacksBase::didReadMetadata):
+ (WebCore::MetadataCallbacks::didReadMetadata):
+ * fileapi/FileSystemCallbacks.h:
+ * platform/AsyncFileSystemCallbacks.h:
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add VectorMath files
+ https://bugs.webkit.org/show_bug.cgi?id=48467
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/VectorMath.cpp: Added.
+ (WebCore::VectorMath::vsmul):
+ (WebCore::VectorMath::vadd):
+ * platform/audio/VectorMath.h: Added.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Fixup files affected by VectorMath and related API changes
+ https://bugs.webkit.org/show_bug.cgi?id=48481
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioBus.cpp:
+ * platform/audio/AudioChannel.cpp:
+ * platform/audio/Biquad.cpp:
+ * platform/audio/FFTConvolver.cpp:
+ * platform/audio/FFTConvolver.h:
+ * platform/audio/Panner.cpp:
+ (WebCore::Panner::create):
+ * platform/audio/Reverb.cpp:
+ (WebCore::calculateNormalizationScale):
+ (WebCore::Reverb::initialize):
+ (WebCore::Reverb::process):
+ * platform/audio/ReverbAccumulationBuffer.cpp:
+ * platform/audio/ReverbAccumulationBuffer.h:
+ * platform/audio/ReverbConvolver.cpp:
+ (WebCore::ReverbConvolver::ReverbConvolver):
+ (WebCore::ReverbConvolver::process):
+ * platform/audio/ReverbConvolver.h:
+ * platform/audio/ReverbConvolverStage.cpp:
+ (WebCore::ReverbConvolverStage::ReverbConvolverStage):
+ * platform/audio/ReverbConvolverStage.h:
+ * platform/audio/ReverbInputBuffer.h:
+
+2010-10-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ DOMFileSystem's reference should be kept while there're any active Entries/callbacks
+ https://bugs.webkit.org/show_bug.cgi?id=47535
+
+ Changed to keep DOMFileSystem's reference in each EntryBase, DirectoryReaderBase, EntryCallbacks and EntriesCallbacks.
+
+ Test: fast/filesystem/filesystem-reference.html
+
+ * fileapi/DOMFileSystemBase.cpp:
+ (WebCore::DOMFileSystemBase::readDirectory): Changed to pass/take
+ PassRefPtr but not a raw pointer.
+ * fileapi/DOMFileSystemBase.h:
+ * fileapi/DirectoryEntry.cpp:
+ (WebCore::DirectoryEntry::DirectoryEntry): Ditto.
+ (WebCore::DirectoryEntry::createReader):
+ * fileapi/DirectoryEntry.h:
+ (WebCore::DirectoryEntry::create): Ditto.
+ * fileapi/DirectoryEntrySync.cpp:
+ (WebCore::DirectoryEntrySync::DirectoryEntrySync): Ditto.
+ * fileapi/DirectoryEntrySync.h:
+ (WebCore::DirectoryEntrySync::create): Ditto.
+ * fileapi/DirectoryReader.h:
+ (WebCore::DirectoryReader::filesystem):
+ * fileapi/DirectoryReaderBase.h:
+ (WebCore::DirectoryReaderBase::filesystem):
+ * fileapi/Entry.cpp:
+ (WebCore::Entry::Entry): Ditto.
+ * fileapi/Entry.h:
+ (WebCore::Entry::filesystem):
+ * fileapi/EntryBase.h:
+ (WebCore::EntryBase::filesystem):
+ (WebCore::EntryBase::EntryBase): Ditto.
+ * fileapi/EntrySync.cpp:
+ (WebCore::EntrySync::create): Ditto.
+ (WebCore::EntrySync::getParent):
+ (WebCore::EntrySync::EntrySync): Ditto.
+ * fileapi/EntrySync.h:
+ (WebCore::EntrySync::filesystem):
+ * fileapi/FileEntry.cpp:
+ (WebCore::FileEntry::FileEntry): Ditto.
+ * fileapi/FileEntry.h:
+ (WebCore::FileEntry::create): Ditto.
+ * fileapi/FileEntrySync.cpp:
+ (WebCore::FileEntrySync::FileEntrySync): Ditto.
+ * fileapi/FileEntrySync.h:
+ (WebCore::FileEntrySync::create): Ditto.
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::EntriesCallbacks::create): Ditto.
+ (WebCore::EntriesCallbacks::EntriesCallbacks): Ditto.
+ * fileapi/FileSystemCallbacks.h:
+
+2010-10-27 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Fix for Bug 48310 - SVG font-face-name without name attribute causes a crash
+ https://bugs.webkit.org/show_bug.cgi?id=48310
+
+ Test: svg/custom/font-face-name-without-name-attr.svg
+
+ * svg/SVGFontFaceElement.cpp:
+ (WebCore::SVGFontFaceElement::rebuildFontFace): Don't create src
+ property if the src value list is empty.
+ * svg/SVGFontFaceSrcElement.cpp:
+ (WebCore::SVGFontFaceSrcElement::srcValue): Don't add empty src
+ values to the src value list.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Allow AudioDSPKernel to function without an AudioDSPKernelProcessor
+ https://bugs.webkit.org/show_bug.cgi?id=48472
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioDSPKernel.h:
+ (WebCore::AudioDSPKernel::AudioDSPKernel):
+ (WebCore::AudioDSPKernel::sampleRate):
+
+2010-10-27 Enrica Casucci <enrica@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Support Appkit key bindings and custom key bindings in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=48271
+ <rdar://problem/7660723>
+
+ * dom/KeyboardEvent.h:
+ (WebCore::KeypressCommand::KeypressCommand): Added default constructor and modified assert for text
+ insertion command constructor to support WebKit2 scenarios.
+ The default constructor is needed to support the generated WebKit2 message processing code.
+
+2010-10-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42322
+ rdar://problem/8193631
+
+ WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42333
+ rdar://problem/8193643
+
+ * WebCore.exp.in: Updated exports.
+
+ * history/BackForwardList.h: Added comments about future refactoring.
+ Moved functions that are not called inside WebCore into a separate
+ section, to be removed later. Added an isActive function to replace the
+ use of enabled() and entries().
+
+ * history/BackForwardListImpl.h: Removed isBackForwardListImpl.
+ Marked virtual function overrides virtual explicitly, except for the
+ ones that will be non-virtual once we make the changes above.
+ Added the isActive function.
+
+ * history/PageCache.cpp:
+ (WebCore::logCanCachePageDecision): Use isActive.
+ (WebCore::PageCache::canCache): Ditto.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::checkDidPerformFirstNavigation): Check
+ using currentItem, backItem, and forwardItem instead of
+ using entries.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::setUsesPageCache): Loop through the back/forward
+ list entries using backListCount and forwardListCount instead of
+ using entries.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Chris Marrin.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48279
+
+ No new tests since flag is disabled.
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioResamplerKernel files
+ https://bugs.webkit.org/show_bug.cgi?id=47624
+
+ No new tests since audio API is not yet implemented.
+
+ * platform/audio/AudioResamplerKernel.cpp: Added.
+ (WebCore::AudioResamplerKernel::AudioResamplerKernel):
+ (WebCore::AudioResamplerKernel::getSourcePointer):
+ (WebCore::AudioResamplerKernel::process):
+ (WebCore::AudioResamplerKernel::reset):
+ (WebCore::AudioResamplerKernel::rate):
+ * platform/audio/AudioResamplerKernel.h: Added.
+
+2010-10-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ REGRESSION(66511): CORDYS Process Factory doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=48453
+
+ When Ojan refactored this function in 66511, he missed an "else",
+ which causes us to generated HIERARCHY_REQUEST_ERR in some cases where
+ we're not supposed to. This patch restores the "else" behavior (using
+ an early return) and adds a test for the cases that caused problems in
+ the field.
+
+ Test: fast/dom/allowed-children.html
+
+ * dom/Node.cpp:
+ (WebCore::isChildTypeAllowed):
+
+2010-10-27 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=48385 Add WebKit
+ SPI to scale a WebView
+ -and corresponding-
+ <rdar://problem/8107667>
+
+ This patch adds SPI to Mac WebKit that scales the page by the given
+ scale factor. The scale factor is factored into the RenderStyle's
+ transform.
+
+ Set the current pageScale for the document.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForDocument):
+
+ Frame keeps track of the page scale factor. When
+ scalePage() is called, it modifies the RenderView's style to
+ include a transform of the appropriate scale and forces a style
+ recalc.
+ * page/Frame.cpp:
+ (WebCore::Frame::Frame):
+ (WebCore::Frame::scalePage):
+ * page/Frame.h:
+ (WebCore::Frame::pageScaleFactor):
+ * WebCore.exp.in:
+
+ Add a scale to the transformation matrix.
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::setPageScaleTransform):
+ * rendering/style/RenderStyle.h:
+
+2010-10-27 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r70335): Incorrect article layout in Safari Reader
+ https://bugs.webkit.org/show_bug.cgi?id=48436
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::getMatchedCSSRules): Return rules from all origins if the cross-origin
+ check is disabled.
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings): Initialize m_crossOriginCheckInGetMatchedCSSRulesDisabled.
+ * page/Settings.h:
+ (WebCore::Settings::setCrossOriginCheckInGetMatchedCSSRulesDisabled): Added this accessor.
+ (WebCore::Settings::crossOriginCheckInGetMatchedCSSRulesDisabled): Ditto.
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ refactor the nested large switch statements in GraphicsContext3DCG.cpp:getImageData()
+ https://bugs.webkit.org/show_bug.cgi?id=47027
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::doPacking): ASSERT false if undefined format is passed in.
+ * platform/graphics/GraphicsContext3D.h: Add kSourceFormatUndefined enum.
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::getSourceDataFormat): Decide source data format from componentsPerPixel, alpha format, bitsPerComponet, etc.
+ (WebCore::GraphicsContext3D::getImageData): Refactor the code to use getSourceDataFormat and remove nested switches.
+
+2010-10-27 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Use WTF::StringHasher::createBlobHash where possible
+ https://bugs.webkit.org/show_bug.cgi?id=48228
+
+ Replace StringImpl::computeHash with StringHasher::createBlobHash.
+ This removes many duplicated code.
+
+ * bindings/js/JSSVGPODTypeWrapper.h:
+ (WebCore::PODTypeWrapperCacheInfoHash::hash):
+ * page/SecurityOriginHash.h:
+ (WebCore::SecurityOriginHash::hash):
+ * platform/cf/SchedulePair.h:
+ (WebCore::SchedulePairHash::hash):
+ * platform/graphics/FontCache.cpp:
+ (WebCore::computeHash):
+ * platform/graphics/chromium/FontPlatformDataChromiumWin.h:
+ (WebCore::FontPlatformData::RefCountedHFONT::hash):
+ * platform/graphics/cocoa/FontPlatformData.h:
+ (WebCore::FontPlatformData::hash):
+ * platform/graphics/gtk/FontPlatformDataPango.h:
+ (WebCore::FontPlatformData::hash):
+ * platform/graphics/wince/FontPlatformData.cpp:
+ (WebCore::FixedSizeFontDataKeyHash::hash):
+ * platform/graphics/wx/FontPlatformDataWx.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::computeHash):
+ * plugins/PluginPackage.cpp:
+ (WebCore::PluginPackage::hash):
+ * plugins/win/PluginPackageWin.cpp:
+ (WebCore::PluginPackage::hash):
+ * svg/DeprecatedSVGAnimatedTemplate.h:
+ (WebCore::DeprecatedSVGAnimatedTypeWrapperKeyHash::hash):
+ * svg/properties/SVGAnimatedPropertyDescription.h:
+ (WebCore::SVGAnimatedPropertyDescriptionHash::hash):
+
+2010-10-27 Tony Chang <tony@chromium.org>
+
+ Unreviewed, build fix after r70692.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBorder):
+
+2010-10-27 Leandro Pereira <leandro@profusion.mobi>
+
+ Unreviewed. Build fix after r70651.
+
+ * CMakeListsEfl.txt: Add SoupURIUtils.cpp.
+
+2010-10-27 Crystal Zhang <haizhang@rim.com>
+
+ Reviewed by Eric Carlson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48446
+
+ Fix an issue where we were passing the wrong parameter
+ to MIMETypeRegistry::getMIMETypeForExtension().
+
+ * platform/MIMETypeRegistry.cpp:
+
+2010-10-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48449
+
+ Make border drawing work correctly with vertical inline flows. The top and bottom edge have to be omitted
+ rather than the left and right edges.
+
+ Also discovered that border-radius is broken with the new path-based-drawing code for all inline flows. This
+ is a regression from the old drawing code. I patched the code to be correct rather than clipping out stuff
+ that it shouldn't and applying border-radii on lines that don't even have them.
+
+ Added fast/blockflow/border-vertical-lr.html and fast/borders/border-radius-inline-flow.html
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintBorder):
+ (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
+ * rendering/RenderBoxModelObject.h:
+
+2010-10-27 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Cairo] Font fallback determination is very ineffecient
+ https://bugs.webkit.org/show_bug.cgi?id=42052
+
+ When choosing a fallback font in FontCache::getFontDataForCharacters, use FontConfig's
+ mechanism for searching the fallback list directly, instead of scanning the list manually.
+ If the font is a custom font or any other font with no FontConfig pattern associated with
+ it, as FontConfig for a font that can supply the missing glyphs.
+
+ Test: platform/gtk/fonts/custom-font-missing-glyphs.html
+
+ * platform/graphics/cairo/FontCacheFreeType.cpp:
+ (WebCore::createFontConfigPatternForCharacters): Added this helper which turns
+ a collection of unicode characters into a FontConfig pattern.
+ (WebCore::findBestFontGivenFallbacks): Using a FontConfig pattern created with th
+ above helper and a FcFontSet of fallback fonts, this helper will find a font in
+ the set which fulfills the requirments.
+ (WebCore::FontCache::getFontDataForCharacters): Given an existing font with missing
+ glyphs, either find an appropriate fallback font from the list of FontConfig fallbacks
+ or ask FontConfig directly for an appropriate font.
+ * platform/graphics/cairo/FontPlatformDataFreeType.h: Made a member mutable, as it is
+ initialized lazily.
+
+2010-10-27 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: "Reload Page and Audit on Load" fails to run audits when resource tracking is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=48431
+
+ * inspector/front-end/AuditsPanel.js:
+ (WebInspector.AuditsPanel.prototype._reloadResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._createPanelEnabler):
+ (WebInspector.ResourcesPanel.prototype._enableResourceTracking):
+
+2010-10-27 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Add a function to make sure child is allowed before adding to a
+ render view.
+ https://bugs.webkit.org/show_bug.cgi?id=48328
+
+ Test: fast/inline/inline-child-height-width-calc-crash.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::isChildAllowed):
+ * rendering/RenderView.h:
+
+2010-10-27 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] r69296 includes a cast from GdkWindow* to GtkWindow*
+ https://bugs.webkit.org/show_bug.cgi?id=48445
+
+ Pass the pageClient GtkWidget* to gtk_xtbin_new instead of the
+ GdkWindow*. The pageClient is used to get the proper visual for the
+ plugin container widget.
+
+ No new tests. This patch should prevent plugins/null-npp-getvalue-pointer.html
+ from crashing.
+
+ * plugins/gtk/PluginViewGtk.cpp:
+ (WebCore::PluginView::platformStart): Pass the widget instead of the window.
+ * plugins/gtk/gtk2xtbin.c: Accept the widget instead of the window.
+ (gtk_xtbin_new):
+ * plugins/gtk/gtk2xtbin.h: Update the declaration.
+
+2010-10-27 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by James Robinson.
+
+ [BREWMP] Port graphics backend
+ https://bugs.webkit.org/show_bug.cgi?id=40275
+
+ Add PLATFORM(BREWMP) guard to skia's FontCustomPlatformData
+ to share OS(LINUX) implementation.
+
+ * loader/CachedFont.cpp:
+ * platform/graphics/skia/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ (WebCore::createFontCustomPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h:
+
+2010-10-27 Satish Sampath <satish@chromium.org>
+
+ Unreviewed, rolling out r70665.
+ http://trac.webkit.org/changeset/70665
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ Need to address Alexey's review comments.
+
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-27 ZHenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Must enable GL_POINT_SPRITE in GraphicsContext3D implementations
+ https://bugs.webkit.org/show_bug.cgi?id=45908
+
+ * platform/graphics/mac/GraphicsContext3DMac.mm: Enable for Mac port.
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2010-10-27 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use the nearest
+ language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show and
+ http://codereview.chromium.org/3595018/show. The last of the 4 patches
+ depends also on the language tag validation provided by this patch:
+ https://bugs.webkit.org/show_bug.cgi?id=48225.
+
+ Test: fast/speech/input-text-language-tag.html
+
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-27 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48381
+
+ Make basic layer positioning work with vertical-lr writing-mode.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::paintFloats):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
+ (WebCore::RenderBox::locationOffsetIncludingFlipping):
+ * rendering/RenderBox.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updateLayerPosition):
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ object-deletion-behaviour.html fails with mesa backend
+ https://bugs.webkit.org/show_bug.cgi?id=46667
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): If object_type is 0, we return early because object_name should be always be 0.
+
+2010-10-27 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ If WebGL is running on top of a strict version of OpenGL ES it should make sure attribs have buffers assigned at all times
+ https://bugs.webkit.org/show_bug.cgi?id=47964
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::validateRenderingState): Minimum checking: if input <= 0, only check if each enabled vertex attribute is bound to a buffer.
+ (WebCore::WebGLRenderingContext::drawArrays): If underlying GL performs bounds checking, we still need to do the minimum checking using validateRenderingState.
+ (WebCore::WebGLRenderingContext::drawElements): Ditto.
+ * html/canvas/WebGLRenderingContext.h: Add a comment for input <= 0 in validateRenderingState.
+
+2010-10-27 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Accelerated animation with missing values in keyframes is broken
+ https://bugs.webkit.org/show_bug.cgi?id=48395
+
+ r66339 changed the behavior of keyframe animations such that if a property
+ is missing from a keyframe, the property will be interpolated between those
+ keyframes that do have a value for the property. If a value is missing
+ from the first or last keyframes, the element's unanimated style supplies
+ that value.
+
+ However, accelerated animations had a bug where if a value was missing
+ from the first (and maybe subsequent) or last (and maybe preceding) keyframes,
+ the animation data given to the GraphicsLayer would be missing the style from the
+ first or final keyframe.
+
+ Tests: animations/missing-values-first-keyframe.html
+ animations/missing-values-last-keyframe.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::startAnimation):
+
+2010-10-27 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ Calling the super class of RenderSVGImage::updateFromElement is missing
+ https://bugs.webkit.org/show_bug.cgi?id=48347
+
+ RenderSVGImage::updateFromElement is an inherited function of RenderSVGModelObject what needs calling its ancestor.
+ Lack of this call caused filters were not invalidated at SVGImage objects.
+
+ No new tests, because this modification is covered by SVGFEConvolveMatrixElement's dynamic update tests.
+
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::updateFromElement):
+
+2010-10-27 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Dirk Schulze.
+
+ Ignore invalid blend modes
+ https://bugs.webkit.org/show_bug.cgi?id=48371
+
+ Test: svg/filters/feBlend-invalid-mode.xhtml
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::apply):
+
+2010-10-27 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [Gtk] http/tests/xmlhttprequest/basic-auth-default.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=38956
+
+ Added a new utility function that turns SoupURIs into
+ KURLs. That addresses some issues with SoupURIs like for example
+ soup_uri_to_string ignoring the URI password. Basic authentication
+ using URL credentials should work now.
+
+ * GNUmakefile.am:
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+ * platform/network/soup/ResourceRequestSoup.cpp:
+ (WebCore::ResourceRequest::updateFromSoupMessage):
+ * platform/network/soup/ResourceResponseSoup.cpp:
+ (WebCore::ResourceResponse::updateFromSoupMessage):
+ * platform/network/soup/SoupURIUtils.cpp: Added.
+ (WebCore::soupURIToKURL):
+ * platform/network/soup/SoupURIUtils.h: Added.
+
+2010-10-27 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ Remove references to ancient QGVLauncher and QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=48430
+
+ * manual-tests/plugins/windowed.html: change to QtTestBrowser
+ * manual-tests/plugins/windowless.html: ditto
+
+2010-10-27 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [WINCE] Buildfix after r70400.
+ https://bugs.webkit.org/show_bug.cgi?id=48419
+
+ * platform/wince/TemporaryLinkStubs.cpp: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled):
+
+2010-10-27 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add runtime flag check before enabling speech input in code.
+ https://bugs.webkit.org/show_bug.cgi?id=48426
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isSpeechEnabled): Added runtime flag check.
+
+2010-10-27 Adam Roben <aroben@apple.com>
+
+ Only decompress pixel buffers when needed (and fix a crash in the
+ process)
+
+ Fixes <http://webkit.org/b/48417> Crash when running
+ compositing/video/video-background-color.html on Windows
+
+ Reviewed by Anders Carlsson.
+
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::paint): Only
+ decompress the pixel buffer when it has an incompatible format. This
+ also has the benefit of only decompressing the buffer when a
+ QTDecompressionSession has been created! (I assume this was just a typo
+ from when this code was added in r70252.)
+
+2010-10-27 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ getTextAtOffset returns incorrect results if a link includes text and an image
+ https://bugs.webkit.org/show_bug.cgi?id=47365
+
+ Properly consider text under a non-text renderer in textForObject.
+
+ We need to check all the children under a non-text renderer, if
+ any, to consider when current object is not a text object but some
+ of its children are, in order not to miss those portions of text
+ by not properly handling those situations.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (textForRenderer): New. Get the text for a RenderObject's children.
+ (textForObject): Use the new textForRenderer function.
+
+2010-10-26 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Rob Buis.
+
+ Convert SVGRect to the new SVGPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48204
+
+ Convert the next SVG primitive type to use the SVGPropertyTearOff concept: SVGRect.
+ Added new test verifying that StrictTypeChecking is enabled for SVGRect. Refactor and share code between JSC/V8/ObjC generators.
+
+ Test: svg/dom/SVGRect.html
+
+ * GNUmakefile.am: Add SVGAnimatedRect.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Refactor SVGPropertyTearOff handling, and share code between JSC/V8/ObjC generators.
+ * bindings/scripts/CodeGeneratorJS.pm: Ditto.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedRect handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAngle.idl: Remove [SVGProperty] flag.
+ * svg/SVGAnimatedAngle.idl: Remove [SVGAnimatedProperty] flag.
+ * svg/SVGAnimatedLength.idl: Ditto.
+ * svg/SVGAnimatedLengthList.idl: Ditto.
+ * svg/SVGAnimatedRect.h: Added.
+ * svg/SVGFitToViewBox.h: SVGRect now uses the new tear off concept, adapt code.
+ * svg/SVGLength.idl: Remove [SVGProperty] flag.
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGRect.idl: Remove [PODType] flag, add StrictTypeChecking to all attributes.
+ * svg/SVGSVGElement.cpp: s/setViewBox/setViewBoxBaseValue/.
+ (WebCore::SVGSVGElement::currentView):
+ (WebCore::SVGSVGElement::inheritViewAttributes):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewElement.h:
+ * svg/SVGViewSpec.cpp: Take a SVGElement as context element.
+ (WebCore::SVGViewSpec::SVGViewSpec):
+ * svg/SVGViewSpec.h: Ditto.
+ (WebCore::SVGViewSpec::contextElement):
+ * svg/SVGZoomEvent.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Support declaring animated properties on non-SVGElement types (here: SVGViewSpec), just like the old macros handled it.
+
+2010-10-27 Pavel Podivilov <podivilov@chromium.org>
+
+ Unreviewed, fix line endings in InspectorState.h
+
+ * inspector/InspectorState.h:
+
+2010-10-27 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: move frontend settings to local storage
+ https://bugs.webkit.org/show_bug.cgi?id=47715
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::didCommitLoad):
+ * inspector/InspectorController.h:
+ * inspector/InspectorState.cpp:
+ (WebCore::InspectorState::InspectorState):
+ * inspector/InspectorState.h:
+ * inspector/front-end/ConsoleView.js:
+ * inspector/front-end/EventListenersSidebarPane.js:
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel.prototype._createStatusbarButtons):
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype._createStatusbarButtons):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ (WebInspector.Settings.prototype.installApplicationSetting):
+ (WebInspector.Settings.prototype.installProjectSetting):
+ (WebInspector.Settings.prototype._get):
+ (WebInspector.Settings.prototype._set):
+ (WebInspector.Settings.prototype._getProjectSetting):
+ (WebInspector.Settings.prototype._setProjectSetting):
+ (WebInspector.Settings.prototype._formatProjectKey):
+ * inspector/front-end/StylesSidebarPane.js:
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSidebarPane):
+ (WebInspector.WatchExpressionsSidebarPane.prototype.reset):
+ * inspector/front-end/inspector.js:
+ (WebInspector.reset):
+
+2010-10-27 Andy Estes <aestes@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Siblings of floated elements should be cleared below the float if they
+ are too wide to fit in the containing block.
+ https://bugs.webkit.org/show_bug.cgi?id=48396
+
+ Test: fast/block/float/clear-element-too-wide-for-containing-block.html
+
+ WebKit did not clear elements adjacent to floats if they were wider than
+ the containing block, instead keeping them on the same line and allowing
+ them to spill out the right side of the containing block. We should
+ match the spec in this regard and clear the element below the float even
+ if it is too wide for the containing block. Doing this seems to also
+ match IE's and Firefox's behavior.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::getClearDelta): Continue to compute the clear
+ delta even if the child's minimum preferred width is greater than the
+ containing block's available width.
+
+2010-10-26 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Title-Element has no popup on <svg>-Elements, but on <g>
+ https://bugs.webkit.org/show_bug.cgi?id=47669
+
+ Allow tooltips on non-root svg elements.
+
+ No new tests.
+
+ * svg/SVGStyledElement.cpp:
+
+2010-10-26 Dai Mikurube <dmikurube@google.com>
+
+ Reviewed by Kent Tamura.
+
+ constraint validation: stepMismatch (rounding error)
+ https://bugs.webkit.org/show_bug.cgi?id=48220
+
+ 1. Changed the computation to achieve difference from a integral
+ multiple of the allowed value step.
+
+ The previous fmod(doubleValue, step) sometimes returned unacceptable
+ remainder. For example,
+ double doubleValue = 1.005; // Actually, near to 1.005
+ double step = 0.005; // Actually, near to 0.005
+ fmod(doubleValue, step) ==> (near to) 0.005
+ It's a case that doubleValue is a little smaller than 1.005 and step is
+ a little larger than 0.005.
+
+ 2. Changed the error threshold.
+
+ Number values in HTML5 are expressed in IEEE 754 single-precision.
+ Too precise comparison sometimes leads unintended errors.
+
+ For example, I found a case :
+ remainder = 0.00000000000000022204460
+ acceptableError = 0.00000000000000007105427
+
+ * html/NumberInputType.cpp:
+ (WebCore::NumberInputType::stepMismatch):
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add DelayNode files
+ https://bugs.webkit.org/show_bug.cgi?id=47516
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/DelayNode.cpp: Added.
+ (WebCore::DelayNode::DelayNode):
+ (WebCore::DelayNode::delayTime):
+ * webaudio/DelayNode.h: Added.
+ (WebCore::DelayNode::create):
+ (WebCore::DelayNode::delayProcessor):
+ * webaudio/DelayNode.idl: Added.
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ AudioContext and AudioNode followup changes for AudioNodeInput/AudioNodeOutput thread safety
+ https://bugs.webkit.org/show_bug.cgi?id=47504
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::isAudioThread):
+ (WebCore::AudioContext::isGraphOwner):
+ (WebCore::AudioContext::handlePreRenderTasks):
+ (WebCore::AudioContext::handlePostRenderTasks):
+ (WebCore::AudioContext::deleteMarkedNodes):
+ (WebCore::AudioContext::markAudioNodeInputDirty):
+ (WebCore::AudioContext::markAudioNodeOutputDirty):
+ (WebCore::AudioContext::handleDirtyAudioNodeInputs):
+ (WebCore::AudioContext::handleDirtyAudioNodeOutputs):
+ * webaudio/AudioContext.h:
+ * webaudio/AudioNode.cpp:
+ * webaudio/AudioNode.h:
+ (WebCore::AudioNode::isMarkedForDeletion):
+ * webaudio/AudioNode.idl:
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add DelayProcessor files
+ https://bugs.webkit.org/show_bug.cgi?id=47517
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/DelayProcessor.cpp: Added.
+ (WebCore::DelayProcessor::DelayProcessor):
+ (WebCore::DelayProcessor::~DelayProcessor):
+ (WebCore::DelayProcessor::createKernel):
+ * webaudio/DelayProcessor.h: Added.
+ (WebCore::DelayProcessor::delayTime):
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioNodeOutput files
+ https://bugs.webkit.org/show_bug.cgi?id=45581
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioNodeOutput.cpp: Added.
+ (WebCore::AudioNodeOutput::AudioNodeOutput):
+ (WebCore::AudioNodeOutput::setNumberOfChannels):
+ (WebCore::AudioNodeOutput::setInternalBus):
+ (WebCore::AudioNodeOutput::updateRenderingState):
+ (WebCore::AudioNodeOutput::updateNumberOfChannels):
+ (WebCore::AudioNodeOutput::propagateChannelCount):
+ (WebCore::AudioNodeOutput::pull):
+ (WebCore::AudioNodeOutput::bus):
+ (WebCore::AudioNodeOutput::renderingFanOutCount):
+ (WebCore::AudioNodeOutput::fanOutCount):
+ (WebCore::AudioNodeOutput::addInput):
+ (WebCore::AudioNodeOutput::removeInput):
+ (WebCore::AudioNodeOutput::disconnectAllInputs):
+ (WebCore::AudioNodeOutput::disable):
+ (WebCore::AudioNodeOutput::enable):
+ * webaudio/AudioNodeOutput.h: Added.
+ (WebCore::AudioNodeOutput::node):
+ (WebCore::AudioNodeOutput::context):
+ (WebCore::AudioNodeOutput::numberOfChannels):
+ (WebCore::AudioNodeOutput::isChannelCountKnown):
+
+2010-10-26 Chris Rogers <crogers@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Add AudioNodeInput files
+ https://bugs.webkit.org/show_bug.cgi?id=45577
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioNodeInput.cpp: Added.
+ (WebCore::AudioNodeInput::AudioNodeInput):
+ (WebCore::AudioNodeInput::connect):
+ (WebCore::AudioNodeInput::disconnect):
+ (WebCore::AudioNodeInput::disable):
+ (WebCore::AudioNodeInput::enable):
+ (WebCore::AudioNodeInput::changedOutputs):
+ (WebCore::AudioNodeInput::updateRenderingState):
+ (WebCore::AudioNodeInput::numberOfChannels):
+ (WebCore::AudioNodeInput::numberOfRenderingChannels):
+ (WebCore::AudioNodeInput::bus):
+ (WebCore::AudioNodeInput::internalSummingBus):
+ (WebCore::AudioNodeInput::sumAllConnections):
+ (WebCore::AudioNodeInput::pull):
+ * webaudio/AudioNodeInput.h: Added.
+ (WebCore::AudioNodeInput::node):
+ (WebCore::AudioNodeInput::context):
+ (WebCore::AudioNodeInput::numberOfRenderingConnections):
+ (WebCore::AudioNodeInput::renderingOutput):
+ (WebCore::AudioNodeInput::isConnected):
+ (WebCore::AudioNodeInput::numberOfConnections):
+
+2010-10-26 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ Rolling in r70512 again, added missing null-check to
+ Editor::isSpellCheckingEnabled().
+ http://trac.webkit.org/changeset/70512
+
+ spellcheck='' should be the same as spellcheck="true"
+ https://bugs.webkit.org/show_bug.cgi?id=25539
+
+ * dom/Element.cpp:
+ (WebCore::Element::spellcheckAttributeState):
+ (WebCore::Element::isSpellCheckingEnabled):
+ * dom/Element.h:
+ * editing/Editor.cpp:
+ (WebCore::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::isSpellCheckingEnabledInFocusedNode):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ * editing/Editor.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+
+2010-10-26 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed build fixes.
+
+ * WebCore.vcproj/WebCore.vcproj: Turn off several non-WinCairo
+ files. We don't support CoreAnimation!
+ * WebCore.vcproj/WebCoreCairo.vsprops: Add missing include path
+ for 'image-decoders/webp'
+ * platform/network/curl/CookieJarCurl.cpp:
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Add build stub.
+
+2010-10-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ Crash in CompositeEditCommand::splitTreeToNode
+ https://bugs.webkit.org/show_bug.cgi?id=48349
+
+ The bug was caused by indentIntoBlockquote's passing null pointer to splitTreeToNode.
+ Fixed the crash by adding early exits.
+
+ Test: editing/execCommand/indent-node-to-split-to-crash.html
+
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::splitTreeToNode):
+ * editing/IndentOutdentCommand.cpp:
+ (WebCore::IndentOutdentCommand::indentIntoBlockquote):
+
+2010-10-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ REGRESSION(r67170): crash in removeImplicitlyStyledElement
+ https://bugs.webkit.org/show_bug.cgi?id=48389
+
+ Fixed the crash by adding a null pointer check.
+
+ Test: editing/style/invalid-font-size.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
+
+2010-10-26 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r70573.
+ http://trac.webkit.org/changeset/70573
+ https://bugs.webkit.org/show_bug.cgi?id=48204
+
+ Broke 39 tests on Chromium
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h:
+ * svg/DeprecatedSVGAnimatedTemplate.h:
+ * svg/SVGAngle.idl:
+ * svg/SVGAnimatedAngle.idl:
+ * svg/SVGAnimatedLength.idl:
+ * svg/SVGAnimatedLengthList.idl:
+ * svg/SVGAnimatedRect.h: Removed.
+ * svg/SVGFitToViewBox.h:
+ * svg/SVGLength.idl:
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGRect.idl:
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::currentView):
+ (WebCore::SVGSVGElement::inheritViewAttributes):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl:
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewElement.h:
+ * svg/SVGViewSpec.cpp:
+ (WebCore::SVGViewSpec::SVGViewSpec):
+ * svg/SVGViewSpec.h:
+ (WebCore::SVGViewSpec::contextElement):
+ * svg/SVGZoomEvent.idl:
+ * svg/properties/SVGAnimatedPropertyMacros.h:
+
+2010-10-26 Anders Carlsson <andersca@apple.com>
+
+ Fix 32-bit build.
+
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::showGlyphsWithAdvances):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ Test: fast/frames/iframe-reparenting-fail-load.html
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::transferLoadingResourcesFromPage):
+ Added method that notifies the client to update resource tracking for
+ loading resources that have been transferred to a different page.
+ * loader/DocumentLoader.h:
+ * loader/EmptyClients.h:
+ (WebCore::EmptyFrameLoaderClient::transferLoadingResourceFromPage):
+ Empty method.
+ * loader/FrameLoader.h:
+ * loader/FrameLoader.cpp:
+ Added method that triggers resource tracking updates. This wraps
+ the DocumentLoader method as it appears DocumentLoader is opaque
+ to Frame.
+ * loader/FrameLoaderClient.h:
+ Added API to notify the client to update resource tracking for
+ a loading resource that has been transferred to a different page.
+ * page/Frame.cpp:
+ (WebCore::Frame::transferChildFrameToNewDocument):
+ Update resource tracking if page has changed.
+
+2010-10-26 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Rob Buis.
+
+ Convert SVGRect to the new SVGPropertyTearOff concept
+ https://bugs.webkit.org/show_bug.cgi?id=48204
+
+ Convert the next SVG primitive type to use the SVGPropertyTearOff concept: SVGRect.
+ Added new test verifying that StrictTypeChecking is enabled for SVGRect. Refactor and share code between JSC/V8/ObjC generators.
+
+ Test: svg/dom/SVGRect.html
+
+ * GNUmakefile.am: Add SVGAnimatedRect.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Refactor SVGPropertyTearOff handling, and share code between JSC/V8/ObjC generators.
+ * bindings/scripts/CodeGeneratorJS.pm: Ditto.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedRect handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAngle.idl: Remove [SVGProperty] flag.
+ * svg/SVGAnimatedAngle.idl: Remove [SVGAnimatedProperty] flag.
+ * svg/SVGAnimatedLength.idl: Ditto.
+ * svg/SVGAnimatedLengthList.idl: Ditto.
+ * svg/SVGAnimatedRect.h: Added.
+ * svg/SVGFitToViewBox.h: SVGRect now uses the new tear off concept, adapt code.
+ * svg/SVGLength.idl: Remove [SVGProperty] flag.
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGRect.idl: Remove [PODType] flag, add StrictTypeChecking to all attributes.
+ * svg/SVGSVGElement.cpp: s/setViewBox/setViewBoxBaseValue/.
+ (WebCore::SVGSVGElement::currentView):
+ (WebCore::SVGSVGElement::inheritViewAttributes):
+ * svg/SVGSVGElement.h:
+ * svg/SVGSVGElement.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewElement.h:
+ * svg/SVGViewSpec.cpp: Take a SVGElement as context element.
+ (WebCore::SVGViewSpec::SVGViewSpec):
+ * svg/SVGViewSpec.h: Ditto.
+ (WebCore::SVGViewSpec::contextElement):
+ * svg/SVGZoomEvent.idl: Remove [Immutable] flags for SVGRect types, no longer needed.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Support declaring animated properties on non-SVGElement types (here: SVGViewSpec), just like the old macros handled it.
+
+2010-10-26 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Advances are wrong and glyphs are rotated improperly in vertical writing
+ https://bugs.webkit.org/show_bug.cgi?id=48315
+
+ We shouldn't use vertical metrics for Roman fonts. Also, we should rotate vertical variant
+ glyphs back on drawing as the whole run has already been rotated beforehand.
+
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+ (WebCore::FontPlatformData::FontPlatformData): Changed to ignore vertical orientation when the font doesn't support vertical metrics.
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::showGlyphsWithAdvances): Changed to rotate glyphs -90 degree for vertical variants.
+ (WebCore::Font::drawGlyphs):
+
+2010-10-26 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add a 'grammar' attribute for speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=48339
+
+ To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
+ speech enabled input element. This is passed without validation to the speech recognizer. Typical values
+ could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
+ It is up to the recognizer to interpret the value and use it as an aid in recognition.
+
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::webkitGrammarEnabled):
+ * html/HTMLAttributeNames.in:
+ * html/HTMLInputElement.idl:
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: console does not work after two reloads.
+ https://bugs.webkit.org/show_bug.cgi?id=48318
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::disconnectFrontend):
+
+2010-10-26 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: console doesn't work in closures when window is overrode
+ https://bugs.webkit.org/show_bug.cgi?id=48320
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor.):
+
+2010-10-26 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix an assert with QtPixmapInstance creation.
+ https://bugs.webkit.org/show_bug.cgi?id=48323
+
+ This places the newly refcounted QtPixmapInstance in a RefPtr
+ to prevent an assert on the first ref() call.
+
+ * bridge/qt/qt_pixmapruntime.cpp:
+ (JSC::Bindings::QtPixmapInstance::createPixmapRuntimeObject):
+
+2010-10-26 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Input Method inserts conversion candidates unexpectedly
+ https://bugs.webkit.org/show_bug.cgi?id=46868
+
+ Calls updateStyleIfNeeded() before setting selection for the composition to
+ avoid inserting the previous composition text into a content editable element
+ which has an event handler that changes the style of the element.
+
+ Test: platform/chromium/fast/text/chromium-mac-duplicate-ime-composition.html
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::setComposition): calls updateStyleIfNeeded() before setting selection.
+
+2010-10-26 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] Layout tables should indicate that they are not data tables via an object attribute
+ https://bugs.webkit.org/show_bug.cgi?id=35422
+
+ Set the 'layout-guess' attribute to 'true' for data tables.
+
+ Reorganized some code in AccessibilityTable so now the function
+ isDataTable() is more coherent by just answering that very
+ specific question, regardless of whether the table is being
+ exposed or not to Assistive Technologies.
+
+ Hence, now it's possible to make two questions separately instead
+ of just one, meaning that the new function isAccessibleTable() is
+ now what we formerly defined as the isDataTable() function.
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isAccessibilityTable):
+ New function to allow asking tables both whether they are
+ exposed and whether they are data tables, which are different
+ questions whose answers might be the same in many situations,
+ but different sometimes (as it can happen in the GTK port).
+ * accessibility/AccessibilityTable.h:
+ * accessibility/AccessibilityTable.cpp:
+ (WebCore::AccessibilityTable::hasARIARole):
+ New, checks whether the table has a valid ARIA role.
+ (WebCore::AccessibilityTable::isAccessibilityTable):
+ New, returns the value of m_isAccessibilityTable. It's
+ basically the former isDataTable() function renamed.
+ (WebCore::AccessibilityTable::isDataTable):
+ Changed behaviour. Instead of just returning the value of
+ m_isAccessibilityTable as it did so far (which was confusing
+ because of that's not what the name suggests), focus on
+ checking whether it's a data table or not and return a bool
+ value accordingly. It's basically a rename of the former
+ isTableExposableThroughAccessibility() function, but withouth
+ the GTK-specific if-endif region (which didn't make sense
+ here now, because that was answering the question "is the table
+ exposed in the GTK port?", instead of "is it a data table?").
+ (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+ Uses the hasAriaRole(), and isDataTable() to determine whether
+ a table should be exposed or not. Also includes the GTK-specific
+ if-region coming from the former implementation of the function
+ isTableExposableThroughAccessibility() not to check whether it's
+ a data table in case the rest of the checks succeeded (all
+ tables are exposed in the GTK port).
+ (WebCore::AccessibilityTable::addChildren):
+ Replace usage of isDataTable() with isAccessibilityTable(), to
+ keep exactly the same behaviour happening before this patch.
+ (WebCore::AccessibilityTable::roleValue): Ditto.
+ (WebCore::AccessibilityTable::accessibilityIsIgnored): Ditto.
+ (WebCore::AccessibilityTable::title): Ditto.
+
+ Updated usage of the former function isDataTable() everywhere
+ else, replacing it with the new isAccessibilityTable(), so keeping
+ exactly the same behaviour happening before this patch.
+
+ * accessibility/AccessibilityARIAGrid.cpp:
+ (WebCore::AccessibilityARIAGrid::addChildren):
+ Use isAccessibilityTable() instead of isDataTable().
+ * accessibility/AccessibilityARIAGridCell.cpp:
+ (WebCore::AccessibilityARIAGridCell::parentTable): Ditto.
+ * accessibility/AccessibilityARIAGridRow.cpp:
+ (WebCore::AccessibilityARIAGridRow::disclosedRows): Ditto.
+ (WebCore::AccessibilityARIAGridRow::disclosedByRow): Ditto.
+ (WebCore::AccessibilityARIAGridRow::parentTable): Ditto.
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::isTableCell):
+ Use isAccessibilityTable() instead of isDataTable().
+ * accessibility/AccessibilityTableHeaderContainer.cpp:
+ (WebCore::AccessibilityTableHeaderContainer::addChildren): Ditto.
+ * accessibility/AccessibilityTableRow.cpp:
+ (WebCore::AccessibilityTableRow::isTableRow): Ditto
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+ Use isAccessibilityTable() instead of isDataTable().
+ (-[AccessibilityObjectWrapper accessibilityAttributeNames]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilityParameterizedAttributeNames]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilitySetValue:forAttribute:]): Ditto.
+ (-[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto.
+
+ Use the new function isAccessibilityTable() together with the
+ modified implementation of isDataTable() to set the 'layout-guess'
+ attribute when needed.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (webkit_accessible_get_attributes):
+ Set the 'layout-guess' attribute to 'true' to help Assistive
+ Technologies guessing which tables are not data tables.
+
+2010-10-26 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Resuming animations causes webkitAnimationStart events to be fired
+ https://bugs.webkit.org/show_bug.cgi?id=46540
+
+ Added a flag that makes sure start animation event is only ever
+ fired once.
+
+ Test: animations/suspend-resume-animation-events.html
+
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::KeyframeAnimation):
+ (WebCore::KeyframeAnimation::sendAnimationEvent):
+ * page/animation/KeyframeAnimation.h:
+
+2010-10-26 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added checks to ensure that events types are right before casting.
+ https://bugs.webkit.org/show_bug.cgi?id=48345
+
+ * html/ImageDocument.cpp:
+ (WebCore::ImageEventListener::handleEvent):
+ * inspector/InspectorDOMStorageResource.cpp:
+ (WebCore::InspectorDOMStorageResource::handleEvent):
+
+2010-10-26 Dai Mikurube <dmikurube@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Number values for form controls should be in the range of IEEE 754
+ single-precision floating point number
+ https://bugs.webkit.org/show_bug.cgi?id=48221
+
+ Changed the range of number values to fit in IEEE 754 single-precision
+
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::parseToDoubleForNumberType):
+ * html/NumberInputType.cpp:
+
+2010-10-26 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48157
+
+ Direction and writing-mode should propagate from the <body> to the <html> to the initial containing block.
+ Modify the existing code that propagates from the document element to also propagate from the body.
+
+ Fix the buggy code that was trying to dirty the body when the view changed size if it stretched to fill the
+ viewport. The code didn't consider the root element, and it only worked with one axis. I pulled it
+ out of calculateScrollbarModesForLayout, since it should never have been put there in the first place.
+
+ Added four new tests in fast/blockflow.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::initElement):
+ (WebCore::CSSStyleSelector::styleForDocument):
+ (WebCore::CSSStyleSelector::applyProperty):
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ * dom/Document.h:
+ (WebCore::Document::directionSetOnDocumentElement):
+ (WebCore::Document::writingModeSetOnDocumentElement):
+ (WebCore::Document::setDirectionSetOnDocumentElement):
+ (WebCore::Document::setWritingModeSetOnDocumentElement):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::calculateScrollbarModesForLayout):
+ (WebCore::FrameView::layout):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleDidChange):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::stretchesToViewport):
+
+2010-10-26 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Fix Cache::dumpStats formatting
+ https://bugs.webkit.org/show_bug.cgi?id=48286
+
+ This updates the column width in the dumpStats output to be wide enough
+ for all the titles. Previously one of the titles was too wide and crept
+ into later column space.
+
+ * loader/Cache.cpp:
+ (WebCore::Cache::dumpStats): make columns 13 characters wide.
+
+2010-10-26 Alexey Marinichev <amarinichev@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Check getGraphicsResetStatusARB and reinitialize the
+ renderer in an error is returned.
+ https://bugs.webkit.org/show_bug.cgi?id=47848
+
+ Tested by failure injection (stopping in the debugger and issuing a
+ jump as if an error has occurred).
+
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::setLayerRenderer):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebCore::LayerRendererChromium::transferRootLayer): added
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Touching inspector controller to kick gtk build, removing comments.
+
+ * inspector/InspectorController.cpp:
+ * inspector/front-end/ResourceManager.js:
+ * inspector/front-end/ScriptsPanel.js:
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: continue making resources panel optional.
+ https://bugs.webkit.org/show_bug.cgi?id=48261
+
+ This refactoring makes console, audits and extensions tests pass while taking data from
+ resources panel. Network panel as a source is to follow.
+
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain.populateResourcesForDocuments):
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ (WebInspector.ExtensionServer.prototype._onGetResources):
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype.buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ (WebInspector.NetworkPanel.prototype._reset):
+ (WebInspector.NetworkPanel.prototype.get resources):
+ (WebInspector.NetworkPanel.prototype.addResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set category):
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addResource):
+ (WebInspector.ResourcesPanel.prototype.removeResource):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+ (WebInspector.get networkResources):
+ (WebInspector.forAllResources):
+ (WebInspector.resourceForURL):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.reset):
+ (WebInspector.displayNameForURL):
+ (WebInspector.linkifyStringAsFragment):
+ (WebInspector.resourceURLForRelatedNode.callback):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-10-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+ Fix IndexedDB crashes
+ https://bugs.webkit.org/show_bug.cgi?id=48266
+
+ If IDBKey returns null, type conversion failed. Handle this case
+ in the bindings.
+
+ Change UNKNOWN_ERR to be 1 since 0 is hard coded to mean no error.
+ This is just a stop-gap move until we get it figured out in standards
+ land.
+
+ IDBObjectStore needs to handle null ranges.
+
+ It's actually OK for m_transaction to be non-null when hitting the
+ destructor. We just need to then remove it from the set of pending
+ transactions.
+
+ The transaction can become aborted in the middle of processing a
+ list of tasks. Fix this.
+
+ All changes (except the last 2 races) are tested in LayoutTests.
+ I couldn't find a way to reliably reproduce the races.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::idbKeyCallback):
+ * bindings/v8/IDBBindingUtilities.cpp:
+ (WebCore::createIDBKeyFromValue):
+ * storage/IDBDatabaseException.h:
+ * storage/IDBDatabaseException.idl:
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
+ * storage/IDBRequest.cpp:
+ (WebCore::IDBRequest::~IDBRequest):
+ (WebCore::IDBRequest::timerFired):
+ * storage/IDBTransactionBackendImpl.cpp:
+ (WebCore::IDBTransactionBackendImpl::taskTimerFired):
+
+2010-10-25 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Show cookie data in the request headers in network pane
+ https://bugs.webkit.org/show_bug.cgi?id=16531
+
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView): Factor out common cookies grid logic to CookiesTable
+ (WebInspector.CookieItemsView.prototype._populateDataGrid):
+ * inspector/front-end/CookieParser.js: Store cookie type (request/response) within a cookie.
+ (WebInspector.CookieParser.prototype.parseCookie):
+ (WebInspector.CookieParser.prototype.parseSetCookie):
+ (WebInspector.CookieParser.prototype._addCookie):
+ (WebInspector.Cookie):
+ * inspector/front-end/DataGrid.js:
+ (WebInspector.DataGrid.prototype.autoSizeColumns): Optionally, traverse nested nodes when looking for max field widths.
+ (WebInspector.DataGrid.prototype._enumerateChildren):
+ (WebInspector.DataGrid.prototype.updateWidths): Skip attempt to calculate column widths if grid is not attached to DOM tree yet.
+ * inspector/front-end/FontView.js:
+ (WebInspector.FontView.prototype.resize):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceView.prototype.resize):
+ (WebInspector.ResourceView.prototype._selectTab):
+ (WebInspector.ResourceView.prototype._selectCookiesTab):
+ (WebInspector.ResourceView.prototype._innerSelectContentTab):
+ (WebInspector.ResourceView.prototype._refreshRequestHeaders):
+ (WebInspector.ResourceView.prototype._refreshResponseHeaders):
+ (WebInspector.ResourceView.prototype._refreshHeaders):
+ (WebInspector.ResourceView.prototype._refreshCookies):
+ (WebInspector.ResourceCookiesTab):
+ (WebInspector.ResourceCookiesTab.prototype.set requestCookies):
+ (WebInspector.ResourceCookiesTab.prototype.set responseCookies):
+ (WebInspector.ResourceCookiesTab.prototype._populateDataGrid):
+ (WebInspector.ResourceCookiesTab.prototype._populateCookies):
+ (WebInspector.ResourceCookiesTab.prototype._createFolder):
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype.resize):
+ * inspector/front-end/inspector.css:
+ (.resource-view .resource-view-cookies):
+ (.resource-view.headers-visible .resource-view-cookies):
+ (.resource-view-cookies.table .data-grid):
+ (.resource-view-cookies .data-grid .row-group):
+
+2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70518.
+ http://trac.webkit.org/changeset/70518
+ https://bugs.webkit.org/show_bug.cgi?id=48332
+
+ Breaks inspector tests. (Requested by pfeldman on #webkit).
+
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ (WebInspector.ExtensionServer.prototype._onGetResources):
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype.buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ (WebInspector.NetworkPanel.prototype._reset):
+ (WebInspector.NetworkPanel.prototype.addResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set category):
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ (WebInspector.ResourceCategory.prototype.addResource):
+ (WebInspector.ResourceCategory.prototype.removeResource):
+ (WebInspector.ResourceCategory.prototype.removeAllResources):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addResource):
+ (WebInspector.ResourcesPanel.prototype.removeResource):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.reset):
+ (WebInspector.displayNameForURL):
+ (WebInspector.resourceForURL):
+ (WebInspector.linkifyStringAsFragment):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-10-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Quota for IndexedDB should be per origin not per database
+ https://bugs.webkit.org/show_bug.cgi?id=48064
+
+ Merge all databases for each origin into a single SQLiteDatabase.
+
+ Replace the awkward metaData table with a Database table.
+
+ Create a new IDBSQLiteDatabase class that wraps SQLiteDatabase
+ and implements weak pointer semantics for IDBFactory. It's ref
+ counted so multiple IDBDatabaseBackendImpls can share one.
+
+ Fix uniqueness constraints that were overly conservitive.
+
+ Get rid of the code that blows away existing data every time
+ the database is opened.
+
+ Get rid of the fairly useless indexedDB manual test and replace
+ it with one that verifies data persists.
+
+ Use name+origin (not just name) in our cache of IDBDatabaseBackend
+ objects (so one origin can't access anothers' data).
+
+ Test: storage/indexeddb/duplicates.html
+
+ * WebCore.gypi:
+ * manual-tests/indexed-database.html: Removed.
+ * manual-tests/indexeddb-persists.html: Added.
+ * storage/IDBDatabaseBackendImpl.cpp:
+ (WebCore::extractMetaData):
+ (WebCore::setMetaData):
+ (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
+ (WebCore::IDBDatabaseBackendImpl::setDescription):
+ (WebCore::IDBDatabaseBackendImpl::sqliteDatabase):
+ (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal):
+ (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
+ (WebCore::IDBDatabaseBackendImpl::loadObjectStores):
+ * storage/IDBDatabaseBackendImpl.h:
+ (WebCore::IDBDatabaseBackendImpl::create):
+ (WebCore::IDBDatabaseBackendImpl::id):
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::IDBFactoryBackendImpl::removeSQLiteDatabase):
+ (WebCore::openSQLiteDatabase):
+ (WebCore::createTables):
+ (WebCore::IDBFactoryBackendImpl::open):
+ (WebCore::IDBFactoryBackendImpl::databaseFileName):
+ * storage/IDBFactoryBackendImpl.h:
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::putObjectStoreData):
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+ * storage/IDBSQLiteDatabase.cpp: Added.
+ (WebCore::IDBSQLiteDatabase::IDBSQLiteDatabase):
+ (WebCore::IDBSQLiteDatabase::~IDBSQLiteDatabase):
+ * storage/IDBSQLiteDatabase.h: Added.
+ (WebCore::IDBSQLiteDatabase::create):
+ (WebCore::IDBSQLiteDatabase::db):
+
+2010-10-20 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Inspector needs to use cached resources to display image resources.
+ https://bugs.webkit.org/show_bug.cgi?id=16395
+
+ * inspector/Inspector.idl: Add base64Encode parameter to getContent
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::resourceContent):
+ * inspector/InspectorResourceAgent.h:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/ImageView.js:
+ (WebInspector.ImageView.prototype.contentTabSelected.onResourceContent):
+ (WebInspector.ImageView.prototype.contentTabSelected):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkDataGridNode.prototype._refreshNameCell.):
+ (WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource):
+ (WebInspector.Resource.prototype.set finished):
+ (WebInspector.Resource.prototype.getContent):
+ (WebInspector.Resource.prototype.get contentURL):
+ (WebInspector.Resource.prototype._requestContent.onResourceContent):
+ (WebInspector.Resource.prototype._requestContent):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourceSidebarTreeElement.prototype.createIconElement.):
+ (WebInspector.ResourceSidebarTreeElement.prototype.createIconElement):
+ * inspector/front-end/Settings.js: Added useDataURLForResourceImageIcons
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded):
+
+2010-10-26 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: continue making resources panel optional.
+ https://bugs.webkit.org/show_bug.cgi?id=48261
+
+ This refactoring makes console, audits and extensions tests pass while taking data from
+ resources panel. Network panel as a source is to follow.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::connectFrontend):
+ * inspector/front-end/AuditLauncherView.js:
+ (WebInspector.AuditLauncherView.prototype._createLauncherUI):
+ * inspector/front-end/AuditsPanel.js:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain.populateResourcesForDocuments):
+ (WebInspector.CookieItemsView.prototype._filterCookiesForDomain):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ (WebInspector.ExtensionServer.prototype._onGetResources):
+ (WebInspector.ExtensionServer.prototype._onGetResourceContent):
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HARLog.prototype.build):
+ (WebInspector.HARLog.prototype.buildMainResourceTimings):
+ (WebInspector.HARLog.prototype._convertResource):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel):
+ (WebInspector.NetworkPanel.prototype._reset):
+ (WebInspector.NetworkPanel.prototype.get resources):
+ (WebInspector.NetworkPanel.prototype.addResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set category):
+ * inspector/front-end/ResourceCategory.js:
+ (WebInspector.ResourceCategory):
+ (WebInspector.ResourceCategory.prototype.toString):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel):
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype.addResource):
+ (WebInspector.ResourcesPanel.prototype.removeResource):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype._resourceLoadingFinished):
+ (WebInspector.ScriptsPanel.prototype._breakpointAdded):
+ * inspector/front-end/Settings.js:
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype.updateTitle.linkifyURL):
+ * inspector/front-end/inspector.js:
+ (WebInspector._updateFocusedNode):
+ (WebInspector.get networkResources):
+ (WebInspector.forAllResources):
+ (WebInspector.resourceForURL):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.reset):
+ (WebInspector.displayNameForURL):
+ (WebInspector.linkifyStringAsFragment):
+ (WebInspector.resourceURLForRelatedNode.callback):
+ (WebInspector.resourceURLForRelatedNode):
+
+2010-10-26 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Protect the frame from being blown away in loadWithDocumentLoader function call.
+ dispatchBeforeLoadEvent can cause the frame to be freed, which gets later used in
+ continueLoadAfterNavigationPolicy call.
+ https://bugs.webkit.org/show_bug.cgi?id=48281
+
+ Test: fast/events/form-iframe-target-before-load-crash.html
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadWithDocumentLoader):
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Restore another mix-up in copy&paste error. Use height for the
+ vertical adjustments instead of width.
+
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::setVerticalAdjustment):
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Restore early return accidentally removed in previous
+ patch. Should make API tests pass again.
+
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::setHorizontalAdjustment):
+ (WebCore::ScrollView::setVerticalAdjustment):
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Port to new GtkScrollable interface in GTK+ 3.x
+ https://bugs.webkit.org/show_bug.cgi?id=48202
+
+ The new GtkScrollable API sets the adjustments individually, so
+ adjust the code for this fact.
+
+ * platform/ScrollView.h:
+ * platform/gtk/ScrollViewGtk.cpp:
+ (WebCore::ScrollView::setHorizontalAdjustment): new method to set the horizontal adjustment.
+ (WebCore::ScrollView::setVerticalAdjustment): new method to set the vertical adjustment.
+ (WebCore::ScrollView::setGtkAdjustments): make this just call the other two methods.
+
+2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70512.
+ http://trac.webkit.org/changeset/70512
+ https://bugs.webkit.org/show_bug.cgi?id=48314
+
+ crashes many tests (Requested by inferno-sec on #webkit).
+
+ * dom/Element.cpp:
+ * dom/Element.h:
+ * editing/Editor.cpp:
+ (WebCore::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::spellCheckingEnabledInFocusedNode):
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ * editing/Editor.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+
+2010-10-24 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ spellcheck='' should be the same as spellcheck="true"
+ https://bugs.webkit.org/show_bug.cgi?id=25539
+
+ - Added a check for empty string and missing attribute.
+ - Extracted the check to Element::spellCheckingEnabled()
+ - Introduced SpellcheckAttributeState enum to represent the
+ states for spellcheck attributes.
+
+ * dom/Element.cpp:
+ (WebCore::Element::spellcheckAttributeState): Added.
+ (WebCore::Element::isSpellCheckingEnabled): Added.
+ * dom/Element.h:
+ * editing/Editor.cpp:
+ (WebCore::markMisspellingsOrBadGrammar):
+ (WebCore::Editor::isSpellCheckingEnabledInFocusedNode): Renamed, partly extracted to Element::isSpellCheckingEnabled()
+ (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+ * editing/Editor.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::ContextMenu::populate):
+
+2010-10-25 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Refactor HTMLInputElement: Move createRender(), appendFormData(),
+ saveFormControlState() and restoreFormControlState() to InputTypes.
+ https://bugs.webkit.org/show_bug.cgi?id=47834
+
+ This change adds BaseButtonInputType and BaseCheckableInputType. They
+ are super classes of some concrete InputType classes.
+
+ No new tests. Just a code refactoring.
+
+ * CMakeLists.txt: Add BaseButtonInputType and BaseCheckableInputType files.
+ * GNUmakefile.am: ditto.
+ * WebCore.gypi: ditto.
+ * WebCore.pro: ditto.
+ * WebCore.vcproj/WebCore.vcproj: ditto.
+ * WebCore.xcodeproj/project.pbxproj: ditto.
+ * html/BaseButtonInputType.cpp: Added.
+ (WebCore::BaseButtonInputType::appendFormData):
+ (WebCore::BaseButtonInputType::createRenderer):
+ * html/BaseButtonInputType.h: Added.
+ (WebCore::BaseButtonInputType::BaseButtonInputType):
+ * html/BaseCheckableInputType.cpp: Added.
+ (WebCore::BaseCheckableInputType::saveFormControlState):
+ (WebCore::BaseCheckableInputType::restoreFormControlState):
+ (WebCore::BaseCheckableInputType::appendFormData):
+ * html/BaseCheckableInputType.h: Added.
+ (WebCore::BaseCheckableInputType::BaseCheckableInputType):
+ * html/ButtonInputType.h: Change the super class.
+ (WebCore::ButtonInputType::ButtonInputType):
+ * html/CheckboxInputType.h: Change the super class.
+ (WebCore::CheckboxInputType::CheckboxInputType):
+ * html/FileInputType.cpp:
+ (WebCore::FileInputType::appendFormData):
+ (WebCore::FileInputType::createRenderer):
+ * html/FileInputType.h: Change the super class.
+ (WebCore::FileInputType::FileInputType):
+ * html/HTMLFormControlElement.h:
+ Make placeholderShouldBeVisible() public for access from TextFieldInputType.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::saveFormControlState):
+ (WebCore::HTMLInputElement::restoreFormControlState):
+ (WebCore::HTMLInputElement::createRenderer):
+ (WebCore::HTMLInputElement::appendFormData):
+ * html/HTMLInputElement.h:
+ Add the following functions for ImageInputType and SubmitInputType.
+ (WebCore::HTMLInputElement::xPosition):
+ (WebCore::HTMLInputElement::yPosition):
+ * html/HiddenInputType.cpp:
+ (WebCore::HiddenInputType::createRenderer):
+ * html/HiddenInputType.h:
+ * html/ImageInputType.cpp:
+ (WebCore::ImageInputType::isFormDataAppendable):
+ (WebCore::ImageInputType::appendFormData):
+ (WebCore::ImageInputType::createRenderer):
+ * html/ImageInputType.h: Change the super class.
+ (WebCore::ImageInputType::ImageInputType):
+ * html/InputType.cpp:
+ (WebCore::InputType::saveFormControlState):
+ (WebCore::InputType::restoreFormControlState):
+ (WebCore::InputType::isFormDataAppendable):
+ (WebCore::InputType::appendFormData):
+ (WebCore::InputType::createRenderer):
+ * html/InputType.h:
+ * html/PasswordInputType.cpp:
+ (WebCore::PasswordInputType::saveFormControlState):
+ (WebCore::PasswordInputType::restoreFormControlState):
+ * html/PasswordInputType.h:
+ * html/RadioInputType.h: Change the super class.
+ (WebCore::RadioInputType::RadioInputType):
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::createRenderer):
+ * html/RangeInputType.h:
+ * html/ResetInputType.h:
+ (WebCore::ResetInputType::ResetInputType):
+ * html/SubmitInputType.cpp:
+ (WebCore::SubmitInputType::appendFormData):
+ * html/SubmitInputType.h: Change the super class.
+ (WebCore::SubmitInputType::SubmitInputType):
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::createRenderer):
+ * html/TextFieldInputType.h:
+
+2010-10-25 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix scrolling of noncomposited iframes within composited document
+ https://bugs.webkit.org/show_bug.cgi?id=47391
+
+ When an iframe that is painting into a compositing layer is scrolled,
+ we need to repaint via the RenderObject (which dirties the compositing layer contents),
+ rather than going out to hostWindow.
+
+ Test: compositing/iframes/composited-iframe-scroll.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollContentsSlowPath):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollContents):
+ (WebCore::ScrollView::scrollContentsSlowPath):
+ * platform/ScrollView.h:
+
+2010-10-25 Ryosuke Niwa <rniwa@webkit.org>
+
+ Unreviewed Qt build fix for r70496.
+
+ * bridge/qt/qt_instance.cpp:
+ (JSC::Bindings::QtInstance::numberValue):
+ * bridge/qt/qt_pixmapruntime.cpp:
+ (JSC::Bindings::QtPixmapWidthField::valueFromInstance):
+ (JSC::Bindings::QtPixmapHeightField::valueFromInstance):
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+ (JSC::Bindings::convertQVariantToValue):
+ (JSC::Bindings::QtRuntimeMetaMethod::lengthGetter):
+ (JSC::Bindings::QtRuntimeConnectionMethod::lengthGetter):
+
+2010-10-25 Andy Estes <aestes@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Source change by Simon Fraser.
+
+ Setting an element's visibility property to visible has no effect when
+ it has a hidden parent.
+ https://bugs.webkit.org/show_bug.cgi?id=48267
+
+ Test: fast/layers/visible-layer-with-hidden-parent.html
+
+ When a layer is hidden, there is an optimization that removes it from
+ the layer tree. If the layer is made visible again, it would only mark
+ its own stacking context's z-order list as dirty. If there are hidden
+ parent layers, they need to be marked dirty as well so layers with
+ visible descendents are re-added to the layer tree.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::setHasVisibleContent): Dirty the z-order lists of
+ all parent stacking context render layers up to and including the first
+ visible stacking context.
+
+2010-10-25 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Remove exec and globalData arguments from jsNumber
+ https://bugs.webkit.org/show_bug.cgi?id=48270
+
+ Mechanical removal of exec parameter to jsNumber.
+
+ * bindings/js/JSAudioConstructor.cpp:
+ (WebCore::JSAudioConstructor::JSAudioConstructor):
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::JSCSSStyleDeclaration::nameGetter):
+ * bindings/js/JSCoordinatesCustom.cpp:
+ (WebCore::JSCoordinates::altitude):
+ (WebCore::JSCoordinates::altitudeAccuracy):
+ (WebCore::JSCoordinates::heading):
+ (WebCore::JSCoordinates::speed):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::setTimeout):
+ (WebCore::JSDOMWindow::setInterval):
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::createAccelerationObject):
+ (WebCore::createRotationRateObject):
+ (WebCore::JSDeviceMotionEvent::interval):
+ * bindings/js/JSDeviceOrientationEventCustom.cpp:
+ (WebCore::JSDeviceOrientationEvent::alpha):
+ (WebCore::JSDeviceOrientationEvent::beta):
+ (WebCore::JSDeviceOrientationEvent::gamma):
+ * bindings/js/JSGeolocationCustom.cpp:
+ (WebCore::JSGeolocation::watchPosition):
+ * bindings/js/JSHTMLInputElementCustom.cpp:
+ (WebCore::JSHTMLInputElement::selectionStart):
+ (WebCore::JSHTMLInputElement::selectionEnd):
+ * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+ (WebCore::JSHTMLOptionsCollection::length):
+ * bindings/js/JSIDBKeyCustom.cpp:
+ (WebCore::toJS):
+ * bindings/js/JSInjectedScriptHostCustom.cpp:
+ (WebCore::InjectedScriptHost::createInjectedScript):
+ (WebCore::JSInjectedScriptHost::pushNodePathToFrontend):
+ * bindings/js/JSOptionConstructor.cpp:
+ (WebCore::JSOptionConstructor::JSOptionConstructor):
+ * bindings/js/JSSQLResultSetRowListCustom.cpp:
+ (WebCore::JSSQLResultSetRowList::item):
+ * bindings/js/JSSVGLengthCustom.cpp:
+ (WebCore::JSSVGLength::value):
+ * bindings/js/JSScriptProfileNodeCustom.cpp:
+ (WebCore::JSScriptProfileNode::callUID):
+ * bindings/js/JSWebGLRenderingContextCustom.cpp:
+ (WebCore::toJS):
+ * bindings/js/JSWorkerContextCustom.cpp:
+ (WebCore::JSWorkerContext::setTimeout):
+ (WebCore::JSWorkerContext::setInterval):
+ * bindings/js/JSWorkerContextErrorHandler.cpp:
+ (WebCore::JSWorkerContextErrorHandler::handleEvent):
+ * bindings/js/ScriptFunctionCall.cpp:
+ (WebCore::ScriptCallArgumentHandler::appendArgument):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::readTerminal):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bridge/c/c_instance.cpp:
+ (JSC::Bindings::CInstance::numberValue):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertNPVariantToValue):
+ * bridge/jni/jsc/JNIBridgeJSC.cpp:
+ (JavaField::valueFromInstance):
+ (JavaArray::valueAt):
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ (JavaInstance::numberValue):
+ (JavaInstance::invokeMethod):
+ * bridge/objc/objc_instance.mm:
+ (ObjcInstance::numberValue):
+ * bridge/objc/objc_utility.mm:
+ (JSC::Bindings::convertObjcValueToValue):
+ * bridge/runtime_array.cpp:
+ (JSC::RuntimeArray::lengthGetter):
+ * bridge/runtime_method.cpp:
+ (JSC::RuntimeMethod::lengthGetter):
+
+2010-10-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Allow embedder to pass on all the speech recognition results to the input element.
+ https://bugs.webkit.org/show_bug.cgi?id=48068
+
+ No new tests added as functionality has not changed, tests will be added in the next
+ patch where these results are exposed as an attribute to scripts.
+
+ * Android.mk: Added new source files.
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::setRecognitionResult): Accept an array instead of a single string.
+ * page/SpeechInput.h:
+ * page/SpeechInputListener.h:
+ * page/SpeechInputResult.cpp: Added, defines a class for managing a speech input result.
+ (WebCore::SpeechInputResult::create):
+ (WebCore::SpeechInputResult::SpeechInputResult):
+ (WebCore::SpeechInputResult::confidence):
+ (WebCore::SpeechInputResult::utterance):
+ * page/SpeechInputResult.h: Added.
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::timerFired):
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
+ * rendering/TextControlInnerElements.h:
+
+2010-10-25 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Support appending an ArrayBuffer object in BlobBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=47701
+
+ Test cases have been added to read-blob-test-cases.js.
+
+ * fileapi/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::getBuffer):
+ (WebCore::BlobBuilder::append): Removed bool return values since they
+ weren't used.
+ * fileapi/BlobBuilder.h:
+ * fileapi/BlobBuilder.idl:
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Glue layer (WebCoreSupport) changes to allow connecting TextureMapper to a Qt PageClient, i.e.
+ a QWebView or a QGraphicsWebView. This enables the new type, TextureMapperPlatformLayer, to be recognized both by
+ the compositor and by the page client.
+ Note that this is temporarily an opt-in, under USE(TEXTURE_MAPPER)
+
+ No new tests: the existing tests under LayoutTests/compositing already cover this.
+
+ * platform/graphics/GraphicsLayer.h:
+ * platform/qt/QWebPageClient.h:
+ (QWebPageClient::setRootGraphicsLayer):
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Add a config flag and a define (WTF_USE_TEXTURE_MAPPER) to WebCore, to enable opt-in compilation of texture-mapper with Qt.
+
+ No new tests: WIP for a new implementation.
+
+ * WebCore.pro:
+
+2010-10-25 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Calling FileReader.abort during reading could cause crash
+ https://bugs.webkit.org/show_bug.cgi?id=48163
+
+ Test: fast/files/file-reader-abort.html
+
+ * fileapi/FileReader.cpp:
+ (WebCore::delayedAbort):
+ (WebCore::FileReader::abort): Schedule to do the abort later to work
+ around the case that abort() could be called from event handler.
+ (WebCore::FileReader::doAbort):
+ (WebCore::FileReader::didFail): Do not go with normal error handling
+ when we are in the process of aborting.
+ (WebCore::FileReader::failed):
+ (WebCore::FileReader::readyState):
+ * fileapi/FileReader.h:
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Buildfix for NetworkStateNotifier
+ https://bugs.webkit.org/show_bug.cgi?id=48240
+
+ WinCE does not support RegisterWaitForSingleObject, so disable it for now.
+
+ * platform/network/win/NetworkStateNotifierWin.cpp:
+ (WebCore::NetworkStateNotifier::NetworkStateNotifier):
+
+2010-10-25 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48257
+
+ Make "rl" and "bt" writing-modes work for blocks and lines. InlineTextBox is refactored to compute the correct
+ top left corner and left baseline edge once so that can be passed down to all the painting functions instead of
+ tx and ty.
+
+ adjustment helpers have been added that can be called before painting children or lines and that fix up
+ the coordinates from flipped to physical.
+
+ Added fast/blockflow/english-rl-text.html and fast/blockflow/english-bt-text.html
+
+ * rendering/InlineBox.cpp:
+ (WebCore::InlineBox::adjustForFlippedBlocksWritingMode):
+ * rendering/InlineBox.h:
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paintBoxDecorations):
+ (WebCore::InlineFlowBox::paintMask):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::paintTextWithShadows):
+ (WebCore::InlineTextBox::paint):
+ (WebCore::InlineTextBox::paintSelection):
+ (WebCore::InlineTextBox::paintCompositionBackground):
+ (WebCore::InlineTextBox::paintDecoration):
+ (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ (WebCore::InlineTextBox::computeRectForReplacementMarker):
+ (WebCore::InlineTextBox::paintDocumentMarkers):
+ (WebCore::InlineTextBox::paintCompositionUnderline):
+ * rendering/InlineTextBox.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::paintFloats):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
+ * rendering/RenderBox.h:
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::isFlippedBlocksWritingMode):
+
+2010-10-25 Ben Murdoch <benm@google.com>
+
+ Reviewed by Steve Block.
+
+ Build break with ENABLE(BLOB) and not ENABLE(3D_CANVAS)
+ https://bugs.webkit.org/show_bug.cgi?id=48243
+
+ Build fix only so no new tests.
+
+ * bindings/generic/RuntimeEnabledFeatures.h: Guard appropriately.
+ * bindings/v8/custom/V8ArrayBufferViewCustom.h: ditto.
+
+2010-10-25 Cris Neckar <cdn@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added check to ensure that events with the type "mousedown" are mouse events before dispatching.
+ https://bugs.webkit.org/show_bug.cgi?id=48159
+
+ Test: fast/events/keyboardevent-mousedown-crash.html
+
+ * dom/Node.cpp:
+ (WebCore::Node::defaultEventHandler):
+
+2010-10-25 Kwang Yul Seo <skyul@company100.net>
+
+ Unreviewed build fix for r70400.
+
+ Add dummy setCookieStoragePrivateBrowsingEnabled.
+
+ * platform/brew/TemporaryLinkStubs.cpp: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled):
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Use default implementation of AXObjectCache::platformGenerateAXID
+ https://bugs.webkit.org/show_bug.cgi?id=48239
+
+ WinCE does not support NotifyWinEvent, so use the default implementation.
+
+ * accessibility/AXObjectCache.cpp:
+
+2010-10-25 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Need WebKit2 API to figure out if a frame can provide source
+ <rdar://problem/8424632>
+ https://bugs.webkit.org/show_bug.cgi?id=48252
+
+ * WebCore.exp.in:
+
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70451.
+ http://trac.webkit.org/changeset/70451
+ https://bugs.webkit.org/show_bug.cgi?id=48249
+
+ Broke set-unloaded-frame-location.html under Qt (Requested by
+ caseq on #webkit).
+
+ * ForwardingHeaders/wtf/text/TextPosition.h: Removed.
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/v8/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::ScheduledAction):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::eventHandlerLineNumber):
+ (WebCore::ScriptController::eventHandlerColumnNumber):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/ScriptEventListener.cpp:
+ (WebCore::createAttributeEventListener):
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ (WebCore::ScriptSourceCode::startLine):
+ * bindings/v8/V8LazyEventListener.cpp:
+ (WebCore::V8LazyEventListener::V8LazyEventListener):
+ (WebCore::V8LazyEventListener::prepareListenerObject):
+ * bindings/v8/V8LazyEventListener.h:
+ (WebCore::V8LazyEventListener::create):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::evaluate):
+ (WebCore::V8Proxy::runScript):
+ * bindings/v8/V8Proxy.h:
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::evaluate):
+ (WebCore::WorkerContextExecutionProxy::runScript):
+ * bindings/v8/WorkerContextExecutionProxy.h:
+ * bindings/v8/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * dom/PendingScript.cpp:
+ (WebCore::PendingScript::releaseElementAndClear):
+ * dom/PendingScript.h:
+ (WebCore::PendingScript::PendingScript):
+ (WebCore::PendingScript::operator=):
+ (WebCore::PendingScript::startingLineNumber):
+ * dom/ScriptableDocumentParser.h:
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::startElementNs):
+ (WebCore::XMLDocumentParser::endElementNs):
+ (WebCore::XMLDocumentParser::lineNumber):
+ (WebCore::XMLDocumentParser::columnNumber):
+ * dom/XMLDocumentParserQt.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::parseStartElement):
+ (WebCore::XMLDocumentParser::parseEndElement):
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
+ (WebCore::HTMLDocumentParser::columnNumber):
+ * html/parser/HTMLDocumentParser.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+ (WebCore::HTMLScriptRunner::execute):
+ (WebCore::HTMLScriptRunner::runScript):
+ * html/parser/HTMLScriptRunner.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::takeScriptToProcess):
+ (WebCore::HTMLTreeBuilder::processEndTag):
+ (WebCore::HTMLTreeBuilder::processScriptStartTag):
+ * html/parser/HTMLTreeBuilder.h:
+
+2010-10-25 Kwang Yul Seo <skyul@company100.net>
+
+ Unreviewed build fix for r70095.
+
+ Provide platformDefaultLanguage().
+
+ * platform/brew/LanguageBrew.cpp: Added.
+ (WebCore::platformDefaultLanguage):
+ * platform/brew/LocalizedStringsBrew.cpp:
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Replace _countof with WTF_ARRAY_LENGTH
+ https://bugs.webkit.org/show_bug.cgi?id=48229
+
+ * platform/win/FileSystemWin.cpp:
+ (WebCore::openTemporaryFile):
+ * platform/wince/FileSystemWinCE.cpp:
+ (WebCore::openTemporaryFile):
+ * plugins/win/PluginDatabaseWin.cpp:
+ (WebCore::addPluginPathsFromRegistry):
+ (WebCore::addWindowsMediaPlayerPluginDirectory):
+ (WebCore::addMacromediaPluginDirectories):
+
+2010-10-25 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48246
+
+ Make selectionRect() on InlineTextBox give the right value for a vertical line. Selection is still too broken
+ to test anything though.
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::selectionRect):
+
+2010-10-25 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ Typo in the TextureMapperGL
+ https://bugs.webkit.org/show_bug.cgi?id=48241
+
+ Fix the typo.
+
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGL::TextureMapperGL):
+
+2010-10-25 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: slowly make old resources panel optional (continued).
+ https://bugs.webkit.org/show_bug.cgi?id=48207
+
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set url):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.get toolbarItemLabel):
+ (WebInspector.StoragePanel.prototype.showResource):
+ (WebInspector.StoragePanel.prototype.searchMatchFound):
+ (WebInspector.StoragePanel.prototype._findTreeElementForResource):
+ (WebInspector.StoragePanel.prototype._findTreeElementForResource.getParent):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ * inspector/front-end/inspector.css:
+ (.storage.panel .sidebar):
+ (.storage.panel .sidebar li):
+ (.storage.panel .sidebar li.parent):
+ (.storage.panel .sidebar li.selected):
+ (.storage.panel .sidebar li .selection):
+ (.storage.panel .sidebar :focus li .selection):
+ (body.inactive .storage.panel .sidebar li .selection):
+ (.storage.panel .sidebar .icon):
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ This patch adds the OpenGL implementation of TextureMapper. See the other entries from bug 47070 for details.
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ No new tests. Part of a new implementation.
+
+ * platform/graphics/opengl/TextureMapperGL.cpp: Added.
+ * platform/graphics/opengl/TextureMapperGL.h: Added.
+
+2010-10-25 Peter Rybin <peter.rybin@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ HTML parser should provide script column position within HTML document to JavaScript engine
+ https://bugs.webkit.org/show_bug.cgi?id=45271
+
+ Replaces line number with TextPosition struct so that script engine
+ gets script starting line/column.
+
+ * ForwardingHeaders/wtf/text/TextPosition.h: Added.
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/v8/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::ScheduledAction):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::eventHandlerPosition):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/ScriptEventListener.cpp:
+ (WebCore::createAttributeEventListener):
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ (WebCore::ScriptSourceCode::startLine):
+ (WebCore::ScriptSourceCode::startPosition):
+ * bindings/v8/V8LazyEventListener.cpp:
+ (WebCore::V8LazyEventListener::V8LazyEventListener):
+ (WebCore::V8LazyEventListener::prepareListenerObject):
+ * bindings/v8/V8LazyEventListener.h:
+ (WebCore::V8LazyEventListener::create):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::evaluate):
+ (WebCore::V8Proxy::runScript):
+ * bindings/v8/V8Proxy.h:
+ * bindings/v8/WorkerContextExecutionProxy.cpp:
+ (WebCore::WorkerContextExecutionProxy::evaluate):
+ (WebCore::WorkerContextExecutionProxy::runScript):
+ * bindings/v8/WorkerContextExecutionProxy.h:
+ * bindings/v8/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * dom/PendingScript.cpp:
+ (WebCore::PendingScript::releaseElementAndClear):
+ * dom/PendingScript.h:
+ (WebCore::PendingScript::PendingScript):
+ (WebCore::PendingScript::operator=):
+ (WebCore::PendingScript::startingPosition):
+ * dom/ScriptableDocumentParser.h:
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::startElementNs):
+ (WebCore::XMLDocumentParser::endElementNs):
+ (WebCore::XMLDocumentParser::lineNumber):
+ (WebCore::XMLDocumentParser::columnNumber):
+ (WebCore::XMLDocumentParser::textPosition):
+ (WebCore::XMLDocumentParser::textPositionOneBased):
+ * dom/XMLDocumentParserQt.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::textPosition):
+ (WebCore::XMLDocumentParser::parseStartElement):
+ (WebCore::XMLDocumentParser::parseEndElement):
+ * html/parser/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
+ (WebCore::HTMLDocumentParser::textPosition):
+ * html/parser/HTMLDocumentParser.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+ (WebCore::HTMLScriptRunner::execute):
+ (WebCore::HTMLScriptRunner::runScript):
+ * html/parser/HTMLScriptRunner.h:
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::uninitializedPositionValue1):
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::takeScriptToProcess):
+ (WebCore::HTMLTreeBuilder::processEndTag):
+ (WebCore::HTMLTreeBuilder::processScriptStartTag):
+ * html/parser/HTMLTreeBuilder.h:
+
+2010-10-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: slowly make old resources panel optional.
+ https://bugs.webkit.org/show_bug.cgi?id=48207
+
+ * inspector/front-end/AuditsPanel.js:
+ (WebInspector.AuditsPanel.prototype._reloadResources):
+ (WebInspector.AuditsPanel.prototype.show):
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+ * inspector/front-end/ResourcesPanel.js:
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._sourceFrameForScriptOrResource):
+ (WebInspector.ScriptsPanel.prototype._sourceFrameForResource):
+ * inspector/front-end/inspector.js:
+ (WebInspector._createPanels):
+ (WebInspector.doLoadedDone.populateInspectorState):
+ (WebInspector.doLoadedDone):
+ (WebInspector.openResource):
+ (WebInspector.updateResource):
+ (WebInspector.domContentEventFired):
+ (WebInspector.loadEventFired):
+ (WebInspector.removeResource):
+ (WebInspector.displayNameForURL):
+ (WebInspector._choosePanelToShowSourceLine):
+ (WebInspector.doPerformSearch):
+
+2010-10-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add support for errors, warnings and search to the storage panel.
+ https://bugs.webkit.org/show_bug.cgi?id=48206
+
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.addMessage):
+ (WebInspector.ConsoleView.prototype.clearMessages):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set errors):
+ (WebInspector.Resource.prototype.set warnings):
+ (WebInspector.Resource.prototype.get searchMatches):
+ (WebInspector.Resource.prototype.set searchMatches):
+ (WebInspector.Resource.prototype.clearErrorsAndWarnings):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype._appendRedirect):
+ (WebInspector.ResourceManager.prototype.didReceiveResponse):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceManager.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceManager.prototype._addFramesRecursively):
+ (WebInspector.ResourceManager.prototype.resourceForURL):
+ (WebInspector.ResourceManager.prototype.addConsoleMessage):
+ (WebInspector.ResourceManager.prototype.clearConsoleMessages):
+ (WebInspector.ResourceTreeModel):
+ (WebInspector.ResourceTreeModel.prototype.addOrUpdateFrame):
+ (WebInspector.ResourceTreeModel.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceTreeModel.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceTreeModel.prototype._clearChildFramesAndResources):
+ (WebInspector.ResourceTreeModel.prototype.addResourceToFrame):
+ (WebInspector.ResourceTreeModel.prototype._clearResources):
+ (WebInspector.ResourceTreeModel.prototype._bindResourceURL):
+ (WebInspector.ResourceTreeModel.prototype._unbindResourceURL):
+ (WebInspector.ResourceTreeModel.prototype.resourceForURL):
+ (WebInspector.ResourceTreeModel.prototype.forAllResources):
+ (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.get toolbarItemLabel):
+ (WebInspector.StoragePanel.prototype.reset):
+ (WebInspector.StoragePanel.prototype.removeFrame):
+ (WebInspector.StoragePanel.prototype.canShowSourceLine):
+ (WebInspector.StoragePanel.prototype.showSourceLine):
+ (WebInspector.StoragePanel.prototype.showResource):
+ (WebInspector.StoragePanel.prototype._showResourceView):
+ (WebInspector.StoragePanel.prototype.updateMainViewWidth):
+ (WebInspector.StoragePanel.prototype.get searchableViews.callback):
+ (WebInspector.StoragePanel.prototype.get searchableViews):
+ (WebInspector.StoragePanel.prototype._forAllResourceTreeElements):
+ (WebInspector.StoragePanel.prototype.searchMatchFound):
+ (WebInspector.StoragePanel.prototype.searchCanceled.callback):
+ (WebInspector.StoragePanel.prototype.searchCanceled):
+ (WebInspector.StoragePanel.prototype.performSearch):
+ (WebInspector.StoragePanel.prototype.showView):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.BaseStorageTreeElement.prototype.set titleText):
+ (WebInspector.BaseStorageTreeElement.prototype.isEventWithinDisclosureTriangle):
+ (WebInspector.FrameResourceTreeElement):
+ (WebInspector.FrameResourceTreeElement.prototype.onselect):
+ (WebInspector.FrameResourceTreeElement.prototype.ondblclick):
+ (WebInspector.FrameResourceTreeElement.prototype.onattach):
+ (WebInspector.FrameResourceTreeElement.prototype._ondragstart):
+ (WebInspector.FrameResourceTreeElement.prototype._setBubbleText):
+ (WebInspector.FrameResourceTreeElement.prototype._resetBubble):
+ (WebInspector.FrameResourceTreeElement.prototype._searchMatchesUpdated):
+ (WebInspector.FrameResourceTreeElement.prototype._errorsWarningsUpdated):
+ * inspector/front-end/inspector.css:
+ (.storage.panel .sidebar):
+ (.storage.panel .outline-disclosure li):
+ (.storage.panel .outline-disclosure li.parent):
+ (.storage.panel .outline-disclosure li .selection):
+ (.storage.panel .outline-disclosure .icon):
+ (.storage.panel .base-storage-tree-element-title):
+ (.storage.panel .status):
+ (.storage.panel li .status .bubble):
+ (li .status):
+ (li .status:empty):
+ (li .status .bubble):
+ (li .status .bubble:empty):
+ (li.selected .status .bubble):
+ (:focus li.selected .status .bubble):
+ (body.inactive li.selected .status .bubble):
+ (li.selected .bubble.search-matches):
+ (:focus li.selected .bubble.search-matches):
+ (body.inactive li.selected .bubble.search-matches):
+
+2010-10-24 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Fix Qt minimal build break revealed by r70413.
+ https://bugs.webkit.org/show_bug.cgi?id=48185
+
+ * rendering/RenderMeter.h: Missing include added, needless include removed.
+
+2010-10-20 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Renumber FileError/FileException error codes per latest File API spec changes
+ https://bugs.webkit.org/show_bug.cgi?id=47936
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::setDOMException): Added FileExceptionType case.
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::setDOMException): Added FileExceptionType case.
+ * dom/ExceptionCode.cpp:
+ (WebCore::getExceptionCodeDescription): Added code for FileException.
+ * dom/ExceptionCode.h:
+ * fileapi/AsyncFileWriterClient.h:
+ * fileapi/DirectoryEntry.cpp:
+ (WebCore::DirectoryEntry::getFile):
+ (WebCore::DirectoryEntry::getDirectory):
+ (WebCore::DirectoryEntry::removeRecursively):
+ * fileapi/DirectoryEntrySync.cpp:
+ (WebCore::DirectoryEntrySync::getFile):
+ (WebCore::DirectoryEntrySync::getDirectory):
+ (WebCore::DirectoryEntrySync::removeRecursively):
+ * fileapi/DirectoryReaderSync.cpp:
+ (WebCore::DirectoryReaderSync::readEntries):
+ * fileapi/Entry.cpp:
+ (WebCore::Entry::getMetadata):
+ (WebCore::Entry::moveTo):
+ (WebCore::Entry::copyTo):
+ (WebCore::Entry::remove):
+ (WebCore::Entry::getParent):
+ * fileapi/EntrySync.cpp:
+ (WebCore::EntrySync::getMetadata):
+ (WebCore::EntrySync::moveTo):
+ (WebCore::EntrySync::copyTo):
+ (WebCore::EntrySync::remove):
+ * fileapi/FileError.h: Added error code enum.
+ (WebCore::FileError::create):
+ (WebCore::FileError::code):
+ (WebCore::FileError::FileError):
+ * fileapi/FileError.idl: Rebased error code numbers.
+ * fileapi/FileException.h: Added exception code enum.
+ (WebCore::FileException::ErrorCodeToExceptionCode): Added.
+ * fileapi/FileException.idl: Rebased exception code numbers.
+ * fileapi/FileReader.cpp:
+ (WebCore::FileReader::abort):
+ (WebCore::FileReader::failed):
+ (WebCore::FileReader::httpStatusCodeToErrorCode): Changed from
+ httpStatuCodeToExceptionCode.
+ * fileapi/FileReader.h:
+ * fileapi/FileReaderSync.cpp:
+ (WebCore::FileReaderSyncLoader::start):
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::FileSystemCallbacksBase::didFail):
+ * fileapi/FileWriter.cpp:
+ (WebCore::FileWriter::write):
+ (WebCore::FileWriter::seek):
+ (WebCore::FileWriter::truncate):
+ (WebCore::FileWriter::abort):
+ (WebCore::FileWriter::didFail):
+ (WebCore::FileWriter::setError):
+ * fileapi/FileWriter.h:
+ * fileapi/SyncCallbackHelper.h:
+ (WebCore::SyncCallbackHelper::SyncCallbackHelper):
+ (WebCore::SyncCallbackHelper::getResult):
+ (WebCore::SyncCallbackHelper::setError):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::requestFileSystem):
+ * workers/WorkerContext.cpp:
+ (WebCore::WorkerContext::requestFileSystem):
+ (WebCore::WorkerContext::requestFileSystemSync):
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Expose HitTestResult::absoluteMediaURL() via WebKit API
+ https://bugs.webkit.org/show_bug.cgi?id=48219
+
+ * WebCore.exp.in: Export HitTestResult::absoluteMediaURL().
+
+2010-10-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Dan Bernstein.
+
+ Need a way to determine the screen rect for a form control in WebKit2
+ <rdar://problem/8530670>
+ https://bugs.webkit.org/show_bug.cgi?id=48216
+
+ * WebCore.exp.in: Add export.
+ * dom/Element.cpp:
+ (WebCore::Element::boundsInWindowSpace):
+ * dom/Element.h:
+ Add function to return the bounding box in window (in ScrollView terminology) space,
+ this is the same space as the root viewport.
+
+2010-10-24 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] ImageBuffer::platformTransformColorSpace is unnecessarily slow
+ https://bugs.webkit.org/show_bug.cgi?id=48211
+
+ Grab the QImage::bits() and do direct access instead of going through
+ QImage::pixel() and QImage::setPixel().
+
+ This is a performance optimization, so no new tests.
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::ImageBuffer::platformTransformColorSpace):
+
+2010-10-24 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Filter example Chiseled from SVG Wow! is slow
+ https://bugs.webkit.org/show_bug.cgi?id=48174
+
+ Use a pointer to the ByteArray instead of the ref counted CanvasPixelArray or ImageData directly
+ to access the data for pixel manipulation on SVG Filters or SVG Masker. This is a
+ performance increase since the recurring use of the -> operator can be avoided.
+ FEConvolveMatrix and FELighting still need to change in a followup patch.
+
+ No functionality was changed. So, no new tests.
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::apply):
+ * platform/graphics/filters/FEColorMatrix.cpp:
+ (WebCore::luminance):
+ (WebCore::effectType):
+ (WebCore::FEColorMatrix::apply):
+ * platform/graphics/filters/FEComponentTransfer.cpp:
+ (WebCore::FEComponentTransfer::apply):
+ * platform/graphics/filters/FEComposite.cpp:
+ (WebCore::arithmetic):
+ (WebCore::FEComposite::apply):
+ * platform/graphics/filters/FEDisplacementMap.cpp:
+ (WebCore::FEDisplacementMap::apply):
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::boxBlur):
+ (WebCore::FEGaussianBlur::apply):
+ * platform/graphics/filters/FEMorphology.cpp:
+ (WebCore::FEMorphology::apply):
+ * platform/graphics/filters/FETurbulence.cpp:
+ (WebCore::FETurbulence::apply):
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+
+2010-10-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: polish network panel UI.
+ https://bugs.webkit.org/show_bug.cgi?id=48205
+
+ * inspector/front-end/Images/frame.png:
+ * inspector/front-end/Images/networkIcon.png:
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel.prototype._createTable):
+ (WebInspector.NetworkPanel.prototype._setLargerResources):
+ (WebInspector.NetworkPanel.prototype._toggleGridMode):
+ * inspector/front-end/networkPanel.css:
+ (.network.panel .data-grid td):
+ (.network.panel .data-grid.small td):
+ (#network-views .resource-view.headers-visible .resource-view-content):
+ (#network-views.small .resource-view.headers-visible .resource-view-content):
+ (#network-views .resource-view-headers):
+ (#network-views.small .resource-view-headers):
+ (#network-views .resource-view .tabbed-pane-header):
+ (#network-views.small .resource-view .tabbed-pane-header):
+
+2010-10-24 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
+ https://bugs.webkit.org/show_bug.cgi?id=48179
+
+ Fix WebGL tests. Accept 'boolean' as valid numeric type in StrictTypeChecking mode.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+
+2010-10-24 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
+ https://bugs.webkit.org/show_bug.cgi?id=48179
+
+ Speculative fix for the WebGL tests, I was not aware they're not run on Leopard, so I missed the breakage.
+
+ * bindings/scripts/CodeGeneratorJS.pm: Restore the order of type checking in the 'StrictTypeChecking' code.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+
+2010-10-23 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
+ https://bugs.webkit.org/show_bug.cgi?id=48179
+
+ Rewrite SVGAngle to use the new SVGPropertyTearOff concept, and consume much less memory.
+ Down from two floats, one string and an ushort to one float and one ushort. Synchronize value/valueInSpecifiedUnits/valueAsString on demand.
+
+ Adding an extensive SVGAngle test, that required to implement 'StrictTypeChecking' for attribute setters (was only implemented in V8/JSC for function cals so far).
+
+ Test: svg/dom/SVGAngle.html
+
+ * GNUmakefile.am: Add SVGAnimatedAngle.h to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/scripts/CodeGenerator.pm: Split IsPrimitiveType in IsPrimitiveType and IsNumericType.
+ * bindings/scripts/CodeGeneratorJS.pm: Implement 'StrictTypeChecking' for setters and recognize SVGAngle as new SVGPropertyTearOff type.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAngle handling.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Remove SVGAnimatedAngle handling.
+ * svg/SVGAngle.cpp: Rewrite, to consume less memory and to operate more efficient.
+ * svg/SVGAngle.h: Ditto.
+ * svg/SVGAngle.idl: Add 'StrictTypeChecking' to the value/valueInSpecifiedUnits methods.
+ * svg/SVGAnimatedAngle.h: Added.
+ * svg/SVGAnimatedAngle.idl: Mark as [SVGAnimatedProperty].
+ * svg/SVGMarkerElement.cpp:
+ (WebCore::SVGMarkerElement::parseMappedAttribute): SVGAngle::setValueAsString() now takes an ExceptionCode parameter.
+ * svg/SVGMarkerElement.h: s/ANIMATED_PROPERTY/ANIMATED_PROPERTY_NEW/ for the SVGAngle type.
+ * svg/SVGNumber.idl: Remove exception setter exceptions, which aren't needed. As we're now generating exception handlers in the bindings, it would lead to compile errors.
+ * svg/SVGPoint.idl: Ditto.
+ * svg/SVGRect.idl: Ditto.
+ * svg/SVGSVGElement.idl: Remove obsolete [SVGLiveProperty] flag.
+
+2010-10-23 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Barth.
+
+ Remove unused method HTMLFrameElementBase::setNameAndOpenURLCallback()
+ https://bugs.webkit.org/show_bug.cgi?id=48197
+
+ With the landing of the patch for bug #45365 in
+ changeset 67182 <http://trac.webkit.org/changeset/67182>,
+ HTMLFrameElementBase::setNameAndOpenURLCallback() is not needed.
+ Therefore, we remove it.
+
+ Before changeset 67182, HTMLFrameElementBase::attach() set up a post-attach
+ callback to HTMLFrameElementBase::setNameAndOpenURLCallback(). Changeset 67182
+ removed this callback.
+
+ No functionality was changed. So, no new tests.
+
+ * html/HTMLFrameElementBase.cpp: Remove HTMLFrameElementBase::setNameAndOpenURLCallback().
+ * html/HTMLFrameElementBase.h: Ditto.
+
+2010-10-23 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Sam Weinig.
+
+ Unify globalData APIs
+ https://bugs.webkit.org/show_bug.cgi?id=47969
+
+ Adapt code to JSGlobalObject::globalData returning a reference
+ instead of a pointer.
+
+ * bindings/js/JSCallbackData.cpp:
+ (WebCore::JSCallbackData::invokeCallback):
+ * bindings/js/JSCustomXPathNSResolver.cpp:
+ (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
+ * bindings/js/JSEventListener.cpp:
+ (WebCore::JSEventListener::handleEvent):
+ * bindings/js/JSWorkerContextCustom.cpp:
+ (WebCore::JSWorkerContext::markChildren):
+ * bindings/js/JSWorkerContextErrorHandler.cpp:
+ (WebCore::JSWorkerContextErrorHandler::handleEvent):
+ * bindings/js/ScheduledAction.cpp:
+ (WebCore::ScheduledAction::executeFunctionInContext):
+ * bindings/js/WorkerScriptController.cpp:
+ (WebCore::WorkerScriptController::evaluate):
+ * bridge/NP_jsobject.cpp:
+ (_NPN_InvokeDefault):
+ (_NPN_Invoke):
+ (_NPN_Evaluate):
+ (_NPN_Construct):
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Windows debug build fix.
+
+ * platform/network/cf/CookieStorageCFNet.cpp: Include MainThread.h for isMainThread().
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Windows build fix.
+
+ * platform/network/cf/CookieStorageCFNet.cpp:
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): It's adoptCF, not adoptPtr.
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ Added CookieStorage.h to build files that contain headers.
+
+ * WebCore.xcodeproj/project.pbxproj: Added CookieStorage.h and CookieStorageMac.mm.
+
+ * WebCore.exp.in: Export _wkSetCookieStoragePrivateBrowsingEnabled (WebKit initializes WKSI
+ on WebCore's behalf).
+
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+ More work for passing the function pointer down to WebCore.
+
+ * page/Settings.cpp: (WebCore::Settings::setPrivateBrowsingEnabled): Tell cookie manager to
+ when to use private browsing mode. Note that although this is a per-page setting, it
+ actually has global effect.
+
+ * page/Settings.h: Extended a comment about what private browsing does.
+
+ * platform/android/TemporaryLinkStubs.cpp: (setCookieStoragePrivateBrowsingEnabled):
+ * platform/chromium/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/efl/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/gtk/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/haiku/TemporaryLinkStubs.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ * platform/qt/TemporaryLinkStubsQt.cpp: (WebCore::setCookieStoragePrivateBrowsingEnabled):
+ Added an empty implementation for ports that don't implement private browsing, or implement
+ it in ways I cannot discover.
+
+ * platform/network/CookieStorage.h: Added. I'm not entirely sure how this is different from
+ CookieJar.h, just following a precedent already set by Windows port with CookieStorageWin.h.
+
+ * platform/network/mac/CookieStorageMac.mm: Added.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Call a WKSI function to enable private
+ browsing mode for cookies.
+
+ * platform/network/cf/CookieStorageCFNet.cpp:
+ (WebCore::currentCookieStorage): Added ASSERT(isMainThread()).
+ (WebCore::setCurrentCookieStorage): Ditto.
+ (WebCore::setCookieStoragePrivateBrowsingEnabled): Set cookie storage to a private one
+ when in private browsing mode. ResourceHandle applies the storage to each individual request.
+
+ * platform/network/cf/CookieStorageCFNet.h: Added a comment explaining that these functions
+ are only for WebKit1.
+
+2010-10-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48181> Add missing include of MacErrors.h
+
+ Reviewed by Alexey Proskuryakov.
+
+ * platform/network/mac/FormDataStreamMac.mm: Added #import of
+ <MacErrors.h> for iOS since the formOpen() method uses "fnfErr",
+ which was added in r55670. The same header is included through
+ <CoreServices/CoreServices.h> on Mac OS X.
+
+2010-10-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ [WINCE] Port COMPtr.h to WinCE
+ https://bugs.webkit.org/show_bug.cgi?id=48190
+
+ Don't include guiddef.h on WinCE. It's not required and only creates build problems.
+
+ * platform/win/COMPtr.h:
+
+2010-10-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ [WINCE] Rename SharedBitmap::createInstance to SharedBitmap::create
+ https://bugs.webkit.org/show_bug.cgi?id=48180
+
+ Also use better arguments for the create function.
+
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::getTransparentLayerBitmap):
+ (WebCore::TransparentLayerDC::TransparentLayerDC):
+ (WebCore::GraphicsContext::drawFrameControl):
+ * platform/graphics/wince/ImageBufferWinCE.cpp:
+ (WebCore::ImageBufferData::ImageBufferData):
+ * platform/graphics/wince/ImageWinCE.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-23 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r70369.
+ http://trac.webkit.org/changeset/70369
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ Caused weird artifacts in expected results.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::createImage):
+ * platform/graphics/ImageSource.h:
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::operator=):
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ * platform/image-decoders/cg/ImageDecoderCG.cpp: Removed.
+ * platform/image-decoders/haiku/ImageDecoderHaiku.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ * platform/image-decoders/openvg/ImageDecoderOpenVG.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ * platform/image-decoders/wx/ImageDecoderWx.cpp:
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ WebP decoding hits ASSERT
+ https://bugs.webkit.org/show_bug.cgi?id=48168
+
+ Calling reserveCapacity only allocates the memory. It doesn't actually
+ set the length. When you try to access the zeroth element, you hit an
+ ASSERT.
+
+ Covered by fast/images/webp-image-decoding.html in debug.
+
+ * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+ (WebCore::WEBPImageDecoder::decode):
+
+2010-10-23 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Menu list buttons do react properly to CSS styling
+ https://bugs.webkit.org/show_bug.cgi?id=48099
+
+ Correct the way that menu list buttons get their necessary padding from
+ GTK+. Instead of resetting the padding to these values, return them via
+ the popupInternalPadding* methods. Add implementations for *MenuListButton*
+ methods.
+
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::getComboBoxPadding): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingLeft): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingRight): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingTop): Added.
+ (WebCore::RenderThemeGtk::popupInternalPaddingBottom): Added.
+ (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not reset CSS
+ properties, instead rely on the poupInternalPadding* methods.
+ (WebCore::RenderThemeGtk::adjustMenuListButtonStyle): Added.
+ (WebCore::RenderThemeGtk::paintMenuListButton): Added.
+ * platform/gtk/RenderThemeGtk.h: Added new method declarations.
+
+2010-10-23 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Add Gradient::hasAlpha
+ https://bugs.webkit.org/show_bug.cgi?id=48183
+
+ WinCE can do some performance improvements if the gradient is opaque.
+
+ * platform/graphics/Gradient.cpp:
+ (WebCore::Gradient::hasAlpha):
+ * platform/graphics/Gradient.h:
+
+2010-10-23 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by David Kilzer.
+
+ [EFL] Implement platformDefaultLanguage()
+ https://bugs.webkit.org/show_bug.cgi?id=48113
+
+ Implement the platformDefaultLanguage() function for EFL port.
+
+ * platform/efl/LanguageEfl.cpp:
+ (WebCore::platformDefaultLanguage):
+
+2010-10-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70367.
+ http://trac.webkit.org/changeset/70367
+ https://bugs.webkit.org/show_bug.cgi?id=48176
+
+ It made 8-10 tests crash on Qt bot (Requested by Ossy on
+ #webkit).
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::MainResourceLoader):
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ (WebCore::MainResourceLoader::didReceiveResponse):
+ (WebCore::MainResourceLoader::setDefersLoading):
+ * loader/MainResourceLoader.h:
+
+2010-10-22 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adam Roben and Sam Weinig.
+
+ WebKit shouldn't load a plug-in based on file extension if a MIME type
+ is specified.
+ https://bugs.webkit.org/show_bug.cgi?id=48046
+
+ The fix landed in r70332 only covered the Mac port. Implement this fix
+ for other ports as well.
+
+ * plugins/PluginDatabase.cpp:
+ (WebCore::PluginDatabase::findPlugin):
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel, Peter Kasting, and Darin Fisher.
+ (Eric reviewed the CoreGraphics interactions, Peter reviewed the image
+ decoder interaction, and Darin Fisher SGTMed the policy decision.)
+
+ [chromium] Chromium Mac should use WebKit's image decoders
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ This patch teaches WebKit's image decoders how to talk to CoreGraphics.
+ This patch doesn't handle color profiles, but that will come in a
+ subsequent patch.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * loader/CachedImage.cpp:
+ (WebCore::CachedImage::createImage):
+ * platform/graphics/ImageSource.h:
+ * platform/image-decoders/ImageDecoder.cpp:
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/cg: Added.
+ * platform/image-decoders/cg/ImageDecoderCG.cpp: Added.
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+
+2010-10-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Barth and Darin Adler.
+
+ Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48014
+ <rdar://problem/8202716>
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ Resume loading.
+
+ (WebCore::MainResourceLoader::didReceiveResponse):
+ Defer loading until we hear back from the policy client.
+
+2010-10-22 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ REGRESSION(66391): http://ligth-arts.all-up.com/ crashes in EventHandler::selectCursor
+ https://bugs.webkit.org/show_bug.cgi?id=47942
+
+ Add checks for a NULL StyleImage in a CursorList.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::loadPendingImages):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectCursor):
+ * rendering/style/CursorList.h:
+ (WebCore::CursorList::at):
+ * manual-tests/cursor-empty-url.html: Added.
+ * manual-tests/resources/cursor-empty-url.css: Added.
+
+2010-10-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48156
+
+ Make vertical lines hit test properly and show a vertical i-beam cursor. Numerous bugs with overflow were discovered while getting this to work,
+ so these are in the patch as well. The broken layout tests are fixed by the overflow bug fixes as well (which just restore the old behavior).
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectCursor):
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::width):
+ (WebCore::InlineBox::height):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
+ (WebCore::InlineFlowBox::computeBlockDirectionOverflow):
+ (WebCore::InlineFlowBox::nodeAtPoint):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::logicalTopVisibleOverflow):
+ (WebCore::InlineFlowBox::logicalBottomVisibleOverflow):
+ (WebCore::InlineFlowBox::visibleOverflowRect):
+ (WebCore::InlineFlowBox::layoutOverflowRect):
+ (WebCore::InlineFlowBox::logicalTopLayoutOverflow):
+ (WebCore::InlineFlowBox::logicalBottomLayoutOverflow):
+ (WebCore::InlineFlowBox::visualOverflowRect):
+ (WebCore::InlineFlowBox::logicalTopVisualOverflow):
+ (WebCore::InlineFlowBox::logicalBottomVisualOverflow):
+ (WebCore::InlineFlowBox::setBlockDirectionOverflowPositions):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::nodeAtPoint):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::blockDirectionOverflow):
+ * rendering/RenderBox.h:
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::hitTest):
+
+2010-10-22 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ <rdar://problem/8251616> Layout not updating in a subtree when a scrollbar is hidden in a flexbox descendant
+ https://bugs.webkit.org/show_bug.cgi?id=48154
+
+ Test: scrollbars/hidden-scrollbar-prevents-layout.html
+
+ updateScrollInfoAfterLayout() calling setHasHorizontalScrollbar() caused updateScrollbarParts()
+ to call setChildNeedsLayout() on the overflow, because the RenderScrollbar was created with
+ the default thickness instead of the thickness specified in style. This led to the the overflow’s
+ parent to be re-marked for layout during its own parent’s finishDelayUpdateScrollInfo(), and
+ the result was that at the end of RenderView::layout(), there was a dirty renderer.
+
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::RenderScrollbar): Set the frame size in the 'display: none' and
+ 'visibility: hidden' cases as well.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Unreviewed.
+
+ [WINCE] Build fix after r70143.
+
+ * platform/graphics/wince/ImageBufferWinCE.cpp:
+ (WebCore::ImageBuffer::ImageBuffer):
+
+2010-10-22 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ r70319 added Windows-native versions of the various platform/network
+ headers to platform/network/win. WebCoreGenerated was copying these
+ headers over the CFNetwork-specific versions in $WebKitOutputDir,
+ leading to the wrong headers being used in WebKit.
+
+ This patch changes WebCoreGenerated not to copy any headers from
+ platform/network/win into $WebKitOutputDir. Instead, only headers from
+ platform/network/cf or platform/network/curl (as specified) are copied.
+ There were some CFNetwork-specific files still hanging around in
+ platform/network/win; these have been moved to platform/network/cf.
+
+ * WebCore.vcproj/WebCore.vcproj: Updated for file moves and let VS
+ * format the file as it saw fit.
+
+ * WebCore.vcproj/WebCoreGenerated.vcproj: Added the various scripts
+ * this project uses to make editing them easier.
+
+ * WebCore.vcproj/copyForwardingHeaders.cmd: Changed not to copy any
+ * headers from platform/network/win.
+
+ * platform/network/cf/CookieJarCFNet.cpp: Renamed from WebCore/platform/network/win/CookieJarCFNetWin.cpp.
+ * platform/network/cf/CookieStorageCFNet.cpp: Renamed from WebCore/platform/network/win/CookieStorageWin.cpp.
+ * platform/network/cf/CookieStorageCFNet.h: Renamed from WebCore/platform/network/win/CookieStorageWin.h.
+
+ * platform/network/cf/ResourceHandleCFNet.cpp: Updated for rename.
+
+ * platform/network/cf/AuthenticationChallenge.h:
+ * platform/network/cf/ResourceError.h:
+ * platform/network/cf/ResourceRequest.h:
+ * platform/network/cf/ResourceResponse.h:
+ * platform/network/cf/SocketStreamError.h:
+ * platform/network/cf/SocketStreamHandle.h:
+ Touched to force a re-copy.
+
+2010-10-22 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Add code in getMatchedCSSRules to block cross origin access to stylesheet data. Prevent access
+ in Javascript to non author stylesheets.
+ https://bugs.webkit.org/show_bug.cgi?id=46853
+
+ Tests: http/tests/security/cross-origin-getMatchedCSSRules.html
+ http/tests/security/cross-origin-getMatchedCSSRules2.html
+
+ * css/CSSRule.h:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::matchRulesForList):
+ (WebCore::CSSStyleSelector::SelectorChecker::SelectorChecker):
+ (WebCore::CSSStyleSelector::styleRulesForElement):
+ (WebCore::CSSStyleSelector::pseudoStyleRulesForElement):
+ * css/CSSStyleSelector.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::getMatchedCSSRules):
+ * page/DOMWindow.idl:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ Store the NavigationAction used for the newWindowPolicyDecision in the PolicyCallback
+ so that it can be used after the decision has been made in further callbacks.
+
+ * WebCore.exp.in: Fix export name for new function signature.
+ * loader/EmptyClients.h:
+ (WebCore::EmptyChromeClient::createWindow):
+ (WebCore::EmptyFrameLoaderClient::dispatchCreatePage):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::callContinueLoadAfterNewWindowPolicy):
+ (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
+ (WebCore::createWindow):
+ * loader/FrameLoader.h:
+ * loader/FrameLoaderClient.h:
+ * loader/PolicyCallback.cpp:
+ (WebCore::PolicyCallback::set):
+ (WebCore::PolicyCallback::call):
+ (WebCore::PolicyCallback::cancel):
+ * loader/PolicyCallback.h:
+ * loader/PolicyChecker.cpp:
+ (WebCore::PolicyChecker::checkNewWindowPolicy):
+ * page/Chrome.cpp:
+ (WebCore::Chrome::createWindow):
+ * page/Chrome.h:
+ * page/ChromeClient.h:
+ * page/ContextMenuController.cpp:
+ (WebCore::openNewWindow):
+
+2010-10-22 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48149
+
+ Update block direction line overflow computation to be writing-mode-aware.
+
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::logicalBottom):
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::computeBlockDirectionOverflow):
+ * rendering/InlineFlowBox.h:
+ (WebCore::InlineFlowBox::setInlineDirectionOverflowPositions):
+ (WebCore::InlineFlowBox::setBlockDirectionOverflowPositions):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::layoutInlineChildren):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::blockDirectionOverflow):
+ * rendering/RenderBox.h:
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::addHighlightOverflow):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::getTextShadowBlockDirectionExtent):
+ (WebCore::InheritedFlags::getBoxShadowBlockDirectionExtent):
+ (WebCore::InheritedFlags::getShadowBlockDirectionExtent):
+
+2010-10-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ ASSERT while viewing Google C++ style guide
+ https://bugs.webkit.org/show_bug.cgi?id=48148
+
+ This code used to stop the parser twice. Instead of reaching in an
+ trying to stop the parser manually, we now just let close() do the work
+ for us.
+
+ Test: fast/xsl/transform-to-html.xml
+
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Implement GraphicsContext::(get|release)WindowsContext
+ https://bugs.webkit.org/show_bug.cgi?id=48136
+
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+ (WebCore::GraphicsContext::getWindowsContext):
+ (WebCore::GraphicsContext::releaseWindowsContext):
+
+2010-10-22 Adam Roben <aroben@apple.com>
+
+ Attempt to fix the Windows build
+
+ * platform/network/win/CookieJarCFNetWin.cpp: Add a missing #include.
+
+2010-10-22 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Dirk Schulze.
+
+ getBoundingClientRect does not work with SVG <text>
+ https://bugs.webkit.org/show_bug.cgi?id=46775
+
+ Added back to SVGStyledTransformableElement overloads of the following
+ methods: nearestViewportElement, farthestViewportElement, getBBox.
+ This was necessary to appease the Visual C++ compiler, which warned on
+ inheritance via dominance.
+
+ * svg/SVGStyledTransformableElement.cpp:
+ * svg/SVGStyledTransformableElement.h:
+ (SVGStyledTransformableElement::nearestViewportElement):
+ (SVGStyledTransformableElement::farthestViewportElement):
+ (SVGStyledTransformableElement::getBBox):
+
+2010-10-21 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Content in <iframe> doesn't appear when going back to http://webkit.org/blog/386/3d-transforms/
+ https://bugs.webkit.org/show_bug.cgi?id=32447
+
+ Added documentDidBecomeActive() when document comes back from cache to cause compositing
+ layers in iframes to be reattached.
+
+ There is no layout test, but I added a manual test. This test is ready to be a layout test
+ but currently DRT disables the WebCore page cache, so the back/forward essentially do a
+ page load which does not exhibit the bug.
+
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrameBase::restore):
+ * manual-tests/compositing/show-composited-iframe-on-back-button.html: Added.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Add Windows specific files for platform/network/win
+ https://bugs.webkit.org/show_bug.cgi?id=27376
+
+ * platform/network/win/AuthenticationChallenge.h: Added.
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/win/ResourceError.h: Added.
+ (WebCore::ResourceError::ResourceError):
+ * platform/network/win/ResourceRequest.h: Added.
+ (WebCore::ResourceRequest::ResourceRequest):
+ (WebCore::ResourceRequest::doUpdatePlatformRequest):
+ (WebCore::ResourceRequest::doUpdateResourceRequest):
+ (WebCore::ResourceRequest::doPlatformCopyData):
+ (WebCore::ResourceRequest::doPlatformAdopt):
+ * platform/network/win/ResourceResponse.h: Added.
+ (WebCore::ResourceResponse::ResourceResponse):
+ (WebCore::ResourceResponse::doPlatformCopyData):
+ (WebCore::ResourceResponse::doPlatformAdopt):
+
+2010-10-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r70290.
+ http://trac.webkit.org/changeset/70290
+ https://bugs.webkit.org/show_bug.cgi?id=48111
+
+ Undelete Android build files.
+
+ * Android.mk: Added.
+
+2010-10-22 Cosmin Truta <ctruta@chromium.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ getBoundingClientRect does not work with SVG <text>
+ https://bugs.webkit.org/show_bug.cgi?id=46775
+
+ Dispatched the calls from Element::getBoundingClientRect to getBBox
+ through SVGElement::boundingBox.
+ Recognized SVGTextElement in addition to SVGStyledLocatableElement
+ as a class that provides getBBox.
+ Fixed the result of zooming: adjusted the getBoundingClientRect rectangle
+ for absolute zoom, even for SVG elements.
+
+ Additional cleanup task:
+ Removed redundant overloads of SVGStyledTransformableElement
+ methods: nearestViewportElement, farthestViewportElement, getBBox.
+ These methods are already inherited from SVGStyledLocatableElement.
+
+ Test: css3/zoom-coords.xhtml
+
+ * WebCore.xcodeproj/project.pbxproj: Set role of SVGLocatable.h to private.
+ * dom/Element.cpp:
+ (Element::getBoundingClientRect): Used SVGElement::boundingBox.
+ Adjusted coordinates for absolute zoom, for all kinds of elements.
+ * svg/SVGElement.cpp:
+ * svg/SVGElement.h:
+ (SVGElement::boundingBox): Added.
+ * svg/SVGStyledTransformableElement.cpp:
+ * svg/SVGStyledTransformableElement.h:
+ (SVGStyledTransformableElement::nearestViewportElement): Removed.
+ (SVGStyledTransformableElement::farthestViewportElement): Removed.
+ (SVGStyledTransformableElement::getBBox): Removed.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WIN] Add stubs for SocketStream classes
+ https://bugs.webkit.org/show_bug.cgi?id=47983
+
+ * platform/network/win/SocketStreamError.h: Copied from WebCore/platform/network/curl/SocketStreamError.h.
+ (WebCore::SocketStreamError::SocketStreamError):
+ * platform/network/win/SocketStreamHandle.h: Copied from WebCore/platform/network/curl/SocketStreamHandle.h.
+ (WebCore::SocketStreamHandle::create):
+ * platform/network/win/SocketStreamHandleWin.cpp: Copied from WebCore/platform/network/curl/SocketStreamHandleCurl.cpp.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Disable cache in ResourceHandleWin
+ https://bugs.webkit.org/show_bug.cgi?id=48128
+
+ The caching of windows does not work correctly, so disable it for now.
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::start):
+
+2010-10-22 Jia Pu <jpu@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Regression (r69548): cancelled autocorrection suggestion is still applied.
+ https://bugs.webkit.org/show_bug.cgi?id=48081
+ <rdar://problem/8579765>
+
+ The test requires a 0.3 second delay using setTimeout(). So we put it in manual-tests.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::handleRejectedCorrection): Clear autocorrection info when user dismissed the panel.
+ * manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html: Added.
+
+2010-10-22 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Gtk] Fix canvas/philip/tests/2d.path.isPointInPath.nonfinite.html
+ https://bugs.webkit.org/show_bug.cgi?id=48133
+
+ * platform/graphics/cairo/PathCairo.cpp:
+ (WebCore::Path::contains): Return false if any x or y are nonfinite.
+
+2010-10-22 Alexander Pavlov <apavlov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Implement property toggling in InspectorCSSAgent
+
+ This change implements enablement/disablement and setting of style properties.
+ Disabled properties are persisted in the (top-level) scope of InspectorStyleSheet.
+ https://bugs.webkit.org/show_bug.cgi?id=47339
+
+ Drive-by: fixes for the Web Inspector Protocol format.
+
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::getComputedStyleForNode2):
+ (WebCore::InspectorCSSAgent::getInheritedStylesForNode2):
+ (WebCore::InspectorCSSAgent::setPropertyText2):
+ (WebCore::InspectorCSSAgent::toggleProperty2):
+ (WebCore::InspectorCSSAgent::setRuleSelector2):
+ (WebCore::InspectorCSSAgent::buildObjectForAttributeStyles):
+ * inspector/InspectorCSSAgent.h:
+ * inspector/InspectorStyleSheet.cpp:
+ (WebCore::InspectorStyle::buildObjectForStyle):
+ (WebCore::InspectorStyle::setPropertyText):
+ (WebCore::InspectorStyle::toggleProperty):
+ (WebCore::InspectorStyle::disabledIndexByOrdinal):
+ (WebCore::InspectorStyle::styleText):
+ (WebCore::InspectorStyle::disableProperty):
+ (WebCore::InspectorStyle::enableProperty):
+ (WebCore::InspectorStyle::populateAllProperties):
+ (WebCore::InspectorStyle::populateObjectWithStyleProperties):
+ (WebCore::InspectorStyle::shiftDisabledProperties):
+ (WebCore::InspectorStyle::replacePropertyInStyleText):
+ (WebCore::InspectorStyle::shorthandValue):
+ (WebCore::InspectorStyle::shorthandPriority):
+ (WebCore::InspectorStyle::longhandProperties):
+ (WebCore::InspectorStyleSheet::setText):
+ (WebCore::InspectorStyleSheet::setRuleSelector):
+ (WebCore::InspectorStyleSheet::addRule):
+ (WebCore::InspectorStyleSheet::ruleForId):
+ (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
+ (WebCore::InspectorStyleSheet::buildObjectForRule):
+ (WebCore::InspectorStyleSheet::buildObjectForStyle):
+ (WebCore::InspectorStyleSheet::setPropertyText):
+ (WebCore::InspectorStyleSheet::toggleProperty):
+ (WebCore::InspectorStyleSheet::styleForId):
+ (WebCore::InspectorStyleSheet::inspectorStyleForId):
+ (WebCore::InspectorStyleSheet::rememberInspectorStyle):
+ (WebCore::InspectorStyleSheet::forgetInspectorStyle):
+ (WebCore::InspectorStyleSheet::ruleOrStyleId):
+ (WebCore::InspectorStyleSheet::ensureText):
+ (WebCore::InspectorStyleSheet::setStyleText):
+ (WebCore::InspectorStyleSheet::styleSheetTextWithChangedStyle):
+ (WebCore::InspectorStyleSheet::ruleId):
+ (WebCore::InspectorStyleSheet::revalidateStyle):
+ (WebCore::InspectorStyleSheet::originalStyleSheetText):
+ (WebCore::InspectorStyleSheet::resourceStyleSheetText):
+ (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
+ (WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
+ (WebCore::InspectorStyleSheetForInlineStyle::inspectorStyleForId):
+ * inspector/InspectorStyleSheet.h:
+ (WebCore::InspectorCSSId::createFromParts):
+ (WebCore::InspectorCSSId::InspectorCSSId):
+ (WebCore::InspectorCSSId::styleSheetId):
+ (WebCore::InspectorCSSId::ordinal):
+ (WebCore::InspectorCSSId::isEmpty):
+ (WebCore::InspectorCSSId::asString):
+ (WebCore::InspectorStyleProperty::InspectorStyleProperty):
+ (WebCore::InspectorStyle::create):
+ (WebCore::InspectorStyle::InspectorStyle):
+ (WebCore::InspectorStyle::cssStyle):
+ (WebCore::InspectorStyle::hasDisabledProperties):
+ (WebCore::InspectorStyleSheet::styleId):
+ (WebCore::InspectorStyleSheetForInlineStyle::styleForId):
+ (WebCore::InspectorStyleSheetForInlineStyle::ruleSourceDataFor):
+ (WebCore::InspectorStyleSheetForInlineStyle::rememberInspectorStyle):
+ (WebCore::InspectorStyleSheetForInlineStyle::forgetInspectorStyle):
+
+2010-10-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: update resources tree in storage panel upon network events.
+ https://bugs.webkit.org/show_bug.cgi?id=48121
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::buildObjectForDocumentLoader):
+ (WebCore::buildObjectForFrameTree):
+ (WebCore::InspectorResourceAgent::didCommitLoad):
+ (WebCore::InspectorResourceAgent::frameDetachedFromParent):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype.didReceiveResponse):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceManager.prototype._addResourceToStorageFrame):
+ (WebInspector.ResourceManager.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceManager.prototype._clearResources):
+ (WebInspector.ResourceManager.prototype._processCachedResources):
+ (WebInspector.ResourceManager.prototype._addFramesRecursively):
+ (WebInspector.ResourceManager.getContents):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.addOrUpdateFrame):
+ (WebInspector.StoragePanel.prototype.removeFrame):
+ (WebInspector.StoragePanel.prototype.addResourceToFrame):
+ (WebInspector.StoragePanel.prototype.removeResourcesFromFrame):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.BaseStorageTreeElement.prototype.onreveal):
+ (WebInspector.BaseStorageTreeElement.prototype.set titleText):
+ (WebInspector.FrameTreeElement):
+ (WebInspector.FrameTreeElement.prototype.onselect):
+ (WebInspector.FrameTreeElement.prototype.get displayName):
+ (WebInspector.FrameTreeElement.prototype.set displayName):
+
+2010-10-22 François Sausset <sausset@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix wrong xHeight() value for Apple Symbols font.
+ https://bugs.webkit.org/show_bug.cgi?id=41535
+
+ Test: mathml/xHeight.xhtml
+
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformInit):
+
+2010-10-22 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Further preparations to deploy the new SVGAnimatedProperty concept for the rest of the SVG datatypes
+ https://bugs.webkit.org/show_bug.cgi?id=48125
+
+ Model SVGListPropertyTearOff similar to SVGPropertyTearOff, allow it to be used for SVGXXXList datatypes, that are not animated. (SVGStringList)
+ Recognize all SVG primitive datatypes in SVGPropertyTraits.
+ Add a new - temporary - macro to support multiple animated properties that map to a single DOM attribute (kernelUnitLength attribute vs. kernelUnitLengthX/Y properties).
+ These macros will all be removed and expanded by their content, as soon as the transition to the new SVGAnimatedProperty concept is done.
+
+ Doesn't affect any tests yet, as the code is still unused.
+
+ * svg/properties/SVGAnimatedProperty.h:
+ (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
+ (WebCore::SVGAnimatedProperty::lookupWrapper):
+ * svg/properties/SVGAnimatedPropertyMacros.h:
+ * svg/properties/SVGAnimatedPropertySynchronizer.h:
+ * svg/properties/SVGListPropertyTearOff.h:
+ (WebCore::SVGListPropertyTearOff::create):
+ (WebCore::SVGListPropertyTearOff::removeItemFromList):
+ (WebCore::SVGListPropertyTearOff::detachListWrappers):
+ (WebCore::SVGListPropertyTearOff::clear):
+ (WebCore::SVGListPropertyTearOff::numberOfItems):
+ (WebCore::SVGListPropertyTearOff::initialize):
+ (WebCore::SVGListPropertyTearOff::getItem):
+ (WebCore::SVGListPropertyTearOff::insertItemBefore):
+ (WebCore::SVGListPropertyTearOff::replaceItem):
+ (WebCore::SVGListPropertyTearOff::removeItem):
+ (WebCore::SVGListPropertyTearOff::appendItem):
+ (WebCore::SVGListPropertyTearOff::SVGListPropertyTearOff):
+ (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
+ (WebCore::SVGListPropertyTearOff::commitChange):
+ * svg/properties/SVGPropertyTearOff.h:
+ * svg/properties/SVGPropertyTraits.h:
+
+2010-10-22 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70301.
+ http://trac.webkit.org/changeset/70301
+ https://bugs.webkit.org/show_bug.cgi?id=48126
+
+ "Lang attribute layout tests failing" (Requested by satish on
+ #webkit).
+
+ * dom/Element.cpp:
+ (WebCore::Element::computeInheritedLanguage):
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-22 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use and validate the
+ nearest language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show and
+ http://codereview.chromium.org/3595018/show.
+
+ Test: fast/speech/input-text-language-tag.html
+
+ * dom/Element.cpp:
+ (WebCore::Element::computeInheritedLanguage): includes a brief character
+ validation for the BCP 47 language tag.
+ * page/SpeechInput.cpp:
+ (WebCore::SpeechInput::startRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h:
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::setRecognitionResult): results are now
+ stored by language using a hash map.
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::attachInnerElement):
+ (WebCore::SearchFieldCancelButtonElement::detach):
+ (WebCore::SpinButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::detach):
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed, rolling out r70298.WebKit win compilation failure.
+ http://trac.webkit.org/changeset/70298
+ https://bugs.webkit.org/show_bug.cgi?id=48122
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: decouple ScriptArguments from ScriptCallStack
+ https://bugs.webkit.org/show_bug.cgi?id=48058
+
+ ScriptCallFrame and ScriptCallStack are now the same for both JSC and V8.
+ The factory functions that allow to create ScriptCallStack from VM-specific
+ objects are defined in ScriptCallStackFactory.cpp.
+
+ ScriptArguments class is used for passing arguments from JS code to the native
+ part.
+
+ No new tests. This refactoring is covered with existing Console tests.
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/ScriptCallFrame.cpp: Removed.
+ * bindings/js/ScriptCallFrame.h: Removed.
+ * bindings/js/ScriptCallStack.cpp: Removed.
+ * bindings/js/ScriptCallStack.h: Removed.
+ * bindings/js/ScriptCallStackFactory.cpp: Added.
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/js/ScriptCallStackFactory.h: Added.
+ * bindings/js/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptCallFrame.cpp: Removed.
+ * bindings/v8/ScriptCallFrame.h: Removed.
+ * bindings/v8/ScriptCallStack.cpp: Removed.
+ * bindings/v8/ScriptCallStack.h: Removed.
+ * bindings/v8/ScriptCallStackFactory.cpp: Added.
+ (WebCore::toScriptCallFrame):
+ (WebCore::toScriptCallFramesVector):
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/v8/ScriptCallStackFactory.h: Added.
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/v8/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/v8/V8ConsoleMessage.cpp:
+ (WebCore::V8ConsoleMessage::handler):
+ (WebCore::V8ConsoleMessage::dispatchNow):
+ * bindings/v8/V8ConsoleMessage.h:
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ (WebCore::V8Console::traceCallback):
+ (WebCore::V8Console::assertCallback):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ (WebCore::ConsoleMessage::addToFrontend):
+ (WebCore::ConsoleMessage::updateRepeatCountInConsole):
+ (WebCore::ConsoleMessage::isEqual):
+ * inspector/ConsoleMessage.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addMessageToConsole):
+ (WebCore::InspectorController::startGroup):
+ * inspector/InspectorController.h:
+ * inspector/ScriptArguments.cpp: Added.
+ (WebCore::ScriptArguments::ScriptArguments):
+ (WebCore::ScriptArguments::~ScriptArguments):
+ (WebCore::ScriptArguments::argumentAt):
+ (WebCore::ScriptArguments::globalState):
+ (WebCore::ScriptArguments::getFirstArgumentAsString):
+ (WebCore::ScriptArguments::isEqual):
+ * inspector/ScriptArguments.h: Added.
+ (WebCore::ScriptArguments::argumentCount):
+ * inspector/ScriptCallFrame.cpp: Added.
+ (WebCore::ScriptCallFrame::ScriptCallFrame):
+ (WebCore::ScriptCallFrame::~ScriptCallFrame):
+ (WebCore::ScriptCallFrame::isEqual):
+ (WebCore::ScriptCallFrame::buildInspectorObject):
+ * inspector/ScriptCallFrame.h: Added.
+ (WebCore::ScriptCallFrame::functionName):
+ (WebCore::ScriptCallFrame::sourceURL):
+ (WebCore::ScriptCallFrame::lineNumber):
+ * inspector/ScriptCallStack.cpp: Added.
+ (WebCore::ScriptCallStack::ScriptCallStack):
+ (WebCore::ScriptCallStack::~ScriptCallStack):
+ (WebCore::ScriptCallStack::at):
+ (WebCore::ScriptCallStack::size):
+ (WebCore::ScriptCallStack::isEqual):
+ (WebCore::ScriptCallStack::buildInspectorObject):
+ * inspector/ScriptCallStack.h: Added.
+ * page/Console.cpp:
+ (WebCore::Console::addMessage):
+ (WebCore::Console::debug):
+ (WebCore::Console::error):
+ (WebCore::Console::info):
+ (WebCore::Console::log):
+ (WebCore::Console::dir):
+ (WebCore::Console::dirxml):
+ (WebCore::Console::trace):
+ (WebCore::Console::assertCondition):
+ (WebCore::Console::count):
+ (WebCore::Console::markTimeline):
+ (WebCore::Console::profile):
+ (WebCore::Console::profileEnd):
+ (WebCore::Console::timeEnd):
+ (WebCore::Console::group):
+ (WebCore::Console::groupCollapsed):
+ (WebCore::Console::shouldCaptureFullStackTrace):
+ (WebCore::Console::warn):
+ * page/Console.h:
+
+2010-10-22 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] All widgets are rendered incorrectly when rendered through a cache
+ https://bugs.webkit.org/show_bug.cgi?id=47767
+
+ When a widget is not available to the RenderTheme, default
+ value are used for the state.
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::initStyleOption):
+ (WebCore::RenderThemeQt::paintButton):
+ (WebCore::RenderThemeQt::paintTextField):
+ (WebCore::RenderThemeQt::paintMenuList):
+ (WebCore::RenderThemeQt::paintMenuListButton):
+ (WebCore::RenderThemeQt::paintProgressBar):
+ (WebCore::RenderThemeQt::paintSliderTrack):
+
+2010-10-22 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Dirk Schulze.
+
+ Moving all bounding box related calculation to RenderSVGResourceFilterPrimitive
+ https://bugs.webkit.org/show_bug.cgi?id=47174
+
+ The primitive sub-region calculation was spread in many
+ files across in WebKit source code, and all of them are moved
+ to RenderSVGResourceFilterPrimitive, where they should be.
+ In this patch the calculation is a static method which will
+ be turned to a real member function in the near future.
+
+ * platform/graphics/filters/FETile.cpp:
+ * platform/graphics/filters/FETile.h:
+ (WebCore::FETile::filterEffectType):
+ * platform/graphics/filters/Filter.h:
+ * platform/graphics/filters/FilterEffect.cpp:
+ * platform/graphics/filters/FilterEffect.h:
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::applyResource):
+ * rendering/RenderSVGResourceFilterPrimitive.cpp:
+ (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
+ * rendering/RenderSVGResourceFilterPrimitive.h:
+ (WebCore::RenderSVGResourceFilterPrimitive::RenderSVGResourceFilterPrimitive):
+ * svg/graphics/filters/SVGFilter.cpp:
+ * svg/graphics/filters/SVGFilter.h:
+ (WebCore::SVGFilter::mapLocalRectToAbsoluteRect):
+ (WebCore::SVGFilter::targetBoundingBox):
+
+2010-10-21 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Add a String constructor which takes AECHAR*
+ https://bugs.webkit.org/show_bug.cgi?id=45043
+
+ Implement String(const AECHAR*) constructor.
+
+ * platform/text/brew/StringBrew.cpp: Added.
+ (WTF::String::String):
+
+2010-10-21 James Simonsen <simonjam@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ HTMLTreeBuilder's InForeignContent code needs a re-write
+
+ Foreign Content mode was changed significantly by:
+ http://www.w3.org/Bugs/Public/show_bug.cgi?id=10314
+
+ The differences can be seen here:
+ http://html5.org/tools/web-apps-tracker?from=5520&to=5522
+
+ This bug addresses all spec changes in the diff except the select scope
+ changes, which have already been fixed in a separate bug.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46676
+
+ * html/parser/HTMLElementStack.cpp:
+ (WebCore::HTMLNames::isScopeMarker): Add foreign elements to list.
+ * html/parser/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::processDoctypeToken): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto. Remove secondary insertion mode.
+ (WebCore::HTMLTreeBuilder::processStartTagForInTable): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processStartTag): Ditto. Remove secondary insertion mode.
+ (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately): Remove foreign var. Use hasTagName() instead of == localName() to fix bug with foreign elements.
+ (WebCore::HTMLTreeBuilder::processEndTagForInTableBody): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processEndTagForInRow): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndTagForInCell): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndTagForInBody): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
+ (WebCore::HTMLTreeBuilder::prepareToReprocessToken): Added.
+ (WebCore::HTMLTreeBuilder::reprocessStartTag): Added.
+ (WebCore::HTMLTreeBuilder::reprocessEndTag): Added.
+ (WebCore::HTMLTreeBuilder::processForeignContentUsingInBodyModeAndResetMode): Added.
+ (WebCore::HTMLTreeBuilder::resetForeignInsertionMode): Added.
+ (WebCore::HTMLTreeBuilder::processComment): Switch mode before reprocessing any tokens.
+ (WebCore::HTMLTreeBuilder::processCharacterBuffer): Ditto.
+ (WebCore::HTMLTreeBuilder::processEndOfFile): Ditto.
+ * html/parser/HTMLTreeBuilder.h: Functions and member for tracking potential switch from InForeignContentMode.
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ Remove Android build system
+ https://bugs.webkit.org/show_bug.cgi?id=48111
+
+ As far as I can tell, these files are not maintained. They are a
+ mantaince burden on the project. If folks would like to come out of
+ the woodwork and maintain these files, that's great. At the moment,
+ they seem like dead weight for the project.
+
+ * Android.mk: Removed.
+
+2010-10-21 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
+
+ GlyphPageTreeNodeLinux does not depend on Linux or Chromium.
+ Move GlyphPageTreeNodeLinux 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-10-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ removeFormat needs to be reimplemented
+ https://bugs.webkit.org/show_bug.cgi?id=43017
+
+ Reimplemented execCommand('RemoveFormat', false, null). New implementation removes
+ the same elements removed by Internet Explorer. Because WebKit supports StyleWithCSS
+ we also reset any editing styles to match that of the root editable element
+ while Internet Explorer does not remove any CSS styles.
+
+ New implementation uses ApplyStyleCommand to remove appropriate elements and reset the style.
+ Added new constructor and member variable to ApplyStyleCommand to support mass-removal of elements
+ since it's inefficient to call ApplyStyleCommand on each element we're removing.
+
+ To avoid an infinite loop in pushDownInlineStyleAroundNode when mass-removing, WebKit no longer
+ push down element one level at a time. Instead, we keep a stack of styled elements to be applied,
+ and apply wrap siblings of targetNode's ancestors by all of them at once.
+
+ Tests: editing/execCommand/remove-format-elements.html
+ editing/execCommand/remove-format-multiple-elements.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::ApplyStyleCommand): Added; this version takes style and a function pointer
+ to a boolean function that determines which element needs to removed, and set m_removeOnly to true.
+ (WebCore::ApplyStyleCommand::doApply): Added support for m_isInlineElementToRemoveFunction.
+ (WebCore::ApplyStyleCommand::applyBlockStyle): Ditto.
+ (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): Exits early if m_removeOnly is true.
+ (WebCore::ApplyStyleCommand::isStyledInlineElementToRemove): Added.
+ (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Calls isStyledInlineElementToRemove.
+ (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Ditto.
+ (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto.
+ (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): See above.
+ * editing/ApplyStyleCommand.h:
+ (WebCore::ApplyStyleCommand::create): Added.
+ * editing/RemoveFormatCommand.cpp:
+ (WebCore::isElementForRemoveFormatCommand): Added.
+ (WebCore::RemoveFormatCommand::doApply): Rewritten.
+
+2010-10-21 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Ignore document.write() when it comes from a network task
+ https://bugs.webkit.org/show_bug.cgi?id=47560
+
+ This implements the update to the spec made by:
+ http://www.w3.org/Bugs/Public/show_bug.cgi?id=9767
+
+ It also matches the latest Firefox 4 beta. The notable change is that
+ document.write from a deferred script no longer works. This avoids
+ blowing the patch away.
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::write):
+ * dom/Document.h:
+ (WebCore::DestructiveWriteCountIncrementer::DestructiveWriteCountIncrementer):
+ (WebCore::Document::ignoreDestructiveWriteCountIncrementer):
+ * dom/ScriptElement.cpp:
+ (WebCore::ScriptElement::insertedIntoDocument):
+ (WebCore::ScriptElementData::ScriptElementData):
+ (WebCore::ScriptElementData::evaluateScript):
+ * dom/ScriptElement.h:
+ * html/parser/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
+
+2010-10-21 Ryosuke Niwa <rniwa@webkit.org>
+
+ Unreviewed Leopard build fix attempt.
+
+ Explicitly cast the return value of deg2rad to float.
+
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paint):
+
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by James Robinson.
+
+ [Chromium] Fix Chromium Mac build
+ https://bugs.webkit.org/show_bug.cgi?id=48096
+
+ Fix Chromium Mac build after r70225 (Chromium uses Core Text but is not
+ PLATFORM(MAC)).
+
+ * platform/graphics/SimpleFontData.h:
+
+2010-10-21 Xiaomei Ji <xji@chromium.org>
+
+ Reviewed by David Levin.
+
+ Performance improvement for FontLinux.
+ https://bugs.webkit.org/show_bug.cgi?id=47019
+
+ Reduce the number of calls for the normalization function because converting
+ to NFC form is very expensive.
+
+ Combine space normalization and character mirroring into one text scan.
+
+ Test: platform/chromium/fast/text/font-linux-normalize.html
+
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::TextRunWalker::TextRunWalker):
+ (WebCore::TextRunWalker::~TextRunWalker):
+ (WebCore::TextRunWalker::getNormalizedTextRun):
+ (WebCore::TextRunWalker::normalizeSpacesAndMirrorChars):
+
+2010-10-21 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48085
+
+ Make basic vertical text painting work. This includes the text itself, underlines, overlines, line-throughs and shadows.
+
+ Added fast/blockflow/english-lr-text.html
+
+ * rendering/InlineFlowBox.cpp:
+ (WebCore::InlineFlowBox::paint):
+ * rendering/InlineFlowBox.h:
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::applyShadowToGraphicsContext):
+ (WebCore::paintTextWithShadows):
+ (WebCore::InlineTextBox::paint):
+ (WebCore::InlineTextBox::paintDecoration):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ * rendering/InlineTextBox.h:
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::paintTextWithShadows):
+
+2010-10-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] When doing rendering through tiling, it seems the tiles are not initialized before rendering
+ https://bugs.webkit.org/show_bug.cgi?id=48070
+
+ No new tests. Auto-tests for Tiled Backing Store should be added, see bug 48082
+
+ * page/Frame.cpp:
+ (WebCore::Frame::tiledBackingStoreBackgroundColor):
+ * page/Frame.h:
+ * platform/graphics/TiledBackingStoreClient.h:
+ * platform/graphics/qt/TileQt.cpp:
+ (WebCore::Tile::updateBackBuffer):
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Use GCharsetConverter instead of g_iconv in TextCodecGtk
+ https://bugs.webkit.org/show_bug.cgi?id=47896
+
+ It makes error handling easier. Fixes tests:
+ fast/encoding/invalid-multi-byte-over-consumption.html
+ fast/encoding/invalid-xml.html
+ fast/encoding/japanese-encoding-mix.html
+ when building with glib unicode
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::TextCodecGtk::TextCodecGtk):
+ (WebCore::TextCodecGtk::~TextCodecGtk):
+ (WebCore::TextCodecGtk::createIConvDecoder):
+ (WebCore::TextCodecGtk::createIConvEncoder):
+ (WebCore::TextCodecGtk::decode):
+ (WebCore::TextCodecGtk::encode):
+ * platform/text/gtk/TextCodecGtk.h:
+
+2010-10-21 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: contenteditable nodes do not return correct AXSelectedText* attributes
+ https://bugs.webkit.org/show_bug.cgi?id=48080
+
+ The ariaSelectedDOMTextRange() method was not returning the correct values.
+ The fix is to return a plain text range that represents the current selection.
+
+ Test: platform/mac/accessibility/content-editable-range-properties.html
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::accessibilityDescription):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::ariaSelectedTextRange):
+ (WebCore::AccessibilityRenderObject::selectedText):
+ (WebCore::AccessibilityRenderObject::selectedTextRange):
+ * accessibility/AccessibilityRenderObject.h:
+
+2010-10-20 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Video -> Canvas doesn't work on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=47996
+ rdar://problem/7884690
+
+ * WebCore.vcproj/QTMovieWin.vcproj: Added QTDecompressionSession.{cpp,h}
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ (WebCore::MediaPlayerPrivateQuickTimeVisualContext::paint): Create a
+ QTDecompressionSession if necessary and convert the QTPixelBuffer
+ into a CG-compatible one.
+ * platform/graphics/win/QTDecompressionSession.cpp: Added.
+ * platform/graphics/win/QTDecompressionSession.h: Added.
+ * platform/graphics/win/QTPixelBuffer.cpp:
+ (SetNumberValue): Moved from QTMovieVisualContext.
+ (QTPixelBuffer::createPixelBufferAttributesDictionary): Moved from inside
+ QTMovieVisualContext::createPixelBufferOptionsDictionary().
+ * platform/graphics/win/QTPixelBuffer.h: Moved the Type enum
+ from QTMovieVisualContext.h.
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] TextBreakIteratorGtk should initialize its internal index to 0
+ https://bugs.webkit.org/show_bug.cgi?id=48065
+
+ It fixes the following tests when using glib unicode:
+ fast/forms/ValidityState-tooLong-input.html
+ fast/forms/ValidityState-tooLong-textarea.html
+ fast/forms/input-appearance-maxlength.html
+ fast/forms/input-implicit-length-limit.html
+ fast/forms/input-maxlength.html
+ fast/forms/textarea-live-pseudo-selectors.html
+ fast/forms/mailto/advanced-get.html
+ fast/forms/mailto/advanced-put.html
+
+ * platform/text/gtk/TextBreakIteratorGtk.cpp:
+ (WebCore::setUpIterator):
+
+2010-10-21 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Need to swap glyphs for vertical writing
+ https://bugs.webkit.org/show_bug.cgi?id=46973
+
+ Made changes to pass the writing-mode orientation flag in RenderStyle down to FontPlatformData,
+ and ultimately to CoreText APIs in both font complex path and fast path.
+
+ Tests: fast/text/international/vertical-text-glyph-test.html
+ fast/text/international/vertical-text-metrics-test.html
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj: Added platform/graphics/FontOrientation.h.
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::getFontData): Added font orientation parameter to SimpleFontData.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Set appropriate font orientation to the font description
+ when writing-mode is being specified.
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::platformDataFromCustomData): Made to pass font orientation to FontPlatformData.
+ * loader/CachedFont.h:
+ * platform/graphics/FontCache.cpp: Added font orientation to FontPlatformDataCacheKey
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::computeHash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ * platform/graphics/FontDescription.h: Added font orientation support to FontDescription class
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::orientation):
+ (WebCore::FontDescription::setOrientation):
+ (WebCore::FontDescription::operator==):
+ * platform/graphics/FontOrientation.h: Added.
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/cairo/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/cairo/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/cocoa/FontPlatformData.h: Added font orientation support to FontPlatformData class
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::orientation):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::operator==):
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Added font orientation support
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::allowsLigatures): Don't allow ligatures when the font is vertical orientation.
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/mac/FontCacheMac.mm: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.cpp: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.h: Changed to pass font orientation parameter to fontPlatformData()
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill): Changed to use CoreText to extract glyphs when the current font is vertical orientation.
+ CoreText automatically swaps glyphs with vertical variants when the font orientation is vertical.
+ * platform/graphics/mac/SimpleFontDataCoreText.cpp: Added vertical form attribute to the attribute dictionary for a CTLine.
+ (WebCore::SimpleFontData::getCFStringAttributes):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph): Changed to use CoreText (from CG) to support vertical metrics.
+ (WebCore::SimpleFontData::platformWidthForGlyph): Made to use CoreText, instead of wkGetGlyphTransformedAdvances,
+ to get vertical metrics when the font orientation is vertical.
+ * platform/graphics/qt/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformDataCairo.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformDataCairo.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wince/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wince/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wx/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wx/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+
+2010-10-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: provide resource tree in the Storage panel (behind the flag).
+ https://bugs.webkit.org/show_bug.cgi?id=48069
+
+ * WebCore.gypi:
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::frameDetachedFromParent):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::buildObjectForDocumentLoader):
+ (WebCore::buildObjectForFrameResource):
+ (WebCore::buildObjectForCachedResource):
+ (WebCore::populateObjectWithFrameResources):
+ (WebCore::InspectorResourceAgent::identifierForInitialRequest):
+ (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
+ (WebCore::buildObjectForFrameTree):
+ (WebCore::InspectorResourceAgent::didCommitLoad):
+ (WebCore::InspectorResourceAgent::frameDetachedFromParent):
+ (WebCore::InspectorResourceAgent::cachedResources):
+ (WebCore::InspectorResourceAgent::resourceContent):
+ * inspector/InspectorResourceAgent.h:
+ * inspector/front-end/Images/frame.png: Added.
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkPanel.prototype.refreshResource):
+ (WebInspector.NetworkPanel.prototype._showResource):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.Type.toString):
+ (WebInspector.Resource.prototype.getContents):
+ * inspector/front-end/ResourceManager.js:
+ (WebInspector.ResourceManager):
+ (WebInspector.ResourceManager.prototype.identifierForInitialRequest):
+ (WebInspector.ResourceManager.prototype._createResource):
+ (WebInspector.ResourceManager.prototype.willSendRequest):
+ (WebInspector.ResourceManager.prototype._appendRedirect):
+ (WebInspector.ResourceManager.prototype.markResourceAsCached):
+ (WebInspector.ResourceManager.prototype.didReceiveResponse):
+ (WebInspector.ResourceManager.prototype._updateResourceWithResponse):
+ (WebInspector.ResourceManager.prototype.didReceiveContentLength):
+ (WebInspector.ResourceManager.prototype.didFinishLoading):
+ (WebInspector.ResourceManager.prototype.didFailLoading):
+ (WebInspector.ResourceManager.prototype.didLoadResourceFromMemoryCache):
+ (WebInspector.ResourceManager.prototype._updateResourceWithCachedResource):
+ (WebInspector.ResourceManager.prototype.setOverrideContent):
+ (WebInspector.ResourceManager.prototype.didCommitLoadForFrame):
+ (WebInspector.ResourceManager.prototype.frameDetachedFromParent):
+ (WebInspector.ResourceManager.prototype._clearResources):
+ (WebInspector.ResourceManager.prototype.didCreateWebSocket):
+ (WebInspector.ResourceManager.prototype.willSendWebSocketHandshakeRequest):
+ (WebInspector.ResourceManager.prototype.didReceiveWebSocketHandshakeResponse):
+ (WebInspector.ResourceManager.prototype.didCloseWebSocket):
+ (WebInspector.ResourceManager.prototype._processCachedResources):
+ (WebInspector.ResourceManager.prototype._appendFramesRecursively.comparator):
+ (WebInspector.ResourceManager.prototype._appendFramesRecursively):
+ (WebInspector.ResourceManager.createResourceView):
+ (WebInspector.ResourceManager.resourceViewTypeMatchesResource):
+ (WebInspector.ResourceManager.resourceViewForResource):
+ (WebInspector.ResourceManager.getContents):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.get searchableViews):
+ (WebInspector.ResourcesPanel.prototype.addMessageToResource):
+ (WebInspector.ResourcesPanel.prototype._recreateViewForResourceIfNeeded):
+ (WebInspector.ResourcesPanel.prototype.showResource):
+ (WebInspector.ResourcesPanel.prototype.sourceFrameForResource):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.addFrame):
+ (WebInspector.StoragePanel.prototype.removeFrame):
+ (WebInspector.StoragePanel.prototype.addFrameResource):
+ (WebInspector.StoragePanel.prototype.removeFrameResources):
+ (WebInspector.StoragePanel.prototype.showResource):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.BaseStorageTreeElement.prototype.onreveal):
+ (WebInspector.FrameTreeElement):
+ (WebInspector.FrameTreeElement.prototype.onselect):
+ (WebInspector.FrameResourceTreeElement):
+ (WebInspector.FrameResourceTreeElement.prototype.onselect):
+ (WebInspector.FrameResourceTreeElement.prototype.onattach):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.css:
+ (.frame-storage-tree-item .icon):
+ (.storage.panel .sidebar.outline-disclosure > ol):
+ (.resources-category-images .image-resource-icon-preview):
+ (.children.small .resources-category-images .image-resource-icon-preview):
+ * inspector/front-end/inspector.js:
+
+2010-10-21 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48047> Fix warnings found by check-Xcode-source-file-types
+
+ Reviewed by Adam Roben.
+
+ Fixes the following warning:
+
+ WARNING: Unknown file type 'sourcecode' for file 'CSSPrimitiveValue.idl'.
+ 1 issues found for WebCore/WebCore.xcodeproj/project.pbxproj.
+
+ * WebCore.xcodeproj/project.pbxproj: Removed explicit file type
+ for CSSPrimitiveValue.idl to make it match other IDL files.
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Revert r70232. Chromium compilation failure.
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Revert r70233. Too many failures.
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Remove references to deleted headers from WebCore.pro
+
+ * WebCore.pro:
+
+2010-10-21 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: decouple ScriptArguments from ScriptCallStack
+ https://bugs.webkit.org/show_bug.cgi?id=48058
+
+ ScriptCallFrame and ScriptCallStack are now the same for both JSC and V8.
+ The factory functions that allow to create ScriptCallStack from VM-specific
+ objects are defined in ScriptCallStackFactory.cpp.
+
+ ScriptArguments class is used for passing arguments from JS code to the native
+ part.
+
+ No new tests. This refactoring is covered with existing Console tests.
+
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/ScriptCallFrame.cpp: Removed.
+ * bindings/js/ScriptCallFrame.h: Removed.
+ * bindings/js/ScriptCallStack.cpp: Removed.
+ * bindings/js/ScriptCallStack.h: Removed.
+ * bindings/js/ScriptCallStackFactory.cpp: Added.
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/js/ScriptCallStackFactory.h: Added.
+ * bindings/js/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptCallFrame.cpp: Removed.
+ * bindings/v8/ScriptCallFrame.h: Removed.
+ * bindings/v8/ScriptCallStack.cpp: Removed.
+ * bindings/v8/ScriptCallStack.h: Removed.
+ * bindings/v8/ScriptCallStackFactory.cpp: Added.
+ (WebCore::toScriptCallFrame):
+ (WebCore::toScriptCallFramesVector):
+ (WebCore::createScriptCallStack):
+ (WebCore::createScriptArguments):
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/v8/ScriptCallStackFactory.h: Added.
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::setCaptureCallStackForUncaughtExceptions):
+ * bindings/v8/ScriptState.h:
+ (WebCore::ScriptStateProtectedPtr::get):
+ * bindings/v8/V8ConsoleMessage.cpp:
+ (WebCore::V8ConsoleMessage::handler):
+ (WebCore::V8ConsoleMessage::dispatchNow):
+ * bindings/v8/V8ConsoleMessage.h:
+ * bindings/v8/custom/V8ConsoleCustom.cpp:
+ (WebCore::V8Console::traceCallback):
+ (WebCore::V8Console::assertCallback):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::ConsoleMessage):
+ (WebCore::ConsoleMessage::addToFrontend):
+ (WebCore::ConsoleMessage::updateRepeatCountInConsole):
+ (WebCore::ConsoleMessage::isEqual):
+ * inspector/ConsoleMessage.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::addMessageToConsole):
+ (WebCore::InspectorController::startGroup):
+ * inspector/InspectorController.h:
+ * inspector/ScriptArguments.cpp: Added.
+ (WebCore::ScriptArguments::ScriptArguments):
+ (WebCore::ScriptArguments::~ScriptArguments):
+ (WebCore::ScriptArguments::argumentAt):
+ (WebCore::ScriptArguments::globalState):
+ (WebCore::ScriptArguments::getFirstArgumentAsString):
+ (WebCore::ScriptArguments::isEqual):
+ * inspector/ScriptArguments.h: Added.
+ (WebCore::ScriptArguments::argumentCount):
+ * inspector/ScriptCallFrame.cpp: Added.
+ (WebCore::ScriptCallFrame::ScriptCallFrame):
+ (WebCore::ScriptCallFrame::~ScriptCallFrame):
+ (WebCore::ScriptCallFrame::isEqual):
+ (WebCore::ScriptCallFrame::buildInspectorObject):
+ * inspector/ScriptCallFrame.h: Added.
+ (WebCore::ScriptCallFrame::functionName):
+ (WebCore::ScriptCallFrame::sourceURL):
+ (WebCore::ScriptCallFrame::lineNumber):
+ * inspector/ScriptCallStack.cpp: Added.
+ (WebCore::ScriptCallStack::ScriptCallStack):
+ (WebCore::ScriptCallStack::~ScriptCallStack):
+ (WebCore::ScriptCallStack::at):
+ (WebCore::ScriptCallStack::size):
+ (WebCore::ScriptCallStack::isEqual):
+ (WebCore::ScriptCallStack::buildInspectorObject):
+ * inspector/ScriptCallStack.h: Added.
+ * page/Console.cpp:
+ (WebCore::Console::addMessage):
+ (WebCore::Console::debug):
+ (WebCore::Console::error):
+ (WebCore::Console::info):
+ (WebCore::Console::log):
+ (WebCore::Console::dir):
+ (WebCore::Console::dirxml):
+ (WebCore::Console::trace):
+ (WebCore::Console::assertCondition):
+ (WebCore::Console::count):
+ (WebCore::Console::markTimeline):
+ (WebCore::Console::profile):
+ (WebCore::Console::profileEnd):
+ (WebCore::Console::timeEnd):
+ (WebCore::Console::group):
+ (WebCore::Console::groupCollapsed):
+ (WebCore::Console::shouldCaptureFullStackTrace):
+ (WebCore::Console::warn):
+ * page/Console.h:
+
+2010-10-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium: use dedicated event listener type in EventListenerWrapper.
+ https://bugs.webkit.org/show_bug.cgi?id=48059
+
+ This change introduces new EventListener::Type NativeEventListenerType.
+ This new type is intended to be used by any code that wants to protect
+ itself from unsafe casts to particular event listener implementations.
+
+ * dom/EventListener.h:
+
+2010-10-21 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70225.
+ http://trac.webkit.org/changeset/70225
+ https://bugs.webkit.org/show_bug.cgi?id=48061
+
+ Build breakage on Leopard. (Requested by pfeldman on #webkit).
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::getFontData):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::platformDataFromCustomData):
+ * loader/CachedFont.h:
+ * platform/graphics/FontCache.cpp:
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::computeHash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ * platform/graphics/FontDescription.h:
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::operator==):
+ * platform/graphics/FontOrientation.h: Removed.
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/cairo/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/cairo/FontCustomPlatformData.h:
+ * platform/graphics/cocoa/FontPlatformData.h:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::operator==):
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::allowsLigatures):
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/gtk/FontCustomPlatformDataPango.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.h:
+ * platform/graphics/mac/FontCacheMac.mm:
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.h:
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill):
+ * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+ (WebCore::SimpleFontData::getCFStringAttributes):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph):
+ (WebCore::SimpleFontData::platformWidthForGlyph):
+ * platform/graphics/qt/FontCustomPlatformData.h:
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h:
+ * platform/graphics/win/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformData.h:
+ * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformDataCairo.h:
+ * platform/graphics/wince/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wince/FontCustomPlatformData.h:
+ * platform/graphics/wx/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wx/FontCustomPlatformData.h:
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Tests LayoutTests/fast/encoding/utf-32* fail when using glib unicode
+ https://bugs.webkit.org/show_bug.cgi?id=47805
+
+ Register UTF-32 encodings in TextCodecGtk.
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::TextCodecGtk::registerBaseEncodingNames):
+ (WebCore::TextCodecGtk::registerBaseCodecs):
+
+2010-10-21 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Adding MediaQueryListListener binding test cases
+ https://bugs.webkit.org/show_bug.cgi?id=48028
+
+ MediaQueryListListener type will need special handling of the code generators. Adding the test cases.
+
+ * bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp: Added.
+ (WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListenerPrivate::WebDOMTestMediaQueryListListenerPrivate):
+ (WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener):
+ (WebDOMTestMediaQueryListListener::operator=):
+ (WebDOMTestMediaQueryListListener::impl):
+ (WebDOMTestMediaQueryListListener::~WebDOMTestMediaQueryListListener):
+ (WebDOMTestMediaQueryListListener::method):
+ (toWebCore):
+ (toWebKit):
+ * bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp: Added.
+ (WebKit::kit):
+ (webkit_dom_test_media_query_list_listener_method):
+ (WebKit::core):
+ (webkit_dom_test_media_query_list_listener_finalize):
+ (webkit_dom_test_media_query_list_listener_set_property):
+ (webkit_dom_test_media_query_list_listener_get_property):
+ (webkit_dom_test_media_query_list_listener_constructed):
+ (webkit_dom_test_media_query_list_listener_class_init):
+ (webkit_dom_test_media_query_list_listener_init):
+ (WebKit::wrapTestMediaQueryListListener):
+ * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h: Added.
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Added.
+ (WebCore::JSTestMediaQueryListListenerConstructor::classInfo):
+ (WebCore::JSTestMediaQueryListListenerConstructor::createStructure):
+ (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
+ (WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertySlot):
+ (WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor):
+ (WebCore::JSTestMediaQueryListListenerPrototype::self):
+ (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertySlot):
+ (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
+ (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
+ (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
+ (WebCore::JSTestMediaQueryListListener::createPrototype):
+ (WebCore::JSTestMediaQueryListListener::getOwnPropertySlot):
+ (WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
+ (WebCore::jsTestMediaQueryListListenerConstructor):
+ (WebCore::JSTestMediaQueryListListener::getConstructor):
+ (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
+ (WebCore::toJS):
+ (WebCore::toTestMediaQueryListListener):
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Added.
+ (WebCore::JSTestMediaQueryListListener::classInfo):
+ (WebCore::JSTestMediaQueryListListener::createStructure):
+ (WebCore::JSTestMediaQueryListListener::impl):
+ (WebCore::JSTestMediaQueryListListenerPrototype::classInfo):
+ (WebCore::JSTestMediaQueryListListenerPrototype::createStructure):
+ (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Added.
+ (-[DOMTestMediaQueryListListener dealloc]):
+ (-[DOMTestMediaQueryListListener finalize]):
+ (-[DOMTestMediaQueryListListener method:]):
+ (core):
+ (kit):
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h: Added.
+ * bindings/scripts/test/TestMediaQueryListListener.idl: Added.
+ * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: Added.
+ (WebCore::TestMediaQueryListListenerInternal::V8_USE):
+ (WebCore::TestMediaQueryListListenerInternal::methodCallback):
+ (WebCore::ConfigureV8TestMediaQueryListListenerTemplate):
+ (WebCore::V8TestMediaQueryListListener::GetRawTemplate):
+ (WebCore::V8TestMediaQueryListListener::GetTemplate):
+ (WebCore::V8TestMediaQueryListListener::HasInstance):
+ (WebCore::V8TestMediaQueryListListener::wrapSlow):
+ (WebCore::V8TestMediaQueryListListener::derefObject):
+ * bindings/scripts/test/V8/V8TestMediaQueryListListener.h: Added.
+ (WebCore::V8TestMediaQueryListListener::toNative):
+ (WebCore::V8TestMediaQueryListListener::wrap):
+ (WebCore::toV8):
+
+2010-10-21 takano takumi <takano1@asia.apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Need to swap glyphs for vertical writing
+ https://bugs.webkit.org/show_bug.cgi?id=46973
+
+ Made changes to pass the writing-mode orientation flag in RenderStyle down to FontPlatformData,
+ and ultimately to CoreText APIs in both font complex path and fast path.
+
+ Tests: fast/text/international/vertical-text-glyph-test.html
+ fast/text/international/vertical-text-metrics-test.html
+
+ * WebCore.exp.in:
+ * WebCore.xcodeproj/project.pbxproj: Added platform/graphics/FontOrientation.h.
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::getFontData): Added font orientation parameter to SimpleFontData.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Set appropriate font orientation to the font description
+ when writing-mode is being specified.
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::platformDataFromCustomData): Made to pass font orientation to FontPlatformData.
+ * loader/CachedFont.h:
+ * platform/graphics/FontCache.cpp: Added font orientation to FontPlatformDataCacheKey
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::computeHash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ * platform/graphics/FontDescription.h: Added font orientation support to FontDescription class
+ (WebCore::FontDescription::FontDescription):
+ (WebCore::FontDescription::orientation):
+ (WebCore::FontDescription::setOrientation):
+ (WebCore::FontDescription::operator==):
+ * platform/graphics/FontOrientation.h: Added.
+ * platform/graphics/SimpleFontData.h:
+ * platform/graphics/cairo/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/cairo/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/cocoa/FontPlatformData.h: Added font orientation support to FontPlatformData class
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::orientation):
+ (WebCore::FontPlatformData::hash):
+ (WebCore::FontPlatformData::operator==):
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Added font orientation support
+ (WebCore::FontPlatformData::FontPlatformData):
+ (WebCore::FontPlatformData::operator=):
+ (WebCore::FontPlatformData::allowsLigatures): Don't allow ligatures when the font is vertical orientation.
+ (WebCore::FontPlatformData::description):
+ * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/haiku/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/mac/FontCacheMac.mm: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCache::getFontDataForCharacters):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.cpp: Added font orientation parameter when creating FontPlatformData object.
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/mac/FontCustomPlatformData.h: Changed to pass font orientation parameter to fontPlatformData()
+ * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+ (WebCore::GlyphPage::fill): Changed to use CoreText to extract glyphs when the current font is vertical orientation.
+ CoreText automatically swaps glyphs with vertical variants when the font orientation is vertical.
+ * platform/graphics/mac/SimpleFontDataCoreText.cpp: Added vertical form attribute to the attribute dictionary for a CTLine.
+ (WebCore::SimpleFontData::getCFStringAttributes):
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph): Changed to use CoreText (from CG) to support vertical metrics.
+ (WebCore::SimpleFontData::platformWidthForGlyph): Made to use CoreText, instead of wkGetGlyphTransformedAdvances,
+ to get vertical metrics when the font orientation is vertical.
+ * platform/graphics/qt/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/qt/FontCustomPlatformDataQt.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/skia/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/win/FontCustomPlatformDataCairo.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/win/FontCustomPlatformDataCairo.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wince/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wince/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+ * platform/graphics/wx/FontCustomPlatformData.cpp: Changed to pass font orientation to fontPlatformData()
+ (WebCore::FontCustomPlatformData::fontPlatformData):
+ * platform/graphics/wx/FontCustomPlatformData.h: Changed to pass font orientation to fontPlatformData()
+
+2010-10-20 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Redesign SVGAnimatedProperty concept to share "POD type wrappers" between all bindings (-> add ObjC SVG bindings)
+ https://bugs.webkit.org/show_bug.cgi?id=47905
+
+ Tests: svg/dom/SVGLengthList-appendItem.xhtml
+ svg/dom/SVGLengthList-basics.xhtml
+ svg/dom/SVGLengthList-getItem.xhtml
+ svg/dom/SVGLengthList-initialize.xhtml
+ svg/dom/SVGLengthList-insertItemBefore.xhtml
+ svg/dom/SVGLengthList-removeItem.xhtml
+ svg/dom/SVGLengthList-replaceItem.xhtml
+ svg/dom/SVGLengthList-xml-dom-modifications.xhtml
+
+ Introduce a more lightweight, less intrusive way to expose SVGAnimated* DOM bindings.
+
+ Concrete example:
+ The SVG DOM defines a 'SVGAnimatedLength' object, that's used to represent the x / y / width / height attributes of a 'SVGRectElement'.
+ Each 'SVGAnimatedLength' object exposes a baseVal (markup defined attribute value) and an animVal (reflects the current state during animations),
+ both of type 'SVGLength'. These objects are all _live_. That means you can do:
+ var foobar = rect.x.baseVal; foobar.value += 150;
+
+ If we'd implement the SVG DOM straightforward, we'd have to store a refcounted SVGAnimatedLength object, containing two refcounted SVGLength objects
+ in SVGRectElement, for each of the x/y/width/height attributes. Our solution, to reduce memory footprint and increase performance is to store
+ SVGLength stack-allocated, non refcounted types in SVGRectElement for x/y/width/height, and don't implement the SVGAnimatedLength object at all.
+
+ In the past the JS bindings had to expose wrappers for SVGAnimatedLength on their own, and wrap each SVGLength object in an object called JSSVGPODTypeWrapper<SVGLength>.
+ When JS changed the 'value' of the 'SVGLength', we constructed a copy of the SVGLength object, modified it, and called rectElement->setXBaseValue(newLength).
+ This is not efficient at all, as we have to construct several copies of the SVGLength object, utilize callbacks to propagate the value changes in the SVG DOM.
+ Furthermore, all bindings had to expose a similar concept, otherwhise SVG DOM wouldn't work. Up until now, only JSC and V8 bindings were available, that worked properly.
+
+ The new SVGAnimatedProperty concept removes the need for JSSVGPODTypeWrapper (and friends like JSSVGContextCache, that associated a SVGLength with its SVGRectElement).
+ Instead a solution is offered, that all bindings can use simultaneously, without adding new types or special concepts like JSSVGPODTypeWrapper.
+
+ It works like this:
+ A new refcounted SVGAnimatedProperty<PropertyType> template class is available, that stores a QualifiedName to associate the SVG DOM property with a XML DOM attribute.
+ It also stores a RefPtr to the SVGElement that created it.
+
+ In SVGRectElement we still store SVGLength m_x/m_y/m_width/m_height members, and offer a new "xAnimated()" method which looks up or creates a SVGAnimatedProperty<SVGLength>
+ object. The JS/V8/ObjC bindings call this method whenever someone requests "rect.x/y/width/height", and a new wrapper is created, and stored in a HashMap.
+
+ The SVGAnimatedProperty<PropertyType> is a base class for SVGAnimatedPropertyTearOff and SVGAnimatedListPropertyTearOff, the latter is used for all types of lists (SVGLengthList).
+ SVGAnimatedProperty contains two methods used in the bindings: SVGProperty* baseVal and SVGProperty* animVal. SVGProperty is a base class for SVGPropertyTearOff and
+ SVGListPropertyTearOff. Upon invocation of the baseVal/animVal methods a new SVG(List)PropertyTearOff object is created and stored in a RefPtr.
+ The SVGPropertyTearOff objects stores a _reference_ to the type it wraps. Concrete example:
+ When calling rect.x, a SVGAnimatedPropertyTearOff<SVGLength> is created, that stores a pointer to the SVGRectElement, and a SVGNames::xAttr.
+ When calling rect.x.baseVal, a SVGPropertyTearOf<SVGLength> is created, that stores a reference to the "m_x" member variable of the SVGRectElement.
+ Any changes applied to the SVGLength object, through the wrapper, are immediately live, as no copies are involved anymore, nor the need to fire any callback methods.
+ This is the key concept of the new tear offs, no copies, no callbacks, no virtual methods (except one, needed for lists, but it's a detail).
+
+ The SVGAnimatedListPropertyTearOff and SVGListPropertyTearOff work the same, but for SVG*List objects. The whole SVG*List API is _removed_ from the SVG DOM classes
+ like SVGLengthList. It now inherits from Vector<SVGLength>, where it used to store a Vector<RefPtr<SVGListItem<SVGLength> > >. The SVGList API (insertItemBefore, appendItem, etc.)
+ is exposed through SVGListPropertyTearOff, and there's no need anymore for SVGLengthList to deal with it at all.
+ SVGLengthList is live just like most other SVG DOM object. Concrete example:
+ var item0 = text.x.baseVal.getItem(0); item0.value += 150;
+
+ Previously we chose to store a refcounted SVGListItem object, which wrapped the SVGLength object, to achieve liveness. We could change a single list item from DOM
+ w/o copying the whole list. The drawback is that a simple type likeSVGLengthList, was heavy to store, as it contained a list of RefPtrs around a wrapper object
+ around the real object 'SVGLength'. This complexity is completly gone.
+
+ The SVGListPropertyTearOff<SVGLengthList> stores a reference to the SVGLengthList object (eg. SVGTextElement::m_x) and maintains a list of SVGPropertyTearOff<SVGLength>
+ wrappers, that are created when necessary (getItem(2), will create a wrapper around the third list item), and cached. These SVGPropertyTearOff<SVGLength> objects
+ store references to the SVGLength object _in the SVGLengthList_. One has to be extra carefully, to keep those lists synchronized.
+ The SVGLengthList API is fully implemented for the first time, including moving items between lists, and is extensively tested with 8 new testcases.
+
+ This patch only changed SVGLength/SVGLengthList to the new concept. All other types remain using the old DeprecatedSVGAnimatedProperty* concept.
+ This will change in follow-up patches.
+
+ * GNUmakefile.am: Add new files from svg/properties to build.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * bindings/js/JSSVGLengthCustom.cpp: Adapt to context cache removal for SVGLength.
+ (WebCore::JSSVGLength::value):
+ (WebCore::JSSVGLength::convertToSpecifiedUnits):
+ * bindings/scripts/CodeGenerator.pm: Add new isSVGNewStyleAnimatedProperty() helper method, return true for "SVGAnimatedLength" and "SVGAnimatedLengthList".
+ * bindings/scripts/CodeGeneratorJS.pm: Generate new style SVG JS bindings, that don't need JSSVGContextCache / JSSVGPODTypeWrapper.
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto. (+ Finally expose a working set of SVG DOM API for Objective C).
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ * bindings/v8/custom/V8SVGLengthCustom.cpp: Adapt to context cache removal for SVGLength.
+ (WebCore::V8SVGLength::valueAccessorGetter):
+ (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):
+ * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
+ (WebCore::extractFloatValuesFromSVGLengthList): SVGLengthList is a POD type now, passed as const reference.
+ * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove handling for SVGLength/SVGLengthList, those are converted to the new SVGAnimatedProperty design now.
+ * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
+ * svg/SVGAnimatedLength.h: Added.
+ * svg/SVGAnimatedLength.idl: Mark as [SVGAnimatedProperty].
+ * svg/SVGAnimatedLengthList.h: Added.
+ * svg/SVGAnimatedLengthList.idl: Mark as [SVGAnimatedProperty].
+ * svg/SVGCircleElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGCursorElement.h: Ditto.
+ * svg/SVGEllipseElement.h: Ditto.
+ * svg/SVGFilterElement.h: Ditto.
+ * svg/SVGFilterPrimitiveStandardAttributes.h: Ditto.
+ * svg/SVGForeignObjectElement.h: Ditto.
+ * svg/SVGImageElement.h: Ditto.
+ * svg/SVGLength.idl: Mark as [SVGProperty].
+ * svg/SVGLengthList.cpp: Use Vector API (appendItem -> append). No need to ever use the SVGList API internally. SVGLengthList is a Vector<SVGLength> now.
+ (WebCore::SVGLengthList::parse):
+ (WebCore::SVGLengthList::valueAsString):
+ * svg/SVGLengthList.h: Inherit from Vector<SVGLength> - not from the SVGList base class. It's a simple, non-refcounted POD type now.
+ (WebCore::SVGLengthList::SVGLengthList):
+ * svg/SVGLengthList.idl: Mark as [SVGListProperty].
+ * svg/SVGLineElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGLinearGradientElement.h: Ditto.
+ * svg/SVGMarkerElement.h: Ditto.
+ * svg/SVGMaskElement.h: Ditto.
+ * svg/SVGPatternElement.h: Ditto.
+ * svg/SVGRadialGradientElement.h: Ditto.
+ * svg/SVGRectElement.h: Ditto.
+ * svg/SVGSVGElement.h: Ditto.
+ * svg/SVGSVGElement.idl: Mark createSVGLength() as [SVGLiveProperty] - a wrapper for the returned object has to be created.
+ * svg/SVGTextContentElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGTextPathElement.h: Ditto.
+ * svg/SVGTextPositioningElement.cpp:
+ (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
+ (WebCore::SVGTextPositioningElement::parseMappedAttribute): Detach wrappers pointing to the old x/y/dx/dy list, if the underlying list changes via XML DOM.
+ (WebCore::listContainsRelativeValue): Adapt to SVGLengthList interface changes, it's a POD type now.
+ * svg/SVGTextPositioningElement.h: s/DECLARE_ANIMATED_PROPERTY/DECLARE_ANIMATED_LIST_PROPERTY_NEW/ until the transition to the new concept is finished.
+ * svg/SVGUseElement.h:
+ * svg/properties/SVGAnimatedListPropertyTearOff.h: Added.
+ * svg/properties/SVGAnimatedProperty.h: Added. This is the base class for SVGAnimatedPropertyTearOff and SVGAnimatedListPropertyTearOff.
+ * svg/properties/SVGAnimatedPropertyDescription.h: Added. Refactored from DeprecatedSVGAnimatedProperty.h.
+ * svg/properties/SVGAnimatedPropertyMacros.h: Added. These macros will be _removed_ as soon as the transition to the new concept is finished.
+ * svg/properties/SVGAnimatedPropertyTearOff.h: Added.
+ * svg/properties/SVGListPropertyTearOff.h: Added.
+ * svg/properties/SVGProperty.h: Added. This is the base class for SVGPropertyTearOff and SVGListPropertyTearOff.
+ * svg/properties/SVGPropertyTearOff.h: Added.
+ * svg/properties/SVGPropertyTraits.h: Added.
+
+2010-10-21 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Changed the layout algorithm for rows to avoid unnecessary recursion
+ into child rows. This solves the long rendering time experienced in
+ https://bugs.webkit.org/show_bug.cgi?id=43462 as well as reports in
+ various other bugs. The change in the algorithm required some
+ tweaks to other rendering objects to make sure that the baseline
+ alignment still works.
+
+ In addition, an attempt was made to go through the various
+ rendering objects for MathML and reduce unnecessary calls that
+ mark the tree in need of layout.
+
+ * mathml/RenderMathMLFenced.cpp:
+ * mathml/RenderMathMLFenced.h:
+ * mathml/RenderMathMLFraction.cpp:
+ (WebCore::RenderMathMLFraction::layout):
+ * mathml/RenderMathMLOperator.cpp:
+ (WebCore::RenderMathMLOperator::stretchToHeight):
+ * mathml/RenderMathMLRoot.cpp:
+ (WebCore::RenderMathMLRoot::layout):
+ * mathml/RenderMathMLRow.cpp:
+ (WebCore::RenderMathMLRow::layout):
+ * mathml/RenderMathMLRow.h:
+ (WebCore::RenderMathMLRow::stretchToHeight):
+ * mathml/RenderMathMLSubSup.cpp:
+ (WebCore::RenderMathMLSubSup::addChild):
+ (WebCore::RenderMathMLSubSup::stretchToHeight):
+ (WebCore::RenderMathMLSubSup::nonOperatorHeight):
+ (WebCore::RenderMathMLSubSup::layout):
+ (WebCore::RenderMathMLSubSup::baselinePosition):
+ * mathml/RenderMathMLUnderOver.cpp:
+ (WebCore::RenderMathMLUnderOver::stretchToHeight):
+ (WebCore::RenderMathMLUnderOver::layout):
+ (WebCore::RenderMathMLUnderOver::nonOperatorHeight):
+ * mathml/mathtags.in:
+
+2010-10-21 Evan Martin <evan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ sqlite: show extended error codes in error logs
+ https://bugs.webkit.org/show_bug.cgi?id=47859
+
+ SQLite can provide "extended" error codes, where extra information
+ about the error is potentially encoded in the high bits of the error
+ code. It's only off by default in case older apps rely on equality
+ testing on the older error codes, which WebKit doesn't do.
+
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::open):
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::step):
+
+2010-10-21 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Handle WebSocket events via InspectorInstrumentation
+ https://bugs.webkit.org/show_bug.cgi?id=47968
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
+ (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
+ (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
+ (WebCore::InspectorInstrumentation::didCloseWebSocketImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::didCreateWebSocket):
+ (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
+ (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
+ (WebCore::InspectorInstrumentation::didCloseWebSocket):
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ Now we do not depend on InspectorController to generate a resource identifier.
+ (WebCore::WebSocketChannel::disconnect):
+ Check if m_identifier is valid in case we could not obtain an identifier.
+ (WebCore::WebSocketChannel::didOpen):
+ (WebCore::WebSocketChannel::didClose):
+ (WebCore::WebSocketChannel::processBuffer):
+ * websockets/WebSocketChannel.h:
+
+2010-10-20 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Convert sidebar into the browsing tree in the Storage panel.
+ https://bugs.webkit.org/show_bug.cgi?id=47988
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ApplicationCacheItemsView.js:
+ (WebInspector.ApplicationCacheItemsView):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleMessage.prototype._formatMessage):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView):
+ * inspector/front-end/DatabaseTableView.js:
+ (WebInspector.DatabaseTableView.prototype._queryFinished):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel):
+ (WebInspector.StoragePanel.prototype.reset):
+ (WebInspector.StoragePanel.prototype.addDatabase):
+ (WebInspector.StoragePanel.prototype.addCookieDomain):
+ (WebInspector.StoragePanel.prototype.addDOMStorage):
+ (WebInspector.StoragePanel.prototype.addApplicationCache):
+ (WebInspector.StoragePanel.prototype.showDatabase):
+ (WebInspector.StoragePanel.prototype.showDOMStorage):
+ (WebInspector.StoragePanel.prototype.showCookies):
+ (WebInspector.StoragePanel.prototype.showApplicationCache):
+ (WebInspector.StoragePanel.prototype.showCategoryView):
+ (WebInspector.StoragePanel.prototype._innerShowView):
+ (WebInspector.BaseStorageTreeElement):
+ (WebInspector.BaseStorageTreeElement.prototype.onattach):
+ (WebInspector.StorageCategoryTreeElement):
+ (WebInspector.StorageCategoryTreeElement.prototype.onselect):
+ (WebInspector.DatabaseTreeElement):
+ (WebInspector.DatabaseTreeElement.prototype.onselect):
+ (WebInspector.DatabaseTreeElement.prototype.onpopulate.tableNamesCallback):
+ (WebInspector.DatabaseTreeElement.prototype.onpopulate):
+ (WebInspector.DatabaseTableTreeElement):
+ (WebInspector.DatabaseTableTreeElement.prototype.onselect):
+ (WebInspector.DOMStorageTreeElement):
+ (WebInspector.DOMStorageTreeElement.prototype.onselect):
+ (WebInspector.CookieTreeElement):
+ (WebInspector.CookieTreeElement.prototype.onselect):
+ (WebInspector.ApplicationCacheTreeElement):
+ (WebInspector.ApplicationCacheTreeElement.prototype.onselect):
+ (WebInspector.StorageCategoryView):
+ (WebInspector.StorageCategoryView.prototype.setText):
+ * inspector/front-end/inspector.css:
+ (.properties-tree ol):
+ (.properties-tree ol.expanded):
+ (.database-storage-tree-item .icon):
+ (.database-table-storage-tree-item .icon):
+ (.domstorage-storage-tree-item.local-storage .icon):
+ (.domstorage-storage-tree-item.session-storage .icon):
+ (.cookie-storage-tree-item .icon):
+ (.application-cache-storage-tree-item .icon):
+ (.storage.panel .sidebar):
+ (.storage.panel .outline-disclosure > ol):
+ (.storage.panel .outline-disclosure li):
+ (.storage.panel .outline-disclosure li .selection):
+ (.storage.panel .sidebar-resizer-vertical):
+ (.storage-base-tree-element-title):
+ (.storage.panel .outline-disclosure ol):
+ (.storage.panel .outline-disclosure li.selected):
+ (.storage.panel .outline-disclosure .icon):
+ (.storage-empty-view, .storage-view.table .storage-table-error):
+
+2010-10-21 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Replace encodings multi-dimensional array with calls to registrar method
+ https://bugs.webkit.org/show_bug.cgi?id=47990
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::isEncodingAvailable):
+ (WebCore::registerEncodingNameIfAvailable):
+ (WebCore::registerEncodingAliasIfAvailable):
+ (WebCore::registerCodecIfAvailable):
+ (WebCore::TextCodecGtk::registerBaseEncodingNames):
+ (WebCore::TextCodecGtk::registerBaseCodecs):
+ (WebCore::TextCodecGtk::registerExtendedEncodingNames):
+ (WebCore::TextCodecGtk::registerExtendedCodecs):
+ (WebCore::TextCodecGtk::createIConvDecoder):
+ (WebCore::TextCodecGtk::createIConvEncoder):
+ * platform/text/gtk/TextCodecGtk.h:
+
2010-10-20 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r70040.
@@ -318,7 +7303,7 @@
(WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
(WebCore::InputFieldSpeechButtonElement::detach):
-2010-10-19 Leandro Gracia Gil <leandrogracia@google.com>
+2010-10-20 Leandro Gracia Gil <leandrogracia@google.com>
Reviewed by Jeremy Orlow.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 7cb8640..d08fadf 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -109,6 +109,8 @@ ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT;
ENABLE_SVG_USE = ENABLE_SVG_USE;
ENABLE_VIDEO = ENABLE_VIDEO;
+ENABLE_WEB_AUDIO = ;
+
ENABLE_WEB_SOCKETS = $(ENABLE_WEB_SOCKETS_$(REAL_PLATFORM_NAME));
ENABLE_WEB_SOCKETS_macosx = ENABLE_WEB_SOCKETS;
@@ -122,4 +124,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 01f5023..80c1304 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -92,6 +92,7 @@
#include "JSDOMPlugin.cpp"
#include "JSDOMPluginArray.cpp"
#include "JSDOMSelection.cpp"
+#include "JSDOMSettableTokenList.cpp"
#include "JSDOMStringList.cpp"
#include "JSDOMStringMap.cpp"
#include "JSDOMTokenList.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 342bb7b..4e732de 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -125,6 +125,7 @@ DOM_CLASSES = \
DOMSelection \
DOMStringList \
DOMStringMap \
+ DOMSettableTokenList \
DOMTokenList \
DOMWindow \
Database \
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 8f3a228..7403b22 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 b057051..6c1bc35 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -221,6 +221,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSDOMPlugin.h \
DerivedSources/WebCore/JSDOMSelection.cpp \
DerivedSources/WebCore/JSDOMSelection.h \
+ DerivedSources/WebCore/JSDOMSettableTokenList.cpp \
+ DerivedSources/WebCore/JSDOMSettableTokenList.h \
DerivedSources/WebCore/JSDOMStringList.cpp \
DerivedSources/WebCore/JSDOMStringList.h \
DerivedSources/WebCore/JSDOMStringMap.cpp \
@@ -726,6 +728,7 @@ webcore_sources += \
WebCore/bindings/js/JSEventTarget.h \
WebCore/bindings/js/JSExceptionBase.cpp \
WebCore/bindings/js/JSExceptionBase.h \
+ WebCore/bindings/js/JSFileReaderCustom.cpp \
WebCore/bindings/js/JSGeolocationCustom.cpp \
WebCore/bindings/js/JSHistoryCustom.cpp \
WebCore/bindings/js/JSHistoryCustom.h \
@@ -1141,6 +1144,7 @@ webcore_sources += \
WebCore/dom/ExceptionCode.cpp \
WebCore/dom/ExceptionCode.h \
WebCore/dom/FragmentScriptingPermission.h \
+ WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h \
WebCore/dom/InputElement.cpp \
WebCore/dom/InputElement.h \
WebCore/dom/HashChangeEvent.h \
@@ -1351,6 +1355,8 @@ webcore_sources += \
WebCore/editing/SplitTextNodeContainingElementCommand.cpp \
WebCore/editing/SplitTextNodeContainingElementCommand.h \
WebCore/editing/TextAffinity.h \
+ WebCore/editing/TextCheckingHelper.cpp \
+ WebCore/editing/TextCheckingHelper.h \
WebCore/editing/TextGranularity.h \
WebCore/editing/TextIterator.cpp \
WebCore/editing/TextIterator.h \
@@ -1415,6 +1421,9 @@ webcore_sources += \
WebCore/fileapi/FileList.h \
WebCore/fileapi/FileReader.cpp \
WebCore/fileapi/FileReader.h \
+ WebCore/fileapi/FileReaderLoader.cpp \
+ WebCore/fileapi/FileReaderLoader.h \
+ WebCore/fileapi/FileReaderLoaderClient.h \
WebCore/fileapi/FileReaderSync.cpp \
WebCore/fileapi/FileReaderSync.h \
WebCore/fileapi/FileStreamProxy.cpp \
@@ -1452,6 +1461,10 @@ webcore_sources += \
WebCore/history/PageCache.h \
WebCore/html/AsyncImageResizer.cpp \
WebCore/html/AsyncImageResizer.h \
+ WebCore/html/BaseButtonInputType.cpp \
+ WebCore/html/BaseButtonInputType.h \
+ WebCore/html/BaseCheckableInputType.cpp \
+ WebCore/html/BaseCheckableInputType.h \
WebCore/html/BaseDateAndTimeInputType.cpp \
WebCore/html/BaseDateAndTimeInputType.h \
WebCore/html/BaseTextInputType.cpp \
@@ -1471,10 +1484,14 @@ webcore_sources += \
WebCore/html/canvas/CanvasRenderingContext.h \
WebCore/html/canvas/CanvasStyle.cpp \
WebCore/html/canvas/CanvasStyle.h \
+ WebCore/html/DOMSettableTokenList.cpp \
+ WebCore/html/DOMSettableTokenList.h \
WebCore/html/DOMTokenList.cpp \
WebCore/html/DOMTokenList.h \
WebCore/html/CheckboxInputType.cpp \
WebCore/html/CheckboxInputType.h \
+ WebCore/html/ClassList.cpp \
+ WebCore/html/ClassList.h \
WebCore/html/CollectionCache.cpp \
WebCore/html/CollectionCache.h \
WebCore/html/CollectionType.h \
@@ -2125,6 +2142,8 @@ webcore_sources += \
WebCore/page/SpeechInput.cpp \
WebCore/page/SpeechInput.h \
WebCore/page/SpeechInputListener.h \
+ WebCore/page/SpeechInputResult.cpp \
+ WebCore/page/SpeechInputResult.h \
WebCore/page/SuspendableTimer.cpp \
WebCore/page/SuspendableTimer.h \
WebCore/page/Timing.cpp \
@@ -2173,6 +2192,7 @@ webcore_sources += \
WebCore/platform/EventLoop.h \
WebCore/platform/FileChooser.cpp \
WebCore/platform/FileChooser.h \
+ WebCore/platform/FileMetadata.h \
WebCore/platform/FileStreamClient.h \
WebCore/platform/FileStream.cpp \
WebCore/platform/FileStream.h \
@@ -2371,6 +2391,7 @@ webcore_sources += \
WebCore/platform/network/BlobResourceHandle.cpp \
WebCore/platform/network/BlobResourceHandle.h \
WebCore/platform/network/BlobStorageData.h \
+ WebCore/platform/network/CookieStorage.h \
WebCore/platform/network/Credential.cpp \
WebCore/platform/network/Credential.h \
WebCore/platform/network/DNS.h \
@@ -3007,7 +3028,17 @@ webcore_sources += \
WebCore/svg/graphics/SVGImage.h \
WebCore/svg/LinearGradientAttributes.h \
WebCore/svg/PatternAttributes.h \
+ WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h \
+ WebCore/svg/properties/SVGAnimatedProperty.h \
+ WebCore/svg/properties/SVGAnimatedPropertyDescription.h \
+ WebCore/svg/properties/SVGAnimatedPropertyMacros.h \
WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h \
+ WebCore/svg/properties/SVGAnimatedPropertyTearOff.h \
+ WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h \
+ WebCore/svg/properties/SVGListPropertyTearOff.h \
+ WebCore/svg/properties/SVGProperty.h \
+ WebCore/svg/properties/SVGPropertyTearOff.h \
+ WebCore/svg/properties/SVGPropertyTraits.h \
WebCore/svg/RadialGradientAttributes.h \
WebCore/svg/SVGAElement.cpp \
WebCore/svg/SVGAElement.h \
@@ -3017,10 +3048,17 @@ webcore_sources += \
WebCore/svg/SVGAngle.h \
WebCore/svg/SVGAnimateColorElement.cpp \
WebCore/svg/SVGAnimateColorElement.h \
+ WebCore/svg/SVGAnimatedAngle.h \
+ WebCore/svg/SVGAnimatedBoolean.h \
+ WebCore/svg/SVGAnimatedEnumeration.h \
+ WebCore/svg/SVGAnimatedInteger.h \
+ WebCore/svg/SVGAnimatedLength.h \
+ WebCore/svg/SVGAnimatedLengthList.h \
WebCore/svg/SVGAnimatedPathData.cpp \
WebCore/svg/SVGAnimatedPathData.h \
WebCore/svg/SVGAnimatedPoints.cpp \
WebCore/svg/SVGAnimatedPoints.h \
+ WebCore/svg/SVGAnimatedRect.h \
WebCore/svg/SVGAnimateElement.cpp \
WebCore/svg/SVGAnimateElement.h \
WebCore/svg/SVGAnimateMotionElement.cpp \
@@ -3595,6 +3633,8 @@ webcoregtk_sources += \
WebCore/platform/network/soup/SocketStreamError.h \
WebCore/platform/network/soup/SocketStreamHandle.h \
WebCore/platform/network/soup/SocketStreamHandleSoup.cpp \
+ WebCore/platform/network/soup/SoupURIUtils.cpp \
+ WebCore/platform/network/soup/SoupURIUtils.h \
WebCore/platform/network/soup/cache/soup-directory-input-stream.c \
WebCore/platform/network/soup/cache/soup-directory-input-stream.h \
WebCore/platform/network/soup/cache/soup-http-input-stream.c \
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 6948d67..66dc594 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -347,21 +347,17 @@ __ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
__ZN7WebCore15FocusController9setActiveEb
__ZN7WebCore15GraphicsContext12setFillColorERKNS_5ColorENS_10ColorSpaceE
+__ZN7WebCore15GraphicsContext15setFillGradientEN3WTF10PassRefPtrINS_8GradientEEE
__ZN7WebCore15GraphicsContext20endTransparencyLayerEv
__ZN7WebCore15GraphicsContext21setCompositeOperationENS_17CompositeOperatorE
__ZN7WebCore15GraphicsContext22beginTransparencyLayerEf
+__ZN7WebCore15GraphicsContext4clipERKNS_4PathE
__ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE
+__ZN7WebCore15GraphicsContext4saveEv
__ZN7WebCore15GraphicsContext5scaleERKNS_9FloatSizeE
-__ZN7WebCore15GraphicsContext15setFillGradientEN3WTF10PassRefPtrINS_8GradientEEE
-__ZN7WebCore4PathD1Ev
-__ZN7WebCore8Gradient12addColorStopEfRKNS_5ColorE
-__ZN7WebCore4PathC1Ev
-__ZN7WebCore15GraphicsContext4clipERKNS_4PathE
-__ZN7WebCore15GraphicsContext8fillPathEv
-__ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeE
__ZN7WebCore15GraphicsContext7addPathERKNS_4PathE
-__ZN7WebCore15GraphicsContext4saveEv
__ZN7WebCore15GraphicsContext7restoreEv
+__ZN7WebCore15GraphicsContext8fillPathEv
__ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectE
__ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectERKNS_5ColorENS_10ColorSpaceE
__ZN7WebCore15GraphicsContext9setShadowERKNS_9FloatSizeEfRKNS_5ColorENS_10ColorSpaceE
@@ -384,7 +380,7 @@ __ZN7WebCore16DeviceMotionData12Acceleration6createEbdbdbd
__ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
__ZN7WebCore16FontFallbackList15releaseFontDataEv
-__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
+__ZN7WebCore16FontPlatformDataC1EP6NSFontbbNS_15FontOrientationE
__ZN7WebCore16FontPlatformDataD1Ev
__ZN7WebCore16HTMLInputElement13setAutofilledEb
__ZN7WebCore16LegacyWebArchive19createFromSelectionEPNS_5FrameE
@@ -421,9 +417,10 @@ __ZN7WebCore16createFullMarkupEPKNS_4NodeE
__ZN7WebCore16createFullMarkupEPKNS_5RangeE
__ZN7WebCore16enclosingIntRectERK7_NSRect
__ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
-__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE
__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplEPNS0_8JSStringEEES6_
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
+__ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE
__ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
__ZN7WebCore17DeviceOrientation6createEbdbdbd
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
@@ -431,13 +428,16 @@ __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
__ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
__ZN7WebCore17openTemporaryFileEPKcRi
__ZN7WebCore18SearchPopupMenuMacC1EPNS_15PopupMenuClientE
-__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
+__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE
__ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE
__ZN7WebCore18proxyServersForURLERKNS_4KURLEPKNS_17NetworkingContextE
__ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE
__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
+__ZN7WebCore19BackForwardListImpl11currentItemEv
+__ZN7WebCore19BackForwardListImpl11forwardItemEv
+__ZN7WebCore19BackForwardListImpl8backItemEv
__ZN7WebCore19BackForwardListImplC1EPNS_4PageE
__ZN7WebCore19CSSStyleDeclaration11setPropertyERKN3WTF6StringES4_Ri
__ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
@@ -485,8 +485,8 @@ __ZN7WebCore22counterValueForElementEPNS_7ElementE
__ZN7WebCore22createFragmentFromTextEPNS_5RangeERKN3WTF6StringE
__ZN7WebCore22externalRepresentationEPNS_5FrameEj
__ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbbbbNS_10EditActionE
-__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
+__ZN7WebCore23overrideDefaultLanguageERKN3WTF6StringE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore24DocumentMarkerController14markersForNodeEPNS_4NodeE
@@ -607,6 +607,9 @@ __ZN7WebCore4Page9goForwardEv
__ZN7WebCore4Page9initGroupEv
__ZN7WebCore4PageC1ERKNS0_11PageClientsE
__ZN7WebCore4PageD1Ev
+__ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeE
+__ZN7WebCore4PathC1Ev
+__ZN7WebCore4PathD1Ev
__ZN7WebCore4coreEP20NSURLProtectionSpace
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
@@ -625,6 +628,7 @@ __ZN7WebCore5Frame28searchForLabelsBeforeElementEP7NSArrayPNS_7ElementEPmPb
__ZN7WebCore5Frame6createEPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
__ZN7WebCore5Frame7setViewEN3WTF10PassRefPtrINS_9FrameViewEEE
__ZN7WebCore5Frame9nodeImageEPNS_4NodeE
+__ZN7WebCore5Frame9scalePageEf
__ZN7WebCore5FrameD1Ev
__ZN7WebCore5Image12supportsTypeERKN3WTF6StringE
__ZN7WebCore5Image20loadPlatformResourceEPKc
@@ -721,6 +725,7 @@ __ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
__ZN7WebCore8Document4headEv
__ZN7WebCore8FormData6createEPKvm
__ZN7WebCore8FormDataD1Ev
+__ZN7WebCore8Gradient12addColorStopEfRKNS_5ColorE
__ZN7WebCore8GradientC1ERKNS_10FloatPointES3_
__ZN7WebCore8IntPointC1ERK8_NSPoint
__ZN7WebCore8PositionC1EN3WTF10PassRefPtrINS_4NodeEEEi
@@ -901,8 +906,8 @@ __ZNK7WebCore11FrameLoader12blockedErrorERKNS_15ResourceRequestE
__ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
__ZNK7WebCore11FrameLoader14frameHasLoadedEv
__ZNK7WebCore11FrameLoader16outgoingReferrerEv
-__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader17networkingContextEv
+__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
__ZNK7WebCore11FrameLoader8loadTypeEv
__ZNK7WebCore11HistoryItem10visitCountEv
@@ -950,6 +955,7 @@ __ZNK7WebCore13HitTestResult11textContentEv
__ZNK7WebCore13HitTestResult15absoluteLinkURLEv
__ZNK7WebCore13HitTestResult15spellingToolTipERNS_13TextDirectionE
__ZNK7WebCore13HitTestResult16absoluteImageURLEv
+__ZNK7WebCore13HitTestResult16absoluteMediaURLEv
__ZNK7WebCore13HitTestResult16altDisplayStringEv
__ZNK7WebCore13HitTestResult17isContentEditableEv
__ZNK7WebCore13HitTestResult18titleDisplayStringEv
@@ -1050,7 +1056,7 @@ __ZNK7WebCore5Range14startContainerERi
__ZNK7WebCore5Range19boundaryPointsValidEv
__ZNK7WebCore5Range9endOffsetERi
__ZNK7WebCore5Range9firstNodeEv
-__ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesE
+__ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesERKNS_16NavigationActionE
__ZNK7WebCore6Cursor14platformCursorEv
__ZNK7WebCore6Editor12selectedTextEv
__ZNK7WebCore6Editor13canEditRichlyEv
@@ -1085,6 +1091,7 @@ __ZNK7WebCore6Widget25convertToContainingWindowERKNS_7IntRectE
__ZNK7WebCore6Widget25convertToContainingWindowERKNS_8IntPointE
__ZNK7WebCore6Widget9frameRectEv
__ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE
+__ZNK7WebCore7Element19boundsInWindowSpaceEv
__ZNK7WebCore7Element9innerTextEv
__ZNK7WebCore7IntRectcv6CGRectEv
__ZNK7WebCore7IntRectcv7_NSRectEv
@@ -1162,7 +1169,6 @@ _wkInitializeMaximumHTTPConnectionCountPerHost
_wkIsLatchingWheelEvent
_wkMeasureMediaUIPart
_wkMediaControllerThemeAvailable
-_wkNoteOpenPanelFiles
_wkPopupMenu
_wkQTIncludeOnlyModernMediaFileTypes
_wkQTMovieDataRate
@@ -1178,6 +1184,7 @@ _wkQTMovieViewSetDrawSynchronously
_wkSetCGFontRenderingMode
_wkSetCONNECTProxyAuthorizationForStream
_wkSetCONNECTProxyForStream
+_wkSetCookieStoragePrivateBrowsingEnabled
_wkSetDragImage
_wkSetNSURLConnectionDefersCallbacks
_wkSetNSURLRequestShouldContentSniff
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 7f586a6..ce77c8f 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -1077,7 +1077,6 @@
['include', 'platform/graphics/chromium/FontCacheLinux\\.cpp$'],
['include', 'platform/graphics/chromium/FontLinux\\.cpp$'],
['include', 'platform/graphics/chromium/FontPlatformDataLinux\\.cpp$'],
- ['include', 'platform/graphics/chromium/GlyphPageTreeNodeLinux\\.cpp$'],
['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'],
],
}],
@@ -1165,23 +1164,14 @@
# platform/graphics/chromium, included by regex above, instead.
['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
- # The Mac uses ImageSourceCG.cpp from platform/graphics/cg, included
- # by regex above, instead.
- ['exclude', 'platform/graphics/ImageSource\\.cpp$'],
+ # The Mac does not use ImageSourceCG.cpp from platform/graphics/cg
+ # even though it is included by regex above.
+ ['exclude', 'platform/graphics/cg/ImageSourceCG\\.cpp$'],
+ ['exclude', 'platform/graphics/cg/PDFDocumentImage\\.cpp$'],
- # Skia image-decoders are also not used on mac. CoreGraphics
- # is used directly instead.
- ['exclude', 'platform/image-decoders/ImageDecoder\\.h$'],
- ['exclude', 'platform/image-decoders/bmp/BMPImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/bmp/BMPImageReader\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/gif/GIFImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/gif/GIFImageReader\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/ico/ICOImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/jpeg/JPEGImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/webp/WEBPImageDecoder\\.(cpp|h)$'],
- ['exclude', 'platform/image-decoders/png/PNGImageDecoder\\.(cpp|h)$'],
+ # ImageDecoderSkia is not used on mac. ImageDecoderCG is used instead.
['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
- ['exclude', 'platform/image-decoders/xbm/XBMImageDecoder\\.(cpp|h)$'],
+ ['include', 'platform/image-decoders/cg/ImageDecoderCG\\.cpp$'],
# Again, Skia is not used on Mac.
['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
@@ -1206,6 +1196,10 @@
['OS=="win"', {
'sources/': [
['exclude', 'Posix\\.cpp$'],
+
+ # The Chromium Win currently uses GlyphPageTreeNodeChromiumWin.cpp from
+ # platform/graphics/chromium, included by regex above, instead.
+ ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$']
],
}],
['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', {
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 166c4d1..934db17 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -117,6 +117,7 @@
'fileapi/Metadata.idl',
'fileapi/MetadataCallback.idl',
'html/DOMFormData.idl',
+ 'html/DOMSettableTokenList.idl',
'html/DOMTokenList.idl',
'html/DataGridColumn.idl',
'html/DataGridColumnList.idl',
@@ -601,6 +602,7 @@
'bindings/js/JSEventTarget.h',
'bindings/js/JSExceptionBase.cpp',
'bindings/js/JSExceptionBase.h',
+ 'bindings/js/JSFileReaderCustom.cpp',
'bindings/js/JSGeolocationCustom.cpp',
'bindings/js/JSHistoryCustom.cpp',
'bindings/js/JSHistoryCustom.h',
@@ -777,6 +779,7 @@
'bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8DOMFormDataCustom.cpp',
+ 'bindings/v8/custom/V8DOMSettableTokenListCustom.cpp',
'bindings/v8/custom/V8DOMStringMapCustom.cpp',
'bindings/v8/custom/V8DOMTokenListCustom.cpp',
'bindings/v8/custom/V8DOMWindowCustom.cpp',
@@ -1212,6 +1215,7 @@
'dom/ExceptionCode.cpp',
'dom/ExceptionCode.h',
'dom/FragmentScriptingPermission.h',
+ 'dom/IgnoreDestructiveWriteCountIncrementer.h',
'dom/InputElement.cpp',
'dom/InputElement.h',
'dom/HashChangeEvent.h',
@@ -1433,6 +1437,8 @@
'editing/SplitTextNodeContainingElementCommand.cpp',
'editing/SplitTextNodeContainingElementCommand.h',
'editing/TextAffinity.h',
+ 'editing/TextCheckingHelper.cpp',
+ 'editing/TextCheckingHelper.h',
'editing/TextGranularity.h',
'editing/TextIterator.cpp',
'editing/TextIterator.h',
@@ -1503,6 +1509,9 @@
'fileapi/FileList.h',
'fileapi/FileReader.cpp',
'fileapi/FileReader.h',
+ 'fileapi/FileReaderLoader.cpp',
+ 'fileapi/FileReaderLoader.h',
+ 'fileapi/FileReaderLoaderClient.h',
'fileapi/FileReaderSync.cpp',
'fileapi/FileReaderSync.h',
'fileapi/FileStreamProxy.cpp',
@@ -1542,6 +1551,10 @@
'history/PageCache.h',
'html/AsyncImageResizer.cpp',
'html/AsyncImageResizer.h',
+ 'html/BaseButtonInputType.cpp',
+ 'html/BaseButtonInputType.h',
+ 'html/BaseCheckableInputType.cpp',
+ 'html/BaseCheckableInputType.h',
'html/BaseDateAndTimeInputType.cpp',
'html/BaseDateAndTimeInputType.h',
'html/BaseTextInputType.cpp',
@@ -1550,6 +1563,8 @@
'html/ButtonInputType.h',
'html/CheckboxInputType.cpp',
'html/CheckboxInputType.h',
+ 'html/ClassList.cpp',
+ 'html/ClassList.h',
'html/CollectionCache.cpp',
'html/CollectionCache.h',
'html/CollectionType.h',
@@ -1559,6 +1574,8 @@
'html/DOMDataGridDataSource.h',
'html/DOMFormData.cpp',
'html/DOMFormData.h',
+ 'html/DOMSettableTokenList.cpp',
+ 'html/DOMSettableTokenList.h',
'html/DOMTokenList.cpp',
'html/DOMTokenList.h',
'html/DataGridColumn.cpp',
@@ -2262,6 +2279,8 @@
'page/SpeechInput.h',
'page/SpeechInputClient.h',
'page/SpeechInputListener.h',
+ 'page/SpeechInputResult.cpp',
+ 'page/SpeechInputResult.h',
'page/SuspendableTimer.cpp',
'page/SuspendableTimer.h',
'page/Timing.cpp',
@@ -2419,7 +2438,6 @@
'platform/graphics/chromium/GLES2Canvas.cpp',
'platform/graphics/chromium/GLES2Canvas.h',
'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp',
- 'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.h',
'platform/graphics/chromium/HarfbuzzSkia.cpp',
@@ -2614,6 +2632,7 @@
'platform/graphics/skia/FloatRectSkia.cpp',
'platform/graphics/skia/FontCustomPlatformData.cpp',
'platform/graphics/skia/FontCustomPlatformData.h',
+ 'platform/graphics/skia/GlyphPageTreeNodeSkia.cpp',
'platform/graphics/skia/GradientSkia.cpp',
'platform/graphics/skia/GraphicsContextPlatformPrivate.h',
'platform/graphics/skia/GraphicsContextSkia.cpp',
@@ -2844,6 +2863,7 @@
'platform/image-decoders/bmp/BMPImageReader.cpp',
'platform/image-decoders/bmp/BMPImageReader.h',
'platform/image-decoders/cairo/ImageDecoderCairo.cpp',
+ 'platform/image-decoders/cg/ImageDecoderCG.cpp',
'platform/image-decoders/gif/GIFImageDecoder.cpp',
'platform/image-decoders/gif/GIFImageDecoder.h',
'platform/image-decoders/gif/GIFImageReader.cpp',
@@ -3013,6 +3033,7 @@
'platform/network/BlobData.h',
'platform/network/BlobRegistry.h',
'platform/network/BlobStorageData.h',
+ 'platform/network/CookieStorage.h',
'platform/network/Credential.cpp',
'platform/network/Credential.h',
'platform/network/DNS.h',
@@ -3284,6 +3305,7 @@
'platform/EventLoop.h',
'platform/FileChooser.cpp',
'platform/FileChooser.h',
+ 'platform/FileMetadata.h',
'platform/FileStream.cpp',
'platform/FileStream.h',
'platform/FileStreamClient.h',
@@ -3844,6 +3866,8 @@
'storage/IDBPendingTransactionMonitor.h',
'storage/IDBRequest.cpp',
'storage/IDBRequest.h',
+ 'storage/IDBSQLiteDatabase.cpp',
+ 'storage/IDBSQLiteDatabase.h',
'storage/IDBSuccessEvent.cpp',
'storage/IDBSuccessEvent.h',
'storage/IDBTimeoutEvent.cpp',
@@ -3921,6 +3945,17 @@
'svg/graphics/SVGImage.cpp',
'svg/graphics/SVGImage.h',
'svg/properties/SVGAnimatedPropertySynchronizer.h',
+ 'svg/properties/SVGAnimatedListPropertyTearOff.h',
+ 'svg/properties/SVGAnimatedProperty.h',
+ 'svg/properties/SVGAnimatedPropertyDescription.h',
+ 'svg/properties/SVGAnimatedPropertyMacros.h',
+ 'svg/properties/SVGAnimatedPropertySynchronizer.h',
+ 'svg/properties/SVGAnimatedPropertyTearOff.h',
+ 'svg/properties/SVGAnimatedStaticPropertyTearOff.h',
+ 'svg/properties/SVGListPropertyTearOff.h',
+ 'svg/properties/SVGProperty.h',
+ 'svg/properties/SVGPropertyTearOff.h',
+ 'svg/properties/SVGPropertyTraits.h',
'svg/ColorDistance.cpp',
'svg/ColorDistance.h',
'svg/DeprecatedSVGAnimatedProperty.h',
@@ -3946,10 +3981,17 @@
'svg/SVGAnimateMotionElement.h',
'svg/SVGAnimateTransformElement.cpp',
'svg/SVGAnimateTransformElement.h',
+ 'svg/SVGAnimatedAngle.h',
+ 'svg/SVGAnimatedBoolean.h',
+ 'svg/SVGAnimatedEnumeration.h',
+ 'svg/SVGAnimatedInteger.h',
+ 'svg/SVGAnimatedLength.h',
+ 'svg/SVGAnimatedLengthList.h',
'svg/SVGAnimatedPathData.cpp',
'svg/SVGAnimatedPathData.h',
'svg/SVGAnimatedPoints.cpp',
'svg/SVGAnimatedPoints.h',
+ 'svg/SVGAnimatedRect.h',
'svg/SVGAnimationElement.cpp',
'svg/SVGAnimationElement.h',
'svg/SVGCircleElement.cpp',
@@ -4496,6 +4538,7 @@
'inspector/front-end/Images/excludeButtonGlyph.png',
'inspector/front-end/Images/focusButtonGlyph.png',
'inspector/front-end/Images/forward.png',
+ 'inspector/front-end/Images/frame.png',
'inspector/front-end/Images/gearButtonGlyph.png',
'inspector/front-end/Images/glossyHeader.png',
'inspector/front-end/Images/glossyHeaderPressed.png',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 051f4d9..3b38a45 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -207,6 +207,7 @@ IDL_BINDINGS += \
html/DataGridColumn.idl \
html/DataGridColumnList.idl \
html/DOMFormData.idl \
+ html/DOMSettableTokenList.idl \
html/DOMTokenList.idl \
html/HTMLAllCollection.idl \
html/HTMLAudioElement.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index b73061e..132d36d 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -403,6 +403,7 @@ v8 {
bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \
bindings/v8/custom/V8CustomEventListener.cpp \
+ bindings/v8/custom/V8DOMSettableTokenListCustom.cpp \
bindings/v8/custom/V8DOMStringMapCustom.cpp \
bindings/v8/custom/V8DOMTokenListCustom.cpp
@@ -419,6 +420,7 @@ v8 {
bindings/v8/custom/V8ElementCustom.cpp \
bindings/v8/custom/V8EventCustom.cpp \
bindings/v8/custom/V8EventSourceConstructor.cpp \
+ bindings/v8/custom/V8FileReaderCustom.cpp \
bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
contains(DEFINES, ENABLE_VIDEO=1) {
@@ -518,6 +520,7 @@ v8 {
bindings/js/JSEventSourceCustom.cpp \
bindings/js/JSEventTarget.cpp \
bindings/js/JSExceptionBase.cpp \
+ bindings/js/JSFileReaderCustom.cpp \
bindings/js/JSGeolocationCustom.cpp \
bindings/js/JSHistoryCustom.cpp \
bindings/js/JSHTMLAppletElementCustom.cpp \
@@ -814,6 +817,7 @@ SOURCES += \
editing/SplitElementCommand.cpp \
editing/SplitTextNodeCommand.cpp \
editing/SplitTextNodeContainingElementCommand.cpp \
+ editing/TextCheckingHelper.cpp \
editing/TextIterator.cpp \
editing/TypingCommand.cpp \
editing/UnlinkCommand.cpp \
@@ -827,6 +831,7 @@ SOURCES += \
fileapi/File.cpp \
fileapi/FileList.cpp \
fileapi/FileReader.cpp \
+ fileapi/FileReaderLoader.cpp \
fileapi/FileReaderSync.cpp \
fileapi/FileStreamProxy.cpp \
fileapi/FileThread.cpp \
@@ -839,14 +844,18 @@ SOURCES += \
history/qt/HistoryItemQt.cpp \
history/PageCache.cpp \
html/AsyncImageResizer.cpp \
+ html/BaseButtonInputType.cpp \
+ html/BaseCheckableInputType.cpp \
html/BaseDateAndTimeInputType.cpp \
html/BaseTextInputType.cpp \
html/ButtonInputType.cpp \
html/CheckboxInputType.cpp \
+ html/ClassList.cpp \
html/CollectionCache.cpp \
html/ColorInputType.cpp \
html/DOMDataGridDataSource.cpp \
html/DOMFormData.cpp \
+ html/DOMSettableTokenList.cpp \
html/DOMTokenList.cpp \
html/DataGridColumn.cpp \
html/DataGridColumnList.cpp \
@@ -1730,6 +1739,8 @@ HEADERS += \
fileapi/FileException.h \
fileapi/FileList.h \
fileapi/FileReader.h \
+ fileapi/FileReaderLoader.h \
+ fileapi/FileReaderLoaderClient.h \
fileapi/FileReaderSync.h \
fileapi/FileStreamProxy.h \
fileapi/FileThread.h \
@@ -1749,12 +1760,14 @@ HEADERS += \
html/canvas/CanvasRenderingContext.h \
html/canvas/CanvasRenderingContext2D.h \
html/canvas/CanvasStyle.h \
+ html/ClassList.h \
html/CollectionCache.h \
html/DataGridColumn.h \
html/DataGridColumnList.h \
html/DateComponents.h \
html/DOMDataGridDataSource.h \
html/DOMFormData.h \
+ html/DOMSettableTokenList.h \
html/DOMTokenList.h \
html/FormDataList.h \
html/FTPDirectoryDocument.h \
@@ -1999,6 +2012,7 @@ HEADERS += \
page/SpeechInput.h \
page/SpeechInputClient.h \
page/SpeechInputListener.h \
+ page/SpeechInputResult.h \
page/WindowFeatures.h \
page/WorkerNavigator.h \
page/XSSAuditor.h \
@@ -2070,7 +2084,6 @@ HEADERS += \
platform/graphics/Pattern.h \
platform/graphics/Pen.h \
platform/graphics/qt/FontCustomPlatformData.h \
- platform/graphics/qt/GraphicsLayerQt.h \
platform/graphics/qt/ImageDecoderQt.h \
platform/graphics/qt/StillImageQt.h \
platform/graphics/qt/TransparencyLayer.h \
@@ -2103,6 +2116,7 @@ HEADERS += \
platform/network/BlobRegistryImpl.h \
platform/network/BlobResourceHandle.h \
platform/network/BlobStorageData.h \
+ platform/network/CookieStorage.h \
platform/network/Credential.h \
platform/network/FormDataBuilder.h \
platform/network/FormData.h \
@@ -2343,13 +2357,30 @@ HEADERS += \
svg/graphics/filters/SVGFilterBuilder.h \
svg/graphics/filters/SVGFilter.h \
svg/graphics/SVGImage.h \
+ svg/properties/SVGAnimatedListPropertyTearOff.h \
+ svg/properties/SVGAnimatedProperty.h \
+ svg/properties/SVGAnimatedPropertyDescription.h \
+ svg/properties/SVGAnimatedPropertyMacros.h \
svg/properties/SVGAnimatedPropertySynchronizer.h \
+ svg/properties/SVGAnimatedPropertyTearOff.h \
+ svg/properties/SVGAnimatedStaticPropertyTearOff.h \
+ svg/properties/SVGListPropertyTearOff.h \
+ svg/properties/SVGProperty.h \
+ svg/properties/SVGPropertyTearOff.h \
+ svg/properties/SVGPropertyTraits.h \
svg/SVGAElement.h \
svg/SVGAltGlyphElement.h \
svg/SVGAngle.h \
svg/SVGAnimateColorElement.h \
+ svg/SVGAnimatedAngle.h \
+ svg/SVGAnimatedBoolean.h \
+ svg/SVGAnimatedEnumeration.h \
+ svg/SVGAnimatedInteger.h \
+ svg/SVGAnimatedLength.h \
+ svg/SVGAnimatedLengthList.h \
svg/SVGAnimatedPathData.h \
svg/SVGAnimatedPoints.h \
+ svg/SVGAnimatedRect.h \
svg/SVGAnimateElement.h \
svg/SVGAnimateMotionElement.h \
svg/SVGAnimateTransformElement.h \
@@ -2593,7 +2624,6 @@ SOURCES += \
platform/graphics/qt/FloatRectQt.cpp \
platform/graphics/qt/GradientQt.cpp \
platform/graphics/qt/GraphicsContextQt.cpp \
- platform/graphics/qt/GraphicsLayerQt.cpp \
platform/graphics/qt/IconQt.cpp \
platform/graphics/qt/ImageBufferQt.cpp \
platform/graphics/qt/ImageDecoderQt.cpp \
@@ -3016,7 +3046,8 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
fileapi/Metadata.h \
fileapi/MetadataCallback.h \
platform/AsyncFileSystem.h \
- platform/AsyncFileSystemCallbacks.h
+ platform/AsyncFileSystemCallbacks.h \
+ platform/FileMetadata.h
SOURCES += \
bindings/js/JSDirectoryEntryCustom.cpp \
@@ -3092,6 +3123,7 @@ contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
contains(DEFINES, ENABLE_INPUT_SPEECH=1) {
SOURCES += \
page/SpeechInput.cpp \
+ page/SpeechInputResult.cpp \
rendering/RenderInputSpeech.cpp
}
@@ -3806,6 +3838,29 @@ win32:!win32-g++*:contains(QMAKE_HOST.arch, x86_64):{
}
}
+# Uncomment this to enable Texture Mapper.
+# CONFIG += texmap
+
+contains(CONFIG, texmap) {
+ DEFINES += WTF_USE_TEXTURE_MAPPER=1
+ HEADERS += \
+ platform/graphics/texmap/TextureMapper.h \
+ platform/graphics/texmap/TextureMapperPlatformLayer.h
+
+ SOURCES += \
+ platform/graphics/qt/TextureMapperQt.cpp \
+ platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+
+ contains(QT_CONFIG, opengl) {
+ QT += opengl
+ HEADERS += platform/graphics/opengl/TextureMapperGL.h
+ SOURCES += platform/graphics/opengl/TextureMapperGL.cpp
+ }
+} else {
+ HEADERS += platform/graphics/qt/GraphicsLayerQt.h
+ SOURCES += platform/graphics/qt/GraphicsLayerQt.cpp
+}
+
symbian {
shared {
contains(CONFIG, def_files) {
diff --git a/WebCore/WebCore.vcproj/QTMovieWin.vcproj b/WebCore/WebCore.vcproj/QTMovieWin.vcproj
index adda5e0..73e287e 100644
--- a/WebCore/WebCore.vcproj/QTMovieWin.vcproj
+++ b/WebCore/WebCore.vcproj/QTMovieWin.vcproj
@@ -318,6 +318,10 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\win\QTDecompressionSession.cpp"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\win\QTMovie.cpp"
>
</File>
@@ -356,6 +360,10 @@
>
</File>
<File
+ RelativePath="..\platform\graphics\win\QTDecompressionSession.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\graphics\win\QTMovie.h"
>
</File>
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index b7996e5..8cb84a7 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -180,6 +180,7 @@
</Configuration>
<Configuration
Name="Debug_Cairo|Win32"
+ IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops;.\WebCoreCommon.vsprops;.\WebCoreCairo.vsprops;.\WebCoreCURL.vsprops"
CharacterSet="1"
@@ -3959,6 +3960,62 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMSettableTokenList.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMSettableTokenList.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMStringList.cpp"
>
<FileConfiguration
@@ -24263,6 +24320,10 @@
>
</File>
<File
+ RelativePath="..\platform\FileMetadata.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\FileStream.cpp"
>
</File>
@@ -25811,10 +25872,42 @@
<File
RelativePath="..\platform\graphics\win\GraphicsLayerCACF.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="..\platform\graphics\win\GraphicsLayerCACF.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="..\platform\graphics\win\IconWin.cpp"
@@ -25899,18 +25992,82 @@
<File
RelativePath="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.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="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.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="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.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="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.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="..\platform\graphics\win\MediaPlayerPrivateQuickTimeWin.cpp"
@@ -26047,50 +26204,242 @@
<File
RelativePath="..\platform\graphics\win\WebLayer.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="..\platform\graphics\win\WebLayer.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="..\platform\graphics\win\WebTiledLayer.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="..\platform\graphics\win\WebTiledLayer.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="..\platform\graphics\win\WKCACFContextFlusher.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="..\platform\graphics\win\WKCACFContextFlusher.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="..\platform\graphics\win\WKCACFLayer.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="..\platform\graphics\win\WKCACFLayer.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="..\platform\graphics\win\WKCACFLayerRenderer.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="..\platform\graphics\win\WKCACFLayerRenderer.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="..\platform\graphics\win\WKCAImageQueue.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="..\platform\graphics\win\WKCAImageQueue.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
</Filter>
<Filter
@@ -27526,6 +27875,10 @@
>
</File>
<File
+ RelativePath="..\platform\network\CookieStorage.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\network\Credential.cpp"
>
</File>
@@ -27745,7 +28098,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\CredentialStorageCFNet.cpp"
+ RelativePath="..\platform\network\cf\CookieJarCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27765,7 +28118,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\DNSCFNet.cpp"
+ RelativePath="..\platform\network\cf\CookieStorageCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27785,7 +28138,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\FormDataStreamCFNet.cpp"
+ RelativePath="..\platform\network\cf\CookieStorageCFNet.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\cf\CredentialStorageCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27805,14 +28162,14 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\FormDataStreamCFNet.h"
+ RelativePath="..\platform\network\cf\DNSCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -27820,20 +28177,12 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\LoaderRunLoopCF.cpp"
- >
- </File>
- <File
- RelativePath="..\platform\network\cf\LoaderRunLoopCF.h"
- >
- </File>
- <File
- RelativePath="..\platform\network\cf\ProxyServerCFNet.cpp"
+ RelativePath="..\platform\network\cf\FormDataStreamCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27853,7 +28202,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceError.h"
+ RelativePath="..\platform\network\cf\FormDataStreamCFNet.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27873,27 +28222,15 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceErrorCF.cpp"
+ RelativePath="..\platform\network\cf\LoaderRunLoopCF.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="..\platform\network\cf\ResourceHandleCFNet.cpp"
+ RelativePath="..\platform\network\cf\LoaderRunLoopCF.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\cf\ProxyServerCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27913,7 +28250,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceRequest.h"
+ RelativePath="..\platform\network\cf\ResourceError.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27933,7 +28270,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceRequestCFNet.cpp"
+ RelativePath="..\platform\network\cf\ResourceErrorCF.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27953,14 +28290,14 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceRequestCFNet.h"
+ RelativePath="..\platform\network\cf\ResourceHandleCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -27968,12 +28305,12 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCustomBuildTool"
+ Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceResponse.h"
+ RelativePath="..\platform\network\cf\ResourceRequest.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -27993,7 +28330,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\ResourceResponseCFNet.cpp"
+ RelativePath="..\platform\network\cf\ResourceRequestCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28013,14 +28350,14 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\SocketStreamError.h"
+ RelativePath="..\platform\network\cf\ResourceRequestCFNet.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -28028,19 +28365,19 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\SocketStreamHandle.h"
+ RelativePath="..\platform\network\cf\ResourceResponse.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
@@ -28048,12 +28385,12 @@
ExcludedFromBuild="true"
>
<Tool
- Name="VCCLCompilerTool"
+ Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\cf\SocketStreamHandleCFNet.cpp"
+ RelativePath="..\platform\network\cf\ResourceResponseCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28072,12 +28409,8 @@
/>
</FileConfiguration>
</File>
- </Filter>
- <Filter
- Name="win"
- >
<File
- RelativePath="..\platform\network\win\CookieJarCFNetWin.cpp"
+ RelativePath="..\platform\network\cf\SocketStreamError.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28097,7 +28430,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\win\CookieStorageWin.cpp"
+ RelativePath="..\platform\network\cf\SocketStreamHandle.h"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28117,7 +28450,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\platform\network\win\CookieStorageWin.h"
+ RelativePath="..\platform\network\cf\SocketStreamHandleCFNet.cpp"
>
<FileConfiguration
Name="Debug_Cairo|Win32"
@@ -28136,6 +28469,10 @@
/>
</FileConfiguration>
</File>
+ </Filter>
+ <Filter
+ Name="win"
+ >
<File
RelativePath="..\platform\network\win\NetworkStateNotifierWin.cpp"
>
@@ -42171,6 +42508,10 @@
>
</File>
<File
+ RelativePath="..\dom\IgnoreDestructiveWriteCountIncrementer.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\InputElement.cpp"
>
<FileConfiguration
@@ -47619,6 +47960,62 @@
>
</File>
<File
+ RelativePath="..\editing\TextCheckingHelper.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\editing\TextCheckingHelper.h"
+ >
+ </File>
+ <File
RelativePath="..\editing\TextGranularity.h"
>
</File>
@@ -48035,6 +48432,22 @@
>
</File>
<File
+ RelativePath="..\html\BaseButtonInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseButtonInputType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseCheckableInputType.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BaseCheckableInputType.h"
+ >
+ </File>
+ <File
RelativePath="..\html\BaseDateAndTimeInputType.cpp"
>
</File>
@@ -48139,6 +48552,14 @@
>
</File>
<File
+ RelativePath="..\html\ClassList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\ClassList.h"
+ >
+ </File>
+ <File
RelativePath="..\html\CollectionCache.cpp"
>
<FileConfiguration
@@ -48303,6 +48724,14 @@
>
</File>
<File
+ RelativePath="..\html\DOMSettableTokenList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DOMSettableTokenList.h"
+ >
+ </File>
+ <File
RelativePath="..\html\DOMTokenList.cpp"
>
</File>
@@ -48427,6 +48856,18 @@
>
</File>
<File
+ RelativePath="..\fileapi\FileReaderLoader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileReaderLoader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileReaderLoaderClient.h"
+ >
+ </File>
+ <File
RelativePath="..\fileapi\FileReaderSync.cpp"
>
</File>
@@ -55970,6 +56411,10 @@
>
</File>
<File
+ RelativePath="..\bindings\js\JSFileReaderCustom.cpp"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\JSGeolocationCustom.cpp"
>
<FileConfiguration
@@ -61199,6 +61644,30 @@
>
</File>
<File
+ RelativePath="..\svg\SVGAnimatedAngle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedBoolean.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedEnumeration.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedInteger.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedLength.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\SVGAnimatedLengthList.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGAnimatedPathData.h"
>
</File>
@@ -61207,6 +61676,10 @@
>
</File>
<File
+ RelativePath="..\svg\SVGAnimatedRect.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGAnimateElement.h"
>
</File>
@@ -62226,7 +62699,47 @@
Name="properties"
>
<File
- RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h"
+ RelativePath="..\svg\properties\SVGAnimatedListPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedProperty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertyDescription.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertyMacros.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertySynchronizer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGAnimatedStaticPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGListPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGProperty.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGPropertyTearOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\svg\properties\SVGPropertyTraits.h"
>
</File>
</Filter>
diff --git a/WebCore/WebCore.vcproj/WebCoreCairo.vsprops b/WebCore/WebCore.vcproj/WebCoreCairo.vsprops
index 3531128..8c2e770 100644
--- a/WebCore/WebCore.vcproj/WebCoreCairo.vsprops
+++ b/WebCore/WebCore.vcproj/WebCoreCairo.vsprops
@@ -6,6 +6,6 @@
>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\svg\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\xbm&quot;;&quot;$(ProjectDir)..\platform\image-decoders\zlib&quot;;&quot;$(WebKitLibrariesDir)\include\cairo&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\platform\graphics\cairo&quot;;&quot;$(ProjectDir)..\svg\graphics\cairo&quot;;&quot;$(ProjectDir)..\platform\image-decoders&quot;;&quot;$(ProjectDir)..\platform\image-decoders\bmp&quot;;&quot;$(ProjectDir)..\platform\image-decoders\cairo&quot;;&quot;$(ProjectDir)..\platform\image-decoders\gif&quot;;&quot;$(ProjectDir)..\platform\image-decoders\ico&quot;;&quot;$(ProjectDir)..\platform\image-decoders\jpeg&quot;;&quot;$(ProjectDir)..\platform\image-decoders\png&quot;;&quot;$(ProjectDir)..\platform\image-decoders\webp&quot;;&quot;$(WebKitLibrariesDir)\include\cairo&quot;"
/>
</VisualStudioPropertySheet>
diff --git a/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj b/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj
index 4f7dcd9..9b891cd 100644
--- a/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj
+++ b/WebCore/WebCore.vcproj/WebCoreGenerated.vcproj
@@ -62,6 +62,18 @@
RelativePath=".\build-generated-files.sh"
>
</File>
+ <File
+ RelativePath=".\copyForwardingHeaders.cmd"
+ >
+ </File>
+ <File
+ RelativePath=".\copyInspectorFiles.cmd"
+ >
+ </File>
+ <File
+ RelativePath=".\migrate-scripts.sh"
+ >
+ </File>
</Files>
<Globals>
</Globals>
diff --git a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
index a85ace3..3885487 100755
--- a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
+++ b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
@@ -44,7 +44,6 @@ xcopy /y /d "%ProjectDir%..\platform\text\transcoder\*.h" "%WebKitOutputDir%\inc
xcopy /y /d "%ProjectDir%..\platform\win\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\network\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\network\%2\*.h" "%WebKitOutputDir%\include\WebCore"
-xcopy /y /d "%ProjectDir%..\platform\network\win\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\sql\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\platform\cairo\cairo\src\*.h" "%WebKitOutputDir%\include\WebCore"
xcopy /y /d "%ProjectDir%..\bindings\*.h" "%WebKitOutputDir%\include\WebCore"
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index bc612df..6bc2e36 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -91,6 +91,7 @@
08203AA00ED8C35300B8B61A /* WMLAccessElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08203A9E0ED8C35300B8B61A /* WMLAccessElement.h */; };
082341C50FCF3A9500D75BD6 /* WMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */; };
082341C60FCF3A9500D75BD6 /* WMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */; };
+ 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; settings = {ATTRIBUTES = (Private, ); }; };
082FCAC4110927CE00CC4821 /* JSSVGContextCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
083192AA112B43050083C3B9 /* RenderSVGResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 083192A7112B43050083C3B9 /* RenderSVGResource.h */; };
083192AB112B43050083C3B9 /* RenderSVGResourceMasker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 083192A8112B43050083C3B9 /* RenderSVGResourceMasker.cpp */; };
@@ -114,6 +115,7 @@
084D0E3F11F5816100081E1A /* SVGResourcesCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D0E3B11F5816100081E1A /* SVGResourcesCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
084DBAA10ED39D360038C226 /* WMLVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */; };
084DBAA20ED39D360038C226 /* WMLVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 084DBA9E0ED39D360038C226 /* WMLVariables.h */; };
+ 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
0854B0141255E4E600B9CDD0 /* RenderSVGInline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0854B0021255E4E600B9CDD0 /* RenderSVGInline.cpp */; };
0854B0151255E4E600B9CDD0 /* RenderSVGInline.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */; };
0854B0161255E4E600B9CDD0 /* RenderSVGInlineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0854B0041255E4E600B9CDD0 /* RenderSVGInlineText.cpp */; };
@@ -135,6 +137,7 @@
08563BB4117861780012B578 /* RenderSVGResourcePattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08563BB2117861770012B578 /* RenderSVGResourcePattern.cpp */; };
08563BB5117861780012B578 /* RenderSVGResourcePattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 08563BB3117861770012B578 /* RenderSVGResourcePattern.h */; };
08563BD0117865F50012B578 /* RenderSVGResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08563BCF117865F50012B578 /* RenderSVGResource.cpp */; };
+ 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */; settings = {ATTRIBUTES = (Private, ); }; };
08591AA50F085C4E009BACB1 /* InputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08591AA40F085C4E009BACB1 /* InputElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
085AFDC80F2977350061F2B3 /* WMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */; };
085AFDC90F2977350061F2B3 /* WMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */; settings = {ATTRIBUTES = (); }; };
@@ -156,6 +159,7 @@
08735FB910E91232006D6FAD /* SVGMarkerLayoutInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */; };
08744BAA0EDB7D86004C9E63 /* WMLOnEventElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */; };
08744BAE0EDB7D92004C9E63 /* WMLOnEventElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */; };
+ 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */; settings = {ATTRIBUTES = (Private, ); }; };
087D97BF10FB8D7700C00874 /* JSSVGPODListCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 087D97BE10FB8D7700C00874 /* JSSVGPODListCustom.h */; };
087FFA0F0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087FFA0D0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp */; };
087FFA100EFF3ED3009DBD88 /* WMLInsertedLegendElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087FFA0E0EFF3ED3009DBD88 /* WMLInsertedLegendElement.h */; };
@@ -173,6 +177,15 @@
088451160F267B63007F139E /* WMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 088451140F267B63007F139E /* WMLInputElement.h */; };
0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E01126EF1DB00978F7A /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
088C2F7912390081003D65CE /* SVGTextLayoutAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */; };
088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */; };
088C97120ECB6D92000534BA /* WMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA3AB490E556F2400E9C0C0 /* WMLNames.cpp */; };
@@ -189,6 +202,8 @@
088C976D0ECB6E29000534BA /* WMLPageState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0893E4660ECB68F400A28563 /* WMLPageState.h */; };
088C976E0ECB6E29000534BA /* WMLPElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B99350E52E37300487BB7 /* WMLPElement.cpp */; };
088C976F0ECB6E29000534BA /* WMLPElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C6B99360E52E37300487BB7 /* WMLPElement.h */; };
+ 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */; settings = {ATTRIBUTES = (Private, ); }; };
089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 089582530E857A7E00F82C83 /* ImageLoader.cpp */; };
089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; };
0897C14C0ED2EBA500AE06DB /* WMLBRElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0897C14A0ED2EBA400AE06DB /* WMLBRElement.cpp */; };
@@ -213,10 +228,12 @@
08C6A7AB117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */; };
08C6A7AC117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */; };
08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; };
+ 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C859BF1274575300A5728D /* SVGAnimatedRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */; };
08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; };
08CD61BC0ED3929C002DDF51 /* WMLTaskElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08CD61B80ED3929C002DDF51 /* WMLTaskElement.cpp */; };
08CD61BD0ED3929C002DDF51 /* WMLTaskElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08CD61B90ED3929C002DDF51 /* WMLTaskElement.h */; };
+ 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */ = {isa = PBXBuildFile; fileRef = 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */; settings = {ATTRIBUTES = (Private, ); }; };
08DAB9BA1103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08DAB9B81103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp */; };
08DAB9BB1103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08DAB9B91103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h */; };
08DAB9C21103D9C1003E7ABA /* SVGShadowTreeElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */; };
@@ -732,6 +749,10 @@
2E4346550F546A8200B0F1BA /* WorkerThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346430F546A8200B0F1BA /* WorkerThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
2E4346580F546A9900B0F1BA /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */; };
2E4346590F546A9900B0F1BA /* CrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */; };
+ 2E7582EE12764F260062628B /* JSFileReaderCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */; };
+ 2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */; };
+ 2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841B12779ADA0062628B /* FileReaderLoader.h */; };
+ 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; };
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F439119207DA00B7F75D /* JSFileReader.cpp */; };
2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F43A119207DA00B7F75D /* JSFileReader.h */; };
2EA768040FE7126400AB9C8A /* WorkerScriptLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */; };
@@ -845,6 +866,10 @@
379919961200DDF400EA041C /* WOFFFileFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379919941200DDF400EA041C /* WOFFFileFormat.cpp */; };
379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 379919951200DDF400EA041C /* WOFFFileFormat.h */; };
379919B21200DE5000EA041C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 379919B11200DE5000EA041C /* libz.dylib */; };
+ 379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */; };
+ 379E61CA126CA5C400B63E8D /* BaseButtonInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */; };
+ 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */; };
+ 379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */; };
37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37ACCE410DA2980F0089E602 /* FontRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37ACCE620DA2AA960089E602 /* FontDescription.cpp */; };
37C2360B1097EDED00EF9F72 /* FontComplexTextMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C2360A1097EDED00EF9F72 /* FontComplexTextMac.cpp */; };
@@ -931,6 +956,7 @@
4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 4614A1FD0B23A8D600446E1C /* copyCursor.png */; };
464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */; };
464EA2740B8A350B00A8E6E3 /* notAllowedCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */; };
+ 4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
46BD16E30B279473001F0839 /* noneCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46BD16E20B279473001F0839 /* noneCursor.png */; };
46D4F2490AF97E810035385A /* cellCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2460AF97E810035385A /* cellCursor.png */; };
46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2470AF97E810035385A /* contextMenuCursor.png */; };
@@ -1104,6 +1130,12 @@
49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */; };
49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */; };
4A8C96EB0BE69032004EEFF0 /* SelectionControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A8C96EA0BE69032004EEFF0 /* SelectionControllerMac.mm */; };
+ 4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */; };
+ 4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */; };
+ 4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */; };
+ 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */; };
+ 4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */; };
+ 4ACBC0CB12713D0A0094F9B2 /* JSDOMSettableTokenList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */; };
4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2708C50AF19EE40065127F /* Pasteboard.h */; };
4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2709810AF2E5E00065127F /* PasteboardMac.mm */; };
4B3043C70AE0370300A82647 /* Sound.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043C60AE0370300A82647 /* Sound.h */; };
@@ -1466,6 +1498,7 @@
75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */; };
75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
+ 758978EC127090D60076D5A9 /* SpeechInputResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */; };
7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */; };
7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */; };
767F99BE11A1194A0080C51D /* WebSocketHandshakeResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */; };
@@ -2586,6 +2619,7 @@
8A9A587511E84C81008ACFD1 /* JSPerformance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A9A587311E84C81008ACFD1 /* JSPerformance.h */; };
8A9A588711E84F37008ACFD1 /* JSTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A9A587611E84C98008ACFD1 /* JSTiming.cpp */; };
8A9A588811E84F37008ACFD1 /* JSTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A9A587711E84C98008ACFD1 /* JSTiming.h */; };
+ 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */; };
8AF4E55511DC5A36000ED3DE /* Navigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55211DC5A36000ED3DE /* Navigation.cpp */; };
8AF4E55611DC5A36000ED3DE /* Navigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF4E55311DC5A36000ED3DE /* Navigation.h */; };
8AF4E55B11DC5A63000ED3DE /* Timing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF4E55811DC5A63000ED3DE /* Timing.cpp */; };
@@ -3033,6 +3067,8 @@
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 */; };
+ A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */; };
+ A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */; };
A7F338A311C0EFCA00A320A7 /* ShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F338A111C0EFCA00A320A7 /* ShadowElement.cpp */; };
A7F338A411C0EFCA00A320A7 /* ShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F338A211C0EFCA00A320A7 /* ShadowElement.h */; };
A809F1470B73793A002E4D7F /* RenderSVGGradientStop.h in Headers */ = {isa = PBXBuildFile; fileRef = A809F1450B73793A002E4D7F /* RenderSVGGradientStop.h */; };
@@ -4036,7 +4072,7 @@
B2227A3E0D00BF220071B782 /* SVGList.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A80D00BF200071B782 /* SVGList.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2227A3F0D00BF220071B782 /* SVGListTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A90D00BF200071B782 /* SVGListTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278AA0D00BF200071B782 /* SVGLocatable.cpp */; };
- B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AB0D00BF200071B782 /* SVGLocatable.h */; };
+ B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AB0D00BF200071B782 /* SVGLocatable.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2227A430D00BF220071B782 /* SVGMarkerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278AD0D00BF200071B782 /* SVGMarkerElement.cpp */; };
B2227A440D00BF220071B782 /* SVGMarkerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AE0D00BF200071B782 /* SVGMarkerElement.h */; };
B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278B00D00BF200071B782 /* SVGMaskElement.cpp */; };
@@ -5321,6 +5357,8 @@
E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1284BD41044A01E00EAEB52 /* DOMPageTransitionEvent.h */; };
E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = E12EDB7A0B308A78002704B6 /* EventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E12EDBE90B308E0B002704B6 /* EventTarget.cpp */; };
+ E13F01EB1270E10D00DFBA71 /* CookieStorage.h in Resources */ = {isa = PBXBuildFile; fileRef = E13F01EA1270E10D00DFBA71 /* CookieStorage.h */; };
+ E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */; };
E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E15A36D61104572000B7B639 /* XMLNSNames.h */; };
E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15A36D81104572700B7B639 /* XMLNSNames.cpp */; };
E169803D1133542D00894115 /* CRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169803C1133542D00894115 /* CRuntimeObject.h */; };
@@ -5515,6 +5553,7 @@
F5C041E70FFCA96D00839D4A /* JSHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041E20FFCA96D00839D4A /* JSHTMLDataListElement.h */; };
F5D3A57C106B83B300545297 /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D3A57A106B83B300545297 /* DateComponents.cpp */; };
F5D3A57D106B83B300545297 /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D3A57B106B83B300545297 /* DateComponents.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ F7A034C4126BF6BE007DC19E /* FontOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = F7A034C3126BF6BE007DC19E /* FontOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
F916C48D0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */; };
F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
F98FFF4411A2676200F548E8 /* CSSOMUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F98FFF4211A2676200F548E8 /* CSSOMUtils.cpp */; };
@@ -6077,6 +6116,7 @@
08203A9E0ED8C35300B8B61A /* WMLAccessElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLAccessElement.h; sourceTree = "<group>"; };
082341C30FCF3A9400D75BD6 /* WMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLSelectElement.cpp; sourceTree = "<group>"; };
082341C40FCF3A9400D75BD6 /* WMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLSelectElement.h; sourceTree = "<group>"; };
+ 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; };
082FCAC3110927CE00CC4821 /* JSSVGContextCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGContextCache.h; sourceTree = "<group>"; };
083192A7112B43050083C3B9 /* RenderSVGResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResource.h; sourceTree = "<group>"; };
083192A8112B43050083C3B9 /* RenderSVGResourceMasker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceMasker.cpp; sourceTree = "<group>"; };
@@ -6098,6 +6138,7 @@
084D0E3B11F5816100081E1A /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; };
084DBA9D0ED39D350038C226 /* WMLVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLVariables.cpp; sourceTree = "<group>"; };
084DBA9E0ED39D360038C226 /* WMLVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLVariables.h; sourceTree = "<group>"; };
+ 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedStaticPropertyTearOff.h; sourceTree = "<group>"; };
0854B0021255E4E600B9CDD0 /* RenderSVGInline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGInline.cpp; sourceTree = "<group>"; };
0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGInline.h; sourceTree = "<group>"; };
0854B0041255E4E600B9CDD0 /* RenderSVGInlineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGInlineText.cpp; sourceTree = "<group>"; };
@@ -6119,6 +6160,7 @@
08563BB2117861770012B578 /* RenderSVGResourcePattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourcePattern.cpp; sourceTree = "<group>"; };
08563BB3117861770012B578 /* RenderSVGResourcePattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourcePattern.h; sourceTree = "<group>"; };
08563BCF117865F50012B578 /* RenderSVGResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResource.cpp; sourceTree = "<group>"; };
+ 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedBoolean.h; sourceTree = "<group>"; };
08591AA40F085C4E009BACB1 /* InputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputElement.h; sourceTree = "<group>"; };
085AFDC60F2977350061F2B3 /* WMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFormControlElement.cpp; sourceTree = "<group>"; };
085AFDC70F2977350061F2B3 /* WMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFormControlElement.h; sourceTree = "<group>"; };
@@ -6140,6 +6182,7 @@
08735FB710E91232006D6FAD /* SVGMarkerLayoutInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerLayoutInfo.h; sourceTree = "<group>"; };
08744BA90EDB7D86004C9E63 /* WMLOnEventElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLOnEventElement.cpp; sourceTree = "<group>"; };
08744BAD0EDB7D92004C9E63 /* WMLOnEventElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLOnEventElement.h; sourceTree = "<group>"; };
+ 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedAngle.h; sourceTree = "<group>"; };
087D97BE10FB8D7700C00874 /* JSSVGPODListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGPODListCustom.h; sourceTree = "<group>"; };
087FFA0D0EFF3ED3009DBD88 /* WMLInsertedLegendElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLInsertedLegendElement.cpp; sourceTree = "<group>"; };
087FFA0E0EFF3ED3009DBD88 /* WMLInsertedLegendElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLInsertedLegendElement.h; sourceTree = "<group>"; };
@@ -6157,8 +6200,19 @@
088451140F267B63007F139E /* WMLInputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLInputElement.h; sourceTree = "<group>"; };
0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; };
0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; };
+ 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedListPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; };
+ 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyDescription.h; sourceTree = "<group>"; };
+ 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyMacros.h; sourceTree = "<group>"; };
+ 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGListPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0E01126EF1DB00978F7A /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; };
+ 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTearOff.h; sourceTree = "<group>"; };
+ 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTraits.h; sourceTree = "<group>"; };
088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributes.cpp; sourceTree = "<group>"; };
088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributes.h; sourceTree = "<group>"; };
+ 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLength.h; sourceTree = "<group>"; };
+ 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLengthList.h; sourceTree = "<group>"; };
0893E4650ECB68F400A28563 /* WMLPageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLPageState.cpp; sourceTree = "<group>"; };
0893E4660ECB68F400A28563 /* WMLPageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPageState.h; sourceTree = "<group>"; };
089582530E857A7E00F82C83 /* ImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageLoader.cpp; sourceTree = "<group>"; };
@@ -6184,10 +6238,12 @@
08C4C5170EF19A4000E4840F /* WMLImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLImageLoader.h; sourceTree = "<group>"; };
08C6A7A9117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceSolidColor.cpp; sourceTree = "<group>"; };
08C6A7AA117DFBAB00FEA1A2 /* RenderSVGResourceSolidColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceSolidColor.h; sourceTree = "<group>"; };
+ 08C859BF1274575300A5728D /* SVGAnimatedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedRect.h; sourceTree = "<group>"; };
08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FilterEffect.cpp; path = filters/FilterEffect.cpp; sourceTree = "<group>"; };
08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FilterEffect.h; path = filters/FilterEffect.h; sourceTree = "<group>"; };
08CD61B80ED3929C002DDF51 /* WMLTaskElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLTaskElement.cpp; sourceTree = "<group>"; };
08CD61B90ED3929C002DDF51 /* WMLTaskElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLTaskElement.h; sourceTree = "<group>"; };
+ 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumeration.h; sourceTree = "<group>"; };
08DAB9B81103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGShadowTreeRootContainer.cpp; sourceTree = "<group>"; };
08DAB9B91103D9A5003E7ABA /* RenderSVGShadowTreeRootContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGShadowTreeRootContainer.h; sourceTree = "<group>"; };
08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGShadowTreeElements.cpp; sourceTree = "<group>"; };
@@ -6747,6 +6803,10 @@
2E4346430F546A8200B0F1BA /* WorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerThread.h; path = workers/WorkerThread.h; sourceTree = "<group>"; };
2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadCopier.cpp; sourceTree = "<group>"; };
2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadCopier.h; sourceTree = "<group>"; };
+ 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReaderCustom.cpp; sourceTree = "<group>"; };
+ 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileReaderLoader.cpp; path = fileapi/FileReaderLoader.cpp; sourceTree = "<group>"; };
+ 2E75841B12779ADA0062628B /* FileReaderLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReaderLoader.h; path = fileapi/FileReaderLoader.h; sourceTree = "<group>"; };
+ 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReaderLoaderClient.h; path = fileapi/FileReaderLoaderClient.h; sourceTree = "<group>"; };
2E94F439119207DA00B7F75D /* JSFileReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReader.cpp; sourceTree = "<group>"; };
2E94F43A119207DA00B7F75D /* JSFileReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReader.h; sourceTree = "<group>"; };
2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoaderClient.h; path = workers/WorkerScriptLoaderClient.h; sourceTree = "<group>"; };
@@ -6870,6 +6930,10 @@
379919941200DDF400EA041C /* WOFFFileFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WOFFFileFormat.cpp; sourceTree = "<group>"; };
379919951200DDF400EA041C /* WOFFFileFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOFFFileFormat.h; sourceTree = "<group>"; };
379919B11200DE5000EA041C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
+ 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseButtonInputType.cpp; sourceTree = "<group>"; };
+ 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseButtonInputType.h; sourceTree = "<group>"; };
+ 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseCheckableInputType.cpp; sourceTree = "<group>"; };
+ 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseCheckableInputType.h; sourceTree = "<group>"; };
37ACCE410DA2980F0089E602 /* FontRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontRenderingMode.h; sourceTree = "<group>"; };
37ACCE620DA2AA960089E602 /* FontDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontDescription.cpp; sourceTree = "<group>"; };
37C2360A1097EDED00EF9F72 /* FontComplexTextMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontComplexTextMac.cpp; sourceTree = "<group>"; };
@@ -6963,6 +7027,7 @@
4614A1FD0B23A8D600446E1C /* copyCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = copyCursor.png; sourceTree = "<group>"; };
464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crossHairCursor.png; sourceTree = "<group>"; };
464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notAllowedCursor.png; sourceTree = "<group>"; };
+ 4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileMetadata.h; path = platform/FileMetadata.h; sourceTree = "<group>"; };
46BD16E20B279473001F0839 /* noneCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noneCursor.png; sourceTree = "<group>"; };
46D4F2460AF97E810035385A /* cellCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cellCursor.png; sourceTree = "<group>"; };
46D4F2470AF97E810035385A /* contextMenuCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contextMenuCursor.png; sourceTree = "<group>"; };
@@ -7159,6 +7224,13 @@
49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLLayer.h; sourceTree = "<group>"; };
49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLLayer.mm; sourceTree = "<group>"; };
4A8C96EA0BE69032004EEFF0 /* SelectionControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectionControllerMac.mm; path = mac/SelectionControllerMac.mm; sourceTree = "<group>"; };
+ 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClassList.cpp; sourceTree = "<group>"; };
+ 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassList.h; sourceTree = "<group>"; };
+ 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMSettableTokenList.cpp; sourceTree = "<group>"; };
+ 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSettableTokenList.h; sourceTree = "<group>"; };
+ 4ACBC0C212713CCA0094F9B2 /* DOMSettableTokenList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMSettableTokenList.idl; sourceTree = "<group>"; };
+ 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMSettableTokenList.cpp; sourceTree = "<group>"; };
+ 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMSettableTokenList.h; sourceTree = "<group>"; };
4B2708C50AF19EE40065127F /* Pasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pasteboard.h; sourceTree = "<group>"; };
4B2709810AF2E5E00065127F /* PasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardMac.mm; sourceTree = "<group>"; };
4B3043C60AE0370300A82647 /* Sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Sound.h; sourceTree = "<group>"; };
@@ -7561,6 +7633,8 @@
75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = "<group>"; };
75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; };
75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
+ 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInputResult.cpp; sourceTree = "<group>"; };
+ 758978EB127090D60076D5A9 /* SpeechInputResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputResult.h; sourceTree = "<group>"; };
7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeRequest.cpp; sourceTree = "<group>"; };
7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshakeRequest.h; sourceTree = "<group>"; };
767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeResponse.cpp; sourceTree = "<group>"; };
@@ -8637,6 +8711,7 @@
8A9A587311E84C81008ACFD1 /* JSPerformance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPerformance.h; sourceTree = "<group>"; };
8A9A587611E84C98008ACFD1 /* JSTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTiming.cpp; sourceTree = "<group>"; };
8A9A587711E84C98008ACFD1 /* JSTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTiming.h; sourceTree = "<group>"; };
+ 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IgnoreDestructiveWriteCountIncrementer.h; sourceTree = "<group>"; };
8AF4E55211DC5A36000ED3DE /* Navigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Navigation.cpp; sourceTree = "<group>"; };
8AF4E55311DC5A36000ED3DE /* Navigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Navigation.h; sourceTree = "<group>"; };
8AF4E55411DC5A36000ED3DE /* Navigation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Navigation.idl; sourceTree = "<group>"; };
@@ -8650,7 +8725,7 @@
9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
9302B0BE0D79F82C00C7EE83 /* PageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroup.h; sourceTree = "<group>"; };
9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
- 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 4; path = CSSPrimitiveValue.idl; sourceTree = "<group>"; };
+ 9307059009E0C75800B17FE4 /* CSSPrimitiveValue.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSPrimitiveValue.idl; sourceTree = "<group>"; };
930705C709E0C95F00B17FE4 /* Counter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Counter.idl; sourceTree = "<group>"; };
930705D709E0C9B700B17FE4 /* JSCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCounter.cpp; sourceTree = "<group>"; };
930705D909E0C9BF00B17FE4 /* JSCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCounter.h; sourceTree = "<group>"; };
@@ -9080,6 +9155,8 @@
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>"; };
+ A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCheckingHelper.cpp; sourceTree = "<group>"; };
+ A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckingHelper.h; sourceTree = "<group>"; };
A7F338A111C0EFCA00A320A7 /* ShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowElement.cpp; sourceTree = "<group>"; };
A7F338A211C0EFCA00A320A7 /* ShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowElement.h; sourceTree = "<group>"; };
A809F1450B73793A002E4D7F /* RenderSVGGradientStop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGGradientStop.h; sourceTree = "<group>"; };
@@ -11322,6 +11399,8 @@
E1284BD41044A01E00EAEB52 /* DOMPageTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPageTransitionEvent.h; sourceTree = "<group>"; };
E12EDB7A0B308A78002704B6 /* EventTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTarget.h; sourceTree = "<group>"; };
E12EDBE90B308E0B002704B6 /* EventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTarget.cpp; sourceTree = "<group>"; };
+ E13F01EA1270E10D00DFBA71 /* CookieStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieStorage.h; sourceTree = "<group>"; };
+ E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieStorageMac.mm; sourceTree = "<group>"; };
E15A36D61104572000B7B639 /* XMLNSNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLNSNames.h; sourceTree = "<group>"; };
E15A36D81104572700B7B639 /* XMLNSNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNSNames.cpp; sourceTree = "<group>"; };
E169803C1133542D00894115 /* CRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRuntimeObject.h; sourceTree = "<group>"; };
@@ -11555,6 +11634,7 @@
F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
F5D3A57A106B83B300545297 /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
F5D3A57B106B83B300545297 /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
+ F7A034C3126BF6BE007DC19E /* FontOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontOrientation.h; sourceTree = "<group>"; };
F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };
F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequestProgressEvent.h; sourceTree = "<group>"; };
@@ -11663,7 +11743,17 @@
081CDFBD126ECFE800D215CA /* properties */ = {
isa = PBXGroup;
children = (
+ 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */,
+ 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */,
+ 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */,
+ 088A0DFE126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h */,
081CDFBE126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h */,
+ 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */,
+ 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */,
+ 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */,
+ 088A0E01126EF1DB00978F7A /* SVGProperty.h */,
+ 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */,
+ 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */,
);
path = properties;
sourceTree = "<group>";
@@ -12918,6 +13008,7 @@
2EB4BCD0121F03E300EC4885 /* BlobResourceHandle.cpp */,
2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */,
2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */,
+ E13F01EA1270E10D00DFBA71 /* CookieStorage.h */,
514C76580CE923A1007EF3CD /* Credential.cpp */,
514C76590CE923A1007EF3CD /* Credential.h */,
51A052321058774F00CC9E95 /* CredentialStorage.cpp */,
@@ -12966,6 +13057,7 @@
934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */,
514C76420CE9234E007EF3CD /* AuthenticationMac.h */,
514C76430CE9234E007EF3CD /* AuthenticationMac.mm */,
+ E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */,
E1B4CD2410B322E200BFFD7E /* CredentialStorageMac.mm */,
514C76440CE9234E007EF3CD /* FormDataStreamMac.h */,
514C76450CE9234E007EF3CD /* FormDataStreamMac.mm */,
@@ -13173,6 +13265,8 @@
7578F90911DDF26900D933C5 /* SpeechInput.h */,
7578F90A11DDF26900D933C5 /* SpeechInputClient.h */,
7578F91E11E4E32800D933C5 /* SpeechInputListener.h */,
+ 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */,
+ 758978EB127090D60076D5A9 /* SpeechInputResult.h */,
62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
8AF4E55811DC5A63000ED3DE /* Timing.cpp */,
@@ -14454,6 +14548,8 @@
93309DC6099E64910056E581 /* SplitTextNodeContainingElementCommand.cpp */,
93309DC7099E64910056E581 /* SplitTextNodeContainingElementCommand.h */,
93309DC8099E64910056E581 /* TextAffinity.h */,
+ A7DBF8DB1276919C006B6008 /* TextCheckingHelper.cpp */,
+ A7DBF8DC1276919C006B6008 /* TextCheckingHelper.h */,
93309DC9099E64910056E581 /* TextGranularity.h */,
93309DCC099E64910056E581 /* TextIterator.cpp */,
93309DCD099E64910056E581 /* TextIterator.h */,
@@ -14518,6 +14614,10 @@
97C1F5511228558800EDE616 /* parser */,
B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */,
B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */,
+ 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */,
+ 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */,
+ 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */,
+ 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */,
F59C95FD1255B23F000623C0 /* BaseDateAndTimeInputType.cpp */,
F59C95FE1255B23F000623C0 /* BaseDateAndTimeInputType.h */,
F55B3D791251F12D003EF269 /* BaseTextInputType.cpp */,
@@ -14526,6 +14626,8 @@
F55B3D7C1251F12D003EF269 /* ButtonInputType.h */,
F55B3D7D1251F12D003EF269 /* CheckboxInputType.cpp */,
F55B3D7E1251F12D003EF269 /* CheckboxInputType.h */,
+ 4ACBC0BC12713CBD0094F9B2 /* ClassList.cpp */,
+ 4ACBC0BD12713CBD0094F9B2 /* ClassList.h */,
93C441ED0F813A1A00C1A634 /* CollectionCache.cpp */,
93C441EE0F813A1A00C1A634 /* CollectionCache.h */,
93C441FF0F813AE100C1A634 /* CollectionType.h */,
@@ -14551,6 +14653,9 @@
2ED609BA1145B07100C8684E /* DOMFormData.cpp */,
2ED609BB1145B07100C8684E /* DOMFormData.h */,
2E0888C3114883A900AF4265 /* DOMFormData.idl */,
+ 4ACBC0C012713CCA0094F9B2 /* DOMSettableTokenList.cpp */,
+ 4ACBC0C112713CCA0094F9B2 /* DOMSettableTokenList.h */,
+ 4ACBC0C212713CCA0094F9B2 /* DOMSettableTokenList.idl */,
76FC2B0812370DA0006A991A /* DOMTokenList.cpp */,
76FC2B0912370DA0006A991A /* DOMTokenList.h */,
76FC2B0A12370DA0006A991A /* DOMTokenList.idl */,
@@ -14931,8 +15036,12 @@
2EDF369E122C94C8002F7D4E /* FileException.h */,
976D6C66122B8A3D001FD1F7 /* FileList.cpp */,
976D6C67122B8A3D001FD1F7 /* FileList.h */,
+ 4689F1AE1267BAE100E8D380 /* FileMetadata.h */,
976D6C69122B8A3D001FD1F7 /* FileReader.cpp */,
976D6C6A122B8A3D001FD1F7 /* FileReader.h */,
+ 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */,
+ 2E75841B12779ADA0062628B /* FileReaderLoader.h */,
+ 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */,
2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */,
2EDF369B122C94B4002F7D4E /* FileReaderSync.h */,
976D6C6C122B8A3D001FD1F7 /* FileStreamProxy.cpp */,
@@ -15101,6 +15210,8 @@
BC77D1680FF19F550070887B /* JSDataGridColumnList.h */,
2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */,
2E0888D31148848A00AF4265 /* JSDOMFormData.h */,
+ 4ACBC0C812713D0A0094F9B2 /* JSDOMSettableTokenList.cpp */,
+ 4ACBC0C912713D0A0094F9B2 /* JSDOMSettableTokenList.h */,
7694563A1214D97C0007CBAE /* JSDOMTokenList.cpp */,
7694563B1214D97C0007CBAE /* JSDOMTokenList.h */,
49EECEF4105070C400099FAB /* JSFloat32Array.cpp */,
@@ -15900,11 +16011,17 @@
B22277E30D00BF1F0071B782 /* SVGAnimateColorElement.cpp */,
B22277E40D00BF1F0071B782 /* SVGAnimateColorElement.h */,
B22277E50D00BF1F0071B782 /* SVGAnimateColorElement.idl */,
+ 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */,
B22277E60D00BF1F0071B782 /* SVGAnimatedAngle.idl */,
+ 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */,
B22277E70D00BF1F0071B782 /* SVGAnimatedBoolean.idl */,
+ 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */,
B22277E80D00BF1F0071B782 /* SVGAnimatedEnumeration.idl */,
+ 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */,
B22277E90D00BF1F0071B782 /* SVGAnimatedInteger.idl */,
+ 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */,
B22277EA0D00BF1F0071B782 /* SVGAnimatedLength.idl */,
+ 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */,
B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */,
B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */,
B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */,
@@ -15915,6 +16032,7 @@
B22277F20D00BF1F0071B782 /* SVGAnimatedPoints.h */,
B22277F30D00BF1F0071B782 /* SVGAnimatedPoints.idl */,
B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */,
+ 08C859BF1274575300A5728D /* SVGAnimatedRect.h */,
B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */,
B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */,
B22277F80D00BF1F0071B782 /* SVGAnimatedTransformList.idl */,
@@ -16478,6 +16596,7 @@
B2C3DA580D006CD600EF6F26 /* FontFamily.cpp */,
B2C3DA590D006CD600EF6F26 /* FontFamily.h */,
72626E010EF022FE00A07E20 /* FontFastPath.cpp */,
+ F7A034C3126BF6BE007DC19E /* FontOrientation.h */,
37ACCE410DA2980F0089E602 /* FontRenderingMode.h */,
B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */,
37202198106213C600F25C4B /* FontSmoothingMode.h */,
@@ -16865,6 +16984,7 @@
893C485212499B06002B3D86 /* JSEntrySyncCustom.cpp */,
BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */,
+ 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */,
49EECF7210508D9C00099FAB /* JSFloat32ArrayCustom.cpp */,
FE80D7A60E9C1ED2000D6F75 /* JSGeolocationCustom.cpp */,
BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */,
@@ -18062,6 +18182,7 @@
A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
+ 8AB4BC76126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h */,
08700BE60F086C5300919419 /* InputElement.cpp */,
08591AA40F085C4E009BACB1 /* InputElement.h */,
85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
@@ -18338,6 +18459,8 @@
BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */,
BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */,
B2C3DA220D006C1D00EF6F26 /* Base64.h in Headers */,
+ 379E61CA126CA5C400B63E8D /* BaseButtonInputType.h in Headers */,
+ 379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */,
F59C96001255B23F000623C0 /* BaseDateAndTimeInputType.h in Headers */,
F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */,
BC9462D8107A7B4C00857193 /* BeforeLoadEvent.h in Headers */,
@@ -18406,6 +18529,7 @@
A81872200977D3C0005826D9 /* ChildNodeList.h in Headers */,
14D823520AF92A790004F057 /* Chrome.h in Headers */,
14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */,
+ 4ACBC0BF12713CBD0094F9B2 /* ClassList.h in Headers */,
BC904B770D10998F00680D32 /* ClassNodeList.h in Headers */,
BCC0657E0F3CE1B700CD2D87 /* ClientRect.h in Headers */,
BCC065810F3CE1B700CD2D87 /* ClientRectList.h in Headers */,
@@ -18544,6 +18668,9 @@
93309DE1099E64920056E581 /* DeleteSelectionCommand.h in Headers */,
93F1998208245E59001E9ABC /* DeprecatedPtrList.h in Headers */,
93F1996D08245E59001E9ABC /* DeprecatedPtrListImpl.h in Headers */,
+ 081CDFB8126ECFDB00D215CA /* DeprecatedSVGAnimatedProperty.h in Headers */,
+ 081CDFB9126ECFDB00D215CA /* DeprecatedSVGAnimatedPropertyTraits.h in Headers */,
+ 081CDFBA126ECFDB00D215CA /* DeprecatedSVGAnimatedTemplate.h in Headers */,
31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */,
31FB1A59120A5D0600DC02A0 /* DeviceMotionController.h in Headers */,
31FB1A5B120A5D0600DC02A0 /* DeviceMotionData.h in Headers */,
@@ -18833,6 +18960,7 @@
855D358A0AD707310019AAC7 /* DOMRGBColor.h in Headers */,
BCD0FC4F0DBD720B00B2F630 /* DOMRGBColorInternal.h in Headers */,
BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */,
+ 4ACBC0C412713CCA0094F9B2 /* DOMSettableTokenList.h in Headers */,
C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */,
BC64640A11D7F304006455B0 /* DOMStringMap.h in Headers */,
0FF5025B102BA9010066F39A /* DOMStyleMedia.h in Headers */,
@@ -19397,7 +19525,10 @@
2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
F55B3DBE1251F12D003EF269 /* FileInputType.h in Headers */,
976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */,
+ 4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */,
976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */,
+ 2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */,
+ 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */,
2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */,
2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */,
@@ -19431,6 +19562,7 @@
B2C3DA680D006CD600EF6F26 /* FontFallbackList.h in Headers */,
B2C3DA6A0D006CD600EF6F26 /* FontFamily.h in Headers */,
A80E6CF30A1989CA007FB8C5 /* FontFamilyValue.h in Headers */,
+ F7A034C4126BF6BE007DC19E /* FontOrientation.h in Headers */,
B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */,
B2C3DA6B0D006CD600EF6F26 /* FontSelector.h in Headers */,
@@ -19641,6 +19773,7 @@
49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */,
C0C054CD1118C8E400CE2636 /* IDLParser.pm in Headers */,
C0C054CE1118C8E400CE2636 /* IDLStructure.pm in Headers */,
+ 8AB4BC77126FDB7100DEB727 /* IgnoreDestructiveWriteCountIncrementer.h in Headers */,
B27535700B053814002CE64F /* Image.h in Headers */,
B2A10B920B3818BD00099AA4 /* ImageBuffer.h in Headers */,
BCA979171215D055005C485C /* ImageBufferData.h in Headers */,
@@ -19686,6 +19819,7 @@
9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */,
41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */,
82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
+ 4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
@@ -19791,6 +19925,7 @@
A9D247FF0D757E6900FDF959 /* JSDOMPlugin.h in Headers */,
A9D248010D757E6900FDF959 /* JSDOMPluginArray.h in Headers */,
BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
+ 4ACBC0CB12713D0A0094F9B2 /* JSDOMSettableTokenList.h in Headers */,
C5137CF311A58378004ADB99 /* JSDOMStringList.h in Headers */,
BC64649811D82349006455B0 /* JSDOMStringMap.h in Headers */,
7694563D1214D97C0007CBAE /* JSDOMTokenList.h in Headers */,
@@ -20212,6 +20347,7 @@
1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
A8C4A84C09D5649D0003AC8D /* MappedAttributeEntry.h in Headers */,
93309DF8099E64920056E581 /* markup.h in Headers */,
+ 9728C3141268E4390041E89B /* MarkupAccumulator.h in Headers */,
FABE72F51059C1EB00D999DD /* MathMLElement.h in Headers */,
FABE72F71059C1EB00D999DD /* MathMLInlineContainerElement.h in Headers */,
FABE72F91059C1EB00D999DD /* MathMLMathElement.h in Headers */,
@@ -20677,8 +20813,18 @@
65653F2E0D9727D200CA9723 /* SVGAltGlyphElement.h in Headers */,
B22279770D00BF220071B782 /* SVGAngle.h in Headers */,
B222797A0D00BF220071B782 /* SVGAnimateColorElement.h in Headers */,
+ 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */,
+ 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */,
+ 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */,
+ 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */,
B22279850D00BF220071B782 /* SVGAnimatedPathData.h in Headers */,
B22279880D00BF220071B782 /* SVGAnimatedPoints.h in Headers */,
+ 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */,
+ 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */,
+ 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */,
+ 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */,
+ 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */,
+ 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */,
B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */,
B22279930D00BF220071B782 /* SVGAnimateMotionElement.h in Headers */,
B22279950D00BF220071B782 /* SVGAnimateTransformElement.h in Headers */,
@@ -20756,6 +20902,7 @@
B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
B2227A3E0D00BF220071B782 /* SVGList.h in Headers */,
+ 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,
B2227A3F0D00BF220071B782 /* SVGListTraits.h in Headers */,
B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */,
08385FF610F0186000BFE07B /* SVGMarkerData.h in Headers */,
@@ -20801,6 +20948,9 @@
B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */,
B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */,
+ 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */,
+ 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */,
+ 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */,
B2227A9A0D00BF220071B782 /* SVGRadialGradientElement.h in Headers */,
B2227A9E0D00BF220071B782 /* SVGRectElement.h in Headers */,
B2227AA00D00BF220071B782 /* SVGRenderingIntent.h in Headers */,
@@ -20866,6 +21016,7 @@
B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */,
B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */,
B2C3DA380D006C1D00EF6F26 /* TextBreakIteratorInternalICU.h in Headers */,
+ A7DBF8DE1276919C006B6008 /* TextCheckingHelper.h in Headers */,
B2C3DA3A0D006C1D00EF6F26 /* TextCodec.h in Headers */,
B2C3DA3C0D006C1D00EF6F26 /* TextCodecICU.h in Headers */,
B2C3DA3E0D006C1D00EF6F26 /* TextCodecLatin1.h in Headers */,
@@ -21087,12 +21238,10 @@
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
- 4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
- 9728C3141268E4390041E89B /* MarkupAccumulator.h in Headers */,
- 081CDFB8126ECFDB00D215CA /* DeprecatedSVGAnimatedProperty.h in Headers */,
- 081CDFB9126ECFDB00D215CA /* DeprecatedSVGAnimatedPropertyTraits.h in Headers */,
- 081CDFBA126ECFDB00D215CA /* DeprecatedSVGAnimatedTemplate.h in Headers */,
- 081CDFBF126ECFE800D215CA /* SVGAnimatedPropertySynchronizer.h in Headers */,
+ 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */,
+ 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */,
+ 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */,
+ 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -21152,7 +21301,6 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
- developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -21184,6 +21332,7 @@
46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */,
46D4F2490AF97E810035385A /* cellCursor.png in Resources */,
46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */,
+ E13F01EB1270E10D00DFBA71 /* CookieStorage.h in Resources */,
4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */,
464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */,
1C14E76C0AD8C81C00B6158B /* deleteButton.tiff in Resources */,
@@ -21453,6 +21602,8 @@
BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */,
BC124EE70C2641CD009E2349 /* BarInfo.cpp in Sources */,
B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */,
+ 379E61C9126CA5C300B63E8D /* BaseButtonInputType.cpp in Sources */,
+ 379E61CB126CA5C400B63E8D /* BaseCheckableInputType.cpp in Sources */,
F59C95FF1255B23F000623C0 /* BaseDateAndTimeInputType.cpp in Sources */,
F55B3DAD1251F12D003EF269 /* BaseTextInputType.cpp in Sources */,
5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */,
@@ -21506,6 +21657,7 @@
A81872250977D3C0005826D9 /* ChildNodeList.cpp in Sources */,
14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
ABAF22080C03B1C700B0BCF0 /* ChromeMac.mm in Sources */,
+ 4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */,
BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
BCC0657D0F3CE1B700CD2D87 /* ClientRect.cpp in Sources */,
BCC065800F3CE1B700CD2D87 /* ClientRectList.cpp in Sources */,
@@ -21536,6 +21688,7 @@
06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */,
93B6A0EA0B0BCA8400F5027A /* ContextMenuMac.mm in Sources */,
9352087709BD453400F2038D /* CookieJar.mm in Sources */,
+ E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */,
BC5EB9500E82056B00B25965 /* CounterDirectives.cpp in Sources */,
9392F1500AD1862300691BD4 /* CounterNode.cpp in Sources */,
D0B0556909C6700100307E43 /* CreateLinkCommand.cpp in Sources */,
@@ -21779,6 +21932,7 @@
858C38A80AA8F20400B187A4 /* DOMRect.mm in Sources */,
BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */,
BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */,
+ 4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */,
C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */,
BC64640911D7F304006455B0 /* DOMStringMap.cpp in Sources */,
0FF5025C102BA9010066F39A /* DOMStyleMedia.mm in Sources */,
@@ -21997,6 +22151,7 @@
F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */,
976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */,
+ 2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */,
2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
976D6C8B122B8A3D001FD1F7 /* FileStreamProxy.cpp in Sources */,
@@ -22243,6 +22398,7 @@
B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */,
4F707A9911EF679400ACDA69 /* InspectorBackendDispatcher.cpp in Sources */,
+ 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
82AB1743124B99EC00C5069D /* InspectorCSSAgent.cpp in Sources */,
82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */,
@@ -22257,6 +22413,7 @@
9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */,
41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */,
82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
+ 4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
@@ -22387,6 +22544,7 @@
A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */,
A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */,
BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
+ 4ACBC0CA12713D0A0094F9B2 /* JSDOMSettableTokenList.cpp in Sources */,
C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
@@ -22426,6 +22584,7 @@
898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */,
BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */,
+ 2E7582EE12764F260062628B /* JSFileReaderCustom.cpp in Sources */,
898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */,
898785B2122CA2A7003AABDA /* JSFileSystemCallback.cpp in Sources */,
46DA844D1224A0710060D006 /* JSFileWriter.cpp in Sources */,
@@ -22850,6 +23009,7 @@
1A98956B0AA78F80005EF5EF /* KURLCFNet.cpp in Sources */,
6593923A09AE435C002C531F /* KURLMac.mm in Sources */,
A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
+ E18772F1126E2629003DD586 /* Language.cpp in Sources */,
9352084509BD43B900F2038D /* Language.mm in Sources */,
2D9066060BE141D400956998 /* LayoutState.cpp in Sources */,
512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
@@ -22874,6 +23034,7 @@
93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */,
1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */,
93309DF7099E64920056E581 /* markup.cpp in Sources */,
+ 9728C3131268E4390041E89B /* MarkupAccumulator.cpp in Sources */,
FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */,
FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */,
FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */,
@@ -23209,6 +23370,7 @@
626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
7578F90B11DDF26900D933C5 /* SpeechInput.cpp in Sources */,
7535BC9412020CFF0037EC45 /* SpeechInputClientMock.cpp in Sources */,
+ 758978EC127090D60076D5A9 /* SpeechInputResult.cpp in Sources */,
93309E11099E64920056E581 /* SplitElementCommand.cpp in Sources */,
93309E13099E64920056E581 /* SplitTextNodeCommand.cpp in Sources */,
93309E15099E64920056E581 /* SplitTextNodeContainingElementCommand.cpp in Sources */,
@@ -23454,6 +23616,7 @@
B2AFFC970D00A5DF0030074D /* TextBoundaries.mm in Sources */,
B2C3DA370D006C1D00EF6F26 /* TextBreakIteratorICU.cpp in Sources */,
B2AFFC980D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm in Sources */,
+ A7DBF8DD1276919C006B6008 /* TextCheckingHelper.cpp in Sources */,
B2C3DA390D006C1D00EF6F26 /* TextCodec.cpp in Sources */,
B2C3DA3B0D006C1D00EF6F26 /* TextCodecICU.cpp in Sources */,
B2C3DA3D0D006C1D00EF6F26 /* TextCodecLatin1.cpp in Sources */,
@@ -23640,10 +23803,6 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- 4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
- 9728C3131268E4390041E89B /* MarkupAccumulator.cpp in Sources */,
- E18772F1126E2629003DD586 /* Language.cpp in Sources */,
- 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/WebCorePrefix.h b/WebCore/WebCorePrefix.h
index a871e4c..b42f035 100644
--- a/WebCore/WebCorePrefix.h
+++ b/WebCore/WebCorePrefix.h
@@ -23,7 +23,7 @@
* 2) in one case at least: OS-X-specific performance bug workarounds
* 3) the special trick to catch us using new or delete without including "config.h"
* The project should be able to build without this header, although we rarely test that.
- */
+ */
/* Things that need to be defined globally should go into "config.h". */
diff --git a/WebCore/accessibility/AXObjectCache.cpp b/WebCore/accessibility/AXObjectCache.cpp
index 30cce3a..5f969cd 100644
--- a/WebCore/accessibility/AXObjectCache.cpp
+++ b/WebCore/accessibility/AXObjectCache.cpp
@@ -323,7 +323,7 @@ void AXObjectCache::remove(RenderObject* renderer)
m_renderObjectMapping.remove(renderer);
}
-#if !PLATFORM(WIN)
+#if !PLATFORM(WIN) || OS(WINCE)
AXID AXObjectCache::platformGenerateAXID() const
{
static AXID lastUsedID = 0;
diff --git a/WebCore/accessibility/AccessibilityARIAGrid.cpp b/WebCore/accessibility/AccessibilityARIAGrid.cpp
index 0d9f845..8651a80 100644
--- a/WebCore/accessibility/AccessibilityARIAGrid.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGrid.cpp
@@ -83,7 +83,7 @@ void AccessibilityARIAGrid::addChildren()
{
ASSERT(!m_haveChildren);
- if (!isDataTable()) {
+ if (!isAccessibilityTable()) {
AccessibilityRenderObject::addChildren();
return;
}
diff --git a/WebCore/accessibility/AccessibilityARIAGridCell.cpp b/WebCore/accessibility/AccessibilityARIAGridCell.cpp
index 1771bb8..c8157f5 100644
--- a/WebCore/accessibility/AccessibilityARIAGridCell.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGridCell.cpp
@@ -57,7 +57,7 @@ AccessibilityObject* AccessibilityARIAGridCell::parentTable() const
return 0;
parent = parent->parentObjectUnignored();
- if (!parent || !parent->isDataTable())
+ if (!parent || !parent->isAccessibilityTable())
return 0;
return parent;
diff --git a/WebCore/accessibility/AccessibilityARIAGridRow.cpp b/WebCore/accessibility/AccessibilityARIAGridRow.cpp
index 7d562d9..2b96036 100644
--- a/WebCore/accessibility/AccessibilityARIAGridRow.cpp
+++ b/WebCore/accessibility/AccessibilityARIAGridRow.cpp
@@ -65,7 +65,7 @@ void AccessibilityARIAGridRow::disclosedRows(AccessibilityChildrenVector& disclo
// The contiguous disclosed rows will be the rows in the table that
// have an aria-level of plus 1 from this row.
AccessibilityObject* parent = parentObjectUnignored();
- if (!parent || !parent->isDataTable())
+ if (!parent || !parent->isAccessibilityTable())
return;
// Search for rows that match the correct level.
@@ -92,7 +92,7 @@ AccessibilityObject* AccessibilityARIAGridRow::disclosedByRow() const
// The row that discloses this one is the row in the table
// that is aria-level subtract 1 from this row.
AccessibilityObject* parent = parentObjectUnignored();
- if (!parent || !parent->isDataTable())
+ if (!parent || !parent->isAccessibilityTable())
return 0;
// If the level is 1 or less, than nothing discloses this row.
@@ -119,7 +119,7 @@ AccessibilityObject* AccessibilityARIAGridRow::disclosedByRow() const
AccessibilityObject* AccessibilityARIAGridRow::parentTable() const
{
AccessibilityObject* parent = parentObjectUnignored();
- if (!parent->isDataTable())
+ if (!parent->isAccessibilityTable())
return 0;
return parent;
diff --git a/WebCore/accessibility/AccessibilityListBoxOption.cpp b/WebCore/accessibility/AccessibilityListBoxOption.cpp
index 3e4dad9..81a5978 100644
--- a/WebCore/accessibility/AccessibilityListBoxOption.cpp
+++ b/WebCore/accessibility/AccessibilityListBoxOption.cpp
@@ -184,7 +184,9 @@ void AccessibilityListBoxOption::setSelected(bool selected)
if ((isOptionSelected && selected) || (!isOptionSelected && !selected))
return;
- selectElement->accessKeySetSelectedIndex(listBoxOptionIndex());
+ // Convert from the entire list index to the option index.
+ int optionIndex = static_cast<SelectElement*>(selectElement)->listToOptionIndex(listBoxOptionIndex());
+ selectElement->accessKeySetSelectedIndex(optionIndex);
}
HTMLSelectElement* AccessibilityListBoxOption::listBoxOptionParentNode() const
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index bcf09d2..66424ea 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -285,6 +285,7 @@ public:
virtual bool isSlider() const { return false; }
virtual bool isControl() const { return false; }
virtual bool isList() const { return false; }
+ virtual bool isAccessibilityTable() const { return false; }
virtual bool isDataTable() const { return false; }
virtual bool isTableRow() const { return false; }
virtual bool isTableColumn() const { return false; }
@@ -392,7 +393,6 @@ public:
virtual String ariaLabeledByAttribute() const { return String(); }
virtual String ariaDescribedByAttribute() const { return String(); }
virtual String accessibilityDescription() const { return String(); }
- virtual PassRefPtr<Range> ariaSelectedTextDOMRange() const { return 0; }
virtual AXObjectCache* axObjectCache() const { return 0; }
AXID axObjectID() const { return m_id; }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 0b82c67..efa2036 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1916,35 +1916,22 @@ int AccessibilityRenderObject::textLength() const
return text().length();
}
-PassRefPtr<Range> AccessibilityRenderObject::ariaSelectedTextDOMRange() const
+PlainTextRange AccessibilityRenderObject::ariaSelectedTextRange() const
{
Node* node = m_renderer->node();
if (!node)
- return 0;
-
- RefPtr<Range> currentSelectionRange = selection().toNormalizedRange();
- if (!currentSelectionRange)
- return 0;
+ return PlainTextRange();
ExceptionCode ec = 0;
- if (!currentSelectionRange->intersectsNode(node, ec))
- return Range::create(currentSelectionRange->ownerDocument());
-
- RefPtr<Range> ariaRange = rangeOfContents(node);
- Position startPosition, endPosition;
-
- // Find intersection of currentSelectionRange and ariaRange
- if (ariaRange->startOffset() > currentSelectionRange->startOffset())
- startPosition = ariaRange->startPosition();
- else
- startPosition = currentSelectionRange->startPosition();
+ VisibleSelection visibleSelection = selection();
+ RefPtr<Range> currentSelectionRange = visibleSelection.toNormalizedRange();
+ if (!currentSelectionRange || !currentSelectionRange->intersectsNode(node, ec))
+ return PlainTextRange();
- if (ariaRange->endOffset() < currentSelectionRange->endOffset())
- endPosition = ariaRange->endPosition();
- else
- endPosition = currentSelectionRange->endPosition();
+ int start = indexForVisiblePosition(visibleSelection.start());
+ int end = indexForVisiblePosition(visibleSelection.end());
- return Range::create(ariaRange->ownerDocument(), startPosition, endPosition);
+ return PlainTextRange(start, end - start);
}
String AccessibilityRenderObject::selectedText() const
@@ -1962,10 +1949,7 @@ String AccessibilityRenderObject::selectedText() const
if (ariaRoleAttribute() == UnknownRole)
return String();
- RefPtr<Range> ariaRange = ariaSelectedTextDOMRange();
- if (!ariaRange)
- return String();
- return ariaRange->text();
+ return doAXStringForRange(ariaSelectedTextRange());
}
const AtomicString& AccessibilityRenderObject::accessKey() const
@@ -1999,20 +1983,16 @@ PlainTextRange AccessibilityRenderObject::selectedTextRange() const
if (ariaRole == UnknownRole)
return PlainTextRange();
- RefPtr<Range> ariaRange = ariaSelectedTextDOMRange();
- if (!ariaRange)
- return PlainTextRange();
- return PlainTextRange(ariaRange->startOffset(), ariaRange->endOffset());
+ return ariaSelectedTextRange();
}
void AccessibilityRenderObject::setSelectedTextRange(const PlainTextRange& range)
{
if (isNativeTextControl()) {
- RenderTextControl* textControl = toRenderTextControl(m_renderer);
- textControl->setSelectionRange(range.start, range.start + range.length);
+ setSelectionRange(m_renderer->node(), range.start, range.start + range.length);
return;
}
-
+
Document* document = m_renderer->document();
if (!document)
return;
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index c62e98d..970ef9f 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -186,7 +186,6 @@ public:
virtual String textUnderElement() const;
virtual String text() const;
virtual int textLength() const;
- virtual PassRefPtr<Range> ariaSelectedTextDOMRange() const;
virtual String selectedText() const;
virtual const AtomicString& accessKey() const;
virtual const String& actionVerb() const;
@@ -277,6 +276,7 @@ private:
bool isAllowedChildOfTree() const;
bool hasTextAlternative() const;
String positionalDescriptionForMSAA() const;
+ PlainTextRange ariaSelectedTextRange() const;
Element* menuElementForMenuButton() const;
Element* menuItemElementForMenu() const;
diff --git a/WebCore/accessibility/AccessibilityTable.cpp b/WebCore/accessibility/AccessibilityTable.cpp
index 7f7b6f2..aa51f9e 100644
--- a/WebCore/accessibility/AccessibilityTable.cpp
+++ b/WebCore/accessibility/AccessibilityTable.cpp
@@ -67,37 +67,45 @@ PassRefPtr<AccessibilityTable> AccessibilityTable::create(RenderObject* renderer
return adoptRef(new AccessibilityTable(renderer));
}
-bool AccessibilityTable::isTableExposableThroughAccessibility()
+bool AccessibilityTable::hasARIARole() const
{
- // the following is a heuristic used to determine if a
- // <table> should be exposed as an AXTable. The goal
- // is to only show "data" tables
-
- if (!renderer())
+ if (!m_renderer)
return false;
- // if the developer assigned an aria role to this, then we shouldn't
- // expose it as a table, unless, of course, the aria role is a table
AccessibilityRole ariaRole = ariaRoleAttribute();
if (ariaRole != UnknownRole)
+ return true;
+
+ return false;
+}
+
+bool AccessibilityTable::isAccessibilityTable() const
+{
+ if (!m_renderer)
return false;
- RenderTable* table = toRenderTable(m_renderer);
-
- // this employs a heuristic to determine if this table should appear.
- // Only "data" tables should be exposed as tables.
+ return m_isAccessibilityTable;
+}
+
+bool AccessibilityTable::isDataTable() const
+{
+ if (!m_renderer)
+ return false;
+
+ // Do not consider it a data table is it has an ARIA role.
+ if (hasARIARole())
+ return false;
+
+ // This employs a heuristic to determine if this table should appear.
+ // Only "data" tables should be exposed as tables.
// Unfortunately, there is no good way to determine the difference
- // between a "layout" table and a "data" table
+ // between a "layout" table and a "data" table.
+ RenderTable* table = toRenderTable(m_renderer);
Node* tableNode = table->node();
if (!tableNode || !tableNode->hasTagName(tableTag))
return false;
- // Gtk+ ATs expect all tables to be exposed as tables.
-#if PLATFORM(GTK)
- return true;
-#endif
-
// if there is a caption element, summary, THEAD, or TFOOT section, it's most certainly a data table
HTMLTableElement* tableElement = static_cast<HTMLTableElement*>(tableNode);
if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElement->tFoot() || tableElement->caption())
@@ -242,6 +250,30 @@ bool AccessibilityTable::isTableExposableThroughAccessibility()
return false;
}
+bool AccessibilityTable::isTableExposableThroughAccessibility() const
+{
+ // The following is a heuristic used to determine if a
+ // <table> should be exposed as an AXTable. The goal
+ // is to only show "data" tables.
+
+ if (!m_renderer)
+ return false;
+
+ // If the developer assigned an aria role to this, then we
+ // shouldn't expose it as a table, unless, of course, the aria
+ // role is a table.
+ if (hasARIARole())
+ return false;
+
+ // Gtk+ ATs expect all tables to be exposed as tables.
+#if PLATFORM(GTK)
+ Node* tableNode = toRenderTable(m_renderer)->node();
+ return tableNode && tableNode->hasTagName(tableTag);
+#endif
+
+ return isDataTable();
+}
+
void AccessibilityTable::clearChildren()
{
AccessibilityRenderObject::clearChildren();
@@ -251,7 +283,7 @@ void AccessibilityTable::clearChildren()
void AccessibilityTable::addChildren()
{
- if (!isDataTable()) {
+ if (!isAccessibilityTable()) {
AccessibilityRenderObject::addChildren();
return;
}
@@ -488,7 +520,7 @@ AccessibilityTableCell* AccessibilityTable::cellForColumnAndRow(unsigned column,
AccessibilityRole AccessibilityTable::roleValue() const
{
- if (!isDataTable())
+ if (!isAccessibilityTable())
return AccessibilityRenderObject::roleValue();
return TableRole;
@@ -502,7 +534,7 @@ bool AccessibilityTable::accessibilityIsIgnored() const
if (decision == IgnoreObject)
return true;
- if (!isDataTable())
+ if (!isAccessibilityTable())
return AccessibilityRenderObject::accessibilityIsIgnored();
return false;
@@ -510,7 +542,7 @@ bool AccessibilityTable::accessibilityIsIgnored() const
String AccessibilityTable::title() const
{
- if (!isDataTable())
+ if (!isAccessibilityTable())
return AccessibilityRenderObject::title();
String title;
@@ -532,12 +564,4 @@ String AccessibilityTable::title() const
return title;
}
-bool AccessibilityTable::isDataTable() const
-{
- if (!m_renderer)
- return false;
-
- return m_isAccessibilityTable;
-}
-
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityTable.h b/WebCore/accessibility/AccessibilityTable.h
index 2ee5812..1666367 100644
--- a/WebCore/accessibility/AccessibilityTable.h
+++ b/WebCore/accessibility/AccessibilityTable.h
@@ -51,7 +51,9 @@ public:
static PassRefPtr<AccessibilityTable> create(RenderObject*);
virtual ~AccessibilityTable();
+ virtual bool isAccessibilityTable() const;
virtual bool isDataTable() const;
+
virtual AccessibilityRole roleValue() const;
virtual bool isAriaTable() const { return false; }
@@ -86,7 +88,8 @@ protected:
AccessibilityTableHeaderContainer* m_headerContainer;
mutable bool m_isAccessibilityTable;
- bool isTableExposableThroughAccessibility();
+ bool hasARIARole() const;
+ bool isTableExposableThroughAccessibility() const;
};
} // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp
index e2efb5e..7ad6063 100644
--- a/WebCore/accessibility/AccessibilityTableCell.cpp
+++ b/WebCore/accessibility/AccessibilityTableCell.cpp
@@ -84,7 +84,7 @@ AccessibilityObject* AccessibilityTableCell::parentTable() const
bool AccessibilityTableCell::isTableCell() const
{
AccessibilityObject* table = parentTable();
- if (!table || !table->isDataTable())
+ if (!table || !table->isAccessibilityTable())
return false;
return true;
diff --git a/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp b/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
index e2da83c..dad6963 100644
--- a/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
+++ b/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
@@ -85,7 +85,7 @@ void AccessibilityTableHeaderContainer::addChildren()
ASSERT(!m_haveChildren);
m_haveChildren = true;
- if (!m_parentTable || !m_parentTable->isDataTable())
+ if (!m_parentTable || !m_parentTable->isAccessibilityTable())
return;
static_cast<AccessibilityTable*>(m_parentTable)->columnHeaders(m_children);
diff --git a/WebCore/accessibility/AccessibilityTableRow.cpp b/WebCore/accessibility/AccessibilityTableRow.cpp
index 5e9f05c..09db132 100644
--- a/WebCore/accessibility/AccessibilityTableRow.cpp
+++ b/WebCore/accessibility/AccessibilityTableRow.cpp
@@ -68,7 +68,7 @@ AccessibilityRole AccessibilityTableRow::roleValue() const
bool AccessibilityTableRow::isTableRow() const
{
AccessibilityObject* table = parentTable();
- if (!table || !table->isDataTable())
+ if (!table || !table->isAccessibilityTable())
return false;
return true;
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index aa88217..283b2de 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -329,14 +329,23 @@ static AtkAttributeSet* addAttributeToSet(AtkAttributeSet* attributeSet, const c
static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object)
{
AtkAttributeSet* attributeSet = 0;
-
attributeSet = addAttributeToSet(attributeSet, "toolkit", "WebKitGtk");
- int headingLevel = core(object)->headingLevel();
+ AccessibilityObject* coreObject = core(object);
+ if (!coreObject)
+ return attributeSet;
+
+ int headingLevel = coreObject->headingLevel();
if (headingLevel) {
String value = String::number(headingLevel);
attributeSet = addAttributeToSet(attributeSet, "level", value.utf8().data());
}
+
+ // Set the 'layout-guess' attribute to help Assistive
+ // Technologies know when an exposed table is not data table.
+ if (coreObject->isAccessibilityTable() && !coreObject->isDataTable())
+ attributeSet = addAttributeToSet(attributeSet, "layout-guess", "true");
+
return attributeSet;
}
@@ -861,6 +870,59 @@ static gchar* convertUniCharToUTF8(const UChar* characters, gint length, int fro
return g_string_free(ret, FALSE);
}
+gchar* textForRenderer(RenderObject* renderer)
+{
+ GString* resultText = g_string_new(0);
+
+ if (!renderer)
+ return g_string_free(resultText, FALSE);
+
+ // For RenderBlocks, piece together the text from the RenderText objects they contain.
+ for (RenderObject* object = renderer->firstChild(); object; object = object->nextSibling()) {
+ if (object->isBR()) {
+ g_string_append(resultText, "\n");
+ continue;
+ }
+
+ RenderText* renderText;
+ if (object->isText())
+ renderText = toRenderText(object);
+ else {
+ // We need to check children, if any, to consider when
+ // current object is not a text object but some of its
+ // children are, in order not to miss those portions of
+ // text by not properly handling those situations
+ if (object->firstChild())
+ g_string_append(resultText, textForRenderer(object));
+
+ continue;
+ }
+
+ InlineTextBox* box = renderText->firstTextBox();
+ while (box) {
+ gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
+ g_string_append(resultText, text);
+ // Newline chars in the source result in separate text boxes, so check
+ // before adding a newline in the layout. See bug 25415 comment #78.
+ // If the next sibling is a BR, we'll add the newline when we examine that child.
+ if (!box->nextOnLineExists() && (!object->nextSibling() || !object->nextSibling()->isBR()))
+ g_string_append(resultText, "\n");
+ 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(resultText, markerText.utf8().data());
+ else
+ g_string_append(resultText, markerText.utf8().data());
+ }
+
+ return g_string_free(resultText, FALSE);
+}
+
gchar* textForObject(AccessibilityRenderObject* accObject)
{
GString* str = g_string_new(0);
@@ -879,48 +941,9 @@ gchar* textForObject(AccessibilityRenderObject* accObject)
g_string_append(str, "\n");
range = accObject->doAXRangeForLine(++lineNumber);
}
- } 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 = renderer->firstChild(); obj; obj = obj->nextSibling()) {
- if (obj->isBR()) {
- g_string_append(str, "\n");
- continue;
- }
-
- RenderText* renderText;
- if (obj->isText())
- renderText = toRenderText(obj);
- else if (obj->firstChild() && obj->firstChild()->isText()) {
- // Handle RenderInlines (and any other similiar RenderObjects).
- renderText = toRenderText(obj->firstChild());
- } else
- continue;
-
- InlineTextBox* box = renderText->firstTextBox();
- while (box) {
- gchar* text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
- g_string_append(str, text);
- // Newline chars in the source result in separate text boxes, so check
- // before adding a newline in the layout. See bug 25415 comment #78.
- // If the next sibling is a BR, we'll add the newline when we examine that child.
- if (!box->nextOnLineExists() && (!obj->nextSibling() || !obj->nextSibling()->isBR()))
- g_string_append(str, "\n");
- 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());
- }
+ } else if (accObject->isAccessibilityRenderObject()) {
+ GOwnPtr<gchar> rendererText(textForRenderer(accObject->renderer()));
+ g_string_append(str, rendererText.get());
}
return g_string_free(str, FALSE);
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index e4b7d8e..7a13f11 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -647,7 +647,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(AXObjectCache
if (m_object->supportsARIADropping())
[additional addObject:NSAccessibilityDropEffectsAttribute];
- if (m_object->isDataTable() && static_cast<AccessibilityTable*>(m_object)->supportsSelectedRows())
+ if (m_object->isAccessibilityTable() && static_cast<AccessibilityTable*>(m_object)->supportsSelectedRows())
[additional addObject:NSAccessibilitySelectedRowsAttribute];
if (m_object->supportsARIALiveRegion()) {
@@ -948,7 +948,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(AXObjectCache
else if (m_object->isAnchor() || m_object->isImage() || m_object->isLink())
objectAttributes = anchorAttrs;
- else if (m_object->isDataTable())
+ else if (m_object->isAccessibilityTable())
objectAttributes = tableAttrs;
else if (m_object->isTableColumn())
objectAttributes = tableColAttrs;
@@ -1636,7 +1636,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
}
}
- if (m_object->isDataTable()) {
+ if (m_object->isAccessibilityTable()) {
// TODO: distinguish between visible and non-visible rows
if ([attributeName isEqualToString:NSAccessibilityRowsAttribute] ||
[attributeName isEqualToString:NSAccessibilityVisibleRowsAttribute]) {
@@ -2086,7 +2086,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
if (m_object->isTextControl())
return textParamAttrs;
- if (m_object->isDataTable())
+ if (m_object->isAccessibilityTable())
return tableParamAttrs;
if (m_object->isMenuRelated())
@@ -2247,7 +2247,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
else if ([attributeName isEqualToString:NSAccessibilitySelectedRowsAttribute]) {
AccessibilityObject::AccessibilityChildrenVector selectedRows;
convertToVector(array, selectedRows);
- if (m_object->isTree() || m_object->isDataTable())
+ if (m_object->isTree() || m_object->isAccessibilityTable())
m_object->setSelectedRows(selectedRows);
} else if ([attributeName isEqualToString:NSAccessibilityGrabbedAttribute])
m_object->setARIAGrabbed([number boolValue]);
@@ -2541,7 +2541,7 @@ static RenderObject* rendererForView(NSView* view)
return [self textMarkerForVisiblePosition:visiblePosRange.end];
}
- if (m_object->isDataTable()) {
+ if (m_object->isAccessibilityTable()) {
if ([attribute isEqualToString:NSAccessibilityCellForColumnAndRowParameterizedAttribute]) {
if (array == nil || [array count] != 2)
return nil;
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index b572b2c..4a9a420 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -139,6 +139,7 @@ public:
static void setSpeechInputEnabled(bool isEnabled) { isSpeechInputEnabled = isEnabled; }
static bool speechInputEnabled() { return isSpeechInputEnabled; }
static bool webkitSpeechEnabled() { return isSpeechInputEnabled; }
+ static bool webkitGrammarEnabled() { return isSpeechInputEnabled; }
#if ENABLE(XHR_RESPONSE_BLOB)
static bool xhrResponseBlobEnabled() { return isXHRResponseBlobEnabled; }
diff --git a/WebCore/bindings/gobject/GNUmakefile.am b/WebCore/bindings/gobject/GNUmakefile.am
index d808e18..338d7f9 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/WebKitDOMDOMSettableTokenList.cpp \
+ DerivedSources/webkit/WebKitDOMDOMSettableTokenListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMTokenList.cpp \
DerivedSources/webkit/WebKitDOMDOMTokenListPrivate.h \
DerivedSources/webkit/WebKitDOMDOMWindow.cpp \
@@ -263,6 +265,7 @@ webkitgtk_built_h_api += \
DerivedSources/webkit/WebKitDOMDocumentFragment.h \
DerivedSources/webkit/WebKitDOMDocumentType.h \
DerivedSources/webkit/WebKitDOMDOMImplementation.h \
+ DerivedSources/webkit/WebKitDOMDOMSettableTokenList.h \
DerivedSources/webkit/WebKitDOMDOMStringList.h \
DerivedSources/webkit/WebKitDOMDOMStringMap.h \
DerivedSources/webkit/WebKitDOMDOMTokenList.h \
diff --git a/WebCore/bindings/js/JSAudioConstructor.cpp b/WebCore/bindings/js/JSAudioConstructor.cpp
index 5bbaf41..1ea5ae4 100644
--- a/WebCore/bindings/js/JSAudioConstructor.cpp
+++ b/WebCore/bindings/js/JSAudioConstructor.cpp
@@ -43,7 +43,7 @@ JSAudioConstructor::JSAudioConstructor(ExecState* exec, JSDOMGlobalObject* globa
: DOMConstructorWithDocument(JSAudioConstructor::createStructure(globalObject->objectPrototype()), globalObject)
{
putDirect(exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
}
static EncodedJSValue JSC_HOST_CALL constructAudio(ExecState* exec)
diff --git a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
index 3b3465e..458ad5b 100644
--- a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
+++ b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -156,7 +156,7 @@ JSValue JSCSSStyleDeclaration::nameGetter(ExecState* exec, JSValue slotBase, con
RefPtr<CSSValue> v = thisObj->impl()->getPropertyCSSValue(prop);
if (v) {
if (pixelOrPos && v->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE)
- return jsNumber(exec, static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
+ return jsNumber(static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
return jsStringOrNull(exec, v->cssText());
}
diff --git a/WebCore/bindings/js/JSCallbackData.cpp b/WebCore/bindings/js/JSCallbackData.cpp
index 6b19639..f39c53c 100644
--- a/WebCore/bindings/js/JSCallbackData.cpp
+++ b/WebCore/bindings/js/JSCallbackData.cpp
@@ -59,7 +59,7 @@ JSValue JSCallbackData::invokeCallback(MarkedArgumentBuffer& args, bool* raisedE
function = callback();
}
- globalObject()->globalData()->timeoutChecker.start();
+ globalObject()->globalData().timeoutChecker.start();
ScriptExecutionContext* context = globalObject()->scriptExecutionContext();
// We will fail to get the context if the frame has been detached.
if (!context)
@@ -68,7 +68,7 @@ JSValue JSCallbackData::invokeCallback(MarkedArgumentBuffer& args, bool* raisedE
JSValue result = context->isDocument()
? JSMainThreadExecState::call(exec, function, callType, callData, callback(), args)
: JSC::call(exec, function, callType, callData, callback(), args);
- globalObject()->globalData()->timeoutChecker.stop();
+ globalObject()->globalData().timeoutChecker.stop();
Document::updateStyleForAllDocuments();
diff --git a/WebCore/bindings/js/JSCoordinatesCustom.cpp b/WebCore/bindings/js/JSCoordinatesCustom.cpp
index 720bb9b..8ef34ad 100644
--- a/WebCore/bindings/js/JSCoordinatesCustom.cpp
+++ b/WebCore/bindings/js/JSCoordinatesCustom.cpp
@@ -32,36 +32,36 @@ using namespace JSC;
namespace WebCore {
-JSValue JSCoordinates::altitude(ExecState* exec) const
+JSValue JSCoordinates::altitude(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideAltitude())
return jsNull();
- return jsNumber(exec, imp->altitude());
+ return jsNumber(imp->altitude());
}
-JSValue JSCoordinates::altitudeAccuracy(ExecState* exec) const
+JSValue JSCoordinates::altitudeAccuracy(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideAltitudeAccuracy())
return jsNull();
- return jsNumber(exec, imp->altitudeAccuracy());
+ return jsNumber(imp->altitudeAccuracy());
}
-JSValue JSCoordinates::heading(ExecState* exec) const
+JSValue JSCoordinates::heading(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideHeading())
return jsNull();
- return jsNumber(exec, imp->heading());
+ return jsNumber(imp->heading());
}
-JSValue JSCoordinates::speed(ExecState* exec) const
+JSValue JSCoordinates::speed(ExecState*) const
{
Coordinates* imp = impl();
if (!imp->canProvideSpeed())
return jsNull();
- return jsNumber(exec, imp->speed());
+ return jsNumber(imp->speed());
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
index 37f2512..e8e1369 100644
--- a/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
+++ b/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
@@ -89,9 +89,9 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
MarkedArgumentBuffer args;
args.append(jsString(exec, prefix));
- m_globalObject->globalData()->timeoutChecker.start();
+ m_globalObject->globalData().timeoutChecker.start();
JSValue retval = JSC::call(exec, function, callType, callData, m_customResolver, args);
- m_globalObject->globalData()->timeoutChecker.stop();
+ m_globalObject->globalData().timeoutChecker.stop();
String result;
if (exec->hadException())
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 72e6d03..e4cff4a 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -78,6 +78,11 @@
#include "SQLException.h"
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+#include "FileException.h"
+#include "JSFileException.h"
+#endif
+
using namespace JSC;
namespace WebCore {
@@ -619,6 +624,11 @@ void setDOMException(ExecState* exec, ExceptionCode ec)
errorObject = toJS(exec, globalObject, SQLException::create(description));
break;
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ case FileExceptionType:
+ errorObject = toJS(exec, globalObject, FileException::create(description));
+ break;
+#endif
}
ASSERT(errorObject);
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index ecb37f3..7119ea6 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -910,7 +910,7 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec)
int result = impl()->setTimeout(action.release(), delay, ec);
setDOMException(exec, ec);
- return jsNumber(exec, result);
+ return jsNumber(result);
}
JSValue JSDOMWindow::setInterval(ExecState* exec)
@@ -924,7 +924,7 @@ JSValue JSDOMWindow::setInterval(ExecState* exec)
int result = impl()->setInterval(action.release(), delay, ec);
setDOMException(exec, ec);
- return jsNumber(exec, result);
+ return jsNumber(result);
}
JSValue JSDOMWindow::addEventListener(ExecState* exec)
diff --git a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
index f1c1bc0..7bb09a9 100644
--- a/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
+++ b/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
@@ -114,18 +114,18 @@ static PassRefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(JSVal
static JSObject* createAccelerationObject(const DeviceMotionData::Acceleration* acceleration, ExecState* exec)
{
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());
+ object->putDirect(Identifier(exec, "x"), acceleration->canProvideX() ? jsNumber(acceleration->x()) : jsNull());
+ object->putDirect(Identifier(exec, "y"), acceleration->canProvideY() ? jsNumber(acceleration->y()) : jsNull());
+ object->putDirect(Identifier(exec, "z"), acceleration->canProvideZ() ? jsNumber(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());
+ object->putDirect(Identifier(exec, "alpha"), rotationRate->canProvideAlpha() ? jsNumber(rotationRate->alpha()) : jsNull());
+ object->putDirect(Identifier(exec, "beta"), rotationRate->canProvideBeta() ? jsNumber(rotationRate->beta()) : jsNull());
+ object->putDirect(Identifier(exec, "gamma"), rotationRate->canProvideGamma() ? jsNumber(rotationRate->gamma()) : jsNull());
return object;
}
@@ -158,7 +158,7 @@ JSValue JSDeviceMotionEvent::interval(ExecState* exec) const
DeviceMotionEvent* imp = static_cast<DeviceMotionEvent*>(impl());
if (!imp->deviceMotionData()->canProvideInterval())
return jsNull();
- return jsNumber(exec, imp->deviceMotionData()->interval());
+ return jsNumber(imp->deviceMotionData()->interval());
}
JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState* exec)
diff --git a/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp b/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
index 05f8755..9074a6b 100644
--- a/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
+++ b/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
@@ -40,7 +40,7 @@ JSValue JSDeviceOrientationEvent::alpha(ExecState* exec) const
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideAlpha())
return jsNull();
- return jsNumber(exec, imp->orientation()->alpha());
+ return jsNumber(imp->orientation()->alpha());
}
JSValue JSDeviceOrientationEvent::beta(ExecState* exec) const
@@ -48,7 +48,7 @@ JSValue JSDeviceOrientationEvent::beta(ExecState* exec) const
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideBeta())
return jsNull();
- return jsNumber(exec, imp->orientation()->beta());
+ return jsNumber(imp->orientation()->beta());
}
JSValue JSDeviceOrientationEvent::gamma(ExecState* exec) const
@@ -56,7 +56,7 @@ JSValue JSDeviceOrientationEvent::gamma(ExecState* exec) const
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
if (!imp->orientation()->canProvideGamma())
return jsNull();
- return jsNumber(exec, imp->orientation()->gamma());
+ return jsNumber(imp->orientation()->gamma());
}
JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
diff --git a/WebCore/bindings/js/JSEventListener.cpp b/WebCore/bindings/js/JSEventListener.cpp
index ceed445..5604374 100644
--- a/WebCore/bindings/js/JSEventListener.cpp
+++ b/WebCore/bindings/js/JSEventListener.cpp
@@ -108,10 +108,10 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
Event* savedEvent = globalObject->currentEvent();
globalObject->setCurrentEvent(event);
- JSGlobalData* globalData = globalObject->globalData();
- DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);
+ JSGlobalData& globalData = globalObject->globalData();
+ DynamicGlobalObjectScope globalObjectScope(exec, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
- globalData->timeoutChecker.start();
+ globalData.timeoutChecker.start();
JSValue retval;
if (handleEventFunction) {
retval = scriptExecutionContext->isDocument()
@@ -123,7 +123,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
? JSMainThreadExecState::call(exec, jsFunction, callType, callData, currentTarget, args)
: JSC::call(exec, jsFunction, callType, callData, currentTarget, args);
}
- globalData->timeoutChecker.stop();
+ globalData.timeoutChecker.stop();
globalObject->setCurrentEvent(savedEvent);
diff --git a/WebCore/bindings/js/JSFileReaderCustom.cpp b/WebCore/bindings/js/JSFileReaderCustom.cpp
new file mode 100644
index 0000000..c771b63
--- /dev/null
+++ b/WebCore/bindings/js/JSFileReaderCustom.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(BLOB)
+
+#include "JSFileReader.h"
+
+#include "ArrayBuffer.h"
+#include "FileReader.h"
+#include "JSArrayBuffer.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSFileReader::result(ExecState* exec) const
+{
+ FileReader* imp = impl();
+ if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
+ return toJS(exec, globalObject(), WTF::getPtr(imp->arrayBufferResult()));
+ return jsOwnedStringOrNull(exec, imp->stringResult());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/WebCore/bindings/js/JSGeolocationCustom.cpp b/WebCore/bindings/js/JSGeolocationCustom.cpp
index bd36df8..1e40f86 100644
--- a/WebCore/bindings/js/JSGeolocationCustom.cpp
+++ b/WebCore/bindings/js/JSGeolocationCustom.cpp
@@ -181,7 +181,7 @@ JSValue JSGeolocation::watchPosition(ExecState* exec)
ASSERT(positionOptions);
int watchID = m_impl->watchPosition(positionCallback.release(), positionErrorCallback.release(), positionOptions.release());
- return jsNumber(exec, watchID);
+ return jsNumber(watchID);
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSHTMLInputElementCustom.cpp b/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
index 412a096..171a1f9 100644
--- a/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
@@ -39,7 +39,7 @@ JSValue JSHTMLInputElement::selectionStart(ExecState* exec) const
if (!input->canHaveSelection())
return throwTypeError(exec);
- return jsNumber(exec, input->selectionStart());
+ return jsNumber(input->selectionStart());
}
void JSHTMLInputElement::setSelectionStart(ExecState* exec, JSValue value)
@@ -57,7 +57,7 @@ JSValue JSHTMLInputElement::selectionEnd(ExecState* exec) const
if (!input->canHaveSelection())
return throwTypeError(exec);
- return jsNumber(exec, input->selectionEnd());
+ return jsNumber(input->selectionEnd());
}
void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value)
diff --git a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
index 6143c1e..d169bc4 100644
--- a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
@@ -35,10 +35,10 @@ using namespace JSC;
namespace WebCore {
-JSValue JSHTMLOptionsCollection::length(ExecState* exec) const
+JSValue JSHTMLOptionsCollection::length(ExecState*) const
{
HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
- return jsNumber(exec, imp->length());
+ return jsNumber(imp->length());
}
void JSHTMLOptionsCollection::setLength(ExecState* exec, JSValue value)
diff --git a/WebCore/bindings/js/JSIDBKeyCustom.cpp b/WebCore/bindings/js/JSIDBKeyCustom.cpp
index 98c9315..f0faef5 100644
--- a/WebCore/bindings/js/JSIDBKeyCustom.cpp
+++ b/WebCore/bindings/js/JSIDBKeyCustom.cpp
@@ -46,7 +46,7 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject*, IDBKey* key)
case IDBKey::NullType:
return jsNull();
case IDBKey::NumberType:
- return jsNumber(exec, key->number());
+ return jsNumber(key->number());
case IDBKey::StringType:
return jsString(exec, key->string());
// FIXME: Implement dates.
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index ac5225e..818d549 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -95,7 +95,7 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& source, Scri
MarkedArgumentBuffer args;
args.append(toJS(scriptState, globalObject, this));
args.append(globalThisValue);
- args.append(jsNumber(scriptState, id));
+ args.append(jsNumber(id));
args.append(jsString(scriptState, String("JSC")));
JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
if (result.isObject())
@@ -149,7 +149,7 @@ JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec)
bool withChildren = exec->argument(1).toBoolean(exec);
bool selectInUI = exec->argument(2).toBoolean(exec);
- return jsNumber(exec, impl()->pushNodePathToFrontend(node, withChildren, selectInUI));
+ return jsNumber(impl()->pushNodePathToFrontend(node, withChildren, selectInUI));
}
#if ENABLE(DATABASE)
diff --git a/WebCore/bindings/js/JSOptionConstructor.cpp b/WebCore/bindings/js/JSOptionConstructor.cpp
index d0a51cd..4ecfe58 100644
--- a/WebCore/bindings/js/JSOptionConstructor.cpp
+++ b/WebCore/bindings/js/JSOptionConstructor.cpp
@@ -39,7 +39,7 @@ JSOptionConstructor::JSOptionConstructor(ExecState* exec, JSDOMGlobalObject* glo
: DOMConstructorWithDocument(JSOptionConstructor::createStructure(globalObject->objectPrototype()), globalObject)
{
putDirect(exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 4), ReadOnly|DontDelete|DontEnum);
+ putDirect(exec->propertyNames().length, jsNumber(4), ReadOnly | DontDelete | DontEnum);
}
static EncodedJSValue JSC_HOST_CALL constructHTMLOptionElement(ExecState* exec)
diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
index e9a97ed..7274cd0 100644
--- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
+++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
@@ -68,7 +68,7 @@ JSValue JSSQLResultSetRowList::item(ExecState* exec)
jsValue = jsNull();
break;
case SQLValue::NumberValue:
- jsValue = jsNumber(exec, value.number());
+ jsValue = jsNumber(value.number());
break;
default:
ASSERT_NOT_REACHED();
diff --git a/WebCore/bindings/js/JSSVGLengthCustom.cpp b/WebCore/bindings/js/JSSVGLengthCustom.cpp
index c7cfdb0..0cc7c6d 100644
--- a/WebCore/bindings/js/JSSVGLengthCustom.cpp
+++ b/WebCore/bindings/js/JSSVGLengthCustom.cpp
@@ -22,28 +22,24 @@
#if ENABLE(SVG)
#include "JSSVGLength.h"
+#include "SVGAnimatedProperty.h"
+
using namespace JSC;
namespace WebCore {
-JSValue JSSVGLength::value(ExecState* exec) const
+JSValue JSSVGLength::value(ExecState*) const
{
- JSSVGPODTypeWrapper<SVGLength>* imp = impl();
- SVGElement* context = JSSVGContextCache::svgContextForDOMObject(const_cast<JSSVGLength*>(this));
-
- SVGLength podImp(*imp);
- return jsNumber(exec, podImp.value(context));
+ SVGLength& podImp = impl()->propertyReference();
+ return jsNumber(podImp.value(impl()->contextElement()));
}
JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
{
- JSSVGPODTypeWrapper<SVGLength>* imp = impl();
- SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
-
- SVGLength podImp(*imp);
- podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), context);
+ SVGLength& podImp = impl()->propertyReference();
+ podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), impl()->contextElement());
- imp->commitChange(podImp, this);
+ impl()->commitChange();
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSSVGPODTypeWrapper.h b/WebCore/bindings/js/JSSVGPODTypeWrapper.h
index 2efc60e..2329365 100644
--- a/WebCore/bindings/js/JSSVGPODTypeWrapper.h
+++ b/WebCore/bindings/js/JSSVGPODTypeWrapper.h
@@ -323,7 +323,7 @@ struct PODTypeWrapperCacheInfoHash {
static unsigned hash(const CacheInfo& info)
{
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(&info), sizeof(CacheInfo) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(CacheInfo)>(&info);
}
static bool equal(const CacheInfo& a, const CacheInfo& b)
diff --git a/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp b/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
index 127227e..0c2a6a2 100644
--- a/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
+++ b/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
@@ -40,9 +40,9 @@ namespace WebCore {
#if ENABLE(JAVASCRIPT_DEBUGGER)
-JSValue JSScriptProfileNode::callUID(ExecState* exec) const
+JSValue JSScriptProfileNode::callUID(ExecState*) const
{
- JSValue result = jsNumber(exec, impl()->callIdentifier().hash());
+ JSValue result = jsNumber(impl()->callIdentifier().hash());
return result;
}
diff --git a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
index 4b31659..643ce64 100644
--- a/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
@@ -81,15 +81,15 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebG
return constructArray(exec, list);
}
case WebGLGetInfo::kTypeFloat:
- return jsNumber(exec, info.getFloat());
+ return jsNumber(info.getFloat());
case WebGLGetInfo::kTypeLong:
- return jsNumber(exec, info.getLong());
+ return jsNumber(info.getLong());
case WebGLGetInfo::kTypeNull:
return jsNull();
case WebGLGetInfo::kTypeString:
return jsString(exec, info.getString());
case WebGLGetInfo::kTypeUnsignedLong:
- return jsNumber(exec, info.getUnsignedLong());
+ return jsNumber(info.getUnsignedLong());
case WebGLGetInfo::kTypeWebGLBuffer:
return toJS(exec, globalObject, info.getWebGLBuffer());
case WebGLGetInfo::kTypeWebGLFloatArray:
diff --git a/WebCore/bindings/js/JSWorkerContextCustom.cpp b/WebCore/bindings/js/JSWorkerContextCustom.cpp
index b8885cf..8c1caef 100644
--- a/WebCore/bindings/js/JSWorkerContextCustom.cpp
+++ b/WebCore/bindings/js/JSWorkerContextCustom.cpp
@@ -57,7 +57,7 @@ void JSWorkerContext::markChildren(MarkStack& markStack)
{
Base::markChildren(markStack);
- JSGlobalData& globalData = *this->globalData();
+ JSGlobalData& globalData = this->globalData();
markActiveObjectsForContext(markStack, globalData, scriptExecutionContext());
@@ -126,7 +126,7 @@ JSValue JSWorkerContext::setTimeout(ExecState* exec)
if (exec->hadException())
return jsUndefined();
int delay = exec->argument(1).toInt32(exec);
- return jsNumber(exec, impl()->setTimeout(action.release(), delay));
+ return jsNumber(impl()->setTimeout(action.release(), delay));
}
JSValue JSWorkerContext::setInterval(ExecState* exec)
@@ -135,7 +135,7 @@ JSValue JSWorkerContext::setInterval(ExecState* exec)
if (exec->hadException())
return jsUndefined();
int delay = exec->argument(1).toInt32(exec);
- return jsNumber(exec, impl()->setInterval(action.release(), delay));
+ return jsNumber(impl()->setInterval(action.release(), delay));
}
diff --git a/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
index ad3f5ec..f7d2b02 100644
--- a/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
+++ b/WebCore/bindings/js/JSWorkerContextErrorHandler.cpp
@@ -86,16 +86,16 @@ void JSWorkerContextErrorHandler::handleEvent(ScriptExecutionContext* scriptExec
MarkedArgumentBuffer args;
args.append(jsString(exec, errorEvent->message()));
args.append(jsString(exec, errorEvent->filename()));
- args.append(jsNumber(exec, errorEvent->lineno()));
+ args.append(jsNumber(errorEvent->lineno()));
- JSGlobalData* globalData = globalObject->globalData();
- DynamicGlobalObjectScope globalObjectScope(exec, globalData->dynamicGlobalObject ? globalData->dynamicGlobalObject : globalObject);
+ JSGlobalData& globalData = globalObject->globalData();
+ DynamicGlobalObjectScope globalObjectScope(exec, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
JSValue thisValue = globalObject->toThisObject(exec);
- globalData->timeoutChecker.start();
+ globalData.timeoutChecker.start();
JSValue returnValue = JSC::call(exec, jsFunction, callType, callData, thisValue, args);
- globalData->timeoutChecker.stop();
+ globalData.timeoutChecker.stop();
globalObject->setCurrentEvent(savedEvent);
diff --git a/WebCore/bindings/js/ScheduledAction.cpp b/WebCore/bindings/js/ScheduledAction.cpp
index a9dc6a8..d6f8a38 100644
--- a/WebCore/bindings/js/ScheduledAction.cpp
+++ b/WebCore/bindings/js/ScheduledAction.cpp
@@ -101,12 +101,12 @@ void ScheduledAction::executeFunctionInContext(JSGlobalObject* globalObject, JSV
for (size_t i = 0; i < size; ++i)
args.append(m_args[i]);
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
if (context->isDocument())
JSMainThreadExecState::call(exec, m_function, callType, callData, thisValue, args);
else
JSC::call(exec, m_function, callType, callData, thisValue, args);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
if (exec->hadException())
reportCurrentException(exec);
diff --git a/WebCore/bindings/js/ScriptFunctionCall.cpp b/WebCore/bindings/js/ScriptFunctionCall.cpp
index 775e3ad..f77c691 100644
--- a/WebCore/bindings/js/ScriptFunctionCall.cpp
+++ b/WebCore/bindings/js/ScriptFunctionCall.cpp
@@ -82,31 +82,31 @@ void ScriptCallArgumentHandler::appendArgument(JSC::JSValue argument)
void ScriptCallArgumentHandler::appendArgument(long argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(long long argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(unsigned int argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(unsigned long argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(int argument)
{
JSLock lock(SilenceAssertionsOnly);
- m_arguments.append(jsNumber(m_exec, argument));
+ m_arguments.append(jsNumber(argument));
}
void ScriptCallArgumentHandler::appendArgument(bool argument)
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index c9ad0e6..65abd75 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -1041,12 +1041,12 @@ private:
int32_t i;
if (!read(i))
return JSValue();
- return jsNumber(m_exec, i);
+ return jsNumber(i);
}
case ZeroTag:
- return jsNumber(m_exec, 0);
+ return jsNumber(0);
case OneTag:
- return jsNumber(m_exec, 1);
+ return jsNumber(1);
case FalseTag:
return jsBoolean(false);
case TrueTag:
@@ -1055,7 +1055,7 @@ private:
double d;
if (!read(d))
return JSValue();
- return jsNumber(m_exec, d);
+ return jsNumber(d);
}
case DateTag: {
double d;
diff --git a/WebCore/bindings/js/WorkerScriptController.cpp b/WebCore/bindings/js/WorkerScriptController.cpp
index 6ff8a69..5872b2e 100644
--- a/WebCore/bindings/js/WorkerScriptController.cpp
+++ b/WebCore/bindings/js/WorkerScriptController.cpp
@@ -124,9 +124,9 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode,
JSLock lock(SilenceAssertionsOnly);
ExecState* exec = m_workerContextWrapper->globalExec();
- m_workerContextWrapper->globalData()->timeoutChecker.start();
+ m_workerContextWrapper->globalData().timeoutChecker.start();
Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper);
- m_workerContextWrapper->globalData()->timeoutChecker.stop();
+ m_workerContextWrapper->globalData().timeoutChecker.stop();
if (comp.complType() == Normal || comp.complType() == ReturnValue)
return comp.value();
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index a26c315..6bf7afe 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -304,9 +304,9 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
if (![self _isSafeScript])
return nil;
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.start();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.start();
JSValue result = JSMainThreadExecState::call(exec, function, callType, callData, [self _imp], argList);
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.stop();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.stop();
if (exec->hadException()) {
addExceptionToConsole(exec);
@@ -333,9 +333,9 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
JSValue result;
JSLock lock(SilenceAssertionsOnly);
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.start();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.start();
Completion completion = JSMainThreadExecState::evaluate([self _rootObject]->globalObject()->globalExec(), [self _rootObject]->globalObject()->globalScopeChain(), makeSource(String(script)), JSC::JSValue());
- [self _rootObject]->globalObject()->globalData()->timeoutChecker.stop();
+ [self _rootObject]->globalObject()->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
if (type == Normal) {
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index ec762b6..c4f87f0 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -5,6 +5,7 @@
# Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
+# 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
@@ -42,19 +43,24 @@ my $codeGenerator = 0;
my $verbose = 0;
-my %primitiveTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1,
- "unsigned int" => 1, "unsigned short" => 1,
- "unsigned long" => 1, "unsigned long long" => 1,
- "float" => 1, "double" => 1,
- "boolean" => 1, "void" => 1,
- "Date" => 1);
+my %numericTypeHash = ("int" => 1, "short" => 1, "long" => 1, "long long" => 1,
+ "unsigned int" => 1, "unsigned short" => 1,
+ "unsigned long" => 1, "unsigned long long" => 1,
+ "float" => 1, "double" => 1);
+
+my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1);
my %podTypeHash = ("SVGNumber" => 1, "SVGTransform" => 1);
-my %podTypesWithWritablePropertiesHash = ("SVGAngle" => 1, "SVGLength" => 1, "SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1, "SVGRect" => 1);
+my %podTypesWithWritablePropertiesHash = ("SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1);
my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1);
my %nonPointerTypeHash = ("DOMTimeStamp" => 1, "CompareHow" => 1, "SVGPaintType" => 1);
+my %svgNewStyleAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,
+ "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" => 1,
+ "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,
+ "SVGAnimatedRect" => 1);
+
my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,
"SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" => 1,
"SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,
@@ -69,6 +75,13 @@ my %svgAttributesInHTMLHash = ("class" => 1, "id" => 1, "onabort" => 1, "onclick
"onmouseup" => 1, "onresize" => 1, "onscroll" => 1,
"onunload" => 1);
+my %svgNativeType = (
+ "SVGAngle" => "SVGPropertyTearOff<SVGAngle>",
+ "SVGLength" => "SVGPropertyTearOff<SVGLength>",
+ "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>",
+ "SVGRect" => "SVGPropertyTearOff<FloatRect>"
+);
+
# Cache of IDL file pathnames.
my $idlFiles;
@@ -281,6 +294,18 @@ sub ParseInterface
}
# Helpers for all CodeGenerator***.pm modules
+
+sub AvoidInclusionOfType
+{
+ my $object = shift;
+ my $type = shift;
+
+ # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist.
+ return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix";
+ return 0;
+}
+
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsPodType
{
my $object = shift;
@@ -300,12 +325,22 @@ sub IsPodTypeWithWriteableProperties
return 0;
}
+sub IsNumericType
+{
+ my $object = shift;
+ my $type = shift;
+
+ return 1 if $numericTypeHash{$type};
+ return 0;
+}
+
sub IsPrimitiveType
{
my $object = shift;
my $type = shift;
return 1 if $primitiveTypeHash{$type};
+ return 1 if $numericTypeHash{$type};
return 0;
}
@@ -323,7 +358,52 @@ sub IsNonPointerType
my $object = shift;
my $type = shift;
- return 1 if $nonPointerTypeHash{$type} or $primitiveTypeHash{$type};
+ return 1 if $nonPointerTypeHash{$type} or $primitiveTypeHash{$type} or $numericTypeHash{$type};
+ return 0;
+}
+
+sub IsSVGTypeNeedingTearOff
+{
+ my $object = shift;
+ my $type = shift;
+
+ return 1 if exists $svgNativeType{$type};
+ return 0;
+}
+
+sub GetSVGTypeNeedingTearOff
+{
+ my $object = shift;
+ my $type = shift;
+
+ return $svgNativeType{$type} if exists $svgNativeType{$type};
+ return undef;
+}
+
+sub GetSVGWrappedTypeNeedingTearOff
+{
+ my $object = shift;
+ my $type = shift;
+
+ my $svgNativeType = $object->GetSVGTypeNeedingTearOff($type);
+ return $svgNativeType if not $svgNativeType;
+
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgNativeType =~ s/SVGPropertyTearOff<//;
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgNativeType =~ s/SVGListPropertyTearOff<//;
+ }
+ $svgNativeType =~ s/>//;
+ return $svgNativeType;
+}
+
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
+sub IsSVGNewStyleAnimatedType
+{
+ my $object = shift;
+ my $type = shift;
+
+ return 1 if $svgNewStyleAnimatedTypeHash{$type};
return 0;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index 6a1d115..dd9e3c7 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -796,11 +796,6 @@ sub addIncludeInBody {
}
}
-# Some methods' body (only the body, since the public API can't be
-# conditional) should be guarded by #ifdefs depending on whether
-# certain features in WebKit are enabled.
-my %conditionalMethods = ("webkit_dom_geolocation_clear_watch" => "GEOLOCATION");
-
sub GenerateFunction {
my ($object, $interfaceName, $function, $prefix) = @_;
@@ -879,18 +874,11 @@ sub GenerateFunction {
$functionSig .= ", GError **error";
}
- push(@hBody, "#if ${conditionalString}\n") if $conditionalString;
push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n");
- push(@hBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
push(@hBody, "\n");
- push(@cBody, "#if ${conditionalString}\n") if $conditionalString;
push(@cBody, "$returnType\n$functionName($functionSig)\n{\n");
- push(@cBody, " WebCore::JSMainThreadNullState state;\n");
-
- if ($conditionalMethods{$functionName}) {
- push(@cBody, "#if ENABLE($conditionalMethods{$functionName})\n");
- }
+ push(@cBody, "#if ${conditionalString}\n") if $conditionalString;
if ($returnType ne "void") {
# TODO: return proper default result
@@ -899,6 +887,8 @@ sub GenerateFunction {
push(@cBody, " g_return_if_fail(self);\n");
}
+ push(@cBody, " WebCore::JSMainThreadNullState state;\n");
+
# The WebKit::core implementations check for NULL already; no need to
# duplicate effort.
push(@cBody, " WebCore::${interfaceName} * item = WebKit::core(self);\n");
@@ -1050,13 +1040,19 @@ EOF
}
}
- if ($conditionalMethods{$functionName}) {
- push(@cBody, "#endif\n");
+ if ($conditionalString) {
+ if ($returnType ne "void") {
+ push(@cBody, "#else\n");
+ if ($codeGenerator->IsNonPointerType($functionSigType)) {
+ push(@cBody, " return static_cast<${returnType}>(0);\n");
+ } else {
+ push(@cBody, " return NULL;\n");
+ }
+ }
+ push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
}
- push(@cBody, "}\n");
- push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
- push(@cBody, "\n");
+ push(@cBody, "}\n\n");
}
sub ClassHasFunction {
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index fe29b80..9244bc6 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -227,20 +227,11 @@ sub GetCallbackClassName
return "JS$className";
}
-sub AvoidInclusionOfType
-{
- my $type = shift;
-
- # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist.
- return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix";
- return 0;
-}
-
sub IndexGetterReturnsStrings
{
my $type = shift;
- return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList" or $type eq "DOMTokenList";
+ return 1 if $type eq "CSSStyleDeclaration" or $type eq "MediaList" or $type eq "CSSVariablesDeclaration" or $type eq "DOMStringList" or $type eq "DOMTokenList" or $type eq "DOMSettableTokenList";
return 0;
}
@@ -251,7 +242,7 @@ sub AddIncludesForType
# When we're finished with the one-file-per-class
# reorganization, we won't need these special cases.
- if ($codeGenerator->IsPrimitiveType($type) or AvoidInclusionOfType($type)
+ if ($codeGenerator->IsPrimitiveType($type) or $codeGenerator->AvoidInclusionOfType($type)
or $type eq "DOMString" or $type eq "DOMObject" or $type eq "Array") {
} elsif ($type =~ /SVGPathSeg/) {
$joinedName = $type;
@@ -284,6 +275,7 @@ sub AddIncludesForType
}
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub AddIncludesForSVGAnimatedType
{
my $type = shift;
@@ -324,13 +316,19 @@ sub AddClassForwardIfNeeded
}
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsSVGTypeNeedingContextParameter
{
+ # FIXME: This function will be removed, as soon the PODType concept is gone, and all SVG datatypes use the new style JS bindings.
+
my $implClassName = shift;
return 0 unless $implClassName =~ /SVG/;
return 0 if $implClassName =~ /Element/;
- my @noContextNeeded = ("SVGPaint", "SVGColor", "SVGDocument", "SVGZoomEvent");
+ return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName);
+ return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName);
+
+ my @noContextNeeded = ("SVGColor", "SVGDocument", "SVGPaint", "SVGZoomEvent");
foreach (@noContextNeeded) {
return 0 if $implClassName eq $_;
}
@@ -668,16 +666,24 @@ sub GenerateHeader
}
$headerIncludes{"<runtime/JSObjectWithGlobalObject.h>"} = 1;
-
$headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/;
- # Get correct pass/store types respecting PODType flag
- my $podType = $dataNode->extendedAttributes->{"PODType"};
- my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
+ my $implType = $implClassName;
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
+ $implType = $svgNativeType if $svgNativeType;
- $headerIncludes{"$podType.h"} = 1 if $podType and $podType ne "float";
+ # FIXME: Old style SVG JS bindings, will vanish soon.
+ my $podType = $dataNode->extendedAttributes->{"PODType"};
+ if ($podType) {
+ $implType = "JSSVGPODTypeWrapper<$podType> ";
+ $headerIncludes{"$podType.h"} = 1 if $podType ne "float";
+ $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1;
+ }
- $headerIncludes{"JSSVGPODTypeWrapper.h"} = 1 if $podType;
+ my $svgPropertyOrPodType;
+ $svgPropertyOrPodType = $podType if $podType;
+ $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType;
+ $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType;
my $numConstants = @{$dataNode->constants};
my $numAttributes = @{$dataNode->attributes};
@@ -685,8 +691,13 @@ sub GenerateHeader
push(@headerContent, "\nnamespace WebCore {\n\n");
- # Implementation class forward declaration
- AddClassForwardIfNeeded($implClassName) unless $podType;
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) {
+ $headerIncludes{"$implClassName.h"} = 1;
+ } else {
+ # Implementation class forward declaration
+ AddClassForwardIfNeeded($implClassName) unless $svgPropertyOrPodType;
+ }
+
AddClassForwardIfNeeded("JSDOMWindowShell") if $interfaceName eq "DOMWindow";
# Class declaration
@@ -875,8 +886,6 @@ sub GenerateHeader
}
if (!$hasParent) {
- # Extra space after JSSVGPODTypeWrapper<> to make RefPtr<Wrapper<> > compile.
- my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
push(@headerContent, " $implType* impl() const { return m_impl.get(); }\n\n");
push(@headerContent, "private:\n");
push(@headerContent, " RefPtr<$implType> m_impl;\n");
@@ -936,7 +945,9 @@ sub GenerateHeader
if (!$hasParent || $dataNode->extendedAttributes->{"GenerateToJS"} || $dataNode->extendedAttributes->{"CustomToJS"}) {
if ($podType) {
- push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, JSSVGPODTypeWrapper<$podType>*, SVGElement*);\n");
+ push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement*);\n");
+ } elsif ($svgPropertyType) {
+ push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*);\n");
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $implType*, SVGElement* context);\n");
} else {
@@ -944,12 +955,13 @@ sub GenerateHeader
}
}
if (!$hasParent || $dataNode->extendedAttributes->{"GenerateNativeConverter"}) {
+
if ($podType) {
push(@headerContent, "$podType to${interfaceName}(JSC::JSValue);\n");
} elsif ($interfaceName eq "NodeFilter") {
push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSValue);\n");
} else {
- push(@headerContent, "$implClassName* to${interfaceName}(JSC::JSValue);\n");
+ push(@headerContent, "$implType* to${interfaceName}(JSC::JSValue);\n");
}
}
if ($usesToJSNewlyCreated{$interfaceName}) {
@@ -1414,9 +1426,19 @@ sub GenerateImplementation
}
push(@implContent, "};\n\n");
- # Get correct pass/store types respecting PODType flag
+ my $implType = $implClassName;
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
+ $implType = $svgNativeType if $svgNativeType;
+
my $podType = $dataNode->extendedAttributes->{"PODType"};
- my $implType = $podType ? "JSSVGPODTypeWrapper<$podType> " : $implClassName;
+ if ($podType) {
+ $implType = "JSSVGPODTypeWrapper<$podType> ";
+ }
+
+ my $svgPropertyOrPodType;
+ $svgPropertyOrPodType = $podType if $podType;
+ $svgPropertyOrPodType = $svgPropertyType if $svgPropertyType;
+ $svgPropertyOrPodType = $svgListPropertyType if $svgListPropertyType;
# Constructor
if ($interfaceName eq "DOMWindow") {
@@ -1540,7 +1562,7 @@ sub GenerateImplementation
push(@implContent, " ${className}* castedThis = static_cast<$className*>(asObject(slotBase));\n");
my $implClassNameForValueConversion = "";
- if (!$podType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {
+ if (!$svgPropertyOrPodType and ($codeGenerator->IsSVGAnimatedType($implClassName) or $attribute->type !~ /^readonly/)) {
$implClassNameForValueConversion = $implClassName;
}
@@ -1592,9 +1614,13 @@ sub GenerateImplementation
push(@implContent, " if (JSValue cachedValue = castedThis->getAnonymousValue(" . $className . "::" . $attribute->signature->name . "Slot))\n");
push(@implContent, " return cachedValue;\n");
}
- if ($podType) {
- push(@implContent, " $podType imp(*castedThis->impl());\n");
- if ($podType eq "float") { # Special case for JSSVGNumber
+
+ if ($svgListPropertyType) {
+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "castedThis->impl()->$implGetterFunctionName()", "castedThis") . ";\n");
+ } elsif ($svgPropertyOrPodType) {
+ push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType& imp = castedThis->impl()->propertyReference();\n") if !$podType;
+ if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp", "castedThis") . ";\n");
} else {
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName()", "castedThis") . ";\n");
@@ -1605,7 +1631,12 @@ sub GenerateImplementation
push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n");
if ($codeGenerator->IsSVGAnimatedType($type)) {
push(@implContent, " RefPtr<$type> obj = $jsType;\n");
- push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n");
+
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) {
+ push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n");
+ } else {
+ push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n");
+ }
} else {
push(@implContent, " JSValue result = $jsType;\n");
}
@@ -1616,8 +1647,8 @@ sub GenerateImplementation
} else {
push(@implContent, " ExceptionCode ec = 0;\n");
- if ($podType) {
- push(@implContent, " $podType imp(*castedThis->impl());\n");
+ if ($svgPropertyOrPodType) {
+ push(@implContent, " $svgPropertyOrPodType imp(*castedThis->impl());\n");
push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName(ec)", "castedThis") . ";\n");
} else {
push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n");
@@ -1749,19 +1780,60 @@ sub GenerateImplementation
} else {
push(@implContent, " $className* castedThis = static_cast<$className*>(thisObject);\n");
push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n");
- if ($podType) {
- push(@implContent, " $podType podImp(*imp);\n");
- if ($podType eq "float") { # Special case for JSSVGNumber
- push(@implContent, " podImp = " . JSValueToNative($attribute->signature, "value") . ";\n");
+ push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
+
+ # For setters with "StrictTypeChecking", if an input parameter's type does not match the signature,
+ # a TypeError is thrown instead of casting to null.
+ if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ $implIncludes{"<runtime/Error.h>"} = 1;
+
+ my $argType = $attribute->signature->type;
+ if (!IsNativeType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.inherits(&JS${argType}::s_info)) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ } elsif ($codeGenerator->IsStringType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.isString() && !value.isObject()) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.isNumber() && !value.isBoolean()) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ } elsif ($argType eq "boolean") {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.isBoolean()) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
+ }
+ }
+
+ my $nativeValue = JSValueToNative($attribute->signature, "value");
+ if ($svgPropertyOrPodType) {
+ push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType;
+ if ($svgPropertyOrPodType eq "float") { # Special case for JSSVGNumber
+ push(@implContent, " podImp = $nativeValue;\n");
} else {
- push(@implContent, " podImp.set$implSetterFunctionName(" . JSValueToNative($attribute->signature, "value") . ");\n");
+ push(@implContent, " podImp.set$implSetterFunctionName($nativeValue");
+ push(@implContent, ", ec") if @{$attribute->setterExceptions};
+ push(@implContent, ");\n");
+ push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
+ }
+ push(@implContent, " imp->commitChange(podImp, castedThis);\n") if $podType;
+ if ($svgPropertyType) {
+ if (@{$attribute->setterExceptions}) {
+ push(@implContent, " if (!ec)\n");
+ push(@implContent, " imp->commitChange();\n");
+ } else {
+ push(@implContent, " imp->commitChange();\n");
+ }
}
- push(@implContent, " imp->commitChange(podImp, castedThis);\n");
} else {
- my $nativeValue = JSValueToNative($attribute->signature, "value");
my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
-
- push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
push(@implContent, " imp->$setterExpressionPrefix$nativeValue");
push(@implContent, ", ec") if @{$attribute->setterExceptions};
push(@implContent, ");\n");
@@ -1848,7 +1920,7 @@ sub GenerateImplementation
# classes, we directly forward the calls to JSSVGPODListCustom, which centralizes the otherwise
# duplicated code for the JSSVG*List classes mentioned above.
my $svgPODListType;
- if ($implClassName =~ /SVG.*List/) {
+ if ($implClassName =~ /SVG.*List/ and !$svgListPropertyType) {
$svgPODListType = $implClassName;
$svgPODListType =~ s/List$//;
$svgPODListType = "" unless $codeGenerator->IsPodType($svgPODListType);
@@ -1867,7 +1939,8 @@ sub GenerateImplementation
. ">(castedThis, exec, to" . $svgPODListType . "));\n");
} else {
push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n");
- push(@implContent, " $podType podImp(*imp);\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType podImp(*imp);\n") if $podType;
+ push(@implContent, " $svgPropertyOrPodType& podImp = imp->propertyReference();\n") if !$podType and $svgPropertyType;
my $numParameters = @{$function->parameters};
@@ -1906,8 +1979,7 @@ sub GenerateImplementation
} else {
my $argsIndex = 0;
my $paramIndex = 0;
- my $functionString = ($podType ? "podImp." : "imp->") . $functionImplementationName . "(";
-
+ my $functionString = (($svgPropertyOrPodType and !$svgListPropertyType) ? "podImp." : "imp->") . $functionImplementationName . "(";
my $hasOptionalArguments = 0;
if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
@@ -1948,13 +2020,14 @@ sub GenerateImplementation
$hasOptionalArguments = 1;
}
push(@implContent, " if (argsCount <= $argsIndex) {\n");
- GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $implClassName);
+ GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $svgPropertyType, $implClassName);
push(@implContent, " }\n\n");
}
my $name = $parameter->name;
+ my $argType = $codeGenerator->StripModule($parameter->type);
- if ($parameter->type eq "XPathNSResolver") {
+ if ($argType eq "XPathNSResolver") {
push(@implContent, " RefPtr<XPathNSResolver> customResolver;\n");
push(@implContent, " XPathNSResolver* resolver = toXPathNSResolver(exec->argument($argsIndex));\n");
push(@implContent, " if (!resolver) {\n");
@@ -1964,10 +2037,10 @@ sub GenerateImplementation
push(@implContent, " resolver = customResolver.get();\n");
push(@implContent, " }\n");
} elsif ($parameter->extendedAttributes->{"Callback"}) {
- my $callbackClassName = GetCallbackClassName($parameter->type);
+ my $callbackClassName = GetCallbackClassName($argType);
$implIncludes{"$callbackClassName.h"} = 1;
if ($parameter->extendedAttributes->{"Optional"}) {
- push(@implContent, " RefPtr<" . $parameter->type. "> $name;\n");
+ push(@implContent, " RefPtr<$argType> $name;\n");
push(@implContent, " if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isNull() && !exec->argument($argsIndex).isUndefined()) {\n");
push(@implContent, " if (!exec->argument($argsIndex).isObject()) {\n");
push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
@@ -1980,20 +2053,24 @@ sub GenerateImplementation
push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
push(@implContent, " }\n");
- push(@implContent, " RefPtr<" . $parameter->type . "> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
+ push(@implContent, " RefPtr<$argType> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
}
} else {
# For functions with "StrictTypeChecking", if an input parameter's type does not match the signature,
# a TypeError is thrown instead of casting to null.
if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ $implIncludes{"<runtime/Error.h>"} = 1;
+
my $argValue = "exec->argument($argsIndex)";
- my $argType = $codeGenerator->StripModule($parameter->type);
if (!IsNativeType($argType)) {
push(@implContent, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.inherits(&JS${argType}::s_info))\n");
push(@implContent, " return throwVMTypeError(exec);\n");
} elsif ($codeGenerator->IsStringType($argType)) {
push(@implContent, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.isString() && !${argValue}.isObject())\n");
push(@implContent, " return throwVMTypeError(exec);\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContent, " if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.isNumber() && !${argValue}.isBoolean())\n");
+ push(@implContent, " return throwVMTypeError(exec);\n");
}
}
@@ -2012,12 +2089,21 @@ sub GenerateImplementation
# Check if the type conversion succeeded.
push(@implContent, " if (exec->hadException())\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
+
+ if ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $implClassName =~ /List$/) {
+ push(@implContent, " if (!$name) {\n");
+ push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ push(@implContent, " }\n");
+ }
}
$functionString .= ", " if $paramIndex;
- if ($parameter->type eq "NodeFilter") {
+ if ($argType eq "NodeFilter") {
$functionString .= "$name.get()";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $implClassName =~ /List$/) {
+ $functionString .= "$name->propertyReference()";
} else {
$functionString .= $name;
}
@@ -2032,7 +2118,7 @@ sub GenerateImplementation
}
push(@implContent, "\n");
- GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $podType, $implClassName);
+ GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $podType, $svgPropertyType, $implClassName);
}
}
push(@implContent, "}\n\n");
@@ -2056,7 +2142,8 @@ sub GenerateImplementation
if ($constant->type eq "DOMString") {
push(@implContent, " return jsStringOrNull(exec, String(" . $constant->value . "));\n");
} else {
- push(@implContent, " return jsNumber(exec, static_cast<int>(" . $constant->value . "));\n");
+ push(@implContent, " UNUSED_PARAM(exec);");
+ push(@implContent, " return jsNumber(static_cast<int>(" . $constant->value . "));\n");
}
push(@implContent, "}\n\n");
}
@@ -2080,9 +2167,9 @@ sub GenerateImplementation
}
if ($dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
- push(@implContent, "\nJSValue ${className}::getByIndex(ExecState* exec, unsigned index)\n");
+ push(@implContent, "\nJSValue ${className}::getByIndex(ExecState*, unsigned index)\n");
push(@implContent, "{\n");
- push(@implContent, " return jsNumber(exec, static_cast<$implClassName*>(impl())->item(index));\n");
+ push(@implContent, " return jsNumber(static_cast<$implClassName*>(impl())->item(index));\n");
push(@implContent, "}\n");
if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
$implIncludes{"JSNode.h"} = 1;
@@ -2091,16 +2178,18 @@ sub GenerateImplementation
}
if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !$dataNode->extendedAttributes->{"CustomToJS"}) {
- if ($podType) {
- push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSSVGPODTypeWrapper<$podType>* object, SVGElement* context)\n");
- } elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
+ if ($svgPropertyType) {
+ push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object)\n");
+ } elsif ($podType or IsSVGTypeNeedingContextParameter($implClassName)) {
push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object, SVGElement* context)\n");
} else {
push(@implContent, "JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, $implType* object)\n");
}
push(@implContent, "{\n");
- if ($podType) {
- push(@implContent, " return getDOMObjectWrapper<$className, JSSVGPODTypeWrapper<$podType> >(exec, globalObject, object, context);\n");
+ if ($svgPropertyType) {
+ push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object);\n");
+ } elsif ($podType) {
+ push(@implContent, " return getDOMObjectWrapper<$className, $implType>(exec, globalObject, object, context);\n");
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
push(@implContent, " return getDOMObjectWrapper<$className>(exec, globalObject, object, context);\n");
} else {
@@ -2112,18 +2201,15 @@ sub GenerateImplementation
if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateNativeConverter"}) and !$dataNode->extendedAttributes->{"CustomNativeConverter"}) {
if ($podType) {
push(@implContent, "$podType to${interfaceName}(JSC::JSValue value)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return value.inherits(&${className}::s_info) ? ($podType) *static_cast<$className*>(asObject(value))->impl() : $podType()");
} else {
- push(@implContent, "$implClassName* to${interfaceName}(JSC::JSValue value)\n");
+ push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return value.inherits(&${className}::s_info) ? static_cast<$className*>(asObject(value))->impl() : 0");
}
- push(@implContent, "{\n");
-
- push(@implContent, " return value.inherits(&${className}::s_info) ? " . ($podType ? "($podType) *" : "") . "static_cast<$className*>(asObject(value))->impl() : ");
- if ($podType and $podType ne "float") {
- push(@implContent, "$podType();\n}\n");
- } else {
- push(@implContent, "0;\n}\n");
- }
+ push(@implContent, ";\n}\n");
}
push(@implContent, "\n}\n");
@@ -2298,6 +2384,7 @@ sub GenerateImplementationFunctionCall()
my $paramIndex = shift;
my $indent = shift;
my $podType = shift;
+ my $svgPropertyType = shift;
my $implClassName = shift;
if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
@@ -2316,6 +2403,16 @@ sub GenerateImplementationFunctionCall()
push(@implContent, $indent . "$functionString;\n");
push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions};
push(@implContent, $indent . "imp->commitChange(podImp, castedThis);\n") if $podType;
+
+ if ($svgPropertyType) {
+ if (@{$function->raisesExceptions}) {
+ push(@implContent, $indent . "if (!ec)\n");
+ push(@implContent, $indent . " imp->commitChange();\n");
+ } else {
+ push(@implContent, $indent . "imp->commitChange();\n");
+ }
+ }
+
push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n");
} else {
push(@implContent, "\n" . $indent . "JSC::JSValue result = " . NativeToJSValue($function->signature, 1, $implClassName, "", $functionString, "castedThis") . ";\n");
@@ -2357,8 +2454,6 @@ my %nativeType = (
"NodeFilter" => "RefPtr<NodeFilter>",
"SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
"IDBKey" => "RefPtr<IDBKey>",
- "SVGAngle" => "SVGAngle",
- "SVGLength" => "SVGLength",
"SVGMatrix" => "AffineTransform",
"SVGNumber" => "float",
"SVGPaintType" => "SVGPaint::SVGPaintType",
@@ -2380,12 +2475,44 @@ sub GetNativeType
{
my $type = shift;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
+ return "${svgNativeType}*" if $svgNativeType;
return $nativeType{$type} if exists $nativeType{$type};
# For all other types, the native type is a pointer with same type name as the IDL type.
return "${type}*";
}
+sub GetSVGPropertyTypes
+{
+ my $implType = shift;
+
+ my $svgPropertyType;
+ my $svgListPropertyType;
+ my $svgNativeType;
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
+
+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
+
+ # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType>
+ $svgNativeType = "$svgNativeType ";
+
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgPropertyType = $svgWrappedNativeType;
+ $headerIncludes{"$svgWrappedNativeType.h"} = 1;
+ $headerIncludes{"SVGAnimatedPropertyTearOff.h"} = 1;
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgListPropertyType = $svgWrappedNativeType;
+ $headerIncludes{"$svgWrappedNativeType.h"} = 1;
+ $headerIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1;
+ }
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
+}
+
sub IsNativeType
{
my $type = shift;
@@ -2461,7 +2588,7 @@ sub NativeToJSValue
}
if ($codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType" or $type eq "DOMTimeStamp") {
$implIncludes{"<runtime/JSNumberCell.h>"} = 1;
- return "jsNumber(exec, $value)";
+ return "jsNumber($value)";
}
if ($codeGenerator->IsStringType($type)) {
@@ -2509,7 +2636,7 @@ sub NativeToJSValue
} else {
return "toJS(exec, $globalObject, JSSVGDynamicPODTypeWrapperCache<$nativeType, $implClassNameForValueConversion>::lookupOrCreateWrapper(imp, &${implClassNameForValueConversion}::$getter, &${implClassNameForValueConversion}::$setter).get(), JSSVGContextCache::svgContextForDOMObject(castedThis));"
}
- }
+ }
if ($type eq "CSSStyleDeclaration") {
$implIncludes{"CSSMutableStyleDeclaration.h"} = 1;
@@ -2536,7 +2663,7 @@ sub NativeToJSValue
} else {
# Default, include header with same name.
$implIncludes{"JS$type.h"} = 1;
- $implIncludes{"$type.h"} = 1;
+ $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type);
}
return $value if $codeGenerator->IsSVGAnimatedType($type);
@@ -2550,6 +2677,13 @@ sub NativeToJSValue
return "toJSNewlyCreated(exec, $globalObject, WTF::getPtr($value))";
}
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName)) {
+ # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
+ $value = "static_cast<" . GetNativeType($type) . ">($value)";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $implClassName =~ /List$/) {
+ $value = $codeGenerator->GetSVGTypeNeedingTearOff($type) . "::create($value)";
+ }
+
return "toJS(exec, $globalObject, WTF::getPtr($value))";
}
@@ -2858,7 +2992,7 @@ sub GenerateConstructorDefinition
} else {
push(@$outputArray, " putDirect(exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n");
}
- push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(exec, ${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;
+ push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;
push(@$outputArray, "}\n\n");
push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index 96f0446..8351c87 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -1,4 +1,4 @@
-#
+#
# Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
# Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
@@ -6,6 +6,7 @@
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) 2010 Google Inc.
+# 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
@@ -587,15 +588,15 @@ sub AddIncludesForType
return;
}
- if ($codeGenerator->IsSVGAnimatedType($type)) {
- $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($type)) {
+ $implIncludes{"${type}.h"} = 1;
$implIncludes{"DOM${type}Internal.h"} = 1;
return;
}
- if ($type eq "SVGRect") {
- $implIncludes{"FloatRect.h"} = 1;
- $implIncludes{"DOMSVGRectInternal.h"} = 1;
+ if ($codeGenerator->IsSVGAnimatedType($type)) {
+ $implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;
+ $implIncludes{"DOM${type}Internal.h"} = 1;
return;
}
@@ -651,10 +652,39 @@ sub AddIncludesForType
$implIncludes{"NameNodeList.h"} = 1 if $type eq "NodeList";
# Default, include the same named file (the implementation) and the same name prefixed with "DOM".
- $implIncludes{"$type.h"} = 1;
+ $implIncludes{"$type.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($type);
$implIncludes{"DOM${type}Internal.h"} = 1;
}
+sub GetSVGPropertyTypes
+{
+ my $implType = shift;
+
+ my $svgPropertyType;
+ my $svgListPropertyType;
+ my $svgNativeType;
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
+
+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
+
+ # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType>
+ $svgNativeType = "WebCore::$svgNativeType ";
+ $svgNativeType =~ s/</\<WebCore::/;
+
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgPropertyType = "WebCore::$svgWrappedNativeType";
+ $svgPropertyType =~ s/</\<WebCore::/;
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgListPropertyType = "WebCore::$svgWrappedNativeType";
+ $svgListPropertyType =~ s/</\<WebCore::/;
+ }
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
+}
+
sub GenerateHeader
{
my $object = shift;
@@ -967,11 +997,24 @@ sub GenerateHeader
unless ($isProtocol) {
# Generate internal interfaces
my $podType = $dataNode->extendedAttributes->{"PODType"};
+ my $podTypeWithNamespace;
+ my $implClassName = GetImplClassName($interfaceName);
+ my $implClassNameWithNamespace = "WebCore::" . $implClassName;
+
+ my $implType = $implClassNameWithNamespace;
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+ $implType = $svgNativeType if $svgNativeType;
+ if ($podType) {
+ $podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";
+ }
+
# Generate interface definitions.
@internalHeaderContent = split("\r", $implementationLicenseTemplate);
push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n");
+ push(@internalHeaderContent, "#import <WebCore/SVGAnimatedPropertyTearOff.h>\n\n") if $svgPropertyType;
+ push(@internalHeaderContent, "#import <WebCore/SVGAnimatedListPropertyTearOff.h>\n\n") if $svgListPropertyType;
push(@internalHeaderContent, $interfaceAvailabilityVersionCheck) if length $interfaceAvailabilityVersion;
if ($interfaceName eq "Node") {
@@ -980,9 +1023,9 @@ sub GenerateHeader
my $startedNamespace = 0;
- my $implClassName = GetImplClassName($interfaceName);
-
- if ($codeGenerator->IsSVGAnimatedType($interfaceName)) {
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) {
+ push(@internalHeaderContent, "#import <WebCore/$implClassName.h>\n\n");
+ } elsif ($codeGenerator->IsSVGAnimatedType($interfaceName)) {
push(@internalHeaderContent, "#import <WebCore/DeprecatedSVGAnimatedTemplate.h>\n\n");
} else {
push(@internalHeaderContent, "namespace WebCore {\n");
@@ -998,27 +1041,15 @@ sub GenerateHeader
}
if ($podType) {
- if ($podType eq "float") {
- push(@internalHeaderContent, "float core($className *);\n");
- } else {
- push(@internalHeaderContent, "WebCore::$podType core($className *);\n");
- }
+ push(@internalHeaderContent, "$podTypeWithNamespace core($className *);\n");
+ push(@internalHeaderContent, "$className *kit($podTypeWithNamespace);\n");
} else {
- push(@internalHeaderContent, "WebCore::$implClassName* core($className *);\n");
- }
-
- if ($podType) {
- if ($podType eq "float") {
- push(@internalHeaderContent, "$className *kit($podType);\n");
- } else {
- push(@internalHeaderContent, "$className *kit(WebCore::$podType);\n");
- }
- } else {
- push(@internalHeaderContent, "$className *kit(WebCore::$implClassName*);\n");
+ push(@internalHeaderContent, "$implType* core($className *);\n");
+ push(@internalHeaderContent, "$className *kit($implType*);\n");
}
if ($dataNode->extendedAttributes->{Polymorphic}) {
- push(@internalHeaderContent, "Class kitClass(WebCore::$implClassName*);\n");
+ push(@internalHeaderContent, "Class kitClass($implType*);\n");
}
if ($interfaceName eq "Node") {
@@ -1053,6 +1084,10 @@ sub GenerateImplementation
my $podType = $dataNode->extendedAttributes->{"PODType"};
my $podTypeWithNamespace;
+ my $implType = $implClassNameWithNamespace;
+
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+ $implType = $svgNativeType if $svgNativeType;
if ($podType) {
$podTypeWithNamespace = ($podType eq "float") ? "$podType" : "WebCore::$podType";
@@ -1086,13 +1121,13 @@ sub GenerateImplementation
$implIncludes{"DOMSVGPathSegInternal.h"} = 1 if $interfaceName =~ /^SVGPathSeg.+/;
- if ($codeGenerator->IsSVGAnimatedType($interfaceName)) {
+ if ($codeGenerator->IsSVGAnimatedType($interfaceName) and !$codeGenerator->IsSVGNewStyleAnimatedType($interfaceName)) {
$implIncludes{"DeprecatedSVGAnimatedTemplate.h"} = 1;
} elsif ($interfaceName =~ /(\w+)(Abs|Rel)$/) {
$implIncludes{"$1.h"} = 1;
} else {
if (!$podType) {
- $implIncludes{"$implClassName.h"} = 1;
+ $implIncludes{"$implClassName.h"} = 1 if not $codeGenerator->AvoidInclusionOfType($implClassName);
} else {
$implIncludes{"$podType.h"} = 1 unless $podType eq "float";
}
@@ -1106,7 +1141,7 @@ sub GenerateImplementation
if ($podType) {
push(@implContent, "#define IMPL reinterpret_cast<$podTypeWithNamespace*>(_internal)\n\n");
} elsif ($parentImplClassName eq "Object") {
- push(@implContent, "#define IMPL reinterpret_cast<$implClassNameWithNamespace*>(_internal)\n\n");
+ push(@implContent, "#define IMPL reinterpret_cast<$implType*>(_internal)\n\n");
} else {
my $baseClassWithNamespace = "WebCore::$baseClass";
push(@implContent, "#define IMPL static_cast<$implClassNameWithNamespace*>(reinterpret_cast<$baseClassWithNamespace*>(_internal))\n\n");
@@ -1196,15 +1231,19 @@ sub GenerateImplementation
my $getterContentHead = "IMPL->$getterExpressionPrefix";
my $getterContentTail = ")";
- # Special case for DOMSVGNumber
- if ($podType and $podType eq "float") {
- $getterContentHead = "*IMPL";
- $getterContentTail = "";
- }
+ if ($svgPropertyType) {
+ $getterContentHead = "$getterExpressionPrefix";
- # TODO: Handle special case for DOMSVGLength
- if ($podType and $podType eq "SVGLength" and $attributeName eq "value") {
- $getterContentHead = "IMPL->value(0 /* FIXME */";
+ # TODO: Handle special case for DOMSVGLength. We do need Custom code support for this.
+ if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") {
+ $getterContentHead = "value(0 /* FIXME */";
+ }
+ } else {
+ # Special case for DOMSVGNumber
+ if ($podType and $podType eq "float") {
+ $getterContentHead = "*IMPL";
+ $getterContentTail = "";
+ }
}
my $attributeTypeSansPtr = $attributeType;
@@ -1247,6 +1286,13 @@ sub GenerateImplementation
} elsif ($codeGenerator->IsPodType($idlType) or $idlType eq "Date") {
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
+ } elsif ($svgPropertyType) {
+ $getterContentHead = "IMPL->propertyReference().$getterContentHead";
+ } elsif ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) {
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+ $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)";
+ $getterContentTail .= ")";
} elsif (IsProtocolType($idlType) and $idlType ne "EventTarget") {
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
@@ -1257,8 +1303,16 @@ sub GenerateImplementation
$getterContentHead = "$getterContentHead";
$getterContentTail .= "->toString()";
} elsif (ConversionNeeded($attribute->signature->type)) {
- $getterContentHead = "kit(WTF::getPtr($getterContentHead";
- $getterContentTail .= "))";
+ if ($codeGenerator->IsSVGTypeNeedingTearOff($attribute->signature->type) and not $implClassName =~ /List$/) {
+ my $idlType = $attribute->signature->type;
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+ $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead";
+ $getterContentTail .= ")))";
+ } else {
+ $getterContentHead = "kit(WTF::getPtr($getterContentHead";
+ $getterContentTail .= "))";
+ }
}
my $getterContent;
@@ -1322,7 +1376,23 @@ sub GenerateImplementation
$arg = "core(" . $arg . ")";
}
- if ($podType) {
+ if ($svgPropertyType) {
+ $getterContentHead = "$getterExpressionPrefix";
+ push(@implContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
+ my $ec = $hasSetterException ? ", ec" : "";
+ push(@implContent, " $exceptionInit\n") if $hasSetterException;
+ push(@implContent, " podImpl.$coreSetterName($arg$ec);\n");
+ if ($hasSetterException) {
+ push(@implContent, " if (!ec)\n");
+ push(@implContent, " IMPL->commitChange();\n");
+ push(@implContent, " $exceptionRaiseOnError\n");
+ } else {
+ push(@implContent, " IMPL->commitChange();\n");
+ }
+ } elsif ($svgListPropertyType) {
+ $getterContentHead = "$getterExpressionPrefix";
+ push(@implContent, " IMPL->$coreSetterName($arg);\n");
+ } elsif ($podType) {
# Special case for DOMSVGNumber
if ($podType eq "float") {
push(@implContent, " *IMPL = $arg;\n");
@@ -1447,10 +1517,48 @@ sub GenerateImplementation
# FIXME! We need [Custom] support for ObjC, to move these hacks into DOMSVGLength/MatrixCustom.mm
my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector");
my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse");
- my $svgLengthConvertToSpecifiedUnits = ($podType and $podType eq "SVGLength" and $functionName eq "convertToSpecifiedUnits");
+ my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "WebCore::SVGLength" and $functionName eq "convertToSpecifiedUnits");
push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse);
- my $content = $caller . "->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+ push(@parameterNames, "0 /* FIXME */") if $svgLengthConvertToSpecifiedUnits;
+
+ # Handle arguments that are 'SVGProperty' based (SVGAngle/SVGLength). We need to convert from SVGPropertyTearOff<Type>* to Type,
+ # to be able to call the desired WebCore function. If the conversion fails, we can't extract Type and need to raise an exception.
+ my $currentParameter = -1;
+ foreach my $param (@{$function->parameters}) {
+ $currentParameter++;
+
+ my $paramName = $param->name;
+ my $idlType = $codeGenerator->StripModule($param->type);
+ next if not $codeGenerator->IsSVGTypeNeedingTearOff($idlType) or $implClassName =~ /List$/;
+
+ my $implGetter = GetObjCTypeGetter($paramName, $idlType);
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+
+ push(@functionContent, " $idlTypeWithNamespace* ${paramName}Core = $implGetter;\n");
+ push(@functionContent, " if (!${paramName}Core) {\n");
+ push(@functionContent, " WebCore::ExceptionCode ec = WebCore::TYPE_MISMATCH_ERR;\n");
+ push(@functionContent, " $exceptionRaiseOnError\n");
+ if ($returnType eq "void") {
+ push(@functionContent, " return;\n");
+ } else {
+ push(@functionContent, " return nil;\n");
+ }
+ push(@functionContent, " }\n");
+
+ # Replace the paramter core() getter, by the cached variable.
+ splice(@parameterNames, $currentParameter, 1, "${paramName}Core->propertyReference()");
+ }
+
+ my $content = $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+
+ if ($svgPropertyType) {
+ push(@functionContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
+ $content = "podImpl.$content;\n IMPL->commitChange()";
+ } else {
+ $content = $caller . "->$content";
+ }
if ($svgMatrixRotateFromVector) {
# Special case with rotateFromVector & SVGMatrix
@@ -1466,8 +1574,6 @@ sub GenerateImplementation
push(@functionContent, " ec = WebCore::SVGException::SVG_MATRIX_NOT_INVERTABLE;\n");
push(@functionContent, " $exceptionRaiseOnError\n");
push(@functionContent, " return kit($content);\n");
- } elsif ($svgLengthConvertToSpecifiedUnits) {
- push(@functionContent, " IMPL->convertToSpecifiedUnits(inUnitType, 0 /* FIXME */);\n");
} elsif ($returnType eq "void") {
# Special case 'void' return type.
if ($raisesExceptions) {
@@ -1496,7 +1602,12 @@ sub GenerateImplementation
$content = "foo";
} else {
if (ConversionNeeded($function->signature->type)) {
- if ($codeGenerator->IsPodType($function->signature->type)) {
+ if ($codeGenerator->IsSVGTypeNeedingTearOff($function->signature->type) and not $implClassName =~ /List$/) {
+ my $idlType = $function->signature->type;
+ my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
+ $idlTypeWithNamespace =~ s/</\<WebCore::/;
+ $content = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($content)))";
+ } elsif ($codeGenerator->IsPodType($function->signature->type)) {
$content = "kit($content)";
} else {
$content = "kit(WTF::getPtr($content))";
@@ -1549,30 +1660,28 @@ sub GenerateImplementation
# Generate internal interfaces
if ($podType) {
- my $prefixedPodType = $podType eq "float" ? $podType : "WebCore::$podType";
- push(@implContent, "\n$prefixedPodType core($className *wrapper)\n");
+ push(@implContent, "\n$podTypeWithNamespace core($className *wrapper)\n");
push(@implContent, "{\n");
- push(@implContent, " return wrapper ? *reinterpret_cast<$prefixedPodType*>(wrapper->_internal) : $prefixedPodType();\n");
+ push(@implContent, " return wrapper ? *reinterpret_cast<$podTypeWithNamespace*>(wrapper->_internal) : $podTypeWithNamespace();\n");
push(@implContent, "}\n\n");
} else {
- push(@implContent, "\nWebCore::$implClassName* core($className *wrapper)\n");
+ push(@implContent, "\n$implType* core($className *wrapper)\n");
push(@implContent, "{\n");
- push(@implContent, " return wrapper ? reinterpret_cast<WebCore::$implClassName*>(wrapper->_internal) : 0;\n");
+ push(@implContent, " return wrapper ? reinterpret_cast<$implType*>(wrapper->_internal) : 0;\n");
push(@implContent, "}\n\n");
}
if ($podType) {
# FIXME: Implement caching.
- my $prefixedPodType = $podType eq "float" ? $podType : "WebCore::$podType";
- push(@implContent, "$className *kit($prefixedPodType value)\n");
+ push(@implContent, "$className *kit($podTypeWithNamespace value)\n");
push(@implContent, "{\n");
push(@implContent, " $assertMainThread;\n");
push(@implContent, " $className *wrapper = [[$className alloc] _init];\n");
- push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $prefixedPodType(value));\n");
+ push(@implContent, " wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(new $podTypeWithNamespace(value));\n");
push(@implContent, " return [wrapper autorelease];\n");
push(@implContent, "}\n");
} elsif ($parentImplClassName eq "Object") {
- push(@implContent, "$className *kit(WebCore::$implClassName* value)\n");
+ push(@implContent, "$className *kit($implType* value)\n");
push(@implContent, "{\n");
push(@implContent, " $assertMainThread;\n");
push(@implContent, " if (!value)\n");
@@ -1592,7 +1701,7 @@ sub GenerateImplementation
push(@implContent, " return [wrapper autorelease];\n");
push(@implContent, "}\n");
} else {
- push(@implContent, "$className *kit(WebCore::$implClassName* value)\n");
+ push(@implContent, "$className *kit($implType* value)\n");
push(@implContent, "{\n");
push(@implContent, " $assertMainThread;\n");
push(@implContent, " return static_cast<$className*>(kit(static_cast<WebCore::$baseClass*>(value)));\n");
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 91ffeaa..8cbd63d 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -6,6 +6,7 @@
# Copyright (C) 2006 Apple Computer, Inc.
# Copyright (C) 2007, 2008, 2009 Google Inc.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
+# 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
@@ -87,6 +88,7 @@ sub finish
}
# Workaround for V8 bindings difference where RGBColor is not a POD type.
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsPodType
{
my $type = shift;
@@ -179,6 +181,8 @@ sub AddIncludesForType
sub AddIncludesForSVGAnimatedType
{
my $type = shift;
+ return if $codeGenerator->IsSVGNewStyleAnimatedType($type);
+
$type =~ s/SVGAnimated//;
if ($type eq "Point" or $type eq "Rect") {
@@ -208,6 +212,34 @@ sub GenerateConditionalString
}
}
+sub GetSVGPropertyTypes
+{
+ my $implType = shift;
+
+ my $svgPropertyType;
+ my $svgListPropertyType;
+ my $svgNativeType;
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
+
+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implType);
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
+
+ # Append space to avoid compilation errors when using PassRefPtr<$svgNativeType>
+ $svgNativeType = "$svgNativeType ";
+
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
+ if ($svgNativeType =~ /SVGPropertyTearOff/) {
+ $svgPropertyType = $svgWrappedNativeType;
+ $implIncludes{"SVGAnimatedPropertyTearOff.h"} = 1,
+ } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
+ $svgListPropertyType = $svgWrappedNativeType;
+ $implIncludes{"SVGAnimatedListPropertyTearOff.h"} = 1,
+ }
+
+ return ($svgPropertyType, $svgListPropertyType, $svgNativeType);
+}
+
sub GenerateHeader
{
my $object = shift;
@@ -225,8 +257,6 @@ sub GenerateHeader
# - Add default header template
push(@headerContent, GenerateHeaderContentHeader($dataNode));
-
- # Get correct pass/store types respecting PODType flag
my $podType = $dataNode->extendedAttributes->{"PODType"};
my %headerInclues = ();
@@ -234,9 +264,12 @@ sub GenerateHeader
$headerIncludes{"wtf/text/StringHash.h"} = 1;
$headerIncludes{"WrapperTypeInfo.h"} = 1;
$headerIncludes{"V8DOMWrapper.h"} = 1;
+
my $headerClassInclude = GetHeaderClassInclude($implClassName);
$headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne "";
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+
foreach my $headerInclude (sort keys(%headerIncludes)) {
push(@headerContent, "#include \"${headerInclude}\"\n");
}
@@ -245,16 +278,12 @@ sub GenerateHeader
push(@headerContent, "#include <wtf/HashMap.h>\n");
push(@headerContent, "\nnamespace WebCore {\n");
- if ($podType) {
- push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n");
- }
+ push(@headerContent, "\ntemplate<typename PODType> class V8SVGPODTypeWrapper;\n") if $podType;
+ push(@headerContent, "\ntemplate<typename PropertyType> class SVGPropertyTearOff;\n") if $svgPropertyType;
+ push(@headerContent, "\ntemplate<typename PropertyType> class SVGListPropertyTearOff;\n") if $svgListPropertyType;
push(@headerContent, "\nclass $className {\n");
- my $nativeType = GetNativeTypeForConversions($interfaceName);
- if ($podType) {
- $nativeType = "V8SVGPODTypeWrapper<${nativeType} >";
- }
-
+ my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName);
my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
my $forceNewObjectParameter = IsDOMNodeType($interfaceName) ? ", bool forceNewObject = false" : "";
my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
@@ -450,7 +479,7 @@ sub GetHeaderClassInclude
$className =~ s/Abs|Rel//;
}
return "" if (AvoidInclusionOfType($className));
- return "DeprecatedSVGAnimatedTemplate.h" if ($codeGenerator->IsSVGAnimatedType($className));
+ return "DeprecatedSVGAnimatedTemplate.h" if $codeGenerator->IsSVGAnimatedType($className) and !$codeGenerator->IsSVGNewStyleAnimatedType($className);
return "${className}.h";
}
@@ -693,18 +722,13 @@ sub GenerateNormalAttrGetter
$skipContext = 1;
}
- # Special case: SVGSVGEelement::viewport is read-only
- if (($implClassName eq "SVGSVGElement") and ($attrName eq "viewport")) {
- $attrIsPodType = 0;
- $skipContext = 1;
- }
-
# Special case for SVGColor
if (($implClassName eq "SVGColor") and ($attrName eq "rgbColor")) {
$attrIsPodType = 0;
}
my $getterStringUsesImp = $implClassName ne "float";
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName);
# Getter
my $conditionalString = GenerateConditionalString($attribute->signature);
@@ -726,7 +750,19 @@ END
$implClassName* imp = &impInstance;
END
}
-
+ } elsif ($svgNativeType) {
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
+ if ($svgWrappedNativeType =~ /List$/) {
+ push(@implContentDecls, <<END);
+ $svgNativeType* imp = V8${implClassName}::toNative(info.Holder());
+END
+ } else {
+ push(@implContentDecls, <<END);
+ $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());
+ $svgWrappedNativeType& impInstance = wrapper->propertyReference();
+ $svgWrappedNativeType* imp = &impInstance;
+END
+ }
} elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContentDecls, <<END);
@@ -883,7 +919,16 @@ END
}
}
- if ($attrIsPodType) {
+ if ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($attrType)) {
+ $implIncludes{"V8$attrType.h"} = 1;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
+ # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
+ push(@implContentDecls, " return toV8(static_cast<$svgNativeType*>($result));\n");
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($attrType) and not $implClassName =~ /List$/) {
+ $implIncludes{"V8$attrType.h"} = 1;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($attrType);
+ push(@implContentDecls, " return toV8(WTF::getPtr(${svgNativeType}::create($result)));\n");
+ } elsif ($attrIsPodType) {
$implIncludes{"V8${attrType}.h"} = 1;
push(@implContentDecls, " return toV8(wrapper.release().get());\n");
} else {
@@ -911,7 +956,35 @@ sub GenerateNormalAttrSetter
push(@implContentDecls, "static void ${attrName}AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)\n{\n");
push(@implContentDecls, " INC_STATS(\"DOM.$implClassName.$attrName._set\");\n");
+ # For functions with "StrictTypeChecking", if an input parameter's type does not match the signature,
+ # a TypeError is thrown instead of casting to null.
+ if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ my $argType = GetTypeFromSignature($attribute->signature);
+ if (IsWrapperType($argType)) {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($codeGenerator->IsStringType($argType)) {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !value->IsString() && !value->IsObject()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($argType eq "boolean") {
+ push(@implContentDecls, " if (!isUndefinedOrNull(value) && !value->IsBoolean()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ }
+ }
+
my $isPodType = IsPodType($implClassName);
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName);
if ($isPodType) {
$implClassName = GetNativeType($implClassName);
@@ -919,7 +992,19 @@ sub GenerateNormalAttrSetter
push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8SVGPODTypeWrapper<$implClassName>::toNative(info.Holder());\n");
push(@implContentDecls, " $implClassName impInstance = *wrapper;\n");
push(@implContentDecls, " $implClassName* imp = &impInstance;\n");
-
+ } elsif ($svgNativeType) {
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
+ if ($svgWrappedNativeType =~ /List$/) {
+ push(@implContentDecls, <<END);
+ $svgNativeType* imp = V8${implClassName}::toNative(info.Holder());
+END
+ } else {
+ push(@implContentDecls, <<END);
+ $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());
+ $svgWrappedNativeType& impInstance = wrapper->propertyReference();
+ $svgWrappedNativeType* imp = &impInstance;
+END
+ }
} elsif ($attrExt->{"v8OnProto"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContentDecls, <<END);
@@ -1013,6 +1098,13 @@ END
if ($isPodType) {
push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::svgContext(wrapper));\n");
+ } elsif ($svgNativeType) {
+ if ($useExceptions) {
+ push(@implContentDecls, " if (!ec)\n");
+ push(@implContentDecls, " wrapper->commitChange();\n");
+ } else {
+ push(@implContentDecls, " wrapper->commitChange();\n");
+ }
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
$implIncludes{"SVGElement.h"} = 1;
@@ -1024,7 +1116,7 @@ END
push(@implContentDecls, " if (SVGElement* context = V8Proxy::svgContext($currentObject))\n");
push(@implContentDecls, " context->svgAttributeChanged(imp->associatedAttributeName());\n");
}
-
+
push(@implContentDecls, " return;\n");
push(@implContentDecls, "}\n\n"); # end of setter
push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString;
@@ -1213,11 +1305,23 @@ END
}
}
+ my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implClassName);
+
if (IsPodType($implClassName)) {
my $nativeClassName = GetNativeType($implClassName);
push(@implContentDecls, " V8SVGPODTypeWrapper<$nativeClassName>* impWrapper = V8SVGPODTypeWrapper<$nativeClassName>::toNative(args.Holder());\n");
push(@implContentDecls, " $nativeClassName impInstance = *impWrapper;\n");
push(@implContentDecls, " $nativeClassName* imp = &impInstance;\n");
+ } elsif ($svgNativeType) {
+ my $nativeClassName = GetNativeType($implClassName);
+ if ($implClassName =~ /List$/) {
+ push(@implContentDecls, " $nativeClassName imp = V8${svgListPropertyType}::toNative(args.Holder());\n");
+ } else {
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
+ push(@implContentDecls, " $nativeClassName wrapper = V8${svgPropertyType}::toNative(args.Holder());\n");
+ push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n");
+ push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n");
+ }
} elsif (!$function->signature->extendedAttributes->{"ClassMethod"}) {
push(@implContentDecls, <<END);
${implClassName}* imp = V8${implClassName}::toNative(args.Holder());
@@ -1338,6 +1442,11 @@ END
push(@implContentDecls, " V8Proxy::throwTypeError();\n");
push(@implContentDecls, " return notHandledByInterceptor();\n");
push(@implContentDecls, " }\n");
+ } elsif ($codeGenerator->IsNumericType($argType)) {
+ push(@implContentDecls, " if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !${argValue}->IsNumber() && !${argValue}->IsBoolean()) {\n");
+ push(@implContentDecls, " V8Proxy::throwTypeError();\n");
+ push(@implContentDecls, " return notHandledByInterceptor();\n");
+ push(@implContentDecls, " }\n");
}
}
push(@implContentDecls, " EXCEPTION_BLOCK($nativeType, $parameterName, " .
@@ -2130,10 +2239,7 @@ END
END
}
- my $nativeType = GetNativeTypeForConversions($interfaceName);
- if ($dataNode->extendedAttributes->{"PODType"}) {
- $nativeType = "V8SVGPODTypeWrapper<${nativeType}>";
- }
+ my $nativeType = GetNativeTypeForConversions($dataNode, $interfaceName);
push(@implContent, <<END);
// Custom toString template
@@ -2538,7 +2644,7 @@ sub GetDomMapFunction
return "getDOMSVGElementInstanceMap()" if $type eq "SVGElementInstance";
return "getDOMNodeMap()" if ($dataNode && IsNodeSubType($dataNode));
# Only use getDOMSVGObjectWithContextMap() for non-node svg objects
- return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/;
+ return "getDOMSVGObjectWithContextMap()" if $type =~ /SVG/ and $type ne "SVGLength" and $type ne "SVGLengthList" and not $codeGenerator->IsSVGNewStyleAnimatedType($type);
return "" if $type eq "DOMImplementation";
return "getActiveDOMObjectMap()" if IsActiveDomType($type);
return "getDOMObjectMap()";
@@ -2562,11 +2668,14 @@ sub IsActiveDomType
sub GetNativeTypeForConversions
{
+ my $dataNode = shift;
my $type = shift;
- return "FloatRect" if $type eq "SVGRect";
- return "FloatPoint" if $type eq "SVGPoint";
- return "AffineTransform" if $type eq "SVGMatrix";
- return "float" if $type eq "SVGNumber";
+
+ $type = "FloatPoint" if $type eq "SVGPoint";
+ $type = "AffineTransform" if $type eq "SVGMatrix";
+ $type = "float" if $type eq "SVGNumber";
+ $type = "V8SVGPODTypeWrapper<$type>" if $dataNode->extendedAttributes->{"PODType"};
+ $type = $codeGenerator->GetSVGTypeNeedingTearOff($type) if $codeGenerator->IsSVGTypeNeedingTearOff($type);
return $type;
}
@@ -2584,6 +2693,9 @@ sub GenerateFunctionCallString()
my $nativeReturnType = GetNativeType($returnType, 0);
my $result = "";
+ my $isSVGTearOffType = ($codeGenerator->IsSVGTypeNeedingTearOff($returnType) and not $implClassName =~ /List$/);
+ $nativeReturnType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($returnType) if $isSVGTearOffType;
+
# Special case: SVG matrix transform methods should not mutate
# the matrix but return a copy
my $copyFirst = 0;
@@ -2660,6 +2772,12 @@ sub GenerateFunctionCallString()
if ($parameter->type eq "NodeFilter" || $parameter->type eq "XPathNSResolver") {
$functionString .= "$paramName.get()";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($parameter->type) and not $implClassName =~ /List$/) {
+ $functionString .= "$paramName->propertyReference()";
+ $result .= $indent . "if (!$paramName) {\n";
+ $result .= $indent . " V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR);\n";
+ $result .= $indent . " return v8::Handle<v8::Value>();\n";
+ $result .= $indent . "}\n";
} else {
$functionString .= $paramName;
}
@@ -2725,6 +2843,14 @@ sub GenerateFunctionCallString()
$return = "wrapper";
}
+ if ($isSVGTearOffType) {
+ $implIncludes{"V8$returnType.h"} = 1;
+ $implIncludes{"SVGPropertyTearOff.h"} = 1;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($returnType);
+ $result .= $indent . "return toV8(WTF::getPtr(${svgNativeType}::create($return)));\n";
+ return $result;
+ }
+
my $generatedSVGContextRetrieval = 0;
# If the return type needs an SVG context, output it
if (IsSVGTypeNeedingContextParameter($returnType)) {
@@ -2750,6 +2876,8 @@ sub GenerateFunctionCallString()
}
$result .= $indent . "impWrapper->commitChange(impInstance, context);\n";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($implClassName) and not $implClassName =~ /List$/) {
+ $result .= $indent . "wrapper->commitChange();\n";
}
if ($returnsPodType) {
@@ -2824,6 +2952,15 @@ sub GetNativeType
my $type = shift;
my $isParameter = shift;
+ my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
+ if ($svgNativeType) {
+ if ($svgNativeType =~ /List$/) {
+ return "${svgNativeType}*";
+ } else {
+ return "RefPtr<${svgNativeType} >";
+ }
+ }
+
if ($type eq "float" or $type eq "double") {
return $type;
}
@@ -2838,12 +2975,9 @@ sub GetNativeType
return "bool" if $type eq "boolean";
return "String" if $type eq "DOMString";
return "Range::CompareHow" if $type eq "CompareHow";
- return "FloatRect" if $type eq "SVGRect";
return "FloatPoint" if $type eq "SVGPoint";
return "AffineTransform" if $type eq "SVGMatrix";
return "SVGTransform" if $type eq "SVGTransform";
- return "SVGLength" if $type eq "SVGLength";
- return "SVGAngle" if $type eq "SVGAngle";
return "float" if $type eq "SVGNumber";
return "SVGPreserveAspectRatio" if $type eq "SVGPreserveAspectRatio";
return "SVGPaint::SVGPaintType" if $type eq "SVGPaintType";
@@ -2895,12 +3029,9 @@ sub BasicTypeCanFailConversion
my $signature = shift;
my $type = GetTypeFromSignature($signature);
- return 1 if $type eq "SVGAngle";
- return 1 if $type eq "SVGLength";
return 1 if $type eq "SVGMatrix";
return 1 if $type eq "SVGPoint";
return 1 if $type eq "SVGPreserveAspectRatio";
- return 1 if $type eq "SVGRect";
return 1 if $type eq "SVGTransform";
return 0;
}
@@ -2914,6 +3045,7 @@ sub TypeCanFailConversion
$implIncludes{"ExceptionCode.h"} = 1 if $type eq "Attr";
return 1 if $type eq "Attr";
return 1 if $type eq "VoidCallback";
+ return 1 if $type eq "IDBKey";
return BasicTypeCanFailConversion($signature);
}
@@ -3220,6 +3352,7 @@ sub ReturnNativeToJSValue
return "return toV8($value)";
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub GenerateSVGStaticPodTypeWrapper {
my $type = shift;
my $value = shift;
@@ -3274,17 +3407,24 @@ sub WriteData
}
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub IsSVGTypeNeedingContextParameter
{
my $implClassName = shift;
- if ($implClassName =~ /SVG/ and not $implClassName =~ /Element/) {
- return 1 unless $implClassName =~ /SVGPaint/ or $implClassName =~ /SVGColor/ or $implClassName =~ /SVGDocument/;
- }
+ return 0 unless $implClassName =~ /SVG/;
+ return 0 if $implClassName =~ /Element/;
+ return 0 if $codeGenerator->IsSVGNewStyleAnimatedType($implClassName);
+ return 0 if $codeGenerator->IsSVGTypeNeedingTearOff($implClassName);
- return 0;
+ my @noContextNeeded = ("SVGColor", "SVGDocument", "SVGPaintType", "SVGPaint", "SVGZoomEvent");
+ foreach (@noContextNeeded) {
+ return 0 if $implClassName eq $_;
+ }
+ return 1;
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub GenerateSVGContextAssignment
{
my $srcType = shift;
@@ -3297,6 +3437,7 @@ sub GenerateSVGContextAssignment
return $result;
}
+# FIXME: This method will go away once all SVG animated properties are converted to the new scheme.
sub GenerateSVGContextRetrieval
{
my $srcType = shift;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
new file mode 100644
index 0000000..7543fc4
--- /dev/null
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * 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 "WebDOMTestMediaQueryListListener.h"
+
+#include "MediaQueryListListener.h"
+#include "TestMediaQueryListListener.h"
+#include "WebDOMMediaQueryListListener.h"
+#include "WebExceptionHandler.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+struct WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListenerPrivate {
+ WebDOMTestMediaQueryListListenerPrivate(WebCore::TestMediaQueryListListener* object = 0)
+ : impl(object)
+ {
+ }
+
+ RefPtr<WebCore::TestMediaQueryListListener> impl;
+};
+
+WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener()
+ : WebDOMObject()
+ , m_impl(0)
+{
+}
+
+WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener(WebCore::TestMediaQueryListListener* impl)
+ : WebDOMObject()
+ , m_impl(new WebDOMTestMediaQueryListListenerPrivate(impl))
+{
+}
+
+WebDOMTestMediaQueryListListener::WebDOMTestMediaQueryListListener(const WebDOMTestMediaQueryListListener& copy)
+ : WebDOMObject()
+{
+ m_impl = copy.impl() ? new WebDOMTestMediaQueryListListenerPrivate(copy.impl()) : 0;
+}
+
+WebDOMTestMediaQueryListListener& WebDOMTestMediaQueryListListener::operator=(const WebDOMTestMediaQueryListListener& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestMediaQueryListListenerPrivate(copy.impl()) : 0;
+ return *this;
+}
+
+WebCore::TestMediaQueryListListener* WebDOMTestMediaQueryListListener::impl() const
+{
+ return m_impl ? m_impl->impl.get() : 0;
+}
+
+WebDOMTestMediaQueryListListener::~WebDOMTestMediaQueryListListener()
+{
+ delete m_impl;
+ m_impl = 0;
+}
+
+void WebDOMTestMediaQueryListListener::method(const WebDOMMediaQueryListListener& listener)
+{
+ if (!impl())
+ return;
+
+ impl()->method(toWebCore(listener));
+}
+
+WebCore::TestMediaQueryListListener* toWebCore(const WebDOMTestMediaQueryListListener& wrapper)
+{
+ return wrapper.impl();
+}
+
+WebDOMTestMediaQueryListListener toWebKit(WebCore::TestMediaQueryListListener* value)
+{
+ return WebDOMTestMediaQueryListListener(value);
+}
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h
new file mode 100644
index 0000000..8f89836
--- /dev/null
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * 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.
+ */
+
+#ifndef WebDOMTestMediaQueryListListener_h
+#define WebDOMTestMediaQueryListListener_h
+
+#include <WebDOMObject.h>
+#include <WebDOMString.h>
+
+namespace WebCore {
+class TestMediaQueryListListener;
+};
+
+class WebDOMMediaQueryListListener;
+
+class WebDOMTestMediaQueryListListener : public WebDOMObject {
+public:
+ WebDOMTestMediaQueryListListener();
+ explicit WebDOMTestMediaQueryListListener(WebCore::TestMediaQueryListListener*);
+ WebDOMTestMediaQueryListListener(const WebDOMTestMediaQueryListListener&);
+ WebDOMTestMediaQueryListListener& operator=(const WebDOMTestMediaQueryListListener&);
+ virtual ~WebDOMTestMediaQueryListListener();
+
+ void method(const WebDOMMediaQueryListListener& listener);
+
+ WebCore::TestMediaQueryListListener* impl() const;
+
+protected:
+ struct WebDOMTestMediaQueryListListenerPrivate;
+ WebDOMTestMediaQueryListListenerPrivate* m_impl;
+};
+
+WebCore::TestMediaQueryListListener* toWebCore(const WebDOMTestMediaQueryListListener&);
+WebDOMTestMediaQueryListListener toWebKit(WebCore::TestMediaQueryListListener*);
+
+#endif
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
new file mode 100644
index 0000000..af9300d
--- /dev/null
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
@@ -0,0 +1,163 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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 <glib-object.h>
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+#include "ExceptionCode.h"
+#include "JSMainThreadExecState.h"
+#include "TestMediaQueryListListener.h"
+#include "WebKitDOMBinding.h"
+#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMMediaQueryListListener.h"
+#include "webkit/WebKitDOMMediaQueryListListenerPrivate.h"
+#include "webkit/WebKitDOMTestMediaQueryListListener.h"
+#include "webkit/WebKitDOMTestMediaQueryListListenerPrivate.h"
+#include "webkitmarshal.h"
+#include "webkitprivate.h"
+
+namespace WebKit {
+
+gpointer kit(WebCore::TestMediaQueryListListener* obj)
+{
+ g_return_val_if_fail(obj, 0);
+
+ if (gpointer ret = DOMObjectCache::get(obj))
+ return ret;
+
+ return DOMObjectCache::put(obj, WebKit::wrapTestMediaQueryListListener(obj));
+}
+
+} // namespace WebKit //
+
+void
+webkit_dom_test_media_query_list_listener_method(WebKitDOMTestMediaQueryListListener* self, WebKitDOMMediaQueryListListener* listener)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(self);
+ WebCore::TestMediaQueryListListener * item = WebKit::core(self);
+ g_return_if_fail(listener);
+ WebCore::MediaQueryListListener * converted_listener = NULL;
+ if (listener != NULL) {
+ converted_listener = WebKit::core(listener);
+ g_return_if_fail(converted_listener);
+ }
+ item->method(converted_listener);
+}
+
+
+G_DEFINE_TYPE(WebKitDOMTestMediaQueryListListener, webkit_dom_test_media_query_list_listener, WEBKIT_TYPE_DOM_OBJECT)
+
+namespace WebKit {
+
+WebCore::TestMediaQueryListListener* core(WebKitDOMTestMediaQueryListListener* request)
+{
+ g_return_val_if_fail(request, 0);
+
+ WebCore::TestMediaQueryListListener* coreObject = static_cast<WebCore::TestMediaQueryListListener*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+ g_return_val_if_fail(coreObject, 0);
+
+ return coreObject;
+}
+
+} // namespace WebKit
+enum {
+ PROP_0,
+};
+
+
+static void webkit_dom_test_media_query_list_listener_finalize(GObject* object)
+{
+ WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+
+ if (dom_object->coreObject) {
+ WebCore::TestMediaQueryListListener* coreObject = static_cast<WebCore::TestMediaQueryListListener *>(dom_object->coreObject);
+
+ WebKit::DOMObjectCache::forget(coreObject);
+ coreObject->deref();
+
+ dom_object->coreObject = NULL;
+ }
+
+ G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_media_query_list_listener_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_media_query_list_listener_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_media_query_list_listener_constructed(GObject* object)
+{
+
+ if (G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->constructed)
+ G_OBJECT_CLASS(webkit_dom_test_media_query_list_listener_parent_class)->constructed(object);
+}
+
+static void webkit_dom_test_media_query_list_listener_class_init(WebKitDOMTestMediaQueryListListenerClass* requestClass)
+{
+ GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+ gobjectClass->finalize = webkit_dom_test_media_query_list_listener_finalize;
+ gobjectClass->set_property = webkit_dom_test_media_query_list_listener_set_property;
+ gobjectClass->get_property = webkit_dom_test_media_query_list_listener_get_property;
+ gobjectClass->constructed = webkit_dom_test_media_query_list_listener_constructed;
+
+
+
+}
+
+static void webkit_dom_test_media_query_list_listener_init(WebKitDOMTestMediaQueryListListener* request)
+{
+}
+
+namespace WebKit {
+WebKitDOMTestMediaQueryListListener* wrapTestMediaQueryListListener(WebCore::TestMediaQueryListListener* coreObject)
+{
+ g_return_val_if_fail(coreObject, 0);
+
+ /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+ * in a C-allocated GObject structure. See the finalize() code for the
+ * matching deref().
+ */
+ coreObject->ref();
+
+ return WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER(g_object_new(WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER,
+ "core-object", coreObject, NULL));
+}
+} // namespace WebKit
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h
new file mode 100644
index 0000000..94e825e
--- /dev/null
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h
@@ -0,0 +1,54 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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 WebKitDOMTestMediaQueryListListener_h
+#define WebKitDOMTestMediaQueryListListener_h
+
+#include "webkit/webkitdomdefines.h"
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+#include "webkit/WebKitDOMObject.h"
+
+
+G_BEGIN_DECLS
+#define WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER (webkit_dom_test_media_query_list_listener_get_type())
+#define WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER, WebKitDOMTestMediaQueryListListener))
+#define WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER, WebKitDOMTestMediaQueryListListenerClass)
+#define WEBKIT_DOM_IS_TEST_MEDIA_QUERY_LIST_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER))
+#define WEBKIT_DOM_IS_TEST_MEDIA_QUERY_LIST_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER))
+#define WEBKIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOM_TEST_MEDIA_QUERY_LIST_LISTENER, WebKitDOMTestMediaQueryListListenerClass))
+
+struct _WebKitDOMTestMediaQueryListListener {
+ WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestMediaQueryListListenerClass {
+ WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_media_query_list_listener_get_type (void);
+
+WEBKIT_API void
+webkit_dom_test_media_query_list_listener_method(WebKitDOMTestMediaQueryListListener* self, WebKitDOMMediaQueryListListener* listener);
+
+G_END_DECLS
+
+#endif /* WebKitDOMTestMediaQueryListListener_h */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h
new file mode 100644
index 0000000..c8ba6cc
--- /dev/null
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h
@@ -0,0 +1,39 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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 WEB_KIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_PRIVATE_H
+#define WEB_KIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_PRIVATE_H
+
+#include <glib-object.h>
+#include <webkit/WebKitDOMObject.h>
+#include "TestMediaQueryListListener.h"
+namespace WebKit {
+ WebKitDOMTestMediaQueryListListener *
+ wrapTestMediaQueryListListener(WebCore::TestMediaQueryListListener *coreObject);
+
+ WebCore::TestMediaQueryListListener *
+ core(WebKitDOMTestMediaQueryListListener *request);
+
+ gpointer
+ kit(WebCore::TestMediaQueryListListener* node);
+
+} // namespace WebKit
+
+#endif /* WEB_KIT_DOM_TEST_MEDIA_QUERY_LIST_LISTENER_PRIVATE_H */
diff --git a/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
new file mode 100644
index 0000000..cde9672
--- /dev/null
+++ b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
@@ -0,0 +1,194 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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 "JSTestMediaQueryListListener.h"
+
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "JSMediaQueryListListener.h"
+#include "TestMediaQueryListListener.h"
+#include <runtime/Error.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSTestMediaQueryListListener);
+
+/* Hash table */
+#if ENABLE(JIT)
+#define THUNK_GENERATOR(generator) , generator
+#else
+#define THUNK_GENERATOR(generator)
+#endif
+
+static const HashTableValue JSTestMediaQueryListListenerTableValues[2] =
+{
+ { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMediaQueryListListenerConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
+ { 0, 0, 0, 0 THUNK_GENERATOR(0) }
+};
+
+#undef THUNK_GENERATOR
+static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerTable = { 2, 1, JSTestMediaQueryListListenerTableValues, 0 };
+/* Hash table for constructor */
+#if ENABLE(JIT)
+#define THUNK_GENERATOR(generator) , generator
+#else
+#define THUNK_GENERATOR(generator)
+#endif
+
+static const HashTableValue JSTestMediaQueryListListenerConstructorTableValues[1] =
+{
+ { 0, 0, 0, 0 THUNK_GENERATOR(0) }
+};
+
+#undef THUNK_GENERATOR
+static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerConstructorTable = { 1, 0, JSTestMediaQueryListListenerConstructorTableValues, 0 };
+class JSTestMediaQueryListListenerConstructor : public DOMConstructorObject {
+public:
+ JSTestMediaQueryListListenerConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+};
+
+const ClassInfo JSTestMediaQueryListListenerConstructor::s_info = { "TestMediaQueryListListenerConstructor", 0, &JSTestMediaQueryListListenerConstructorTable, 0 };
+
+JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSTestMediaQueryListListenerConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+{
+ putDirect(exec->propertyNames().prototype, JSTestMediaQueryListListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
+bool JSTestMediaQueryListListenerConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestMediaQueryListListenerConstructor, DOMObject>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, slot);
+}
+
+bool JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestMediaQueryListListenerConstructor, DOMObject>(exec, &JSTestMediaQueryListListenerConstructorTable, this, propertyName, descriptor);
+}
+
+/* Hash table for prototype */
+#if ENABLE(JIT)
+#define THUNK_GENERATOR(generator) , generator
+#else
+#define THUNK_GENERATOR(generator)
+#endif
+
+static const HashTableValue JSTestMediaQueryListListenerPrototypeTableValues[2] =
+{
+ { "method", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestMediaQueryListListenerPrototypeFunctionMethod), (intptr_t)1 THUNK_GENERATOR(0) },
+ { 0, 0, 0, 0 THUNK_GENERATOR(0) }
+};
+
+#undef THUNK_GENERATOR
+static JSC_CONST_HASHTABLE HashTable JSTestMediaQueryListListenerPrototypeTable = { 2, 1, JSTestMediaQueryListListenerPrototypeTableValues, 0 };
+const ClassInfo JSTestMediaQueryListListenerPrototype::s_info = { "TestMediaQueryListListenerPrototype", 0, &JSTestMediaQueryListListenerPrototypeTable, 0 };
+
+JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestMediaQueryListListener>(exec, globalObject);
+}
+
+bool JSTestMediaQueryListListenerPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticFunctionSlot<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, slot);
+}
+
+bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, this, propertyName, descriptor);
+}
+
+const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", 0, &JSTestMediaQueryListListenerTable, 0 };
+
+JSTestMediaQueryListListener::JSTestMediaQueryListListener(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestMediaQueryListListener> impl)
+ : DOMObjectWithGlobalPointer(structure, globalObject)
+ , m_impl(impl)
+{
+}
+
+JSTestMediaQueryListListener::~JSTestMediaQueryListListener()
+{
+ forgetDOMObject(this, impl());
+}
+
+JSObject* JSTestMediaQueryListListener::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return new (exec) JSTestMediaQueryListListenerPrototype(globalObject, JSTestMediaQueryListListenerPrototype::createStructure(globalObject->objectPrototype()));
+}
+
+bool JSTestMediaQueryListListener::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, slot);
+}
+
+bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, this, propertyName, descriptor);
+}
+
+JSValue jsTestMediaQueryListListenerConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestMediaQueryListListener* domObject = static_cast<JSTestMediaQueryListListener*>(asObject(slotBase));
+ return JSTestMediaQueryListListener::getConstructor(exec, domObject->globalObject());
+}
+JSValue JSTestMediaQueryListListener::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestMediaQueryListListenerConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestMediaQueryListListener::s_info))
+ return throwVMTypeError(exec);
+ JSTestMediaQueryListListener* castedThis = static_cast<JSTestMediaQueryListListener*>(asObject(thisValue));
+ TestMediaQueryListListener* imp = static_cast<TestMediaQueryListListener*>(castedThis->impl());
+ MediaQueryListListener* listener = toMediaQueryListListener(exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ imp->method(listener);
+ return JSValue::encode(jsUndefined());
+}
+
+JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* object)
+{
+ return getDOMObjectWrapper<JSTestMediaQueryListListener>(exec, globalObject, object);
+}
+TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue value)
+{
+ return value.inherits(&JSTestMediaQueryListListener::s_info) ? static_cast<JSTestMediaQueryListListener*>(asObject(value))->impl() : 0;
+}
+
+}
diff --git a/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
new file mode 100644
index 0000000..1863703
--- /dev/null
+++ b/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
@@ -0,0 +1,87 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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 JSTestMediaQueryListListener_h
+#define JSTestMediaQueryListListener_h
+
+#include "JSDOMBinding.h"
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSObjectWithGlobalObject.h>
+#include <runtime/ObjectPrototype.h>
+
+namespace WebCore {
+
+class TestMediaQueryListListener;
+
+class JSTestMediaQueryListListener : public DOMObjectWithGlobalPointer {
+ typedef DOMObjectWithGlobalPointer Base;
+public:
+ JSTestMediaQueryListListener(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<TestMediaQueryListListener>);
+ virtual ~JSTestMediaQueryListListener();
+ static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+
+ static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
+ TestMediaQueryListListener* impl() const { return m_impl.get(); }
+
+private:
+ RefPtr<TestMediaQueryListListener> m_impl;
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*);
+TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue);
+
+class JSTestMediaQueryListListenerPrototype : public JSC::JSObjectWithGlobalObject {
+ typedef JSC::JSObjectWithGlobalObject Base;
+public:
+ static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
+ }
+ JSTestMediaQueryListListenerPrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod(JSC::ExecState*);
+// Attributes
+
+JSC::JSValue jsTestMediaQueryListListenerConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h
new file mode 100644
index 0000000..20be806
--- /dev/null
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 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
+ * 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.
+ */
+
+#import <WebCore/DOMObject.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+@class DOMMediaQueryListListener;
+
+@interface DOMTestMediaQueryListListener : DOMObject
+- (void)method:(DOMMediaQueryListListener *)listener;
+@end
+
+#endif
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm
new file mode 100644
index 0000000..74e3d52
--- /dev/null
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm
@@ -0,0 +1,95 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * 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.
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestMediaQueryListListener.h"
+
+#import "DOMBlobInternal.h"
+#import "DOMCSSRuleInternal.h"
+#import "DOMCSSValueInternal.h"
+#import "DOMEventInternal.h"
+#import "DOMMediaQueryListListenerInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMStyleSheetInternal.h"
+#import "DOMTestMediaQueryListListenerInternal.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "MediaQueryListListener.h"
+#import "TestMediaQueryListListener.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestMediaQueryListListener*>(_internal)
+
+@implementation DOMTestMediaQueryListListener
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestMediaQueryListListener class], self))
+ return;
+
+ if (_internal)
+ IMPL->deref();
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ if (_internal)
+ IMPL->deref();
+ [super finalize];
+}
+
+- (void)method:(DOMMediaQueryListListener *)listener
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->method(core(listener));
+}
+
+@end
+
+WebCore::TestMediaQueryListListener* core(DOMTestMediaQueryListListener *wrapper)
+{
+ return wrapper ? reinterpret_cast<WebCore::TestMediaQueryListListener*>(wrapper->_internal) : 0;
+}
+
+DOMTestMediaQueryListListener *kit(WebCore::TestMediaQueryListListener* value)
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
+ if (!value)
+ return nil;
+ if (DOMTestMediaQueryListListener *wrapper = getDOMWrapper(value))
+ return [[wrapper retain] autorelease];
+ DOMTestMediaQueryListListener *wrapper = [[DOMTestMediaQueryListListener alloc] _init];
+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+ value->ref();
+ addDOMWrapper(wrapper, value);
+ return [wrapper autorelease];
+}
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h
new file mode 100644
index 0000000..b1421a3
--- /dev/null
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListenerInternal.h
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * 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.
+ */
+
+#import <WebCore/DOMTestMediaQueryListListener.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+namespace WebCore {
+ class TestMediaQueryListListener;
+}
+
+WebCore::TestMediaQueryListListener* core(DOMTestMediaQueryListListener *);
+DOMTestMediaQueryListListener *kit(WebCore::TestMediaQueryListListener*);
+
+#endif
diff --git a/WebCore/bindings/scripts/test/TestMediaQueryListListener.idl b/WebCore/bindings/scripts/test/TestMediaQueryListListener.idl
new file mode 100644
index 0000000..536393b
--- /dev/null
+++ b/WebCore/bindings/scripts/test/TestMediaQueryListListener.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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.
+ */
+
+// This IDL file is for testing the bindings code generator with an interface
+// that has methods receiving a parameter of the type MediaQueryListListener.
+module test {
+ interface TestMediaQueryListListener {
+ void method(in MediaQueryListListener listener);
+ };
+}
diff --git a/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
new file mode 100644
index 0000000..1f78f39
--- /dev/null
+++ b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
@@ -0,0 +1,109 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestMediaQueryListListener.h"
+
+#include "ExceptionCode.h"
+#include "RuntimeEnabledFeatures.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8BindingState.h"
+#include "V8DOMWrapper.h"
+#include "V8IsolatedContext.h"
+#include "V8MediaQueryListListener.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0 };
+
+namespace TestMediaQueryListListenerInternal {
+
+template <typename T> void V8_USE(T) { }
+
+static v8::Handle<v8::Value> methodCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestMediaQueryListListener.method");
+ TestMediaQueryListListener* imp = V8TestMediaQueryListListener::toNative(args.Holder());
+ EXCEPTION_BLOCK(MediaQueryListListener*, listener, V8MediaQueryListListener::HasInstance(args[0]) ? V8MediaQueryListListener::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->method(listener);
+ return v8::Handle<v8::Value>();
+}
+
+} // namespace TestMediaQueryListListenerInternal
+
+static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListenerTemplate(v8::Persistent<v8::FunctionTemplate> desc)
+{
+ v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestMediaQueryListListener", v8::Persistent<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
+ 0, 0,
+ 0, 0);
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+
+
+ // Custom Signature 'method'
+ const int methodArgc = 1;
+ v8::Handle<v8::FunctionTemplate> methodArgv[methodArgc] = { V8MediaQueryListListener::GetRawTemplate() };
+ v8::Handle<v8::Signature> methodSignature = v8::Signature::New(desc, methodArgc, methodArgv);
+ proto->Set(v8::String::New("method"), v8::FunctionTemplate::New(TestMediaQueryListListenerInternal::methodCallback, v8::Handle<v8::Value>(), methodSignature));
+
+ // Custom toString template
+ desc->Set(getToStringName(), getToStringTemplate());
+ return desc;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetRawTemplate()
+{
+ static v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListenerRawCache = createRawTemplate();
+ return V8TestMediaQueryListListenerRawCache;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetTemplate()
+{
+ static v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListenerCache = ConfigureV8TestMediaQueryListListenerTemplate(GetRawTemplate());
+ return V8TestMediaQueryListListenerCache;
+}
+
+bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value)
+{
+ return GetRawTemplate()->HasInstance(value);
+}
+
+
+v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(TestMediaQueryListListener* impl)
+{
+ v8::Handle<v8::Object> wrapper;
+ V8Proxy* proxy = 0;
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
+ if (wrapper.IsEmpty())
+ return wrapper;
+
+ impl->ref();
+ getDOMObjectMap().set(impl, v8::Persistent<v8::Object>::New(wrapper));
+ return wrapper;
+}
+
+void V8TestMediaQueryListListener::derefObject(void* object)
+{
+ static_cast<TestMediaQueryListListener*>(object)->deref();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
new file mode 100644
index 0000000..908d9cd
--- /dev/null
+++ b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h
@@ -0,0 +1,72 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef V8TestMediaQueryListListener_h
+#define V8TestMediaQueryListListener_h
+
+#include "TestMediaQueryListListener.h"
+#include "V8DOMWrapper.h"
+#include "WrapperTypeInfo.h"
+#include "wtf/text/StringHash.h"
+#include <v8.h>
+#include <wtf/HashMap.h>
+
+namespace WebCore {
+
+class V8TestMediaQueryListListener {
+
+public:
+ static bool HasInstance(v8::Handle<v8::Value> value);
+ static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+ static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+ static TestMediaQueryListListener* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestMediaQueryListListener*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestMediaQueryListListener*);
+ static void derefObject(void*);
+ static WrapperTypeInfo info;
+ static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestMediaQueryListListener*);
+};
+
+
+v8::Handle<v8::Object> V8TestMediaQueryListListener::wrap(TestMediaQueryListListener* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestMediaQueryListListener::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestMediaQueryListListener* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestMediaQueryListListener::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestMediaQueryListListener > impl)
+{
+ return toV8(impl.get());
+}
+}
+
+#endif // V8TestMediaQueryListListener_h
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 44f0d3e..4be1177 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -678,9 +678,19 @@ static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.idbKey");
TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(RefPtr<IDBKey>, key, createIDBKeyFromValue(args[0]));
+ ExceptionCode ec = 0;
+ {
+ RefPtr<IDBKey> key = createIDBKeyFromValue(args[0]);
+ if (UNLIKELY(!key)) {
+ ec = TYPE_MISMATCH_ERR;
+ goto fail;
+ }
imp->idbKey(key);
return v8::Handle<v8::Value>();
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& args)
diff --git a/WebCore/bindings/v8/DateExtension.cpp b/WebCore/bindings/v8/DateExtension.cpp
index f2b6242..332828b 100644
--- a/WebCore/bindings/v8/DateExtension.cpp
+++ b/WebCore/bindings/v8/DateExtension.cpp
@@ -76,7 +76,7 @@ DateExtension* DateExtension::get()
void DateExtension::setAllowSleep(bool allow)
{
v8::Local<v8::Value> result = V8Proxy::currentContext()->Global()->Get(v8::String::New("Date"));
- if (result.IsEmpty())
+ if (result.IsEmpty() || !result->IsObject())
return;
v8::Handle<v8::Object> dateObject = v8::Handle<v8::Object>::Cast(result);
diff --git a/WebCore/bindings/v8/IDBBindingUtilities.cpp b/WebCore/bindings/v8/IDBBindingUtilities.cpp
index 4a58853..123b15c 100644
--- a/WebCore/bindings/v8/IDBBindingUtilities.cpp
+++ b/WebCore/bindings/v8/IDBBindingUtilities.cpp
@@ -28,6 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseException.h"
#include "IDBKey.h"
#include "IDBKeyPath.h"
#include "SerializedScriptValue.h"
@@ -45,7 +46,8 @@ PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value)
if (value->IsString())
return IDBKey::create(v8ValueToWebCoreString(value));
// FIXME: Implement dates.
- return 0;
+
+ return 0; // Signals type error.
}
template<typename T>
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index ff92167..36fc1f6 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -82,6 +82,7 @@ enum SerializationTag {
ArrayTag = '[',
ObjectTag = '{',
SparseArrayTag = '@',
+ RegExpTag = 'R',
};
static bool shouldCheckForCycles(int depth)
@@ -219,6 +220,14 @@ public:
doWriteUint32(pixelDataLength);
append(pixelData, pixelDataLength);
}
+
+ void writeRegExp(v8::Local<v8::String> pattern, v8::RegExp::Flags flags)
+ {
+ append(RegExpTag);
+ v8::String::Utf8Value patternUtf8Value(pattern);
+ doWriteString(*patternUtf8Value, patternUtf8Value.length());
+ doWriteUint32(static_cast<uint32_t>(flags));
+ }
void writeArray(uint32_t length)
{
@@ -605,6 +614,12 @@ private:
WTF::ByteArray* pixelArray = imageData->data()->data();
m_writer.writeImageData(imageData->width(), imageData->height(), pixelArray->data(), pixelArray->length());
}
+
+ void writeRegExp(v8::Handle<v8::Value> value)
+ {
+ v8::Handle<v8::RegExp> regExp = value.As<v8::RegExp>();
+ m_writer.writeRegExp(regExp->GetSource(), regExp->GetFlags());
+ }
static StateBase* newArrayState(v8::Handle<v8::Array> array, StateBase* next)
{
@@ -656,6 +671,8 @@ Serializer::StateBase* Serializer::doSerialize(v8::Handle<v8::Value> value, Stat
writeFileList(value);
else if (V8ImageData::HasInstance(value))
writeImageData(value);
+ else if (value->IsRegExp())
+ writeRegExp(value);
else if (value->IsObject())
return push(newObjectState(value.As<v8::Object>(), next));
return 0;
@@ -751,6 +768,10 @@ public:
return false;
break;
}
+ case RegExpTag:
+ if (!readRegExp(value))
+ return false;
+ break;
case ObjectTag: {
uint32_t numProperties;
if (!doReadUint32(&numProperties))
@@ -867,6 +888,18 @@ private:
*value = toV8(imageData);
return true;
}
+
+ bool readRegExp(v8::Handle<v8::Value>* value)
+ {
+ v8::Handle<v8::Value> pattern;
+ if (!readString(&pattern))
+ return false;
+ uint32_t flags;
+ if (!doReadUint32(&flags))
+ return false;
+ *value = v8::RegExp::New(pattern.As<v8::String>(), static_cast<v8::RegExp::Flags>(flags));
+ return true;
+ }
bool readBlob(v8::Handle<v8::Value>* value)
{
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index e7dca4f..c7e5bf1 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -55,6 +55,7 @@
#include "V8DOMMap.h"
#include "V8DOMWindow.h"
#include "V8EventException.h"
+#include "V8FileException.h"
#include "V8HiddenPropertyName.h"
#include "V8IsolatedContext.h"
#include "V8RangeException.h"
@@ -737,6 +738,11 @@ void V8Proxy::setDOMException(int exceptionCode)
exception = toV8(SQLException::create(description));
break;
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ case FileExceptionType:
+ exception = toV8(FileException::create(description));
+ break;
+#endif
default:
ASSERT_NOT_REACHED();
}
diff --git a/WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp b/WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp
new file mode 100644
index 0000000..4eeb1e0
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DOMSettableTokenListCustom.cpp
@@ -0,0 +1,41 @@
+/*
+ * 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 "V8DOMSettableTokenList.h"
+
+#include "DOMSettableTokenList.h"
+
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DOMSettableTokenList::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
+{
+ // FIXME: Implement this function.
+ return v8String("");
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp b/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
index 5f4fb57..fb0d53c 100755
--- a/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
@@ -29,9 +29,13 @@
*/
#include "config.h"
+
+#if ENABLE(BLOB)
+
#include "V8FileReader.h"
#include "ScriptExecutionContext.h"
+#include "V8ArrayBuffer.h"
#include "V8Binding.h"
namespace WebCore {
@@ -57,4 +61,16 @@ v8::Handle<v8::Value> V8FileReader::constructorCallback(const v8::Arguments& arg
return args.Holder();
}
+v8::Handle<v8::Value> V8FileReader::resultAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.FileReader.result._get");
+ v8::Handle<v8::Object> holder = info.Holder();
+ FileReader* imp = V8FileReader::toNative(holder);
+ if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
+ return toV8(imp->arrayBufferResult());
+ return v8StringOrNull(imp->stringResult());
+}
+
} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
index 0dae6af..3582a36 100644
--- a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -33,29 +33,26 @@
#if ENABLE(SVG)
#include "V8SVGLength.h"
-#include "SVGLength.h"
+#include "SVGPropertyTearOff.h"
#include "V8Binding.h"
-#include "V8SVGPODTypeWrapper.h"
-#include "V8Proxy.h"
namespace WebCore {
v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLength.value");
- V8SVGPODTypeWrapper<SVGLength>* wrapper = V8SVGPODTypeWrapper<SVGLength>::toNative(info.Holder());
- SVGLength imp = *wrapper;
- return v8::Number::New(imp.value(V8Proxy::svgContext(wrapper)));
+ SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
+ SVGLength& imp = wrapper->propertyReference();
+ return v8::Number::New(imp.value(wrapper->contextElement()));
}
v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
- V8SVGPODTypeWrapper<SVGLength>* wrapper = V8SVGPODTypeWrapper<SVGLength>::toNative(args.Holder());
- SVGLength imp = *wrapper;
- SVGElement* context = V8Proxy::svgContext(wrapper);
- imp.convertToSpecifiedUnits(toInt32(args[0]), context);
- wrapper->commitChange(imp, context);
+ SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
+ SVGLength& imp = wrapper->propertyReference();
+ imp.convertToSpecifiedUnits(toInt32(args[0]), wrapper->contextElement());
+ wrapper->commitChange();
return v8::Undefined();
}
diff --git a/WebCore/bridge/NP_jsobject.cpp b/WebCore/bridge/NP_jsobject.cpp
index 17270eb..0780ad7 100644
--- a/WebCore/bridge/NP_jsobject.cpp
+++ b/WebCore/bridge/NP_jsobject.cpp
@@ -190,9 +190,9 @@ bool _NPN_InvokeDefault(NPP, NPObject* o, const NPVariant* args, uint32_t argCou
MarkedArgumentBuffer argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue resultV = JSC::call(exec, function, callType, callData, function, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
@@ -240,9 +240,9 @@ bool _NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant*
MarkedArgumentBuffer argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue resultV = JSC::call(exec, function, callType, callData, obj->imp, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
// Convert and return the result of the function call.
convertValueToNPVariant(exec, resultV, result);
@@ -274,9 +274,9 @@ bool _NPN_Evaluate(NPP instance, NPObject* o, NPString* s, NPVariant* variant)
JSLock lock(SilenceAssertionsOnly);
String scriptString = convertNPStringToUTF16(s);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
Completion completion = JSC::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(scriptString), JSC::JSValue());
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
JSValue result;
@@ -514,9 +514,9 @@ bool _NPN_Construct(NPP, NPObject* o, const NPVariant* args, uint32_t argCount,
MarkedArgumentBuffer argList;
getListFromVariantArgs(exec, args, argCount, rootObject, argList);
ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue resultV = JSC::construct(exec, constructor, constructType, constructData, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
// Convert and return the result.
convertValueToNPVariant(exec, resultV, result);
diff --git a/WebCore/bridge/c/c_instance.cpp b/WebCore/bridge/c/c_instance.cpp
index 03e72fc..f1dd4e5 100644
--- a/WebCore/bridge/c/c_instance.cpp
+++ b/WebCore/bridge/c/c_instance.cpp
@@ -265,10 +265,10 @@ JSValue CInstance::stringValue(ExecState* exec) const
return jsString(exec, buf);
}
-JSValue CInstance::numberValue(ExecState* exec) const
+JSValue CInstance::numberValue(ExecState*) const
{
// FIXME: Implement something sensible.
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue CInstance::booleanValue() const
diff --git a/WebCore/bridge/c/c_utility.cpp b/WebCore/bridge/c/c_utility.cpp
index b160f9f..e786896 100644
--- a/WebCore/bridge/c/c_utility.cpp
+++ b/WebCore/bridge/c/c_utility.cpp
@@ -118,9 +118,9 @@ JSValue convertNPVariantToValue(ExecState* exec, const NPVariant* variant, RootO
if (type == NPVariantType_Void)
return jsUndefined();
if (type == NPVariantType_Int32)
- return jsNumber(exec, NPVARIANT_TO_INT32(*variant));
+ return jsNumber(NPVARIANT_TO_INT32(*variant));
if (type == NPVariantType_Double)
- return jsNumber(exec, NPVARIANT_TO_DOUBLE(*variant));
+ return jsNumber(NPVARIANT_TO_DOUBLE(*variant));
if (type == NPVariantType_String)
return WebCore::jsString(exec, convertNPStringToUTF16(&variant->value.stringValue));
if (type == NPVariantType_Object) {
diff --git a/WebCore/bridge/jni/jni_jsobject.mm b/WebCore/bridge/jni/jni_jsobject.mm
index d7d3a54..f8ec1c4 100644
--- a/WebCore/bridge/jni/jni_jsobject.mm
+++ b/WebCore/bridge/jni/jni_jsobject.mm
@@ -296,9 +296,9 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
// Call the function object.
MarkedArgumentBuffer argList;
getListFromJArray(exec, args, argList);
- rootObject->globalObject()->globalData()->timeoutChecker.start();
+ rootObject->globalObject()->globalData().timeoutChecker.start();
JSValue result = JSC::call(exec, function, callType, callData, _imp, argList);
- rootObject->globalObject()->globalData()->timeoutChecker.stop();
+ rootObject->globalObject()->globalData().timeoutChecker.stop();
return convertValueToJObject(result);
}
@@ -315,9 +315,9 @@ jobject JavaJSObject::eval(jstring script) const
if (!rootObject)
return 0;
- rootObject->globalObject()->globalData()->timeoutChecker.start();
+ rootObject->globalObject()->globalData().timeoutChecker.start();
Completion completion = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script)), JSC::JSValue());
- rootObject->globalObject()->globalData()->timeoutChecker.stop();
+ rootObject->globalObject()->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
if (type == Normal) {
diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
index 8a34ced..3c16d05 100644
--- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
@@ -132,7 +132,7 @@ JSValue JavaField::valueFromInstance(ExecState* exec, const Instance* i) const
jint value;
jvalue result = dispatchValueFromInstance(exec, instance, "getInt", "(Ljava/lang/Object;)I", int_type);
value = result.i;
- jsresult = jsNumber(exec, static_cast<int>(value));
+ jsresult = jsNumber(static_cast<int>(value));
}
break;
@@ -143,7 +143,7 @@ JSValue JavaField::valueFromInstance(ExecState* exec, const Instance* i) const
jdouble value;
jvalue result = dispatchValueFromInstance(exec, instance, "getDouble", "(Ljava/lang/Object;)D", double_type);
value = result.i;
- jsresult = jsNumber(exec, static_cast<double>(value));
+ jsresult = jsNumber(static_cast<double>(value));
}
break;
default:
@@ -380,7 +380,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jbyteArray byteArray = static_cast<jbyteArray>(javaArray());
jbyte aByte;
env->GetByteArrayRegion(byteArray, index, 1, &aByte);
- return jsNumber(exec, aByte);
+ return jsNumber(aByte);
}
case char_type:
@@ -388,7 +388,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jcharArray charArray = static_cast<jcharArray>(javaArray());
jchar aChar;
env->GetCharArrayRegion(charArray, index, 1, &aChar);
- return jsNumber(exec, aChar);
+ return jsNumber(aChar);
break;
}
@@ -397,7 +397,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jshortArray shortArray = static_cast<jshortArray>(javaArray());
jshort aShort;
env->GetShortArrayRegion(shortArray, index, 1, &aShort);
- return jsNumber(exec, aShort);
+ return jsNumber(aShort);
}
case int_type:
@@ -405,7 +405,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jintArray intArray = static_cast<jintArray>(javaArray());
jint anInt;
env->GetIntArrayRegion(intArray, index, 1, &anInt);
- return jsNumber(exec, anInt);
+ return jsNumber(anInt);
}
case long_type:
@@ -413,7 +413,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jlongArray longArray = static_cast<jlongArray>(javaArray());
jlong aLong;
env->GetLongArrayRegion(longArray, index, 1, &aLong);
- return jsNumber(exec, aLong);
+ return jsNumber(aLong);
}
case float_type:
@@ -421,7 +421,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jfloatArray floatArray = static_cast<jfloatArray>(javaArray());
jfloat aFloat;
env->GetFloatArrayRegion(floatArray, index, 1, &aFloat);
- return jsNumber(exec, aFloat);
+ return jsNumber(aFloat);
}
case double_type:
@@ -429,7 +429,7 @@ JSValue JavaArray::valueAt(ExecState* exec, unsigned index) const
jdoubleArray doubleArray = static_cast<jdoubleArray>(javaArray());
jdouble aDouble;
env->GetDoubleArrayRegion(doubleArray, index, 1, &aDouble);
- return jsNumber(exec, aDouble);
+ return jsNumber(aDouble);
}
default:
break;
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
index 1e584af..db57d2c 100644
--- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
@@ -104,10 +104,10 @@ JSValue JavaInstance::stringValue(ExecState* exec) const
return jsString(exec, u);
}
-JSValue JavaInstance::numberValue(ExecState* exec) const
+JSValue JavaInstance::numberValue(ExecState*) const
{
jdouble doubleValue = callJNIMethod<jdouble>(m_instance->m_instance, "doubleValue", "()D");
- return jsNumber(exec, doubleValue);
+ return jsNumber(doubleValue);
}
JSValue JavaInstance::booleanValue() const
@@ -284,43 +284,43 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod
case byte_type:
{
- resultValue = jsNumber(exec, result.b);
+ resultValue = jsNumber(result.b);
}
break;
case char_type:
{
- resultValue = jsNumber(exec, result.c);
+ resultValue = jsNumber(result.c);
}
break;
case short_type:
{
- resultValue = jsNumber(exec, result.s);
+ resultValue = jsNumber(result.s);
}
break;
case int_type:
{
- resultValue = jsNumber(exec, result.i);
+ resultValue = jsNumber(result.i);
}
break;
case long_type:
{
- resultValue = jsNumber(exec, result.j);
+ resultValue = jsNumber(result.j);
}
break;
case float_type:
{
- resultValue = jsNumber(exec, result.f);
+ resultValue = jsNumber(result.f);
}
break;
case double_type:
{
- resultValue = jsNumber(exec, result.d);
+ resultValue = jsNumber(result.d);
}
break;
diff --git a/WebCore/bridge/objc/objc_instance.mm b/WebCore/bridge/objc/objc_instance.mm
index 989d9eb..ae9d95d 100644
--- a/WebCore/bridge/objc/objc_instance.mm
+++ b/WebCore/bridge/objc/objc_instance.mm
@@ -447,10 +447,10 @@ JSValue ObjcInstance::stringValue(ExecState* exec) const
return convertNSStringToString(exec, [getObject() description]);
}
-JSValue ObjcInstance::numberValue(ExecState* exec) const
+JSValue ObjcInstance::numberValue(ExecState*) const
{
// FIXME: Implement something sensible
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue ObjcInstance::booleanValue() const
diff --git a/WebCore/bridge/objc/objc_utility.mm b/WebCore/bridge/objc/objc_utility.mm
index 8eb7ba5..dfba852 100644
--- a/WebCore/bridge/objc/objc_utility.mm
+++ b/WebCore/bridge/objc/objc_utility.mm
@@ -242,7 +242,7 @@ JSValue convertObjcValueToValue(ExecState* exec, void* buffer, ObjcValueType typ
if ((CFBooleanRef)obj == kCFBooleanFalse)
return jsBoolean(false);
if ([obj isKindOfClass:[NSNumber class]])
- return jsNumber(exec, [obj doubleValue]);
+ return jsNumber([obj doubleValue]);
if ([obj isKindOfClass:[NSArray class]])
return new (exec) RuntimeArray(exec, new ObjcArray(obj, rootObject));
if ([obj isKindOfClass:webScriptObjectClass()]) {
@@ -256,29 +256,29 @@ JSValue convertObjcValueToValue(ExecState* exec, void* buffer, ObjcValueType typ
return ObjcInstance::create(obj, rootObject)->createRuntimeObject(exec);
}
case ObjcCharType:
- return jsNumber(exec, *(char*)buffer);
+ return jsNumber(*(char*)buffer);
case ObjcUnsignedCharType:
- return jsNumber(exec, *(unsigned char*)buffer);
+ return jsNumber(*(unsigned char*)buffer);
case ObjcShortType:
- return jsNumber(exec, *(short*)buffer);
+ return jsNumber(*(short*)buffer);
case ObjcUnsignedShortType:
- return jsNumber(exec, *(unsigned short*)buffer);
+ return jsNumber(*(unsigned short*)buffer);
case ObjcIntType:
- return jsNumber(exec, *(int*)buffer);
+ return jsNumber(*(int*)buffer);
case ObjcUnsignedIntType:
- return jsNumber(exec, *(unsigned int*)buffer);
+ return jsNumber(*(unsigned int*)buffer);
case ObjcLongType:
- return jsNumber(exec, *(long*)buffer);
+ return jsNumber(*(long*)buffer);
case ObjcUnsignedLongType:
- return jsNumber(exec, *(unsigned long*)buffer);
+ return jsNumber(*(unsigned long*)buffer);
case ObjcLongLongType:
- return jsNumber(exec, *(long long*)buffer);
+ return jsNumber(*(long long*)buffer);
case ObjcUnsignedLongLongType:
- return jsNumber(exec, *(unsigned long long*)buffer);
+ return jsNumber(*(unsigned long long*)buffer);
case ObjcFloatType:
- return jsNumber(exec, *(float*)buffer);
+ return jsNumber(*(float*)buffer);
case ObjcDoubleType:
- return jsNumber(exec, *(double*)buffer);
+ return jsNumber(*(double*)buffer);
default:
// Should never get here. Argument types are filtered.
fprintf(stderr, "%s: invalid type (%d)\n", __PRETTY_FUNCTION__, (int)type);
diff --git a/WebCore/bridge/qt/qt_instance.cpp b/WebCore/bridge/qt/qt_instance.cpp
index 1229919..c2e2dce 100644
--- a/WebCore/bridge/qt/qt_instance.cpp
+++ b/WebCore/bridge/qt/qt_instance.cpp
@@ -306,9 +306,9 @@ JSValue QtInstance::stringValue(ExecState* exec) const
return jsString(exec, buf.constData());
}
-JSValue QtInstance::numberValue(ExecState* exec) const
+JSValue QtInstance::numberValue(ExecState*) const
{
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue QtInstance::booleanValue() const
diff --git a/WebCore/bridge/qt/qt_pixmapruntime.cpp b/WebCore/bridge/qt/qt_pixmapruntime.cpp
index ad26019..1ef20c3 100644
--- a/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -51,9 +51,9 @@ public:
class QtPixmapWidthField : public Field {
public:
static const char* name() { return "width"; }
- virtual JSValue valueFromInstance(ExecState* exec, const Instance* instance) const
+ virtual JSValue valueFromInstance(ExecState*, const Instance* instance) const
{
- return jsNumber(exec, static_cast<const QtPixmapInstance*>(instance)->width());
+ return jsNumber(static_cast<const QtPixmapInstance*>(instance)->width());
}
virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const {}
};
@@ -61,9 +61,9 @@ public:
class QtPixmapHeightField : public Field {
public:
static const char* name() { return "height"; }
- virtual JSValue valueFromInstance(ExecState* exec, const Instance* instance) const
+ virtual JSValue valueFromInstance(ExecState*, const Instance* instance) const
{
- return jsNumber(exec, static_cast<const QtPixmapInstance*>(instance)->height());
+ return jsNumber(static_cast<const QtPixmapInstance*>(instance)->height());
}
virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const {}
};
@@ -355,7 +355,7 @@ RuntimeObject* QtPixmapInstance::newRuntimeObject(ExecState* exec)
JSObject* QtPixmapInstance::createPixmapRuntimeObject(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& data)
{
JSLock lock(SilenceAssertionsOnly);
- QtPixmapInstance* instance = new QtPixmapInstance(root, data);
+ RefPtr<QtPixmapInstance> instance = adoptRef(new QtPixmapInstance(root, data));
return instance->createRuntimeObject(exec);
}
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index ce4567a..96851fa 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -179,7 +179,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
}
// check magic pointer values before dereferencing value
- if (value == jsNaN(exec)
+ if (value == jsNaN()
|| (value == jsUndefined()
&& hint != QMetaType::QString
&& hint != (QMetaType::Type) qMetaTypeId<QVariant>())) {
@@ -816,7 +816,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con
type == QMetaType::UShort ||
type == QMetaType::Float ||
type == QMetaType::Double)
- return jsNumber(exec, variant.toDouble());
+ return jsNumber(variant.toDouble());
if (type == QMetaType::QRegExp) {
QRegExp re = variant.value<QRegExp>();
@@ -1477,10 +1477,10 @@ void QtRuntimeMetaMethod::getOwnPropertyNames(ExecState* exec, PropertyNameArray
QtRuntimeMethod::getOwnPropertyNames(exec, propertyNames, mode);
}
-JSValue QtRuntimeMetaMethod::lengthGetter(ExecState* exec, JSValue, const Identifier&)
+JSValue QtRuntimeMetaMethod::lengthGetter(ExecState*, JSValue, const Identifier&)
{
// QtScript always returns 0
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue QtRuntimeMetaMethod::connectGetter(ExecState* exec, JSValue slotBase, const Identifier& ident)
@@ -1683,10 +1683,10 @@ void QtRuntimeConnectionMethod::getOwnPropertyNames(ExecState* exec, PropertyNam
QtRuntimeMethod::getOwnPropertyNames(exec, propertyNames, mode);
}
-JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState* exec, JSValue, const Identifier&)
+JSValue QtRuntimeConnectionMethod::lengthGetter(ExecState*, JSValue, const Identifier&)
{
// we have one formal argument, and one optional
- return jsNumber(exec, 1);
+ return jsNumber(1);
}
// ===============
diff --git a/WebCore/bridge/runtime_array.cpp b/WebCore/bridge/runtime_array.cpp
index ca12f48..2d0b7e3 100644
--- a/WebCore/bridge/runtime_array.cpp
+++ b/WebCore/bridge/runtime_array.cpp
@@ -50,10 +50,10 @@ RuntimeArray::~RuntimeArray()
delete getConcreteArray();
}
-JSValue RuntimeArray::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue RuntimeArray::lengthGetter(ExecState*, JSValue slotBase, const Identifier&)
{
RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slotBase));
- return jsNumber(exec, thisObj->getLength());
+ return jsNumber(thisObj->getLength());
}
JSValue RuntimeArray::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
diff --git a/WebCore/bridge/runtime_method.cpp b/WebCore/bridge/runtime_method.cpp
index 15e029c..8a61f2e 100644
--- a/WebCore/bridge/runtime_method.cpp
+++ b/WebCore/bridge/runtime_method.cpp
@@ -52,7 +52,7 @@ RuntimeMethod::RuntimeMethod(ExecState* exec, JSGlobalObject* globalObject, cons
{
}
-JSValue RuntimeMethod::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue RuntimeMethod::lengthGetter(ExecState*, JSValue slotBase, const Identifier&)
{
RuntimeMethod* thisObj = static_cast<RuntimeMethod*>(asObject(slotBase));
@@ -62,7 +62,7 @@ JSValue RuntimeMethod::lengthGetter(ExecState* exec, JSValue slotBase, const Ide
// Java does.
// FIXME: a better solution might be to give the maximum number of parameters
// of any method
- return jsNumber(exec, thisObj->_methodList->at(0)->numParameters());
+ return jsNumber(thisObj->_methodList->at(0)->numParameters());
}
bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 9f4c3be..3f6aa4a 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -913,7 +913,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (cursors && cursors->size() > 0) {
list = CSSValueList::createCommaSeparated();
for (unsigned i = 0; i < cursors->size(); ++i)
- list->append((*cursors)[i].image()->cssValue());
+ if (StyleImage* image = cursors->at(i).image())
+ list->append(image->cssValue());
}
RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor());
if (list) {
diff --git a/WebCore/css/CSSFontFaceSource.cpp b/WebCore/css/CSSFontFaceSource.cpp
index ad9bebc..4fdcc03 100644
--- a/WebCore/css/CSSFontFaceSource.cpp
+++ b/WebCore/css/CSSFontFaceSource.cpp
@@ -162,7 +162,7 @@ SimpleFontData* CSSFontFaceSource::getFontData(const FontDescription& fontDescri
if (!m_font->ensureCustomFontData())
return 0;
- fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.renderingMode()), true, false));
+ fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.renderingMode()), true, false));
}
} else {
#if ENABLE(SVG_FONTS)
diff --git a/WebCore/css/CSSRule.h b/WebCore/css/CSSRule.h
index fc48dd6..1ffca93 100644
--- a/WebCore/css/CSSRule.h
+++ b/WebCore/css/CSSRule.h
@@ -30,6 +30,11 @@ namespace WebCore {
typedef int ExceptionCode;
+enum CSSRuleFilter {
+ AllCSSRules,
+ SameOriginCSSRulesOnly
+};
+
class CSSRule : public StyleBase {
public:
// FIXME: Change name to Type.
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 9ae0505..881bf74 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -702,6 +702,8 @@ void CSSStyleSelector::matchRulesForList(CSSRuleDataList* rules, int& firstRuleI
for (CSSRuleData* d = rules->first(); d; d = d->next()) {
CSSStyleRule* rule = d->rule();
+ if (m_checker.m_sameOriginOnly && !m_checker.m_document->securityOrigin()->canRequest(rule->baseURL()))
+ continue;
if (checkSelector(d->selector())) {
// If the rule has no properties to apply, then ignore it in the non-debug mode.
CSSMutableStyleDeclaration* decl = rule->declaration();
@@ -817,6 +819,10 @@ inline void CSSStyleSelector::initElement(Element* e)
m_element = e;
m_styledElement = m_element && m_element->isStyledElement() ? static_cast<StyledElement*>(m_element) : 0;
m_elementLinkState = m_checker.determineLinkState(m_element);
+ if (e && e == e->document()->documentElement()) {
+ e->document()->setDirectionSetOnDocumentElement(false);
+ e->document()->setWritingModeSetOnDocumentElement(false);
+ }
}
}
@@ -884,6 +890,7 @@ CSSStyleSelector::SelectorChecker::SelectorChecker(Document* document, bool stri
: m_document(document)
, m_strictParsing(strictParsing)
, m_collectRulesOnly(false)
+ , m_sameOriginOnly(false)
, m_pseudoStyle(NOPSEUDO)
, m_documentIsHTML(document->isHTMLDocument())
, m_matchVisitedPseudoClass(false)
@@ -1105,13 +1112,23 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document)
documentStyle->setDisplay(BLOCK);
documentStyle->setVisuallyOrdered(document->visuallyOrdered());
documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
+ documentStyle->setPageScaleTransform(frame ? frame->pageScaleFactor() : 1);
Element* docElement = document->documentElement();
- if (docElement && docElement->renderer()) {
- // Use the direction and block-flow of the document element to set the
- // viewport's direction and block-flow.
- documentStyle->setWritingMode(docElement->renderer()->style()->writingMode());
- documentStyle->setDirection(docElement->renderer()->style()->direction());
+ RenderObject* docElementRenderer = docElement ? docElement->renderer() : 0;
+ if (docElementRenderer) {
+ // Use the direction and writing-mode of the body to set the
+ // viewport's direction and writing-mode unless the property is set on the document element.
+ // If there is no body, then use the document element.
+ RenderObject* bodyRenderer = document->body() ? document->body()->renderer() : 0;
+ if (bodyRenderer && !document->writingModeSetOnDocumentElement())
+ documentStyle->setWritingMode(bodyRenderer->style()->writingMode());
+ else
+ documentStyle->setWritingMode(docElementRenderer->style()->writingMode());
+ if (bodyRenderer && !document->directionSetOnDocumentElement())
+ documentStyle->setDirection(bodyRenderer->style()->direction());
+ else
+ documentStyle->setDirection(docElementRenderer->style()->direction());
}
FontDescription fontDescription;
@@ -1866,12 +1883,12 @@ void CSSStyleSelector::cacheBorderAndBackground()
}
}
-PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly, bool includeEmptyRules)
+PassRefPtr<CSSRuleList> CSSStyleSelector::styleRulesForElement(Element* e, bool authorOnly, bool includeEmptyRules, CSSRuleFilter filter)
{
- return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly, includeEmptyRules);
+ return pseudoStyleRulesForElement(e, NOPSEUDO, authorOnly, includeEmptyRules, filter);
}
-PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly, bool includeEmptyRules)
+PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, PseudoId pseudoId, bool authorOnly, bool includeEmptyRules, CSSRuleFilter filter)
{
if (!e || !e->document()->haveStylesheetsLoaded())
return 0;
@@ -1894,13 +1911,17 @@ PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e,
}
if (m_matchAuthorAndUserStyles) {
+ m_checker.m_sameOriginOnly = (filter == SameOriginCSSRulesOnly);
+
// Check the rules in author sheets.
int firstAuthorRule = -1, lastAuthorRule = -1;
matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule, includeEmptyRules);
+
+ m_checker.m_sameOriginOnly = false;
}
m_checker.m_collectRulesOnly = false;
-
+
return m_ruleList.release();
}
@@ -3224,6 +3245,8 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return;
case CSSPropertyDirection:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(direction, Direction)
+ if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement())
+ m_element->document()->setDirectionSetOnDocumentElement(true);
return;
case CSSPropertyDisplay:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(display, Display)
@@ -5571,9 +5594,16 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
#endif
// CSS Text Layout Module Level 3: Vertical writing support
- case CSSPropertyWebkitWritingMode:
+ case CSSPropertyWebkitWritingMode: {
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(writingMode, WritingMode)
+ if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement())
+ m_element->document()->setWritingModeSetOnDocumentElement(true);
+ FontDescription fontDescription = m_style->fontDescription();
+ fontDescription.setOrientation(m_style->isHorizontalWritingMode() ? Horizontal : Vertical);
+ if (m_style->setFontDescription(fontDescription))
+ m_fontDirty = true;
return;
+<<<<<<< HEAD
#ifdef ANDROID_CSS_RING
case CSSPropertyWebkitRing:
@@ -5719,6 +5749,9 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
}
#endif
+=======
+ }
+>>>>>>> webkit.org at r70949
#if ENABLE(SVG)
default:
// Try the SVG properties
@@ -6972,10 +7005,12 @@ void CSSStyleSelector::loadPendingImages()
case CSSPropertyCursor: {
if (CursorList* cursorList = m_style->cursors()) {
for (size_t i = 0; i < cursorList->size(); ++i) {
- CursorData& currentCursor = (*cursorList)[i];
- if (currentCursor.image()->isPendingImage()) {
- CSSImageValue* imageValue = static_cast<StylePendingImage*>(currentCursor.image())->cssImageValue();
- currentCursor.setImage(imageValue->cachedImage(cachedResourceLoader));
+ CursorData& currentCursor = cursorList->at(i);
+ if (StyleImage* image = currentCursor.image()) {
+ if (image->isPendingImage()) {
+ CSSImageValue* imageValue = static_cast<StylePendingImage*>(image)->cssImageValue();
+ currentCursor.setImage(imageValue->cachedImage(cachedResourceLoader));
+ }
}
}
}
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index 5f70e05..20cd866 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -23,6 +23,7 @@
#define CSSStyleSelector_h
#include "CSSFontSelector.h"
+#include "CSSRule.h"
#include "LinkHash.h"
#include "MediaQueryExp.h"
#include "RenderStyle.h"
@@ -119,8 +120,8 @@ public:
public:
// These methods will give back the set of rules that matched for a given element (or a pseudo-element).
- PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly, bool includeEmptyRules = false);
- PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly, bool includeEmptyRules = false);
+ PassRefPtr<CSSRuleList> styleRulesForElement(Element*, bool authorOnly, bool includeEmptyRules = false, CSSRuleFilter filter = AllCSSRules);
+ PassRefPtr<CSSRuleList> pseudoStyleRulesForElement(Element*, PseudoId, bool authorOnly, bool includeEmptyRules = false, CSSRuleFilter filter = AllCSSRules);
// Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function will return
// the correct font size scaled relative to the user's default (medium).
@@ -231,6 +232,7 @@ public:
Document* m_document;
bool m_strictParsing;
bool m_collectRulesOnly;
+ bool m_sameOriginOnly;
PseudoId m_pseudoStyle;
bool m_documentIsHTML;
mutable bool m_matchVisitedPseudoClass;
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 9ad263c..272387d 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -62,6 +62,7 @@
#include "FocusController.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
#include "FrameTree.h"
#include "FrameView.h"
#include "HashChangeEvent.h"
@@ -381,7 +382,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con
, m_frameElementsShouldIgnoreScrolling(false)
, m_containsValidityStyleRules(false)
, m_updateFocusAppearanceRestoresSelection(false)
- , m_writeDisabled(false)
+ , m_ignoreDestructiveWriteCount(0)
, m_title("")
, m_rawTitle("")
, m_titleSetExplicitly(false)
@@ -425,6 +426,8 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con
#endif
, m_loadEventDelayCount(0)
, m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
+ , m_directionSetOnDocumentElement(false)
+ , m_writingModeSetOnDocumentElement(false)
{
m_document = this;
@@ -2178,10 +2181,8 @@ void Document::write(const SegmentedString& text, Document* ownerDocument)
printf("Beginning a document.write at %d\n", elapsedTime());
#endif
- // If the insertion point is undefined and the Document has the
- // "write-neutralised" flag set, then abort these steps.
bool hasInsertionPoint = m_parser && m_parser->hasInsertionPoint();
- if (!hasInsertionPoint && writeDisabled())
+ if (!hasInsertionPoint && m_ignoreDestructiveWriteCount)
return;
if (!hasInsertionPoint)
@@ -3924,6 +3925,9 @@ void Document::documentDidBecomeActive()
if (renderer())
renderView()->didMoveOnscreen();
#endif
+
+ ASSERT(m_frame);
+ m_frame->loader()->client()->dispatchDidBecomeFrameset(isFrameSet());
}
void Document::registerForDocumentActivationCallbacks(Element* e)
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 25122b5..2d169e7 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -841,6 +841,11 @@ public:
DocumentMarkerController* markers() const { return m_markers.get(); }
+ bool directionSetOnDocumentElement() const { return m_directionSetOnDocumentElement; }
+ bool writingModeSetOnDocumentElement() const { return m_writingModeSetOnDocumentElement; }
+ void setDirectionSetOnDocumentElement(bool b) { m_directionSetOnDocumentElement = b; }
+ void setWritingModeSetOnDocumentElement(bool b) { m_writingModeSetOnDocumentElement = b; }
+
bool execCommand(const String& command, bool userInterface = false, const String& value = String());
bool queryCommandEnabled(const String& command);
bool queryCommandIndeterm(const String& command);
@@ -1043,9 +1048,6 @@ public:
void webkitDidExitFullScreenForElement(Element*);
#endif
- bool writeDisabled() const { return m_writeDisabled; }
- void setWriteDisabled(bool flag) { m_writeDisabled = flag; }
-
// Used to allow element that loads data without going through a FrameLoader to delay the 'load' event.
void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; }
void decrementLoadEventDelayCount();
@@ -1063,6 +1065,8 @@ protected:
private:
+ friend class IgnoreDestructiveWriteCountIncrementer;
+
void detachParser();
typedef void (*ArgumentsCallback)(const String& keyString, const String& valueString, Document*, void* data);
@@ -1220,8 +1224,8 @@ private:
bool m_containsValidityStyleRules;
bool m_updateFocusAppearanceRestoresSelection;
- // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised
- bool m_writeDisabled;
+ // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-writes-counter
+ unsigned m_ignoreDestructiveWriteCount;
String m_title;
String m_rawTitle;
@@ -1353,6 +1357,9 @@ private:
Timer<Document> m_loadEventDelayTimer;
ViewportArguments m_viewportArguments;
+
+ bool m_directionSetOnDocumentElement;
+ bool m_writingModeSetOnDocumentElement;
};
inline bool Document::hasElementWithId(AtomicStringImpl* id) const
diff --git a/WebCore/dom/DocumentMarker.h b/WebCore/dom/DocumentMarker.h
index dd5e981..2be60f8 100644
--- a/WebCore/dom/DocumentMarker.h
+++ b/WebCore/dom/DocumentMarker.h
@@ -33,18 +33,17 @@ namespace WebCore {
// It also optionally includes a flag specifying whether the match is active, which is ignored
// for all types other than type TextMatch.
struct DocumentMarker {
-
enum MarkerType {
- AllMarkers = -1,
- Spelling,
- Grammar,
- TextMatch,
- Replacement,
- CorrectionIndicator,
- RejectedCorrection
+ Spelling = 1 << 0,
+ Grammar = 1 << 1,
+ TextMatch = 1 << 2,
+ Replacement = 1 << 3,
+ CorrectionIndicator = 1 << 4,
+ RejectedCorrection = 1 << 5,
+ AllMarkers = Spelling | Grammar | TextMatch | Replacement | CorrectionIndicator | RejectedCorrection
};
-
MarkerType type;
+ typedef unsigned MarkerTypes;
unsigned startOffset;
unsigned endOffset;
String description;
diff --git a/WebCore/dom/DocumentMarkerController.cpp b/WebCore/dom/DocumentMarkerController.cpp
index 2b7fd85..3b7abcc 100644
--- a/WebCore/dom/DocumentMarkerController.cpp
+++ b/WebCore/dom/DocumentMarkerController.cpp
@@ -321,15 +321,11 @@ Vector<IntRect> DocumentMarkerController::renderedRectsForMarkers(DocumentMarker
return result;
}
-void DocumentMarkerController::removeMarkers(Node* node)
+void DocumentMarkerController::removeMarkers(Node* node, DocumentMarker::MarkerType markerType)
{
- MarkerMap::iterator i = m_markers.find(node);
- if (i != m_markers.end()) {
- delete i->second;
- m_markers.remove(i);
- if (RenderObject* renderer = node->renderer())
- renderer->repaint();
- }
+ MarkerMap::iterator iterator = m_markers.find(node);
+ if (iterator != m_markers.end())
+ removeMarkersFromMarkerMapVectorPair(node, iterator->second, markerType);
}
void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerType)
@@ -339,10 +335,21 @@ void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerTy
MarkerMap::iterator end = markerMapCopy.end();
for (MarkerMap::iterator i = markerMapCopy.begin(); i != end; ++i) {
Node* node = i->first.get();
- bool nodeNeedsRepaint = false;
-
- // inner loop: process each marker in the current node
MarkerMapVectorPair* vectorPair = i->second;
+ removeMarkersFromMarkerMapVectorPair(node, vectorPair, markerType);
+ }
+}
+
+// This function may release node and vectorPair.
+void DocumentMarkerController::removeMarkersFromMarkerMapVectorPair(Node* node, MarkerMapVectorPair* vectorPair, DocumentMarker::MarkerType markerType)
+{
+ if (markerType == DocumentMarker::AllMarkers) {
+ delete vectorPair;
+ m_markers.remove(node);
+ if (RenderObject* renderer = node->renderer())
+ renderer->repaint();
+ } else {
+ bool needsRepaint = false;
Vector<DocumentMarker>& markers = vectorPair->first;
Vector<IntRect>& rects = vectorPair->second;
ASSERT(markers.size() == rects.size());
@@ -350,7 +357,7 @@ void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerTy
DocumentMarker marker = markers[i];
// skip nodes that are not of the specified type
- if (marker.type != markerType && markerType != DocumentMarker::AllMarkers) {
+ if (marker.type != markerType) {
++i;
continue;
}
@@ -358,13 +365,13 @@ void DocumentMarkerController::removeMarkers(DocumentMarker::MarkerType markerTy
// pitch the old marker
markers.remove(i);
rects.remove(i);
- nodeNeedsRepaint = true;
- // markerIterator now points to the next node
+ needsRepaint = true;
+ // i now is the index of the next marker
}
- // Redraw the node if it changed. Do this before the node is removed from m_markers, since
+ // Redraw the node if it changed. Do this before the node is removed from m_markers, since
// m_markers might contain the last reference to the node.
- if (nodeNeedsRepaint) {
+ if (needsRepaint) {
RenderObject* renderer = node->renderer();
if (renderer)
renderer->repaint();
@@ -524,4 +531,40 @@ void DocumentMarkerController::setMarkersActive(Node* node, unsigned startOffset
node->renderer()->repaint();
}
+bool DocumentMarkerController::hasMarkers(Range* range, DocumentMarker::MarkerTypes markerTypes)
+{
+ if (m_markers.isEmpty())
+ return false;
+
+ Node* startContainer = range->startContainer();
+ ASSERT(startContainer);
+ Node* endContainer = range->endContainer();
+ ASSERT(endContainer);
+
+ Node* pastLastNode = range->pastLastNode();
+ for (Node* node = range->firstNode(); node != pastLastNode; node = node->traverseNextNode()) {
+ Vector<DocumentMarker> markers = markersForNode(node);
+ Vector<DocumentMarker>::const_iterator end = markers.end();
+ for (Vector<DocumentMarker>::const_iterator it = markers.begin(); it != end; ++it) {
+ if (!(markerTypes & it->type))
+ continue;
+ if (node == startContainer && node == endContainer) {
+ // The range spans only one node.
+ if (it->endOffset > static_cast<unsigned>(range->startOffset()) && it->startOffset < static_cast<unsigned>(range->endOffset()))
+ return true;
+ } else {
+ if (node == startContainer) {
+ if (it->endOffset > static_cast<unsigned>(range->startOffset()))
+ return true;
+ } else if (node == endContainer) {
+ if (it->startOffset < static_cast<unsigned>(range->endOffset()))
+ return true;
+ } else
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
} // namespace WebCore
diff --git a/WebCore/dom/DocumentMarkerController.h b/WebCore/dom/DocumentMarkerController.h
index 8921baa..96fb7f3 100644
--- a/WebCore/dom/DocumentMarkerController.h
+++ b/WebCore/dom/DocumentMarkerController.h
@@ -46,10 +46,11 @@ public:
void addMarker(Range*, DocumentMarker::MarkerType, String description = String());
void addMarker(Node*, DocumentMarker);
void copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
+ bool hasMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers);
void removeMarkers(Range*, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void removeMarkers(Node*, unsigned startOffset, int length, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void removeMarkers(DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
- void removeMarkers(Node*);
+ void removeMarkers(Node*, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void repaintMarkers(DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void setRenderedRectForMarker(Node*, const DocumentMarker&, const IntRect&);
void invalidateRenderedRectsForMarkersInRect(const IntRect&);
@@ -65,6 +66,7 @@ private:
typedef std::pair<Vector<DocumentMarker>, Vector<IntRect> > MarkerMapVectorPair;
typedef HashMap<RefPtr<Node>, MarkerMapVectorPair*> MarkerMap;
MarkerMap m_markers;
+ void removeMarkersFromMarkerMapVectorPair(Node*, MarkerMapVectorPair*, DocumentMarker::MarkerType);
};
} // namespace WebCore
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 10ba71b..a86f30a 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -31,6 +31,7 @@
#include "CSSParser.h"
#include "CSSSelectorList.h"
#include "CSSStyleSelector.h"
+#include "ClassList.h"
#include "ClientRect.h"
#include "ClientRectList.h"
#include "DOMTokenList.h"
@@ -52,13 +53,13 @@
#include "RenderLayer.h"
#include "RenderView.h"
#include "RenderWidget.h"
-#include "SVGStyledLocatableElement.h"
#include "Settings.h"
#include "TextIterator.h"
#include "XMLNames.h"
#include <wtf/text/CString.h>
#if ENABLE(SVG)
+#include "SVGElement.h"
#include "SVGNames.h"
#endif
@@ -457,6 +458,41 @@ int Element::scrollHeight() const
return 0;
}
+IntRect Element::boundsInWindowSpace() const
+{
+ document()->updateLayoutIgnorePendingStylesheets();
+
+ FrameView* view = document()->view();
+ if (!view)
+ return IntRect();
+
+ Vector<FloatQuad> quads;
+#if ENABLE(SVG)
+ if (isSVGElement() && renderer()) {
+ // Get the bounding rectangle from the SVG model.
+ const SVGElement* svgElement = static_cast<const SVGElement*>(this);
+ FloatRect localRect;
+ if (svgElement->boundingBox(localRect))
+ quads.append(renderer()->localToAbsoluteQuad(localRect));
+ } else
+#endif
+ {
+ // Get the bounding rectangle from the box model.
+ if (renderBoxModelObject())
+ renderBoxModelObject()->absoluteQuads(quads);
+ }
+
+ if (quads.isEmpty())
+ return IntRect();
+
+ IntRect result = quads[0].enclosingBoundingBox();
+ for (size_t i = 1; i < quads.size(); ++i)
+ result.unite(quads[i].enclosingBoundingBox());
+
+ result = view->contentsToWindow(result);
+ return result;
+}
+
PassRefPtr<ClientRectList> Element::getClientRects() const
{
document()->updateLayoutIgnorePendingStylesheets();
@@ -488,15 +524,12 @@ PassRefPtr<ClientRect> Element::getBoundingClientRect() const
Vector<FloatQuad> quads;
#if ENABLE(SVG)
- if (isSVGElement()) {
+ if (isSVGElement() && renderer()) {
// Get the bounding rectangle from the SVG model.
const SVGElement* svgElement = static_cast<const SVGElement*>(this);
- if (svgElement->isStyledLocatable()) {
- if (renderer()) {
- const FloatRect& localRect = static_cast<const SVGStyledLocatableElement*>(svgElement)->getBBox();
- quads.append(renderer()->localToAbsoluteQuad(localRect));
- }
- }
+ FloatRect localRect;
+ if (svgElement->boundingBox(localRect))
+ quads.append(renderer()->localToAbsoluteQuad(localRect));
} else
#endif
{
@@ -517,9 +550,7 @@ PassRefPtr<ClientRect> Element::getBoundingClientRect() const
result.move(-visibleContentRect.x(), -visibleContentRect.y());
}
- if (renderBoxModelObject())
- adjustIntRectForAbsoluteZoom(result, renderBoxModelObject());
-
+ adjustIntRectForAbsoluteZoom(result, renderer());
return ClientRect::create(result);
}
@@ -1588,7 +1619,7 @@ DOMTokenList* Element::classList()
{
ElementRareData* data = ensureRareData();
if (!data->m_classList)
- data->m_classList = DOMTokenList::create(this);
+ data->m_classList = ClassList::create(this);
return data->m_classList.get();
}
@@ -1681,4 +1712,37 @@ void Element::webkitRequestFullScreen(unsigned short flags)
}
#endif
+SpellcheckAttributeState Element::spellcheckAttributeState() const
+{
+ if (!hasAttribute(HTMLNames::spellcheckAttr))
+ return SpellcheckAttributeDefault;
+
+ const AtomicString& value = getAttribute(HTMLNames::spellcheckAttr);
+ if (equalIgnoringCase(value, "true") || equalIgnoringCase(value, ""))
+ return SpellcheckAttributeTrue;
+ if (equalIgnoringCase(value, "false"))
+ return SpellcheckAttributeFalse;
+
+ return SpellcheckAttributeDefault;
+}
+
+bool Element::isSpellCheckingEnabled() const
+{
+ const Element* element = this;
+ while (element) {
+ switch (element->spellcheckAttributeState()) {
+ case SpellcheckAttributeTrue:
+ return true;
+ case SpellcheckAttributeFalse:
+ return false;
+ case SpellcheckAttributeDefault:
+ break;
+ }
+
+ element = element->parentElement();
+ }
+
+ return true;
+}
+
} // namespace WebCore
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index b890ecd..67887cc 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -40,6 +40,12 @@ class DOMTokenList;
class ElementRareData;
class IntSize;
+enum SpellcheckAttributeState {
+ SpellcheckAttributeTrue,
+ SpellcheckAttributeFalse,
+ SpellcheckAttributeDefault
+};
+
class Element : public ContainerNode {
public:
static PassRefPtr<Element> create(const QualifiedName&, Document*);
@@ -159,6 +165,8 @@ public:
virtual int scrollWidth() const;
virtual int scrollHeight() const;
+ IntRect boundsInWindowSpace() const;
+
PassRefPtr<ClientRectList> getClientRects() const;
PassRefPtr<ClientRect> getBoundingClientRect() const;
@@ -318,6 +326,8 @@ public:
void webkitRequestFullScreen(unsigned short flags);
#endif
+ bool isSpellCheckingEnabled() const;
+
protected:
Element(const QualifiedName& tagName, Document* document, ConstructionType type)
: ContainerNode(document, type)
@@ -373,7 +383,9 @@ private:
ElementRareData* rareData() const;
ElementRareData* ensureRareData();
-
+
+ SpellcheckAttributeState spellcheckAttributeState() const;
+
private:
mutable RefPtr<NamedNodeMap> m_attributeMap;
};
diff --git a/WebCore/dom/ElementRareData.h b/WebCore/dom/ElementRareData.h
index f1e6334..06bfe0c 100644
--- a/WebCore/dom/ElementRareData.h
+++ b/WebCore/dom/ElementRareData.h
@@ -22,7 +22,7 @@
#ifndef ElementRareData_h
#define ElementRareData_h
-#include "DOMTokenList.h"
+#include "ClassList.h"
#include "DatasetDOMStringMap.h"
#include "Element.h"
#include "NodeRareData.h"
@@ -43,7 +43,7 @@ public:
RefPtr<RenderStyle> m_computedStyle;
OwnPtr<DatasetDOMStringMap> m_datasetDOMStringMap;
- OwnPtr<DOMTokenList> m_classList;
+ OwnPtr<ClassList> m_classList;
};
inline IntSize defaultMinimumSizeForResizing()
diff --git a/WebCore/dom/EventListener.h b/WebCore/dom/EventListener.h
index 96bc858..96d0beb 100644
--- a/WebCore/dom/EventListener.h
+++ b/WebCore/dom/EventListener.h
@@ -43,7 +43,8 @@ namespace WebCore {
ObjCEventListenerType,
CPPEventListenerType,
ConditionEventListenerType,
- GObjectEventListenerType
+ GObjectEventListenerType,
+ NativeEventListenerType
};
virtual ~EventListener() { }
diff --git a/WebCore/dom/ExceptionCode.cpp b/WebCore/dom/ExceptionCode.cpp
index 9303f9e..f048fe5 100644
--- a/WebCore/dom/ExceptionCode.cpp
+++ b/WebCore/dom/ExceptionCode.cpp
@@ -42,6 +42,10 @@
#include "SQLException.h"
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+#include "FileException.h"
+#endif
+
namespace WebCore {
static const char* const exceptionNames[] = {
@@ -173,6 +177,38 @@ static const char* const sqlExceptionDescriptions[] = {
};
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+static const char* const fileExceptionNames[] = {
+ "NOT_FOUND_ERR",
+ "SECURITY_ERR",
+ "ABORT_ERR",
+ "NOT_READABLE_ERR",
+ "ENCODING_ERR",
+ "NO_MODIFICATION_ALLOWED_ERR",
+ "INVALID_STATE_ERR",
+ "SYNTAX_ERR",
+ "INVALID_MODIFICATION_ERR",
+ "QUOTA_EXCEEDED_ERR",
+ "TYPE_MISMATCH_ERR",
+ "PATH_EXISTS_ERR"
+};
+
+static const char* const fileExceptionDescriptions[] = {
+ "A requested file or directory could not be found at the time an operation was processed.",
+ "It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.",
+ "An ongoing operation was aborted, typically with a call to abort().",
+ "The requested file could not be read, typically due to permission problems that have occured after a reference to a file was acquired.",
+ "A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs.",
+ "An attempt was made to write to a file or directory which could not be modified due to the state of the underlying filesystem.",
+ "An operation that depends on state cached in an interface object was made but the state had changed since it was read from disk.",
+ "An invalid or unsupported argument was given, like an invalid line ending specifier.",
+ "The modification request was illegal.",
+ "The operation failed because it would cause the application to exceed its storage quota.",
+ "The path supplied exists, but was not an entry of requested type.",
+ "An attempt was made to create a file or directory where an element already exists."
+};
+#endif
+
void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& description)
{
ASSERT(ec);
@@ -241,6 +277,16 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
nameTableSize = sizeof(sqlExceptionNames) / sizeof(sqlExceptionNames[0]);
nameTableOffset = SQLException::UNKNOWN_ERR;
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ } else if (code >= FileException::FileExceptionOffset && code <= FileException::FileExceptionMax) {
+ type = FileExceptionType;
+ typeName = "DOM File";
+ code -= FileException::FileExceptionOffset;
+ nameTable = fileExceptionNames;
+ descriptionTable = fileExceptionDescriptions;
+ nameTableSize = sizeof(fileExceptionNames) / sizeof(fileExceptionNames[0]);
+ nameTableOffset = FileException::NOT_FOUND_ERR;
+#endif
} else {
type = DOMExceptionType;
typeName = "DOM";
diff --git a/WebCore/dom/ExceptionCode.h b/WebCore/dom/ExceptionCode.h
index cbbf650..6ea9f7d 100644
--- a/WebCore/dom/ExceptionCode.h
+++ b/WebCore/dom/ExceptionCode.h
@@ -81,6 +81,9 @@ namespace WebCore {
#if ENABLE(DATABASE)
, SQLExceptionType
#endif
+#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
+ , FileExceptionType
+#endif
};
diff --git a/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h b/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h
new file mode 100644
index 0000000..9d1835a
--- /dev/null
+++ b/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h
@@ -0,0 +1,57 @@
+/*
+ * 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 GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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 IgnoreDestructiveWriteCountIncrementer_h
+#define IgnoreDestructiveWriteCountIncrementer_h
+
+#include "Document.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class IgnoreDestructiveWriteCountIncrementer : public Noncopyable {
+public:
+ explicit IgnoreDestructiveWriteCountIncrementer(Document* document)
+ : m_count(document ? &document->m_ignoreDestructiveWriteCount : 0)
+ {
+ if (!m_count)
+ return;
+ ++(*m_count);
+ }
+
+ ~IgnoreDestructiveWriteCountIncrementer()
+ {
+ if (!m_count)
+ return;
+ --(*m_count);
+ }
+
+private:
+ unsigned* m_count;
+};
+
+}
+
+#endif
diff --git a/WebCore/dom/InputElement.cpp b/WebCore/dom/InputElement.cpp
index ecae206..85f37e1 100644
--- a/WebCore/dom/InputElement.cpp
+++ b/WebCore/dom/InputElement.cpp
@@ -107,10 +107,7 @@ void InputElement::updateSelectionRange(InputElement* inputElement, Element* ele
if (!inputElement->isTextField())
return;
- element->document()->updateLayoutIgnorePendingStylesheets();
-
- if (RenderTextControl* renderer = toRenderTextControl(element->renderer()))
- renderer->setSelectionRange(start, end);
+ setSelectionRange(element, start, end);
}
void InputElement::aboutToUnload(InputElement* inputElement, Element* element)
diff --git a/WebCore/dom/KeyboardEvent.h b/WebCore/dom/KeyboardEvent.h
index 793ac41..30a2ef0 100644
--- a/WebCore/dom/KeyboardEvent.h
+++ b/WebCore/dom/KeyboardEvent.h
@@ -33,8 +33,9 @@ namespace WebCore {
#if PLATFORM(MAC)
struct KeypressCommand {
- KeypressCommand(const String& commandName) : commandName(commandName) {}
- KeypressCommand(const String& commandName, const String& text) : commandName(commandName), text(text) { ASSERT(commandName == "insertText:"); }
+ KeypressCommand() { }
+ KeypressCommand(const String& commandName) : commandName(commandName) { }
+ KeypressCommand(const String& commandName, const String& text) : commandName(commandName), text(text) { ASSERT(commandName == "insertText:" || commandName == "insertText"); }
String commandName;
String text;
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 5c67bfd..cea2e07 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -1085,13 +1085,13 @@ static bool isChildTypeAllowed(Node* newParent, Node* child)
if (child->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) {
if (!newParent->childTypeAllowed(child->nodeType()))
return false;
+ return true;
}
for (Node *n = child->firstChild(); n; n = n->nextSibling()) {
if (!newParent->childTypeAllowed(n->nodeType()))
return false;
}
-
return true;
}
@@ -2992,7 +2992,7 @@ void Node::defaultEventHandler(Event* event)
if (Frame* frame = document()->frame())
frame->eventHandler()->defaultTextInputEventHandler(static_cast<TextEvent*>(event));
#if ENABLE(PAN_SCROLLING)
- } else if (eventType == eventNames().mousedownEvent) {
+ } else if (eventType == eventNames().mousedownEvent && event->isMouseEvent()) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
if (mouseEvent->button() == MiddleButton) {
if (enclosingLinkEventParentOrSelf())
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 46c85e3..28c7594 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -33,6 +33,7 @@
#include "FrameLoader.h"
#include "HTMLNames.h"
#include "HTMLScriptElement.h"
+#include "IgnoreDestructiveWriteCountIncrementer.h"
#include "MIMETypeRegistry.h"
#include "Page.h"
#include "ScriptController.h"
@@ -57,14 +58,6 @@ void ScriptElement::insertedIntoDocument(ScriptElementData& data, const String&
// http://www.whatwg.org/specs/web-apps/current-work/#script
- // If the element's Document has an active parser, and the parser's script
- // nesting level is non-zero, but this script element does not have the
- // "parser-inserted" flag set, the user agent must set the element's
- // "write-neutralised" flag.
- DocumentParser* parser = data.element()->document()->parser();
- if (parser && parser->hasInsertionPoint())
- data.setWriteDisabled(true);
-
if (!sourceUrl.isEmpty()) {
data.requestScript(sourceUrl);
return;
@@ -142,7 +135,6 @@ ScriptElementData::ScriptElementData(ScriptElement* scriptElement, Element* elem
, m_element(element)
, m_cachedScript(0)
, m_createdByParser(false)
- , m_writeDisabled(false)
, m_requested(false)
, m_evaluated(false)
, m_firedLoad(false)
@@ -191,7 +183,9 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
if (m_evaluated || sourceCode.isEmpty() || !shouldExecuteAsJavaScript())
return;
- if (Frame* frame = m_element->document()->frame()) {
+ RefPtr<Document> document = m_element->document();
+ ASSERT(document);
+ if (Frame* frame = document->frame()) {
if (!frame->script()->canExecuteScripts(AboutToExecuteScript))
return;
@@ -199,25 +193,12 @@ void ScriptElementData::evaluateScript(const ScriptSourceCode& sourceCode)
// http://www.whatwg.org/specs/web-apps/current-work/#script
- // If the script element's "write-neutralised" flag is set, then flag
- // the Document the script element was in when the "write-neutralised"
- // flag was set as being itself "write-neutralised". Let neutralised doc
- // be that Document.
- if (m_writeDisabled) {
- ASSERT(!m_element->document()->writeDisabled());
- m_element->document()->setWriteDisabled(true);
- }
-
- // Create a script from the script element node, using the script
- // block's source and the script block's type.
- // Note: This is where the script is compiled and actually executed.
- frame->script()->evaluate(sourceCode);
-
- // Remove the "write-neutralised" flag from neutralised doc, if it was
- // set in the earlier step.
- if (m_writeDisabled) {
- ASSERT(m_element->document()->writeDisabled());
- m_element->document()->setWriteDisabled(false);
+ {
+ IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountIncrementer(m_requested ? document.get() : 0);
+ // Create a script from the script element node, using the script
+ // block's source and the script block's type.
+ // Note: This is where the script is compiled and actually executed.
+ frame->script()->evaluate(sourceCode);
}
Document::updateStyleForAllDocuments();
diff --git a/WebCore/dom/ScriptElement.h b/WebCore/dom/ScriptElement.h
index 698ffbc..c663e43 100644
--- a/WebCore/dom/ScriptElement.h
+++ b/WebCore/dom/ScriptElement.h
@@ -82,8 +82,6 @@ public:
Element* element() const { return m_element; }
bool createdByParser() const { return m_createdByParser; }
void setCreatedByParser(bool value) { m_createdByParser = value; }
- bool writeDisabled() const { return m_writeDisabled; }
- void setWriteDisabled(bool value) { m_writeDisabled = value; }
bool haveFiredLoadEvent() const { return m_firedLoad; }
void setHaveFiredLoadEvent(bool firedLoad) { m_firedLoad = firedLoad; }
@@ -101,7 +99,6 @@ private:
Element* m_element;
CachedResourceHandle<CachedScript> m_cachedScript;
bool m_createdByParser; // HTML5: "parser-inserted"
- bool m_writeDisabled; // http://www.whatwg.org/specs/web-apps/current-work/#write-neutralised
bool m_requested;
bool m_evaluated; // HTML5: "already started"
bool m_firedLoad;
diff --git a/WebCore/dom/SpaceSplitString.cpp b/WebCore/dom/SpaceSplitString.cpp
index 8a2710c..4bd5b1b 100644
--- a/WebCore/dom/SpaceSplitString.cpp
+++ b/WebCore/dom/SpaceSplitString.cpp
@@ -23,6 +23,7 @@
#include "HTMLParserIdioms.h"
#include <wtf/ASCIICType.h>
+#include <wtf/text/StringBuilder.h>
using namespace WTF;
@@ -90,4 +91,37 @@ bool SpaceSplitStringData::containsAll(SpaceSplitStringData& other)
return true;
}
+void SpaceSplitStringData::add(const AtomicString& string)
+{
+ if (contains(string))
+ return;
+
+ m_vector.append(string);
+}
+
+void SpaceSplitStringData::remove(const AtomicString& string)
+{
+ ensureVector();
+
+ size_t position = 0;
+ while (position < m_vector.size()) {
+ if (m_vector[position] == string)
+ m_vector.remove(position);
+ else
+ ++position;
+ }
+}
+
+void SpaceSplitString::add(const AtomicString& string)
+{
+ if (m_data)
+ m_data->add(string);
+}
+
+void SpaceSplitString::remove(const AtomicString& string)
+{
+ if (m_data)
+ m_data->remove(string);
+}
+
} // namespace WebCore
diff --git a/WebCore/dom/SpaceSplitString.h b/WebCore/dom/SpaceSplitString.h
index 09ca8d9..826e6bd 100644
--- a/WebCore/dom/SpaceSplitString.h
+++ b/WebCore/dom/SpaceSplitString.h
@@ -48,6 +48,9 @@ namespace WebCore {
bool containsAll(SpaceSplitStringData&);
+ void add(const AtomicString&);
+ void remove(const AtomicString&);
+
size_t size() { ensureVector(); return m_vector.size(); }
const AtomicString& operator[](size_t i) { ensureVector(); ASSERT(i < size()); return m_vector[i]; }
@@ -72,6 +75,8 @@ namespace WebCore {
bool contains(const AtomicString& string) const { return m_data && m_data->contains(string); }
bool containsAll(const SpaceSplitString& names) const { return !names.m_data || (m_data && m_data->containsAll(*names.m_data)); }
+ void add(const AtomicString&);
+ void remove(const AtomicString&);
size_t size() const { return m_data ? m_data->size() : 0; }
bool isNull() const { return !m_data; }
diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp
index 12744cb..7384c0b 100644
--- a/WebCore/dom/StyledElement.cpp
+++ b/WebCore/dom/StyledElement.cpp
@@ -25,6 +25,7 @@
#include "StyledElement.h"
#include "Attribute.h"
+#include "ClassList.h"
#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
@@ -222,7 +223,7 @@ void StyledElement::classAttributeChanged(const AtomicString& newClassString)
if (hasClass) {
attributes()->setClass(newClassString);
if (DOMTokenList* classList = optionalClassList())
- classList->reset(newClassString);
+ static_cast<ClassList*>(classList)->reset(newClassString);
} else if (attributeMap())
attributeMap()->clearClass();
setNeedsStyleRecalc();
diff --git a/WebCore/dom/StyledElement.h b/WebCore/dom/StyledElement.h
index 4b62388..8040dbf 100644
--- a/WebCore/dom/StyledElement.h
+++ b/WebCore/dom/StyledElement.h
@@ -32,7 +32,6 @@
namespace WebCore {
class Attribute;
-class ClassList;
class CSSMappedAttributeDeclaration;
class StyledElement : public Element {
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index 3f60a8b..8862da7 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -538,6 +538,7 @@ ApplyStyleCommand::ApplyStyleCommand(Document* document, CSSStyleDeclaration* st
, m_useEndingSelection(true)
, m_styledInlineElement(0)
, m_removeOnly(false)
+ , m_isInlineElementToRemoveFunction(0)
{
}
@@ -551,6 +552,7 @@ ApplyStyleCommand::ApplyStyleCommand(Document* document, CSSStyleDeclaration* st
, m_useEndingSelection(false)
, m_styledInlineElement(0)
, m_removeOnly(false)
+ , m_isInlineElementToRemoveFunction(0)
{
}
@@ -564,6 +566,21 @@ ApplyStyleCommand::ApplyStyleCommand(PassRefPtr<Element> element, bool removeOnl
, m_useEndingSelection(true)
, m_styledInlineElement(element)
, m_removeOnly(removeOnly)
+ , m_isInlineElementToRemoveFunction(0)
+{
+}
+
+ApplyStyleCommand::ApplyStyleCommand(Document* document, CSSStyleDeclaration* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction editingAction)
+ : CompositeEditCommand(document)
+ , m_style(style->makeMutable())
+ , m_editingAction(editingAction)
+ , m_propertyLevel(PropertyDefault)
+ , m_start(endingSelection().start().downstream())
+ , m_end(endingSelection().end().upstream())
+ , m_useEndingSelection(true)
+ , m_styledInlineElement(0)
+ , m_removeOnly(true)
+ , m_isInlineElementToRemoveFunction(isInlineElementToRemoveFunction)
{
}
@@ -605,7 +622,7 @@ void ApplyStyleCommand::doApply()
applyBlockStyle(blockStyle.get());
// apply any remaining styles to the inline elements
// NOTE: hopefully, this string comparison is the same as checking for a non-null diff
- if (blockStyle->length() < m_style->length() || m_styledInlineElement) {
+ if (blockStyle->length() < m_style->length() || m_styledInlineElement || m_isInlineElementToRemoveFunction) {
RefPtr<CSSMutableStyleDeclaration> inlineStyle = m_style->copy();
applyRelativeFontStyleChange(inlineStyle.get());
blockStyle->diff(inlineStyle.get());
@@ -664,9 +681,11 @@ void ApplyStyleCommand::applyBlockStyle(CSSMutableStyleDeclaration *style)
StyleChange styleChange(style, paragraphStart.deepEquivalent());
if (styleChange.cssStyle().length() || m_removeOnly) {
RefPtr<Node> block = enclosingBlock(paragraphStart.deepEquivalent().node());
- RefPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent());
- if (newBlock)
- block = newBlock;
+ if (!m_removeOnly) {
+ RefPtr<Node> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent());
+ if (newBlock)
+ block = newBlock;
+ }
ASSERT(block->isHTMLElement());
if (block->isHTMLElement()) {
removeCSSStyle(style, static_cast<HTMLElement*>(block.get()));
@@ -1104,8 +1123,10 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(CSSMutableStyleDeclaration*
// to generate <font color="blue" size="4">hello</font> instead of <font color="blue"><font size="4">hello</font></font>
RefPtr<Range> range = Range::create(startNode->document(), start, end);
Element* editableRoot = startNode->rootEditableElement();
- while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(startNode->parentNode(), range.get()))
- startNode = startNode->parentNode();
+ if (startNode != editableRoot) {
+ while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(startNode->parentNode(), range.get()))
+ startNode = startNode->parentNode();
+ }
applyInlineStyleToNodeRange(style, startNode, pastEndNode);
}
@@ -1126,6 +1147,9 @@ static bool containsNonEditableRegion(Node* node)
void ApplyStyleCommand::applyInlineStyleToNodeRange(CSSMutableStyleDeclaration* style, Node* node, Node* pastEndNode)
{
+ if (m_removeOnly)
+ return;
+
for (Node* next; node && node != pastEndNode; node = next) {
next = node->traverseNextNode();
@@ -1171,10 +1195,16 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(CSSMutableStyleDeclaration*
if (!removeStyleFromRunBeforeApplyingStyle(style, node, runEnd))
continue;
- addInlineStyleIfNeeded(style, node, runEnd, m_removeOnly ? DoNotAddStyledElement : AddStyledElement);
+ addInlineStyleIfNeeded(style, node, runEnd, AddStyledElement);
}
}
+bool ApplyStyleCommand::isStyledInlineElementToRemove(Element* element) const
+{
+ return (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName()))
+ || (m_isInlineElementToRemoveFunction && m_isInlineElementToRemoveFunction(element));
+}
+
bool ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd)
{
ASSERT(runStart && runEnd && runStart->parentNode() == runEnd->parentNode());
@@ -1183,6 +1213,7 @@ bool ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDec
for (Node* node = runStart; node && node != pastEndNode; node = node->traverseNextNode()) {
if (node->childNodeCount())
continue;
+ // We don't consider m_isInlineElementToRemoveFunction here because we never apply style when m_isInlineElementToRemoveFunction is specified
if (getPropertiesNotIn(style, computedStyle(node).get())->length()
|| (m_styledInlineElement && !enclosingNodeWithTag(positionBeforeNode(node), m_styledInlineElement->tagQName()))) {
needToApplyStyle = true;
@@ -1222,7 +1253,7 @@ bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration*
if (!element->parentNode() || !element->parentNode()->isContentEditable())
return false;
- if (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName())) {
+ if (isStyledInlineElementToRemove(element)) {
if (mode == RemoveNone)
return true;
ASSERT(extractedStyle);
@@ -1331,7 +1362,7 @@ bool ApplyStyleCommand::removeImplicitlyStyledElement(CSSMutableStyleDeclaration
continue; // If CSS value is primitive, then skip if they are equal.
}
- if (extractedStyle)
+ if (extractedStyle && mapValue)
extractedStyle->setProperty(equivalent.propertyID, mapValue->cssText());
if (mode == RemoveNone)
@@ -1504,6 +1535,9 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
// The outer loop is traversing the tree vertically from highestAncestor to targetNode
Node* current = highestAncestor;
+ // Along the way, styled elements that contain targetNode are removed and accumulated into elementsToPushDown.
+ // Each child of the removed element, exclusing ancestors of targetNode, is then wrapped by clones of elements in elementsToPushDown.
+ Vector<RefPtr<Element> > elementsToPushDown;
while (current != targetNode) {
ASSERT(current);
ASSERT(current->isHTMLElement());
@@ -1511,8 +1545,10 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
Node* child = current->firstChild();
Node* lastChild = current->lastChild();
RefPtr<StyledElement> styledElement;
- if (current->isStyledElement() && m_styledInlineElement && current->hasTagName(m_styledInlineElement->tagQName()))
+ if (current->isStyledElement() && isStyledInlineElementToRemove(static_cast<Element*>(current))) {
styledElement = static_cast<StyledElement*>(current);
+ elementsToPushDown.append(styledElement);
+ }
RefPtr<CSSMutableStyleDeclaration> styleToPushDown = CSSMutableStyleDeclaration::create();
removeInlineStyleFromElement(style, static_cast<HTMLElement*>(current), RemoveIfNeeded, styleToPushDown.get());
@@ -1521,17 +1557,14 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration
while (child) {
Node* nextChild = child->nextSibling();
- if (child != targetNode && styledElement) {
- // If child has children, wrap children of child by a clone of the styled element to avoid infinite loop.
- // Otherwise, wrap the child by the styled element, and we won't fall into an infinite loop.
- RefPtr<Element> wrapper = styledElement->cloneElementWithoutChildren();
- ExceptionCode ec = 0;
- wrapper->removeAttribute(styleAttr, ec);
- ASSERT(!ec);
- if (child->firstChild())
- surroundNodeRangeWithElement(child->firstChild(), child->lastChild(), wrapper);
- else
+ if (!child->contains(targetNode) && elementsToPushDown.size()) {
+ for (size_t i = 0; i < elementsToPushDown.size(); i++) {
+ RefPtr<Element> wrapper = elementsToPushDown[i]->cloneElementWithoutChildren();
+ ExceptionCode ec = 0;
+ wrapper->removeAttribute(styleAttr, ec);
+ ASSERT(!ec);
surroundNodeRangeWithElement(child, child, wrapper);
+ }
}
// Apply text decoration to all nodes containing targetNode and their siblings but NOT to targetNode
@@ -1594,7 +1627,7 @@ void ApplyStyleCommand::removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration>
RefPtr<Node> next = elem->traverseNextNode();
RefPtr<CSSMutableStyleDeclaration> styleToPushDown;
PassRefPtr<Node> childNode = 0;
- if (m_styledInlineElement && elem->hasTagName(m_styledInlineElement->tagQName())) {
+ if (isStyledInlineElementToRemove(elem.get())) {
styleToPushDown = CSSMutableStyleDeclaration::create();
childNode = elem->firstChild();
}
diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h
index eb6a2bc..16c5b68 100644
--- a/WebCore/editing/ApplyStyleCommand.h
+++ b/WebCore/editing/ApplyStyleCommand.h
@@ -44,6 +44,7 @@ public:
enum EPropertyLevel { PropertyDefault, ForceBlockProperties };
enum InlineStyleRemovalMode { RemoveIfNeeded, RemoveAlways, RemoveNone };
enum EAddStyledElement { AddStyledElement, DoNotAddStyledElement };
+ typedef bool (*IsInlineElementToRemoveFunction)(const Element*);
static PassRefPtr<ApplyStyleCommand> create(Document* document, CSSStyleDeclaration* style, EditAction action = EditActionChangeAttributes, EPropertyLevel level = PropertyDefault)
{
@@ -57,6 +58,10 @@ public:
{
return adoptRef(new ApplyStyleCommand(element, removeOnly, action));
}
+ static PassRefPtr<ApplyStyleCommand> create(Document* document, CSSStyleDeclaration* style, IsInlineElementToRemoveFunction isInlineElementToRemoveFunction, EditAction action = EditActionChangeAttributes)
+ {
+ return adoptRef(new ApplyStyleCommand(document, style, isInlineElementToRemoveFunction, action));
+ }
static RefPtr<CSSMutableStyleDeclaration> removeNonEditingProperties(CSSStyleDeclaration* style);
static PassRefPtr<CSSMutableStyleDeclaration> editingStyleAtPosition(Position pos, ShouldIncludeTypingStyle shouldIncludeTypingStyle = IgnoreTypingStyle);
@@ -65,6 +70,7 @@ private:
ApplyStyleCommand(Document*, CSSStyleDeclaration*, EditAction, EPropertyLevel);
ApplyStyleCommand(Document*, CSSStyleDeclaration*, const Position& start, const Position& end, EditAction, EPropertyLevel);
ApplyStyleCommand(PassRefPtr<Element>, bool removeOnly, EditAction);
+ ApplyStyleCommand(Document*, CSSStyleDeclaration*, bool (*isInlineElementToRemove)(const Element*), EditAction);
virtual void doApply();
virtual EditAction editingAction() const;
@@ -72,6 +78,7 @@ private:
CSSMutableStyleDeclaration* style() const { return m_style.get(); }
// style-removal helpers
+ bool isStyledInlineElementToRemove(Element*) const;
bool removeStyleFromRunBeforeApplyingStyle(CSSMutableStyleDeclaration* style, Node*& runStart, Node*& runEnd);
bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveIfNeeded, CSSMutableStyleDeclaration* extractedStyle = 0);
inline bool shouldRemoveInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element) {return removeInlineStyleFromElement(style, element, RemoveNone);}
@@ -122,6 +129,7 @@ private:
bool m_useEndingSelection;
RefPtr<Element> m_styledInlineElement;
bool m_removeOnly;
+ IsInlineElementToRemoveFunction m_isInlineElementToRemoveFunction;
};
bool isStyleSpan(const Node*);
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index a00db36..6f47fb4 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -1184,6 +1184,8 @@ PassRefPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, b
RefPtr<Node> node;
for (node = start; node && node->parent() != end; node = node->parent()) {
+ if (!node->parent()->isElementNode())
+ break;
VisiblePosition positionInParent(Position(node->parent(), 0), DOWNSTREAM);
VisiblePosition positionInNode(Position(node, 0), DOWNSTREAM);
if (positionInParent != positionInNode)
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index 4aca57e..1f56da7 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -756,9 +756,9 @@ void DeleteSelectionCommand::doApply()
EAffinity affinity = m_selectionToDelete.affinity();
Position downstreamEnd = m_selectionToDelete.end().downstream();
- m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart()) &&
- isEndOfParagraph(m_selectionToDelete.visibleEnd()) &&
- !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
+ m_needPlaceholder = isStartOfParagraph(m_selectionToDelete.visibleStart(), Position::CanCrossEditingBoundary)
+ && isEndOfParagraph(m_selectionToDelete.visibleEnd(), Position::CanCrossEditingBoundary)
+ && !lineBreakExistsAtVisiblePosition(m_selectionToDelete.visibleEnd());
if (m_needPlaceholder) {
// Don't need a placeholder when deleting a selection that starts just before a table
// and ends inside it (we do need placeholders to hold open empty cells, but that's
diff --git a/WebCore/editing/EditingAllInOne.cpp b/WebCore/editing/EditingAllInOne.cpp
index ba484be..81483f8 100644
--- a/WebCore/editing/EditingAllInOne.cpp
+++ b/WebCore/editing/EditingAllInOne.cpp
@@ -65,6 +65,7 @@
#include <SplitElementCommand.cpp>
#include <SplitTextNodeCommand.cpp>
#include <SplitTextNodeContainingElementCommand.cpp>
+#include <TextCheckingHelper.cpp>
#include <TextIterator.cpp>
#include <TypingCommand.cpp>
#include <UnlinkCommand.cpp>
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 7b3d055..c74d765 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -62,6 +62,7 @@
#include "NodeList.h"
#include "Page.h"
#include "Pasteboard.h"
+#include "TextCheckingHelper.h"
#include "RemoveFormatCommand.h"
#include "RenderBlock.h"
#include "RenderPart.h"
@@ -468,9 +469,13 @@ void Editor::respondToChangedContents(const VisibleSelection& endingSelection)
if (node)
m_frame->document()->axObjectCache()->postNotification(node->renderer(), AXObjectCache::AXValueChanged, false);
}
-
+
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(true);
+#endif
+
if (client())
- client()->respondToChangedContents();
+ client()->respondToChangedContents();
}
const SimpleFontData* Editor::fontForSelection(bool& hasMultipleFonts) const
@@ -1154,6 +1159,9 @@ void Editor::cut()
}
RefPtr<Range> selection = selectedRange();
if (shouldDeleteRange(selection.get())) {
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(true);
+#endif
if (isNodeInTextFormControl(m_frame->selection()->start().node()))
Pasteboard::generalPasteboard()->writePlainText(selectedText());
else
@@ -1192,6 +1200,9 @@ void Editor::paste()
return; // DHTML did the whole operation
if (!canPaste())
return;
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
CachedResourceLoader* loader = m_frame->document()->cachedResourceLoader();
loader->setAllowStaleResources(true);
if (m_frame->selection()->isContentRichlyEditable())
@@ -1207,6 +1218,9 @@ void Editor::pasteAsPlainText()
return;
if (!canPaste())
return;
+#if REMOVE_MARKERS_UPON_EDITING
+ removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
pasteAsPlainTextWithPasteboard(Pasteboard::generalPasteboard());
}
@@ -1534,6 +1548,11 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin
setIgnoreCompositionSelectionChange(true);
+ // Updates styles before setting selection for composition to prevent
+ // inserting the previous composition text into text nodes oddly.
+ // See https://bugs.webkit.org/show_bug.cgi?id=46868
+ m_frame->document()->updateStyleIfNeeded();
+
selectComposition();
if (m_frame->selection()->isNone()) {
@@ -1641,328 +1660,6 @@ void Editor::learnSpelling()
client()->learnWord(text);
}
-static String findFirstMisspellingInRange(EditorClient* client, Range* searchRange, int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange)
-{
- ASSERT_ARG(client, client);
- ASSERT_ARG(searchRange, searchRange);
-
- WordAwareIterator it(searchRange);
- firstMisspellingOffset = 0;
-
- String firstMisspelling;
- int currentChunkOffset = 0;
-
- while (!it.atEnd()) {
- const UChar* chars = it.characters();
- int len = it.length();
-
- // Skip some work for one-space-char hunks
- if (!(len == 1 && chars[0] == ' ')) {
-
- int misspellingLocation = -1;
- int misspellingLength = 0;
- client->checkSpellingOfString(chars, len, &misspellingLocation, &misspellingLength);
-
- // 5490627 shows that there was some code path here where the String constructor below crashes.
- // We don't know exactly what combination of bad input caused this, so we're making this much
- // more robust against bad input on release builds.
- ASSERT(misspellingLength >= 0);
- ASSERT(misspellingLocation >= -1);
- ASSERT(!misspellingLength || misspellingLocation >= 0);
- ASSERT(misspellingLocation < len);
- ASSERT(misspellingLength <= len);
- ASSERT(misspellingLocation + misspellingLength <= len);
-
- if (misspellingLocation >= 0 && misspellingLength > 0 && misspellingLocation < len && misspellingLength <= len && misspellingLocation + misspellingLength <= len) {
-
- // Compute range of misspelled word
- RefPtr<Range> misspellingRange = TextIterator::subrange(searchRange, currentChunkOffset + misspellingLocation, misspellingLength);
-
- // Remember first-encountered misspelling and its offset.
- if (!firstMisspelling) {
- firstMisspellingOffset = currentChunkOffset + misspellingLocation;
- firstMisspelling = String(chars + misspellingLocation, misspellingLength);
- firstMisspellingRange = misspellingRange;
- }
-
- // Store marker for misspelled word.
- ExceptionCode ec = 0;
- misspellingRange->startContainer(ec)->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
- ASSERT(!ec);
-
- // Bail out if we're marking only the first misspelling, and not all instances.
- if (!markAll)
- break;
- }
- }
-
- currentChunkOffset += len;
- it.advance();
- }
-
- return firstMisspelling;
-}
-
-#ifndef BUILDING_ON_TIGER
-
-static PassRefPtr<Range> paragraphAlignedRangeForRange(Range* arbitraryRange, int& offsetIntoParagraphAlignedRange, String& paragraphString)
-{
- ASSERT_ARG(arbitraryRange, arbitraryRange);
-
- ExceptionCode ec = 0;
-
- // Expand range to paragraph boundaries
- RefPtr<Range> paragraphRange = arbitraryRange->cloneRange(ec);
- setStart(paragraphRange.get(), startOfParagraph(arbitraryRange->startPosition()));
- setEnd(paragraphRange.get(), endOfParagraph(arbitraryRange->endPosition()));
-
- // Compute offset from start of expanded range to start of original range
- RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), arbitraryRange->startPosition());
- offsetIntoParagraphAlignedRange = TextIterator::rangeLength(offsetAsRange.get());
-
- // Fill in out parameter with string representing entire paragraph range.
- // Someday we might have a caller that doesn't use this, but for now all callers do.
- paragraphString = plainText(paragraphRange.get());
-
- return paragraphRange;
-}
-
-static int findFirstGrammarDetailInRange(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int /*badGrammarPhraseLength*/, Range *searchRange, int startOffset, int endOffset, bool markAll)
-{
- // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
- // Optionally add a DocumentMarker for each detail in the range.
- int earliestDetailLocationSoFar = -1;
- int earliestDetailIndex = -1;
- for (unsigned i = 0; i < grammarDetails.size(); i++) {
- const GrammarDetail* detail = &grammarDetails[i];
- ASSERT(detail->length > 0 && detail->location >= 0);
-
- int detailStartOffsetInParagraph = badGrammarPhraseLocation + detail->location;
-
- // Skip this detail if it starts before the original search range
- if (detailStartOffsetInParagraph < startOffset)
- continue;
-
- // Skip this detail if it starts after the original search range
- if (detailStartOffsetInParagraph >= endOffset)
- continue;
-
- if (markAll) {
- RefPtr<Range> badGrammarRange = TextIterator::subrange(searchRange, badGrammarPhraseLocation - startOffset + detail->location, detail->length);
- ExceptionCode ec = 0;
- badGrammarRange->startContainer(ec)->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription);
- ASSERT(!ec);
- }
-
- // Remember this detail only if it's earlier than our current candidate (the details aren't in a guaranteed order)
- if (earliestDetailIndex < 0 || earliestDetailLocationSoFar > detail->location) {
- earliestDetailIndex = i;
- earliestDetailLocationSoFar = detail->location;
- }
- }
-
- return earliestDetailIndex;
-}
-
-static String findFirstBadGrammarInRange(EditorClient* client, Range* searchRange, GrammarDetail& outGrammarDetail, int& outGrammarPhraseOffset, bool markAll)
-{
- ASSERT_ARG(client, client);
- ASSERT_ARG(searchRange, searchRange);
-
- // Initialize out parameters; these will be updated if we find something to return.
- outGrammarDetail.location = -1;
- outGrammarDetail.length = 0;
- outGrammarDetail.guesses.clear();
- outGrammarDetail.userDescription = "";
- outGrammarPhraseOffset = 0;
-
- String firstBadGrammarPhrase;
-
- // Expand the search range to encompass entire paragraphs, since grammar checking needs that much context.
- // Determine the character offset from the start of the paragraph to the start of the original search range,
- // since we will want to ignore results in this area.
- int searchRangeStartOffset;
- String paragraphString;
- RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(searchRange, searchRangeStartOffset, paragraphString);
-
- // Determine the character offset from the start of the paragraph to the end of the original search range,
- // since we will want to ignore results in this area also.
- int searchRangeEndOffset = searchRangeStartOffset + TextIterator::rangeLength(searchRange);
-
- // Start checking from beginning of paragraph, but skip past results that occur before the start of the original search range.
- int startOffset = 0;
- while (startOffset < searchRangeEndOffset) {
- Vector<GrammarDetail> grammarDetails;
- int badGrammarPhraseLocation = -1;
- int badGrammarPhraseLength = 0;
- client->checkGrammarOfString(paragraphString.characters() + startOffset, paragraphString.length() - startOffset, grammarDetails, &badGrammarPhraseLocation, &badGrammarPhraseLength);
-
- if (!badGrammarPhraseLength) {
- ASSERT(badGrammarPhraseLocation == -1);
- return String();
- }
-
- ASSERT(badGrammarPhraseLocation >= 0);
- badGrammarPhraseLocation += startOffset;
-
-
- // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
- int badGrammarIndex = findFirstGrammarDetailInRange(grammarDetails, badGrammarPhraseLocation, badGrammarPhraseLength, searchRange, searchRangeStartOffset, searchRangeEndOffset, markAll);
- if (badGrammarIndex >= 0) {
- ASSERT(static_cast<unsigned>(badGrammarIndex) < grammarDetails.size());
- outGrammarDetail = grammarDetails[badGrammarIndex];
- }
-
- // If we found a detail in range, then we have found the first bad phrase (unless we found one earlier but
- // kept going so we could mark all instances).
- if (badGrammarIndex >= 0 && firstBadGrammarPhrase.isEmpty()) {
- outGrammarPhraseOffset = badGrammarPhraseLocation - searchRangeStartOffset;
- firstBadGrammarPhrase = paragraphString.substring(badGrammarPhraseLocation, badGrammarPhraseLength);
-
- // Found one. We're done now, unless we're marking each instance.
- if (!markAll)
- break;
- }
-
- // These results were all between the start of the paragraph and the start of the search range; look
- // beyond this phrase.
- startOffset = badGrammarPhraseLocation + badGrammarPhraseLength;
- }
-
- return firstBadGrammarPhrase;
-}
-
-#endif /* not BUILDING_ON_TIGER */
-
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-
-static String findFirstMisspellingOrBadGrammarInRange(EditorClient* client, Range* searchRange, bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail)
-{
- ASSERT_ARG(client, client);
- ASSERT_ARG(searchRange, searchRange);
-
- String firstFoundItem;
- String misspelledWord;
- String badGrammarPhrase;
- ExceptionCode ec = 0;
-
- // Initialize out parameters; these will be updated if we find something to return.
- outIsSpelling = true;
- outFirstFoundOffset = 0;
- outGrammarDetail.location = -1;
- outGrammarDetail.length = 0;
- outGrammarDetail.guesses.clear();
- outGrammarDetail.userDescription = "";
-
- // Expand the search range to encompass entire paragraphs, since text checking needs that much context.
- // Determine the character offset from the start of the paragraph to the start of the original search range,
- // since we will want to ignore results in this area.
- RefPtr<Range> paragraphRange = searchRange->cloneRange(ec);
- setStart(paragraphRange.get(), startOfParagraph(searchRange->startPosition()));
- int totalRangeLength = TextIterator::rangeLength(paragraphRange.get());
- setEnd(paragraphRange.get(), endOfParagraph(searchRange->startPosition()));
-
- RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), searchRange->startPosition());
- int searchRangeStartOffset = TextIterator::rangeLength(offsetAsRange.get());
- int totalLengthProcessed = 0;
-
- bool firstIteration = true;
- bool lastIteration = false;
- while (totalLengthProcessed < totalRangeLength) {
- // Iterate through the search range by paragraphs, checking each one for spelling and grammar.
- int currentLength = TextIterator::rangeLength(paragraphRange.get());
- int currentStartOffset = firstIteration ? searchRangeStartOffset : 0;
- int currentEndOffset = currentLength;
- if (inSameParagraph(paragraphRange->startPosition(), searchRange->endPosition())) {
- // Determine the character offset from the end of the original search range to the end of the paragraph,
- // since we will want to ignore results in this area.
- RefPtr<Range> endOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), searchRange->endPosition());
- currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.get());
- lastIteration = true;
- }
- if (currentStartOffset < currentEndOffset) {
- String paragraphString = plainText(paragraphRange.get());
- if (paragraphString.length() > 0) {
- bool foundGrammar = false;
- int spellingLocation = 0;
- int grammarPhraseLocation = 0;
- int grammarDetailLocation = 0;
- unsigned grammarDetailIndex = 0;
-
- Vector<TextCheckingResult> results;
- uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
- client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
-
- for (unsigned i = 0; i < results.size(); i++) {
- const TextCheckingResult* result = &results[i];
- if (result->type == TextCheckingTypeSpelling && result->location >= currentStartOffset && result->location + result->length <= currentEndOffset) {
- ASSERT(result->length > 0 && result->location >= 0);
- spellingLocation = result->location;
- misspelledWord = paragraphString.substring(result->location, result->length);
- ASSERT(misspelledWord.length());
- break;
- }
- if (checkGrammar && result->type == TextCheckingTypeGrammar && result->location < currentEndOffset && result->location + result->length > currentStartOffset) {
- ASSERT(result->length > 0 && result->location >= 0);
- // We can't stop after the first grammar result, since there might still be a spelling result after
- // it begins but before the first detail in it, but we can stop if we find a second grammar result.
- if (foundGrammar)
- break;
- for (unsigned j = 0; j < result->details.size(); j++) {
- const GrammarDetail* detail = &result->details[j];
- ASSERT(detail->length > 0 && detail->location >= 0);
- if (result->location + detail->location >= currentStartOffset && result->location + detail->location + detail->length <= currentEndOffset && (!foundGrammar || result->location + detail->location < grammarDetailLocation)) {
- grammarDetailIndex = j;
- grammarDetailLocation = result->location + detail->location;
- foundGrammar = true;
- }
- }
- if (foundGrammar) {
- grammarPhraseLocation = result->location;
- outGrammarDetail = result->details[grammarDetailIndex];
- badGrammarPhrase = paragraphString.substring(result->location, result->length);
- ASSERT(badGrammarPhrase.length());
- }
- }
- }
-
- if (!misspelledWord.isEmpty() && (!checkGrammar || badGrammarPhrase.isEmpty() || spellingLocation <= grammarDetailLocation)) {
- int spellingOffset = spellingLocation - currentStartOffset;
- if (!firstIteration) {
- RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), searchRange->startPosition(), paragraphRange->startPosition());
- spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
- }
- outIsSpelling = true;
- outFirstFoundOffset = spellingOffset;
- firstFoundItem = misspelledWord;
- break;
- }
- if (checkGrammar && !badGrammarPhrase.isEmpty()) {
- int grammarPhraseOffset = grammarPhraseLocation - currentStartOffset;
- if (!firstIteration) {
- RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), searchRange->startPosition(), paragraphRange->startPosition());
- grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
- }
- outIsSpelling = false;
- outFirstFoundOffset = grammarPhraseOffset;
- firstFoundItem = badGrammarPhrase;
- break;
- }
- }
- }
- if (lastIteration || totalLengthProcessed + currentLength >= totalRangeLength)
- break;
- VisiblePosition newParagraphStart = startOfNextParagraph(paragraphRange->endPosition());
- setStart(paragraphRange.get(), newParagraphStart);
- setEnd(paragraphRange.get(), endOfParagraph(newParagraphStart));
- firstIteration = false;
- totalLengthProcessed += currentLength;
- }
- return firstFoundItem;
-}
-
-#endif
-
void Editor::advanceToNextMisspelling(bool startBeforeSelection)
{
ExceptionCode ec = 0;
@@ -1974,6 +1671,8 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
// repeated "check spelling" commands work.
VisibleSelection selection(frame()->selection()->selection());
RefPtr<Range> spellingSearchRange(rangeOfContents(frame()->document()));
+ TextCheckingHelper checker(client(), spellingSearchRange);
+
bool startedWithSelection = false;
if (selection.start().node()) {
startedWithSelection = true;
@@ -2039,7 +1738,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
bool isSpelling = true;
int foundOffset = 0;
GrammarDetail grammarDetail;
- String foundItem = findFirstMisspellingOrBadGrammarInRange(client(), spellingSearchRange.get(), isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
+ String foundItem = checker.findFirstMisspellingOrBadGrammar(isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
if (isSpelling) {
misspelledWord = foundItem;
misspellingOffset = foundOffset;
@@ -2049,7 +1748,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
}
#else
RefPtr<Range> firstMisspellingRange;
- String misspelledWord = findFirstMisspellingInRange(client(), spellingSearchRange.get(), misspellingOffset, false, firstMisspellingRange);
+ String misspelledWord = checker.findFirstMisspelling(misspellingOffset, false, firstMisspellingRange);
String badGrammarPhrase;
#ifndef BUILDING_ON_TIGER
@@ -2066,7 +1765,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
}
if (isGrammarCheckingEnabled())
- badGrammarPhrase = findFirstBadGrammarInRange(client(), grammarSearchRange.get(), grammarDetail, grammarPhraseOffset, false);
+ badGrammarPhrase = checker.findFirstBadGrammar(grammarDetail, grammarPhraseOffset, false);
#endif
#endif
@@ -2079,7 +1778,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
grammarSearchRange = spellingSearchRange->cloneRange(ec);
- foundItem = findFirstMisspellingOrBadGrammarInRange(client(), spellingSearchRange.get(), isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
+ foundItem = checker.findFirstMisspellingOrBadGrammar(isGrammarCheckingEnabled(), isSpelling, foundOffset, grammarDetail);
if (isSpelling) {
misspelledWord = foundItem;
misspellingOffset = foundOffset;
@@ -2088,7 +1787,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
grammarPhraseOffset = foundOffset;
}
#else
- misspelledWord = findFirstMisspellingInRange(client(), spellingSearchRange.get(), misspellingOffset, false, firstMisspellingRange);
+ misspelledWord = checker.findFirstMisspelling(misspellingOffset, false, firstMisspellingRange);
#ifndef BUILDING_ON_TIGER
grammarSearchRange = spellingSearchRange->cloneRange(ec);
@@ -2099,7 +1798,7 @@ void Editor::advanceToNextMisspelling(bool startBeforeSelection)
grammarSearchRange->setEnd(chars.range()->startContainer(ec), chars.range()->startOffset(ec), ec);
}
if (isGrammarCheckingEnabled())
- badGrammarPhrase = findFirstBadGrammarInRange(client(), grammarSearchRange.get(), grammarDetail, grammarPhraseOffset, false);
+ badGrammarPhrase = checker.findFirstBadGrammar(grammarDetail, grammarPhraseOffset, false);
#endif
#endif
}
@@ -2163,60 +1862,13 @@ bool Editor::isSelectionMisspelled()
return true;
}
-#ifndef BUILDING_ON_TIGER
-static bool isRangeUngrammatical(EditorClient* client, Range *range, Vector<String>& guessesVector)
-{
- if (!client)
- return false;
-
- ExceptionCode ec;
- if (!range || range->collapsed(ec))
- return false;
-
- // Returns true only if the passed range exactly corresponds to a bad grammar detail range. This is analogous
- // to isSelectionMisspelled. It's not good enough for there to be some bad grammar somewhere in the range,
- // or overlapping the range; the ranges must exactly match.
- guessesVector.clear();
- int grammarPhraseOffset;
-
- GrammarDetail grammarDetail;
- String badGrammarPhrase = findFirstBadGrammarInRange(client, range, grammarDetail, grammarPhraseOffset, false);
-
- // No bad grammar in these parts at all.
- if (badGrammarPhrase.isEmpty())
- return false;
-
- // Bad grammar, but phrase (e.g. sentence) starts beyond start of range.
- if (grammarPhraseOffset > 0)
- return false;
-
- ASSERT(grammarDetail.location >= 0 && grammarDetail.length > 0);
-
- // Bad grammar, but start of detail (e.g. ungrammatical word) doesn't match start of range
- if (grammarDetail.location + grammarPhraseOffset)
- return false;
-
- // Bad grammar at start of range, but end of bad grammar is before or after end of range
- if (grammarDetail.length != TextIterator::rangeLength(range))
- return false;
-
- // Update the spelling panel to be displaying this error (whether or not the spelling panel is on screen).
- // This is necessary to make a subsequent call to [NSSpellChecker ignoreWord:inSpellDocumentWithTag:] work
- // correctly; that call behaves differently based on whether the spelling panel is displaying a misspelling
- // or a grammar error.
- client->updateSpellingUIWithGrammarString(badGrammarPhrase, grammarDetail);
-
- return true;
-}
-#endif
-
bool Editor::isSelectionUngrammatical()
{
#ifdef BUILDING_ON_TIGER
return false;
#else
Vector<String> ignoredGuesses;
- return isRangeUngrammatical(client(), frame()->selection()->toNormalizedRange().get(), ignoredGuesses);
+ return TextCheckingHelper(client(), frame()->selection()->toNormalizedRange()).isUngrammatical(ignoredGuesses);
#endif
}
@@ -2226,8 +1878,8 @@ Vector<String> Editor::guessesForUngrammaticalSelection()
return Vector<String>();
#else
Vector<String> guesses;
- // Ignore the result of isRangeUngrammatical; we just want the guesses, whether or not there are any
- isRangeUngrammatical(client(), frame()->selection()->toNormalizedRange().get(), guesses);
+ // Ignore the result of isUngrammatical; we just want the guesses, whether or not there are any
+ TextCheckingHelper(client(), frame()->selection()->toNormalizedRange()).isUngrammatical(guesses);
return guesses;
#endif
}
@@ -2243,72 +1895,10 @@ Vector<String> Editor::guessesForMisspelledSelection()
return guesses;
}
-#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-
-static Vector<String> guessesForMisspelledOrUngrammaticalRange(EditorClient* client, Range *range, bool checkGrammar, bool& misspelled, bool& ungrammatical)
-{
- Vector<String> guesses;
- ExceptionCode ec;
- misspelled = false;
- ungrammatical = false;
-
- if (!client || !range || range->collapsed(ec))
- return guesses;
-
- // Expand the range to encompass entire paragraphs, since text checking needs that much context.
- int rangeStartOffset;
- String paragraphString;
- RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(range, rangeStartOffset, paragraphString);
- int rangeLength = TextIterator::rangeLength(range);
- if (!rangeLength || !paragraphString.length())
- return guesses;
-
- Vector<TextCheckingResult> results;
- uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
- client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
-
- for (unsigned i = 0; i < results.size(); i++) {
- const TextCheckingResult* result = &results[i];
- if (result->type == TextCheckingTypeSpelling && result->location == rangeStartOffset && result->length == rangeLength) {
- String misspelledWord = paragraphString.substring(rangeStartOffset, rangeLength);
- ASSERT(misspelledWord.length());
- client->getGuessesForWord(misspelledWord, guesses);
- client->updateSpellingUIWithMisspelledWord(misspelledWord);
- misspelled = true;
- return guesses;
- }
- }
-
- if (!checkGrammar)
- return guesses;
-
- for (unsigned i = 0; i < results.size(); i++) {
- const TextCheckingResult* result = &results[i];
- if (result->type == TextCheckingTypeGrammar && result->location <= rangeStartOffset && result->location + result->length >= rangeStartOffset + rangeLength) {
- for (unsigned j = 0; j < result->details.size(); j++) {
- const GrammarDetail* detail = &result->details[j];
- ASSERT(detail->length > 0 && detail->location >= 0);
- if (result->location + detail->location == rangeStartOffset && detail->length == rangeLength) {
- String badGrammarPhrase = paragraphString.substring(result->location, result->length);
- ASSERT(badGrammarPhrase.length());
- for (unsigned k = 0; k < detail->guesses.size(); k++)
- guesses.append(detail->guesses[k]);
- client->updateSpellingUIWithGrammarString(badGrammarPhrase, *detail);
- ungrammatical = true;
- return guesses;
- }
- }
- }
- }
- return guesses;
-}
-
-#endif
-
Vector<String> Editor::guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical)
{
#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
- return guessesForMisspelledOrUngrammaticalRange(client(), frame()->selection()->toNormalizedRange().get(), isGrammarCheckingEnabled(), misspelled, ungrammatical);
+ return TextCheckingHelper(client(), frame()->selection()->toNormalizedRange()).guessesForMisspelledOrUngrammaticalRange(isGrammarCheckingEnabled(), misspelled, ungrammatical);
#else
misspelled = isSelectionMisspelled();
if (misspelled) {
@@ -2485,34 +2075,15 @@ void Editor::markMisspellingsAfterTypingToPosition(const VisiblePosition &p)
markBadGrammar(VisibleSelection(startOfSentence(p), endOfSentence(p)));
#endif
}
-
-static void markAllMisspellingsInRange(EditorClient* client, Range* searchRange, RefPtr<Range>& firstMisspellingRange)
-{
- // Use the "markAll" feature of findFirstMisspellingInRange. Ignore the return value and the "out parameter";
- // all we need to do is mark every instance.
- int ignoredOffset;
- findFirstMisspellingInRange(client, searchRange, ignoredOffset, true, firstMisspellingRange);
-}
-
-#ifndef BUILDING_ON_TIGER
-static void markAllBadGrammarInRange(EditorClient* client, Range* searchRange)
-{
- // Use the "markAll" feature of findFirstBadGrammarInRange. Ignore the return value and "out parameters"; all we need to
- // do is mark every instance.
- GrammarDetail ignoredGrammarDetail;
- int ignoredOffset;
- findFirstBadGrammarInRange(client, searchRange, ignoredGrammarDetail, ignoredOffset, true);
-}
-#endif
-static void markMisspellingsOrBadGrammar(Editor* editor, const VisibleSelection& selection, bool checkSpelling, RefPtr<Range>& firstMisspellingRange)
+void Editor::markMisspellingsOrBadGrammar(const VisibleSelection& selection, bool checkSpelling, RefPtr<Range>& firstMisspellingRange)
{
// This function is called with a selection already expanded to word boundaries.
// Might be nice to assert that here.
// This function is used only for as-you-type checking, so if that's off we do nothing. Note that
// grammar checking can only be on if spell checking is also on.
- if (!editor->isContinuousSpellCheckingEnabled())
+ if (!isContinuousSpellCheckingEnabled())
return;
RefPtr<Range> searchRange(selection.toNormalizedRange());
@@ -2524,53 +2095,49 @@ static void markMisspellingsOrBadGrammar(Editor* editor, const VisibleSelection&
if (!editableNode || !editableNode->isContentEditable())
return;
- if (!editor->spellCheckingEnabledInFocusedNode())
+ if (!isSpellCheckingEnabledInFocusedNode())
return;
// Get the spell checker if it is available
- if (!editor->client())
+ if (!client())
return;
+ TextCheckingHelper checker(client(), searchRange);
if (checkSpelling)
- markAllMisspellingsInRange(editor->client(), searchRange.get(), firstMisspellingRange);
+ checker.markAllMisspellings(firstMisspellingRange);
else {
#ifdef BUILDING_ON_TIGER
ASSERT_NOT_REACHED();
#else
- if (editor->isGrammarCheckingEnabled())
- markAllBadGrammarInRange(editor->client(), searchRange.get());
+ if (isGrammarCheckingEnabled())
+ checker.markAllBadGrammar();
#endif
}
}
-bool Editor::spellCheckingEnabledInFocusedNode() const
+bool Editor::isSpellCheckingEnabledInFocusedNode() const
{
// Ascend the DOM tree to find a "spellcheck" attribute.
// When we find a "spellcheck" attribute, retrieve its value and return false if its value is "false".
const Node* node = frame()->document()->focusedNode();
- while (node) {
- if (node->isElementNode()) {
- const WTF::AtomicString& value = static_cast<const Element*>(node)->getAttribute(spellcheckAttr);
- if (equalIgnoringCase(value, "true"))
- return true;
- if (equalIgnoringCase(value, "false"))
- return false;
- }
- node = node->parent();
- }
- return true;
+ if (!node)
+ return false;
+ const Element* focusedElement = node->isElementNode() ? toElement(node) : node->parentElement();
+ if (!focusedElement)
+ return false;
+ return focusedElement->isSpellCheckingEnabled();
}
void Editor::markMisspellings(const VisibleSelection& selection, RefPtr<Range>& firstMisspellingRange)
{
- markMisspellingsOrBadGrammar(this, selection, true, firstMisspellingRange);
+ markMisspellingsOrBadGrammar(selection, true, firstMisspellingRange);
}
void Editor::markBadGrammar(const VisibleSelection& selection)
{
#ifndef BUILDING_ON_TIGER
RefPtr<Range> firstMisspellingRange;
- markMisspellingsOrBadGrammar(this, selection, false, firstMisspellingRange);
+ markMisspellingsOrBadGrammar(selection, false, firstMisspellingRange);
#else
UNUSED_PARAM(selection);
#endif
@@ -2603,7 +2170,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
if (!editableNode || !editableNode->isContentEditable())
return;
- if (!spellCheckingEnabledInFocusedNode())
+ if (!isSpellCheckingEnabledInFocusedNode())
return;
// Expand the range to encompass entire paragraphs, since text checking needs that much context.
@@ -2620,15 +2187,16 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
bool adjustSelectionForParagraphBoundaries = false;
String paragraphString;
RefPtr<Range> paragraphRange;
+ TextCheckingHelper checker(client(), grammarRange);
if (shouldMarkGrammar) {
// The spelling range should be contained in the paragraph-aligned extension of the grammar range.
- paragraphRange = paragraphAlignedRangeForRange(grammarRange, grammarRangeStartOffset, paragraphString);
+ paragraphRange = checker.paragraphAlignedRange(grammarRangeStartOffset, paragraphString);
RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), spellingRange->startPosition());
spellingRangeStartOffset = TextIterator::rangeLength(offsetAsRange.get());
grammarRangeEndOffset = grammarRangeStartOffset + TextIterator::rangeLength(grammarRange);
} else {
- paragraphRange = paragraphAlignedRangeForRange(spellingRange, spellingRangeStartOffset, paragraphString);
+ paragraphRange = checker.paragraphAlignedRange(spellingRangeStartOffset, paragraphString);
}
spellingRangeEndOffset = spellingRangeStartOffset + TextIterator::rangeLength(spellingRange);
paragraphLength = paragraphString.length();
@@ -2818,10 +2386,10 @@ void Editor::changeBackToReplacedString(const String& replacedString)
RefPtr<Range> selection = selectedRange();
if (!shouldInsertText(replacedString, selection.get(), EditorInsertActionPasted))
return;
-
+
String paragraphString;
int selectionOffset;
- RefPtr<Range> paragraphRange = paragraphAlignedRangeForRange(selection.get(), selectionOffset, paragraphString);
+ RefPtr<Range> paragraphRange = TextCheckingHelper(client(), selection).paragraphAlignedRange(selectionOffset, paragraphString);
replaceSelectionWithText(replacedString, false, false);
RefPtr<Range> changedRange = TextIterator::subrange(paragraphRange.get(), selectionOffset, replacedString.length());
changedRange->startContainer()->document()->markers()->addMarker(changedRange.get(), DocumentMarker::Replacement, String());
@@ -2864,6 +2432,7 @@ void Editor::handleRejectedCorrection()
return;
replacedRange->startContainer()->document()->markers()->addMarker(replacedRange, DocumentMarker::RejectedCorrection, m_stringToBeReplacedByCorrection);
+ m_rangeToBeReplacedByCorrection.clear();
}
void Editor::startCorrectionPanelTimer()
@@ -2901,6 +2470,101 @@ bool Editor::isShowingCorrectionPanel()
return false;
}
+void Editor::removeSpellAndCorrectionMarkersFromWordsToBeEdited(bool doNotRemoveIfSelectionAtWordBoundary)
+{
+ // We want to remove the markers from a word if an editing command will change the word. This can happen in one of
+ // several scenarios:
+ // 1. Insert in the middle of a word.
+ // 2. Appending non whitespace at the beginning of word.
+ // 3. Appending non whitespace at the end of word.
+ // Note that, appending only whitespaces at the beginning or end of word won't change the word, so we don't need to
+ // remove the markers on that word.
+ // Of course, if current selection is a range, we potentially will edit two words that fall on the boundaries of
+ // selection, and remove words between the selection boundaries.
+ //
+ VisiblePosition startOfSelection = frame()->selection()->selection().start();
+ VisiblePosition endOfSelection = frame()->selection()->selection().end();
+ if (startOfSelection.isNull())
+ return;
+ // First word is the word that ends after or on the start of selection.
+ VisiblePosition startOfFirstWord = startOfWord(startOfSelection, LeftWordIfOnBoundary);
+ VisiblePosition endOfFirstWord = endOfWord(startOfSelection, LeftWordIfOnBoundary);
+ // Last word is the word that begins before or on the end of selection
+ VisiblePosition startOfLastWord = startOfWord(endOfSelection, RightWordIfOnBoundary);
+ VisiblePosition endOfLastWord = endOfWord(endOfSelection, RightWordIfOnBoundary);
+
+ // This can be the case if the end of selection is at the end of document.
+ if (endOfLastWord.deepEquivalent().anchorType() != Position::PositionIsOffsetInAnchor) {
+ startOfLastWord = startOfWord(frame()->selection()->selection().start(), LeftWordIfOnBoundary);
+ endOfLastWord = endOfWord(frame()->selection()->selection().start(), LeftWordIfOnBoundary);
+ }
+
+ // If doNotRemoveIfSelectionAtWordBoundary is true, and first word ends at the start of selection,
+ // we choose next word as the first word.
+ if (doNotRemoveIfSelectionAtWordBoundary && endOfFirstWord == startOfSelection) {
+ startOfFirstWord = nextWordPosition(startOfFirstWord);
+ if (startOfFirstWord == endOfSelection)
+ return;
+ endOfFirstWord = endOfWord(startOfFirstWord, RightWordIfOnBoundary);
+ if (endOfFirstWord.deepEquivalent().anchorType() != Position::PositionIsOffsetInAnchor)
+ return;
+ }
+
+ // If doNotRemoveIfSelectionAtWordBoundary is true, and last word begins at the end of selection,
+ // we choose previous word as the last word.
+ if (doNotRemoveIfSelectionAtWordBoundary && startOfLastWord == endOfSelection) {
+ startOfLastWord = previousWordPosition(startOfLastWord);
+ endOfLastWord = endOfWord(startOfLastWord, RightWordIfOnBoundary);
+ if (endOfLastWord == startOfFirstWord)
+ return;
+ }
+
+ // Now we remove markers on everything between startOfFirstWord and endOfLastWord.
+ // However, if an autocorrection change a single word to multiple words, we want to remove correction mark from all the
+ // resulted words even we only edit one of them. For example, assuming autocorrection changes "avantgarde" to "avant
+ // garde", we will have CorrectionIndicator marker on both words and on the whitespace between them. If we then edit garde,
+ // we would like to remove the marker from word "avant" and whitespace as well. So we need to get the continous range of
+ // of marker that contains the word in question, and remove marker on that whole range.
+ Document* document = m_frame->document();
+ RefPtr<Range> wordRange = Range::create(document, startOfFirstWord.deepEquivalent(), endOfLastWord.deepEquivalent());
+ RefPtr<Range> rangeOfFirstWord = Range::create(document, startOfFirstWord.deepEquivalent(), endOfFirstWord.deepEquivalent());
+ RefPtr<Range> rangeOfLastWord = Range::create(document, startOfLastWord.deepEquivalent(), endOfLastWord.deepEquivalent());
+
+ typedef pair<RefPtr<Range>, DocumentMarker::MarkerType> RangeMarkerPair;
+ // It's probably unsafe to remove marker while iterating a vector of markers. So we store the markers and ranges that we want to remove temporarily. Then remove them at the end of function.
+ // To avoid allocation on the heap, Give markersToRemove a small inline capacity
+ Vector<RangeMarkerPair, 16> markersToRemove;
+ for (TextIterator textIterator(wordRange.get()); !textIterator.atEnd(); textIterator.advance()) {
+ Node* node = textIterator.node();
+ if (node == startOfFirstWord.deepEquivalent().containerNode() || node == endOfLastWord.deepEquivalent().containerNode()) {
+ // First word and last word can belong to the same node
+ bool processFirstWord = node == startOfFirstWord.deepEquivalent().containerNode() && document->markers()->hasMarkers(rangeOfFirstWord.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator);
+ bool processLastWord = node == endOfLastWord.deepEquivalent().containerNode() && document->markers()->hasMarkers(rangeOfLastWord.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator);
+ // Take note on the markers whose range overlaps with the range of the first word or the last word.
+ Vector<DocumentMarker> markers = document->markers()->markersForNode(node);
+ for (size_t i = 0; i < markers.size(); ++i) {
+ DocumentMarker marker = markers[i];
+ if (processFirstWord && static_cast<int>(marker.endOffset) > startOfFirstWord.deepEquivalent().offsetInContainerNode() && (marker.type == DocumentMarker::Spelling || marker.type == DocumentMarker::CorrectionIndicator)) {
+ RefPtr<Range> markerRange = Range::create(document, node, marker.startOffset, node, marker.endOffset);
+ markersToRemove.append(std::make_pair(markerRange, marker.type));
+ }
+ if (processLastWord && static_cast<int>(marker.startOffset) <= endOfLastWord.deepEquivalent().offsetInContainerNode() && (marker.type == DocumentMarker::Spelling || marker.type == DocumentMarker::CorrectionIndicator)) {
+ RefPtr<Range> markerRange = Range::create(document, node, marker.startOffset, node, marker.endOffset);
+ markersToRemove.append(std::make_pair(markerRange, marker.type));
+ }
+ }
+ } else {
+ document->markers()->removeMarkers(node, DocumentMarker::Spelling);
+ document->markers()->removeMarkers(node, DocumentMarker::CorrectionIndicator);
+ }
+ }
+
+ // Actually remove the markers.
+ Vector<RangeMarkerPair>::const_iterator pairEnd = markersToRemove.end();
+ for (Vector<RangeMarkerPair>::const_iterator pairIterator = markersToRemove.begin(); pairIterator != pairEnd; ++pairIterator)
+ document->markers()->removeMarkers(pairIterator->first.get(), pairIterator->second);
+}
+
PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint)
{
Document* document = m_frame->documentAtPoint(windowPoint);
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index df2e947..110e3f9 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -34,6 +34,17 @@
#include "EditorInsertAction.h"
#include "SelectionController.h"
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+// Some platforms provide UI for suggesting autocorrection.
+#define SUPPORT_AUTOCORRECTION_PANEL 1
+// Some platforms use spelling and autocorrection markers to provide visual cue.
+// On such platform, if word with marker is edited, we need to remove the marker.
+#define REMOVE_MARKERS_UPON_EDITING 1
+#else
+#define SUPPORT_AUTOCORRECTION_PANEL 0
+#define REMOVE_MARKERS_UPON_EDITING 0
+#endif /* #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) */
+
#if PLATFORM(MAC) && !defined(__OBJC__)
class NSDictionary;
typedef int NSWritingDirection;
@@ -207,7 +218,7 @@ public:
Vector<String> guessesForMisspelledSelection();
Vector<String> guessesForUngrammaticalSelection();
Vector<String> guessesForMisspelledOrUngrammaticalSelection(bool& misspelled, bool& ungrammatical);
- bool spellCheckingEnabledInFocusedNode() const;
+ bool isSpellCheckingEnabledInFocusedNode() const;
void markMisspellingsAfterTypingToPosition(const VisiblePosition&);
void markMisspellings(const VisibleSelection&, RefPtr<Range>& firstMisspellingRange);
void markBadGrammar(const VisibleSelection&);
@@ -362,6 +373,7 @@ public:
#endif
bool selectionStartHasSpellingMarkerFor(int from, int length) const;
+ void removeSpellAndCorrectionMarkersFromWordsToBeEdited(bool doNotRemoveIfSelectionAtWordBoundary);
private:
Frame* m_frame;
@@ -392,6 +404,7 @@ private:
void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace);
void writeSelectionToPasteboard(Pasteboard*);
void revealSelectionAfterEditingOperation();
+ void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
void selectComposition();
void confirmComposition(const String&, bool preserveSelection);
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 23fba39..85becd5 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -1638,6 +1638,8 @@ String Editor::Command::value(Event* triggeringEvent) const
{
if (!isSupported() || !m_frame)
return String();
+ if (m_command->value == valueNull && m_command->state != stateNone)
+ return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false";
return m_command->value(m_frame.get(), triggeringEvent);
}
diff --git a/WebCore/editing/IndentOutdentCommand.cpp b/WebCore/editing/IndentOutdentCommand.cpp
index 9642afa..7089f6f 100644
--- a/WebCore/editing/IndentOutdentCommand.cpp
+++ b/WebCore/editing/IndentOutdentCommand.cpp
@@ -99,6 +99,9 @@ void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
else
nodeToSplitTo = editableRootForPosition(start);
+ if (!nodeToSplitTo)
+ return;
+
RefPtr<Node> outerBlock = (start.node() == nodeToSplitTo) ? start.node() : splitTreeToNode(start.node(), nodeToSplitTo);
if (!targetBlockquote) {
diff --git a/WebCore/editing/RemoveFormatCommand.cpp b/WebCore/editing/RemoveFormatCommand.cpp
index 65f6008..f8807e2 100644
--- a/WebCore/editing/RemoveFormatCommand.cpp
+++ b/WebCore/editing/RemoveFormatCommand.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,32 +11,35 @@
* 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
+ * 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.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "RemoveFormatCommand.h"
+#include "ApplyStyleCommand.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
+#include "CSSValueKeywords.h"
#include "Editor.h"
#include "Frame.h"
+#include "HTMLElement.h"
#include "HTMLNames.h"
#include "VisibleSelection.h"
#include "SelectionController.h"
#include "TextIterator.h"
#include "TypingCommand.h"
-#include "ApplyStyleCommand.h"
+#include "htmlediting.h"
namespace WebCore {
@@ -46,6 +50,38 @@ RemoveFormatCommand::RemoveFormatCommand(Document* document)
{
}
+static bool isElementForRemoveFormatCommand(const Element* element)
+{
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, elements, ());
+ if (elements.isEmpty()) {
+ elements.add(acronymTag);
+ elements.add(bTag);
+ elements.add(bdoTag);
+ elements.add(bigTag);
+ elements.add(citeTag);
+ elements.add(codeTag);
+ elements.add(dfnTag);
+ elements.add(emTag);
+ elements.add(fontTag);
+ elements.add(iTag);
+ elements.add(insTag);
+ elements.add(kbdTag);
+ elements.add(nobrTag);
+ elements.add(qTag);
+ elements.add(sTag);
+ elements.add(sampTag);
+ elements.add(smallTag);
+ elements.add(strikeTag);
+ elements.add(strongTag);
+ elements.add(subTag);
+ elements.add(supTag);
+ elements.add(ttTag);
+ elements.add(uTag);
+ elements.add(varTag);
+ }
+ return elements.contains(element->tagQName());
+}
+
void RemoveFormatCommand::doApply()
{
Frame* frame = document()->frame();
@@ -53,34 +89,12 @@ void RemoveFormatCommand::doApply()
if (!frame->selection()->selection().isNonOrphanedCaretOrRange())
return;
- // Make a plain text string from the selection to remove formatting like tables and lists.
- String string = plainText(frame->selection()->selection().toNormalizedRange().get());
-
// Get the default style for this editable root, it's the style that we'll give the
// content that we're operating on.
Node* root = frame->selection()->rootEditableElement();
RefPtr<CSSMutableStyleDeclaration> defaultStyle = ApplyStyleCommand::editingStyleAtPosition(Position(root, 0));
- // Delete the selected content.
- // FIXME: We should be able to leave this to insertText, but its delete operation
- // doesn't preserve the style we're about to set.
- deleteSelection();
-
- // Delete doesn't remove fully selected lists.
- while (breakOutOfEmptyListItem())
- ;
-
- // If the selection was all formatting (like an empty list) the format-less text will
- // be empty. Early return since we don't need to do any of the work that follows and
- // to avoid the ASSERT that fires if input(...) is called with an empty String.
- if (string.isEmpty())
- return;
-
- // Insert the content with the default style.
- // See <rdar://problem/5794382> RemoveFormat doesn't always reset text alignment
- frame->selection()->setTypingStyle(defaultStyle.release());
-
- inputText(string, true);
+ applyCommandToComposite(ApplyStyleCommand::create(document(), defaultStyle.get(), isElementForRemoveFormatCommand, editingAction()));
}
}
diff --git a/WebCore/editing/TextCheckingHelper.cpp b/WebCore/editing/TextCheckingHelper.cpp
new file mode 100644
index 0000000..49674ff
--- /dev/null
+++ b/WebCore/editing/TextCheckingHelper.cpp
@@ -0,0 +1,525 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "TextCheckingHelper.h"
+
+#include "Range.h"
+#include "TextIterator.h"
+#include "VisiblePosition.h"
+#include "visible_units.h"
+
+namespace WebCore {
+
+TextCheckingHelper::TextCheckingHelper(EditorClient* client, PassRefPtr<Range> range)
+ : m_client(client)
+ , m_range(range)
+{
+ ASSERT_ARG(m_client, m_client);
+ ASSERT_ARG(m_range, m_range);
+}
+
+TextCheckingHelper::~TextCheckingHelper()
+{
+}
+
+PassRefPtr<Range> TextCheckingHelper::paragraphAlignedRange(int& offsetIntoParagraphAlignedRange, String& paragraphString) const
+{
+#ifndef BUILDING_ON_TIGER
+ ExceptionCode ec = 0;
+
+ // Expand range to paragraph boundaries
+ RefPtr<Range> paragraphRange = m_range->cloneRange(ec);
+ setStart(paragraphRange.get(), startOfParagraph(m_range->startPosition()));
+ setEnd(paragraphRange.get(), endOfParagraph(m_range->endPosition()));
+
+ // Compute offset from start of expanded range to start of original range
+ RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), m_range->startPosition());
+ offsetIntoParagraphAlignedRange = TextIterator::rangeLength(offsetAsRange.get());
+
+ // Fill in out parameter with string representing entire paragraph range.
+ // Someday we might have a caller that doesn't use this, but for now all callers do.
+ paragraphString = plainText(paragraphRange.get());
+
+ return paragraphRange;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(offsetIntoParagraphAlignedRange);
+ UNUSED_PARAM(paragraphString);
+ return PassRefPtr<Range>(0);
+#endif
+}
+
+String TextCheckingHelper::findFirstMisspelling(int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange)
+{
+ WordAwareIterator it(m_range.get());
+ firstMisspellingOffset = 0;
+
+ String firstMisspelling;
+ int currentChunkOffset = 0;
+
+ while (!it.atEnd()) {
+ const UChar* chars = it.characters();
+ int len = it.length();
+
+ // Skip some work for one-space-char hunks
+ if (!(len == 1 && chars[0] == ' ')) {
+
+ int misspellingLocation = -1;
+ int misspellingLength = 0;
+ m_client->checkSpellingOfString(chars, len, &misspellingLocation, &misspellingLength);
+
+ // 5490627 shows that there was some code path here where the String constructor below crashes.
+ // We don't know exactly what combination of bad input caused this, so we're making this much
+ // more robust against bad input on release builds.
+ ASSERT(misspellingLength >= 0);
+ ASSERT(misspellingLocation >= -1);
+ ASSERT(!misspellingLength || misspellingLocation >= 0);
+ ASSERT(misspellingLocation < len);
+ ASSERT(misspellingLength <= len);
+ ASSERT(misspellingLocation + misspellingLength <= len);
+
+ if (misspellingLocation >= 0 && misspellingLength > 0 && misspellingLocation < len && misspellingLength <= len && misspellingLocation + misspellingLength <= len) {
+
+ // Compute range of misspelled word
+ RefPtr<Range> misspellingRange = TextIterator::subrange(m_range.get(), currentChunkOffset + misspellingLocation, misspellingLength);
+
+ // Remember first-encountered misspelling and its offset.
+ if (!firstMisspelling) {
+ firstMisspellingOffset = currentChunkOffset + misspellingLocation;
+ firstMisspelling = String(chars + misspellingLocation, misspellingLength);
+ firstMisspellingRange = misspellingRange;
+ }
+
+ // Store marker for misspelled word.
+ ExceptionCode ec = 0;
+ misspellingRange->startContainer(ec)->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling);
+ ASSERT(!ec);
+
+ // Bail out if we're marking only the first misspelling, and not all instances.
+ if (!markAll)
+ break;
+ }
+ }
+
+ currentChunkOffset += len;
+ it.advance();
+ }
+
+ return firstMisspelling;
+}
+
+String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail)
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ String firstFoundItem;
+ String misspelledWord;
+ String badGrammarPhrase;
+ ExceptionCode ec = 0;
+
+ // Initialize out parameters; these will be updated if we find something to return.
+ outIsSpelling = true;
+ outFirstFoundOffset = 0;
+ outGrammarDetail.location = -1;
+ outGrammarDetail.length = 0;
+ outGrammarDetail.guesses.clear();
+ outGrammarDetail.userDescription = "";
+
+ // Expand the search range to encompass entire paragraphs, since text checking needs that much context.
+ // Determine the character offset from the start of the paragraph to the start of the original search range,
+ // since we will want to ignore results in this area.
+ RefPtr<Range> paragraphRange = m_range->cloneRange(ec);
+ setStart(paragraphRange.get(), startOfParagraph(m_range->startPosition()));
+ int totalRangeLength = TextIterator::rangeLength(paragraphRange.get());
+ setEnd(paragraphRange.get(), endOfParagraph(m_range->startPosition()));
+
+ RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), m_range->startPosition());
+ int rangeStartOffset = TextIterator::rangeLength(offsetAsRange.get());
+ int totalLengthProcessed = 0;
+
+ bool firstIteration = true;
+ bool lastIteration = false;
+ while (totalLengthProcessed < totalRangeLength) {
+ // Iterate through the search range by paragraphs, checking each one for spelling and grammar.
+ int currentLength = TextIterator::rangeLength(paragraphRange.get());
+ int currentStartOffset = firstIteration ? rangeStartOffset : 0;
+ int currentEndOffset = currentLength;
+ if (inSameParagraph(paragraphRange->startPosition(), m_range->endPosition())) {
+ // Determine the character offset from the end of the original search range to the end of the paragraph,
+ // since we will want to ignore results in this area.
+ RefPtr<Range> endOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), m_range->endPosition());
+ currentEndOffset = TextIterator::rangeLength(endOffsetAsRange.get());
+ lastIteration = true;
+ }
+ if (currentStartOffset < currentEndOffset) {
+ String paragraphString = plainText(paragraphRange.get());
+ if (paragraphString.length() > 0) {
+ bool foundGrammar = false;
+ int spellingLocation = 0;
+ int grammarPhraseLocation = 0;
+ int grammarDetailLocation = 0;
+ unsigned grammarDetailIndex = 0;
+
+ Vector<TextCheckingResult> results;
+ uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
+ m_client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
+
+ for (unsigned i = 0; i < results.size(); i++) {
+ const TextCheckingResult* result = &results[i];
+ if (result->type == TextCheckingTypeSpelling && result->location >= currentStartOffset && result->location + result->length <= currentEndOffset) {
+ ASSERT(result->length > 0 && result->location >= 0);
+ spellingLocation = result->location;
+ misspelledWord = paragraphString.substring(result->location, result->length);
+ ASSERT(misspelledWord.length());
+ break;
+ }
+ if (checkGrammar && result->type == TextCheckingTypeGrammar && result->location < currentEndOffset && result->location + result->length > currentStartOffset) {
+ ASSERT(result->length > 0 && result->location >= 0);
+ // We can't stop after the first grammar result, since there might still be a spelling result after
+ // it begins but before the first detail in it, but we can stop if we find a second grammar result.
+ if (foundGrammar)
+ break;
+ for (unsigned j = 0; j < result->details.size(); j++) {
+ const GrammarDetail* detail = &result->details[j];
+ ASSERT(detail->length > 0 && detail->location >= 0);
+ if (result->location + detail->location >= currentStartOffset && result->location + detail->location + detail->length <= currentEndOffset && (!foundGrammar || result->location + detail->location < grammarDetailLocation)) {
+ grammarDetailIndex = j;
+ grammarDetailLocation = result->location + detail->location;
+ foundGrammar = true;
+ }
+ }
+ if (foundGrammar) {
+ grammarPhraseLocation = result->location;
+ outGrammarDetail = result->details[grammarDetailIndex];
+ badGrammarPhrase = paragraphString.substring(result->location, result->length);
+ ASSERT(badGrammarPhrase.length());
+ }
+ }
+ }
+
+ if (!misspelledWord.isEmpty() && (!checkGrammar || badGrammarPhrase.isEmpty() || spellingLocation <= grammarDetailLocation)) {
+ int spellingOffset = spellingLocation - currentStartOffset;
+ if (!firstIteration) {
+ RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), m_range->startPosition(), paragraphRange->startPosition());
+ spellingOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
+ }
+ outIsSpelling = true;
+ outFirstFoundOffset = spellingOffset;
+ firstFoundItem = misspelledWord;
+ break;
+ }
+ if (checkGrammar && !badGrammarPhrase.isEmpty()) {
+ int grammarPhraseOffset = grammarPhraseLocation - currentStartOffset;
+ if (!firstIteration) {
+ RefPtr<Range> paragraphOffsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), m_range->startPosition(), paragraphRange->startPosition());
+ grammarPhraseOffset += TextIterator::rangeLength(paragraphOffsetAsRange.get());
+ }
+ outIsSpelling = false;
+ outFirstFoundOffset = grammarPhraseOffset;
+ firstFoundItem = badGrammarPhrase;
+ break;
+ }
+ }
+ }
+ if (lastIteration || totalLengthProcessed + currentLength >= totalRangeLength)
+ break;
+ VisiblePosition newParagraphStart = startOfNextParagraph(paragraphRange->endPosition());
+ setStart(paragraphRange.get(), newParagraphStart);
+ setEnd(paragraphRange.get(), endOfParagraph(newParagraphStart));
+ firstIteration = false;
+ totalLengthProcessed += currentLength;
+ }
+ return firstFoundItem;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(checkGrammar);
+ UNUSED_PARAM(outIsSpelling);
+ UNUSED_PARAM(outFirstFoundOffset);
+ UNUSED_PARAM(outGrammarDetail);
+ return "";
+#endif
+}
+
+int TextCheckingHelper::findFirstGrammarDetail(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int /*badGrammarPhraseLength*/, int startOffset, int endOffset, bool markAll)
+{
+#ifndef BUILDING_ON_TIGER
+ // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
+ // Optionally add a DocumentMarker for each detail in the range.
+ int earliestDetailLocationSoFar = -1;
+ int earliestDetailIndex = -1;
+ for (unsigned i = 0; i < grammarDetails.size(); i++) {
+ const GrammarDetail* detail = &grammarDetails[i];
+ ASSERT(detail->length > 0 && detail->location >= 0);
+
+ int detailStartOffsetInParagraph = badGrammarPhraseLocation + detail->location;
+
+ // Skip this detail if it starts before the original search range
+ if (detailStartOffsetInParagraph < startOffset)
+ continue;
+
+ // Skip this detail if it starts after the original search range
+ if (detailStartOffsetInParagraph >= endOffset)
+ continue;
+
+ if (markAll) {
+ RefPtr<Range> badGrammarRange = TextIterator::subrange(m_range.get(), badGrammarPhraseLocation - startOffset + detail->location, detail->length);
+ ExceptionCode ec = 0;
+ badGrammarRange->startContainer(ec)->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription);
+ ASSERT(!ec);
+ }
+
+ // Remember this detail only if it's earlier than our current candidate (the details aren't in a guaranteed order)
+ if (earliestDetailIndex < 0 || earliestDetailLocationSoFar > detail->location) {
+ earliestDetailIndex = i;
+ earliestDetailLocationSoFar = detail->location;
+ }
+ }
+
+ return earliestDetailIndex;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(grammarDetails);
+ UNUSED_PARAM(badGrammarPhraseLocation);
+ UNUSED_PARAM(startOffset);
+ UNUSED_PARAM(endOffset);
+ UNUSED_PARAM(markAll);
+ return 0;
+#endif
+}
+
+String TextCheckingHelper::findFirstBadGrammar(GrammarDetail& outGrammarDetail, int& outGrammarPhraseOffset, bool markAll)
+{
+#ifndef BUILDING_ON_TIGER
+ // Initialize out parameters; these will be updated if we find something to return.
+ outGrammarDetail.location = -1;
+ outGrammarDetail.length = 0;
+ outGrammarDetail.guesses.clear();
+ outGrammarDetail.userDescription = "";
+ outGrammarPhraseOffset = 0;
+
+ String firstBadGrammarPhrase;
+
+ // Expand the search range to encompass entire paragraphs, since grammar checking needs that much context.
+ // Determine the character offset from the start of the paragraph to the start of the original search range,
+ // since we will want to ignore results in this area.
+ int searchRangeStartOffset;
+ String paragraphString;
+ RefPtr<Range> paragraphRange = paragraphAlignedRange(searchRangeStartOffset, paragraphString);
+
+ // Determine the character offset from the start of the paragraph to the end of the original search range,
+ // since we will want to ignore results in this area also.
+ int searchRangeEndOffset = searchRangeStartOffset + TextIterator::rangeLength(m_range.get());
+
+ // Start checking from beginning of paragraph, but skip past results that occur before the start of the original search range.
+ int startOffset = 0;
+ while (startOffset < searchRangeEndOffset) {
+ Vector<GrammarDetail> grammarDetails;
+ int badGrammarPhraseLocation = -1;
+ int badGrammarPhraseLength = 0;
+ m_client->checkGrammarOfString(paragraphString.characters() + startOffset, paragraphString.length() - startOffset, grammarDetails, &badGrammarPhraseLocation, &badGrammarPhraseLength);
+
+ if (!badGrammarPhraseLength) {
+ ASSERT(badGrammarPhraseLocation == -1);
+ return String();
+ }
+
+ ASSERT(badGrammarPhraseLocation >= 0);
+ badGrammarPhraseLocation += startOffset;
+
+
+ // Found some bad grammar. Find the earliest detail range that starts in our search range (if any).
+ int badGrammarIndex = findFirstGrammarDetail(grammarDetails, badGrammarPhraseLocation, badGrammarPhraseLength, searchRangeStartOffset, searchRangeEndOffset, markAll);
+ if (badGrammarIndex >= 0) {
+ ASSERT(static_cast<unsigned>(badGrammarIndex) < grammarDetails.size());
+ outGrammarDetail = grammarDetails[badGrammarIndex];
+ }
+
+ // If we found a detail in range, then we have found the first bad phrase (unless we found one earlier but
+ // kept going so we could mark all instances).
+ if (badGrammarIndex >= 0 && firstBadGrammarPhrase.isEmpty()) {
+ outGrammarPhraseOffset = badGrammarPhraseLocation - searchRangeStartOffset;
+ firstBadGrammarPhrase = paragraphString.substring(badGrammarPhraseLocation, badGrammarPhraseLength);
+
+ // Found one. We're done now, unless we're marking each instance.
+ if (!markAll)
+ break;
+ }
+
+ // These results were all between the start of the paragraph and the start of the search range; look
+ // beyond this phrase.
+ startOffset = badGrammarPhraseLocation + badGrammarPhraseLength;
+ }
+
+ return firstBadGrammarPhrase;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(outGrammarDetail);
+ UNUSED_PARAM(outGrammarPhraseOffset);
+ UNUSED_PARAM(markAll);
+#endif
+}
+
+
+bool TextCheckingHelper::isUngrammatical(Vector<String>& guessesVector) const
+{
+#ifndef BUILDING_ON_TIGER
+ if (!m_client)
+ return false;
+
+ ExceptionCode ec;
+ if (!m_range || m_range->collapsed(ec))
+ return false;
+
+ // Returns true only if the passed range exactly corresponds to a bad grammar detail range. This is analogous
+ // to isSelectionMisspelled. It's not good enough for there to be some bad grammar somewhere in the range,
+ // or overlapping the range; the ranges must exactly match.
+ guessesVector.clear();
+ int grammarPhraseOffset;
+
+ GrammarDetail grammarDetail;
+ String badGrammarPhrase = const_cast<TextCheckingHelper*>(this)->findFirstBadGrammar(grammarDetail, grammarPhraseOffset, false);
+
+ // No bad grammar in these parts at all.
+ if (badGrammarPhrase.isEmpty())
+ return false;
+
+ // Bad grammar, but phrase (e.g. sentence) starts beyond start of range.
+ if (grammarPhraseOffset > 0)
+ return false;
+
+ ASSERT(grammarDetail.location >= 0 && grammarDetail.length > 0);
+
+ // Bad grammar, but start of detail (e.g. ungrammatical word) doesn't match start of range
+ if (grammarDetail.location + grammarPhraseOffset)
+ return false;
+
+ // Bad grammar at start of range, but end of bad grammar is before or after end of range
+ if (grammarDetail.length != TextIterator::rangeLength(m_range.get()))
+ return false;
+
+ // Update the spelling panel to be displaying this error (whether or not the spelling panel is on screen).
+ // This is necessary to make a subsequent call to [NSSpellChecker ignoreWord:inSpellDocumentWithTag:] work
+ // correctly; that call behaves differently based on whether the spelling panel is displaying a misspelling
+ // or a grammar error.
+ m_client->updateSpellingUIWithGrammarString(badGrammarPhrase, grammarDetail);
+
+ return true;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(guessesVector);
+ return true;
+#endif
+}
+
+Vector<String> TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange(bool checkGrammar, bool& misspelled, bool& ungrammatical) const
+{
+#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ Vector<String> guesses;
+ ExceptionCode ec;
+ misspelled = false;
+ ungrammatical = false;
+
+ if (!m_client || !m_range || m_range->collapsed(ec))
+ return guesses;
+
+ // Expand the range to encompass entire paragraphs, since text checking needs that much context.
+ int rangeStartOffset;
+ String paragraphString;
+ RefPtr<Range> paragraphRange = paragraphAlignedRange(rangeStartOffset, paragraphString);
+ int rangeLength = TextIterator::rangeLength(m_range.get());
+ if (!rangeLength || !paragraphString.length())
+ return guesses;
+
+ Vector<TextCheckingResult> results;
+ uint64_t checkingTypes = checkGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
+ m_client->checkTextOfParagraph(paragraphString.characters(), paragraphString.length(), checkingTypes, results);
+
+ for (unsigned i = 0; i < results.size(); i++) {
+ const TextCheckingResult* result = &results[i];
+ if (result->type == TextCheckingTypeSpelling && result->location == rangeStartOffset && result->length == rangeLength) {
+ String misspelledWord = paragraphString.substring(rangeStartOffset, rangeLength);
+ ASSERT(misspelledWord.length());
+ m_client->getGuessesForWord(misspelledWord, guesses);
+ m_client->updateSpellingUIWithMisspelledWord(misspelledWord);
+ misspelled = true;
+ return guesses;
+ }
+ }
+
+ if (!checkGrammar)
+ return guesses;
+
+ for (unsigned i = 0; i < results.size(); i++) {
+ const TextCheckingResult* result = &results[i];
+ if (result->type == TextCheckingTypeGrammar && result->location <= rangeStartOffset && result->location + result->length >= rangeStartOffset + rangeLength) {
+ for (unsigned j = 0; j < result->details.size(); j++) {
+ const GrammarDetail* detail = &result->details[j];
+ ASSERT(detail->length > 0 && detail->location >= 0);
+ if (result->location + detail->location == rangeStartOffset && detail->length == rangeLength) {
+ String badGrammarPhrase = paragraphString.substring(result->location, result->length);
+ ASSERT(badGrammarPhrase.length());
+ for (unsigned k = 0; k < detail->guesses.size(); k++)
+ guesses.append(detail->guesses[k]);
+ m_client->updateSpellingUIWithGrammarString(badGrammarPhrase, *detail);
+ ungrammatical = true;
+ return guesses;
+ }
+ }
+ }
+ }
+ return guesses;
+#else
+ ASSERT_NOT_REACHED();
+ UNUSED_PARAM(checkGrammar);
+ UNUSED_PARAM(misspelled);
+ UNUSED_PARAM(ungrammatical);
+ return Vector<String>();
+#endif
+}
+
+
+void TextCheckingHelper::markAllMisspellings(RefPtr<Range>& firstMisspellingRange)
+{
+ // Use the "markAll" feature of findFirstMisspelling. Ignore the return value and the "out parameter";
+ // all we need to do is mark every instance.
+ int ignoredOffset;
+ findFirstMisspelling(ignoredOffset, true, firstMisspellingRange);
+}
+
+void TextCheckingHelper::markAllBadGrammar()
+{
+#ifndef BUILDING_ON_TIGER
+ // Use the "markAll" feature of findFirstBadGrammar. Ignore the return value and "out parameters"; all we need to
+ // do is mark every instance.
+ GrammarDetail ignoredGrammarDetail;
+ int ignoredOffset;
+ findFirstBadGrammar(ignoredGrammarDetail, ignoredOffset, true);
+#else
+ ASSERT_NOT_REACHED();
+#endif
+}
+
+}
diff --git a/WebCore/editing/TextCheckingHelper.h b/WebCore/editing/TextCheckingHelper.h
new file mode 100644
index 0000000..1dd3b3d
--- /dev/null
+++ b/WebCore/editing/TextCheckingHelper.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 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 TextCheckingHelper_h
+#define TextCheckingHelper_h
+
+#include "EditorClient.h"
+
+namespace WebCore {
+
+class Range;
+
+class TextCheckingHelper : public Noncopyable {
+public:
+ TextCheckingHelper(EditorClient*, PassRefPtr<Range>);
+ ~TextCheckingHelper();
+
+ String findFirstMisspelling(int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange);
+ String findFirstMisspellingOrBadGrammar(bool checkGrammar, bool& outIsSpelling, int& outFirstFoundOffset, GrammarDetail& outGrammarDetail);
+ String findFirstBadGrammar(GrammarDetail& outGrammarDetail, int& outGrammarPhraseOffset, bool markAll);
+ int findFirstGrammarDetail(const Vector<GrammarDetail>& grammarDetails, int badGrammarPhraseLocation, int badGrammarPhraseLength, int startOffset, int endOffset, bool markAll);
+ void markAllMisspellings(RefPtr<Range>& firstMisspellingRange);
+ void markAllBadGrammar();
+
+ bool isUngrammatical(Vector<String>& guessesVector) const;
+ Vector<String> guessesForMisspelledOrUngrammaticalRange(bool checkGrammar, bool& misspelled, bool& ungrammatical) const;
+ PassRefPtr<Range> paragraphAlignedRange(int& offsetIntoParagraphAlignedRange, String& paragraphString) const;
+private:
+ EditorClient* m_client;
+ RefPtr<Range> m_range;
+};
+
+} // namespace WebCore
+
+#endif // TextCheckingHelper_h
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index 60b3f7b..d78708b 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -131,14 +131,18 @@ void TypingCommand::insertText(Document* document, const String& text, bool sele
void TypingCommand::insertText(Document* document, const String& text, const VisibleSelection& selectionForInsertion, bool selectInsertedText, bool insertedTextIsComposition)
{
+#if REMOVE_MARKERS_UPON_EDITING
+ if (!text.isEmpty())
+ document->frame()->editor()->removeSpellAndCorrectionMarkersFromWordsToBeEdited(isSpaceOrNewline(text.characters()[0]));
+#endif
+
ASSERT(document);
-
+
RefPtr<Frame> frame = document->frame();
ASSERT(frame);
-
+
VisibleSelection currentSelection = frame->selection()->selection();
bool changeSelection = currentSelection != selectionForInsertion;
-
String newText = text;
Node* startNode = selectionForInsertion.start().node();
@@ -419,9 +423,12 @@ bool TypingCommand::makeEditableRootEmpty()
void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
{
+#if REMOVE_MARKERS_UPON_EDITING
+ document()->frame()->editor()->removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
VisibleSelection selectionToDelete;
VisibleSelection selectionAfterUndo;
-
+
switch (endingSelection().selectionType()) {
case VisibleSelection::RangeSelection:
selectionToDelete = endingSelection();
@@ -515,6 +522,9 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool killRing)
{
+#if REMOVE_MARKERS_UPON_EDITING
+ document()->frame()->editor()->removeSpellAndCorrectionMarkersFromWordsToBeEdited(false);
+#endif
VisibleSelection selectionToDelete;
VisibleSelection selectionAfterUndo;
diff --git a/WebCore/editing/visible_units.cpp b/WebCore/editing/visible_units.cpp
index d9ca223..8b11013 100644
--- a/WebCore/editing/visible_units.cpp
+++ b/WebCore/editing/visible_units.cpp
@@ -29,6 +29,7 @@
#include "Document.h"
#include "Element.h"
#include "HTMLNames.h"
+#include "Position.h"
#include "RenderBlock.h"
#include "RenderLayer.h"
#include "RenderObject.h"
@@ -779,7 +780,7 @@ VisiblePosition nextSentencePosition(const VisiblePosition &c)
return c.honorEditableBoundaryAtOrBefore(next);
}
-VisiblePosition startOfParagraph(const VisiblePosition& c)
+VisiblePosition startOfParagraph(const VisiblePosition& c, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
Position p = c.deepEquivalent();
Node *startNode = p.node();
@@ -797,7 +798,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
Node *n = startNode;
while (n) {
- if (n->isContentEditable() != startNode->isContentEditable())
+ if (boundaryCrossingRule == Position::CannotCrossEditingBoundary && n->isContentEditable() != startNode->isContentEditable())
break;
RenderObject *r = n->renderer();
if (!r) {
@@ -812,8 +813,8 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
if (r->isBR() || isBlock(n))
break;
-
- if (r->isText()) {
+
+ if (r->isText() && r->caretMaxRenderedOffset() > 0) {
if (style->preserveNewline()) {
const UChar* chars = toRenderText(r)->characters();
int i = toRenderText(r)->textLength();
@@ -838,7 +839,7 @@ VisiblePosition startOfParagraph(const VisiblePosition& c)
return VisiblePosition(node, offset, DOWNSTREAM);
}
-VisiblePosition endOfParagraph(const VisiblePosition &c)
+VisiblePosition endOfParagraph(const VisiblePosition &c, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
if (c.isNull())
return VisiblePosition();
@@ -857,7 +858,7 @@ VisiblePosition endOfParagraph(const VisiblePosition &c)
Node *n = startNode;
while (n) {
- if (n->isContentEditable() != startNode->isContentEditable())
+ if (boundaryCrossingRule == Position::CannotCrossEditingBoundary && n->isContentEditable() != startNode->isContentEditable())
break;
RenderObject *r = n->renderer();
if (!r) {
@@ -872,9 +873,8 @@ VisiblePosition endOfParagraph(const VisiblePosition &c)
if (r->isBR() || isBlock(n))
break;
-
+
// FIXME: We avoid returning a position where the renderer can't accept the caret.
- // We should probably do this in other cases such as startOfParagraph.
if (r->isText() && r->caretMaxRenderedOffset() > 0) {
int length = toRenderText(r)->textLength();
if (style->preserveNewline()) {
@@ -914,14 +914,14 @@ bool inSameParagraph(const VisiblePosition &a, const VisiblePosition &b)
return a.isNotNull() && startOfParagraph(a) == startOfParagraph(b);
}
-bool isStartOfParagraph(const VisiblePosition &pos)
+bool isStartOfParagraph(const VisiblePosition &pos, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
- return pos.isNotNull() && pos == startOfParagraph(pos);
+ return pos.isNotNull() && pos == startOfParagraph(pos, boundaryCrossingRule);
}
-bool isEndOfParagraph(const VisiblePosition &pos)
+bool isEndOfParagraph(const VisiblePosition &pos, Position::EditingBoundaryCrossingRule boundaryCrossingRule)
{
- return pos.isNotNull() && pos == endOfParagraph(pos);
+ return pos.isNotNull() && pos == endOfParagraph(pos, boundaryCrossingRule);
}
VisiblePosition previousParagraphPosition(const VisiblePosition& p, int x)
diff --git a/WebCore/editing/visible_units.h b/WebCore/editing/visible_units.h
index a20b588..f78f9d1 100644
--- a/WebCore/editing/visible_units.h
+++ b/WebCore/editing/visible_units.h
@@ -27,6 +27,7 @@
#define visible_units_h
#include "Document.h"
+#include "Position.h"
#include "TextAffinity.h"
namespace WebCore {
@@ -60,14 +61,14 @@ VisiblePosition logicalStartOfLine(const VisiblePosition &);
VisiblePosition logicalEndOfLine(const VisiblePosition &);
// paragraphs (perhaps a misnomer, can be divided by line break elements)
-VisiblePosition startOfParagraph(const VisiblePosition&);
-VisiblePosition endOfParagraph(const VisiblePosition&);
+VisiblePosition startOfParagraph(const VisiblePosition&, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
+VisiblePosition endOfParagraph(const VisiblePosition&, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
VisiblePosition startOfNextParagraph(const VisiblePosition&);
VisiblePosition previousParagraphPosition(const VisiblePosition &, int x);
VisiblePosition nextParagraphPosition(const VisiblePosition &, int x);
+bool isStartOfParagraph(const VisiblePosition &, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
+bool isEndOfParagraph(const VisiblePosition &, Position::EditingBoundaryCrossingRule = Position::CannotCrossEditingBoundary);
bool inSameParagraph(const VisiblePosition &, const VisiblePosition &);
-bool isStartOfParagraph(const VisiblePosition &);
-bool isEndOfParagraph(const VisiblePosition &);
// blocks (true paragraphs; line break elements don't break blocks)
VisiblePosition startOfBlock(const VisiblePosition &);
diff --git a/WebCore/fileapi/AsyncFileWriterClient.h b/WebCore/fileapi/AsyncFileWriterClient.h
index 327b19c..929f523 100644
--- a/WebCore/fileapi/AsyncFileWriterClient.h
+++ b/WebCore/fileapi/AsyncFileWriterClient.h
@@ -33,7 +33,7 @@
#if ENABLE(FILE_SYSTEM)
-#include "ExceptionCode.h"
+#include "FileError.h"
namespace WebCore {
@@ -43,7 +43,7 @@ public:
virtual void didWrite(long long bytes, bool complete) = 0;
virtual void didTruncate() = 0;
- virtual void didFail(ExceptionCode) = 0;
+ virtual void didFail(FileError::ErrorCode) = 0;
};
} // namespace
diff --git a/WebCore/fileapi/BlobBuilder.cpp b/WebCore/fileapi/BlobBuilder.cpp
index 69443a5..9406899 100644
--- a/WebCore/fileapi/BlobBuilder.cpp
+++ b/WebCore/fileapi/BlobBuilder.cpp
@@ -32,12 +32,16 @@
#include "BlobBuilder.h"
+#include "ArrayBuffer.h"
#include "Blob.h"
#include "ExceptionCode.h"
#include "File.h"
#include "LineEnding.h"
#include "TextEncoding.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
#include <wtf/text/AtomicString.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -46,46 +50,57 @@ BlobBuilder::BlobBuilder()
{
}
-bool BlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec)
+Vector<char>& BlobBuilder::getBuffer()
+{
+ // If the last item is not a data item, create one. Otherwise, we simply append the new string to the last data item.
+ if (m_items.isEmpty() || m_items[m_items.size() - 1].type != BlobDataItem::Data)
+ m_items.append(BlobDataItem(RawData::create()));
+
+ return *m_items[m_items.size() - 1].data->mutableData();
+}
+
+void BlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec)
{
bool isEndingTypeTransparent = endingType == "transparent";
bool isEndingTypeNative = endingType == "native";
if (!endingType.isEmpty() && !isEndingTypeTransparent && !isEndingTypeNative) {
ec = SYNTAX_ERR;
- return 0;
+ return;
}
CString utf8Text = UTF8Encoding().encode(text.characters(), text.length(), EntitiesForUnencodables);
- // If the last item is not a data item, create one. Otherwise, we simply append the new string to the last data item.
- if (m_items.isEmpty() || m_items[m_items.size() - 1].type != BlobDataItem::Data)
- m_items.append(BlobDataItem(RawData::create()));
-
- if (!utf8Text.isNull()) {
- Vector<char>& buffer = *m_items[m_items.size() - 1].data->mutableData();
- size_t oldSize = buffer.size();
+ Vector<char>& buffer = getBuffer();
+ size_t oldSize = buffer.size();
- if (isEndingTypeNative)
- normalizeLineEndingsToNative(utf8Text, buffer);
- else
- buffer.append(utf8Text.data(), utf8Text.length());
- m_size += buffer.size() - oldSize;
- }
+ if (isEndingTypeNative)
+ normalizeLineEndingsToNative(utf8Text, buffer);
+ else
+ buffer.append(utf8Text.data(), utf8Text.length());
+ m_size += buffer.size() - oldSize;
+}
- return true;
+void BlobBuilder::append(const String& text, ExceptionCode& ec)
+{
+ append(text, String(), ec);
}
-bool BlobBuilder::append(const String& text, ExceptionCode& ec)
+#if ENABLE(BLOB)
+void BlobBuilder::append(ArrayBuffer* arrayBuffer)
{
- return append(text, String(), ec);
+ Vector<char>& buffer = getBuffer();
+ size_t oldSize = buffer.size();
+ buffer.append(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength());
+ m_size += buffer.size() - oldSize;
}
+#endif
-bool BlobBuilder::append(PassRefPtr<Blob> blob)
+void BlobBuilder::append(Blob* blob)
{
if (blob->isFile()) {
// If the blob is file that is not snapshoted, capture the snapshot now.
// FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous.
- File* file = static_cast<File*>(blob.get());
+ File* file = static_cast<File*>(blob);
long long snapshotSize;
double snapshotModificationTime;
file->captureSnapshot(snapshotSize, snapshotModificationTime);
@@ -97,7 +112,6 @@ bool BlobBuilder::append(PassRefPtr<Blob> blob)
m_size += blobSize;
m_items.append(BlobDataItem(blob->url(), 0, blobSize));
}
- return true;
}
PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType)
diff --git a/WebCore/fileapi/BlobBuilder.h b/WebCore/fileapi/BlobBuilder.h
index a981e31..db46591 100644
--- a/WebCore/fileapi/BlobBuilder.h
+++ b/WebCore/fileapi/BlobBuilder.h
@@ -32,14 +32,12 @@
#define BlobBuilder_h
#include "BlobData.h"
-#include "PlatformString.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-#include <wtf/text/CString.h>
namespace WebCore {
+class ArrayBuffer;
class Blob;
class TextEncoding;
@@ -49,15 +47,20 @@ class BlobBuilder : public RefCounted<BlobBuilder> {
public:
static PassRefPtr<BlobBuilder> create() { return adoptRef(new BlobBuilder()); }
- bool append(PassRefPtr<Blob>);
- bool append(const String& text, ExceptionCode&);
- bool append(const String& text, const String& ending, ExceptionCode&);
+ void append(Blob*);
+ void append(const String& text, ExceptionCode&);
+ void append(const String& text, const String& ending, ExceptionCode&);
+#if ENABLE(BLOB)
+ void append(ArrayBuffer*);
+#endif
PassRefPtr<Blob> getBlob(const String& contentType = String());
private:
BlobBuilder();
+ Vector<char>& getBuffer();
+
long long m_size;
BlobDataItemList m_items;
};
diff --git a/WebCore/fileapi/BlobBuilder.idl b/WebCore/fileapi/BlobBuilder.idl
index 0da9314..8f5049f 100644
--- a/WebCore/fileapi/BlobBuilder.idl
+++ b/WebCore/fileapi/BlobBuilder.idl
@@ -38,6 +38,9 @@ module html {
Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
#endif
void append(in Blob blob);
+#if defined(ENABLE_BLOB) && ENABLE_BLOB
+ void append(in ArrayBuffer arrayBuffer);
+#endif
void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException);
};
diff --git a/WebCore/fileapi/DOMFileSystemBase.cpp b/WebCore/fileapi/DOMFileSystemBase.cpp
index fefe99f..c462c3c 100644
--- a/WebCore/fileapi/DOMFileSystemBase.cpp
+++ b/WebCore/fileapi/DOMFileSystemBase.cpp
@@ -35,6 +35,7 @@
#include "DOMFilePath.h"
#include "DirectoryEntry.h"
+#include "DirectoryReaderBase.h"
#include "EntriesCallback.h"
#include "EntryArray.h"
#include "EntryBase.h"
@@ -190,7 +191,7 @@ bool DOMFileSystemBase::getDirectory(const EntryBase* base, const String& path,
return true;
}
-bool DOMFileSystemBase::readDirectory(DirectoryReaderBase* reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
ASSERT(DOMFilePath::isAbsolute(path));
String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
diff --git a/WebCore/fileapi/DOMFileSystemBase.h b/WebCore/fileapi/DOMFileSystemBase.h
index 36e35b4..66f1331 100644
--- a/WebCore/fileapi/DOMFileSystemBase.h
+++ b/WebCore/fileapi/DOMFileSystemBase.h
@@ -72,7 +72,7 @@ public:
bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool getFile(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool getDirectory(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
- bool readDirectory(DirectoryReaderBase*, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
+ bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
protected:
DOMFileSystemBase(const String& name, PassOwnPtr<AsyncFileSystem>);
diff --git a/WebCore/fileapi/DirectoryEntry.cpp b/WebCore/fileapi/DirectoryEntry.cpp
index 765fcd5..7bc0af8 100644
--- a/WebCore/fileapi/DirectoryEntry.cpp
+++ b/WebCore/fileapi/DirectoryEntry.cpp
@@ -41,7 +41,7 @@
namespace WebCore {
-DirectoryEntry::DirectoryEntry(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryEntry::DirectoryEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: Entry(fileSystem, fullPath)
{
}
@@ -55,21 +55,21 @@ void DirectoryEntry::getFile(const String& path, PassRefPtr<Flags> flags, PassRe
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getFile(this, path, flags, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void DirectoryEntry::getDirectory(const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void DirectoryEntry::removeRecursively(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->removeRecursively(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
}
diff --git a/WebCore/fileapi/DirectoryEntry.h b/WebCore/fileapi/DirectoryEntry.h
index dd0159e..da903da 100644
--- a/WebCore/fileapi/DirectoryEntry.h
+++ b/WebCore/fileapi/DirectoryEntry.h
@@ -49,7 +49,7 @@ class VoidCallback;
class DirectoryEntry : public Entry {
public:
- static PassRefPtr<DirectoryEntry> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryEntry(fileSystem, fullPath));
}
@@ -61,7 +61,7 @@ public:
void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const;
private:
- DirectoryEntry(DOMFileSystemBase*, const String& fullPath);
+ DirectoryEntry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
} // namespace
diff --git a/WebCore/fileapi/DirectoryEntrySync.cpp b/WebCore/fileapi/DirectoryEntrySync.cpp
index d8d22c2..e68f7be 100644
--- a/WebCore/fileapi/DirectoryEntrySync.cpp
+++ b/WebCore/fileapi/DirectoryEntrySync.cpp
@@ -36,11 +36,12 @@
#include "DirectoryReaderSync.h"
#include "EntrySync.h"
#include "FileEntrySync.h"
+#include "FileException.h"
#include "SyncCallbackHelper.h"
namespace WebCore {
-DirectoryEntrySync::DirectoryEntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryEntrySync::DirectoryEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntrySync(fileSystem, fullPath)
{
}
@@ -55,7 +56,7 @@ PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, PassRe
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return static_pointer_cast<FileEntrySync>(helper.getResult(ec));
@@ -66,7 +67,7 @@ PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& pa
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return static_pointer_cast<DirectoryEntrySync>(helper.getResult(ec));
@@ -77,7 +78,7 @@ void DirectoryEntrySync::removeRecursively(ExceptionCode& ec)
ec = 0;
VoidSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->removeRecursively(this, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return;
}
helper.getResult(ec);
diff --git a/WebCore/fileapi/DirectoryEntrySync.h b/WebCore/fileapi/DirectoryEntrySync.h
index 9a3e0df..eb412bb 100644
--- a/WebCore/fileapi/DirectoryEntrySync.h
+++ b/WebCore/fileapi/DirectoryEntrySync.h
@@ -46,7 +46,7 @@ class FileEntrySync;
class DirectoryEntrySync : public EntrySync {
public:
- static PassRefPtr<DirectoryEntrySync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryEntrySync(fileSystem, fullPath));
}
@@ -59,7 +59,7 @@ public:
private:
friend class EntrySync;
- DirectoryEntrySync(DOMFileSystemBase*, const String& fullPath);
+ DirectoryEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/DirectoryReader.cpp b/WebCore/fileapi/DirectoryReader.cpp
index 3437675..fe2d99f 100644
--- a/WebCore/fileapi/DirectoryReader.cpp
+++ b/WebCore/fileapi/DirectoryReader.cpp
@@ -40,7 +40,7 @@
namespace WebCore {
-DirectoryReader::DirectoryReader(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: DirectoryReaderBase(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/DirectoryReader.h b/WebCore/fileapi/DirectoryReader.h
index 806fdf1..bc89858 100644
--- a/WebCore/fileapi/DirectoryReader.h
+++ b/WebCore/fileapi/DirectoryReader.h
@@ -47,17 +47,17 @@ class ErrorCallback;
class DirectoryReader : public DirectoryReaderBase {
public:
- static PassRefPtr<DirectoryReader> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryReader> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryReader(fileSystem, fullPath));
}
void readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback> = 0);
- DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); }
+ DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
private:
- DirectoryReader(DOMFileSystemBase*, const String& fullPath);
+ DirectoryReader(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/DirectoryReaderBase.h b/WebCore/fileapi/DirectoryReaderBase.h
index 5a2c048..4096fe8 100644
--- a/WebCore/fileapi/DirectoryReaderBase.h
+++ b/WebCore/fileapi/DirectoryReaderBase.h
@@ -42,18 +42,18 @@ namespace WebCore {
class DirectoryReaderBase : public RefCounted<DirectoryReaderBase> {
public:
- DOMFileSystemBase* filesystem() const { return m_fileSystem; }
+ DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); }
void setHasMoreEntries(bool hasMoreEntries) { m_hasMoreEntries = hasMoreEntries; }
protected:
- DirectoryReaderBase(DOMFileSystemBase* fileSystem, const String& fullPath)
+ DirectoryReaderBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
, m_hasMoreEntries(true)
{
}
- DOMFileSystemBase* m_fileSystem;
+ RefPtr<DOMFileSystemBase> m_fileSystem;
// This is a virtual path.
String m_fullPath;
diff --git a/WebCore/fileapi/DirectoryReaderSync.cpp b/WebCore/fileapi/DirectoryReaderSync.cpp
index 6c66a15..15cdaa8 100644
--- a/WebCore/fileapi/DirectoryReaderSync.cpp
+++ b/WebCore/fileapi/DirectoryReaderSync.cpp
@@ -39,12 +39,12 @@
#include "EntrySync.h"
#include "ExceptionCode.h"
#include "FileEntrySync.h"
-#include "FileError.h"
+#include "FileException.h"
#include "SyncCallbackHelper.h"
namespace WebCore {
-DirectoryReaderSync::DirectoryReaderSync(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryReaderSync::DirectoryReaderSync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: DirectoryReaderBase(fileSystem, fullPath)
{
}
@@ -57,7 +57,7 @@ PassRefPtr<EntryArraySync> DirectoryReaderSync::readEntries(ExceptionCode& ec)
EntriesSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->readDirectory(this, m_fullPath, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
setHasMoreEntries(false);
return 0;
}
diff --git a/WebCore/fileapi/DirectoryReaderSync.h b/WebCore/fileapi/DirectoryReaderSync.h
index 39119b7..5e3d61b 100644
--- a/WebCore/fileapi/DirectoryReaderSync.h
+++ b/WebCore/fileapi/DirectoryReaderSync.h
@@ -43,7 +43,7 @@ namespace WebCore {
class DirectoryReaderSync : public DirectoryReaderBase {
public:
- static PassRefPtr<DirectoryReaderSync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new DirectoryReaderSync(fileSystem, fullPath));
}
@@ -51,7 +51,7 @@ public:
PassRefPtr<EntryArraySync> readEntries(ExceptionCode&);
private:
- DirectoryReaderSync(DOMFileSystemBase*, const String& fullPath);
+ DirectoryReaderSync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
} // namespace
diff --git a/WebCore/fileapi/Entry.cpp b/WebCore/fileapi/Entry.cpp
index 2183b33..9c3fa4e 100644
--- a/WebCore/fileapi/Entry.cpp
+++ b/WebCore/fileapi/Entry.cpp
@@ -42,7 +42,7 @@
namespace WebCore {
-Entry::Entry(DOMFileSystemBase* fileSystem, const String& fullPath)
+Entry::Entry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntryBase(fileSystem, fullPath)
{
}
@@ -51,35 +51,35 @@ void Entry::getMetadata(PassRefPtr<MetadataCallback> successCallback, PassRefPtr
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getMetadata(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::moveTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->move(this, parent.get(), name, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::copyTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->copy(this, parent.get(), name, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::remove(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->remove(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
void Entry::getParent(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
{
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getParent(this, successCallback, errorCallback))
- filesystem()->scheduleCallback(errorCallback.release(), FileError::create(INVALID_MODIFICATION_ERR));
+ filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
String Entry::toURI(const String&)
diff --git a/WebCore/fileapi/Entry.h b/WebCore/fileapi/Entry.h
index 36f85eb..9367f4f 100644
--- a/WebCore/fileapi/Entry.h
+++ b/WebCore/fileapi/Entry.h
@@ -49,7 +49,7 @@ class VoidCallback;
class Entry : public EntryBase {
public:
- DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); }
+ DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
@@ -60,7 +60,7 @@ public:
String toURI(const String& mimeType = String());
protected:
- Entry(DOMFileSystemBase*, const String& fullPath);
+ Entry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
} // namespace WebCore
diff --git a/WebCore/fileapi/EntryBase.h b/WebCore/fileapi/EntryBase.h
index 2aaeba8..16f93ba 100644
--- a/WebCore/fileapi/EntryBase.h
+++ b/WebCore/fileapi/EntryBase.h
@@ -48,7 +48,7 @@ class EntryBase : public RefCounted<EntryBase> {
public:
virtual ~EntryBase() { }
- DOMFileSystemBase* filesystem() const { return m_fileSystem; }
+ DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); }
virtual bool isFile() const { return false; }
virtual bool isDirectory() const { return false; }
@@ -57,7 +57,7 @@ public:
const String& name() const { return m_name; }
protected:
- EntryBase(DOMFileSystemBase* fileSystem, const String& fullPath)
+ EntryBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
, m_name(DOMFilePath::getName(fullPath))
@@ -66,7 +66,7 @@ protected:
friend class EntrySync;
- DOMFileSystemBase* m_fileSystem;
+ RefPtr<DOMFileSystemBase> m_fileSystem;
// This is a virtual path.
String m_fullPath;
diff --git a/WebCore/fileapi/EntrySync.cpp b/WebCore/fileapi/EntrySync.cpp
index ad007db..299aeda 100644
--- a/WebCore/fileapi/EntrySync.cpp
+++ b/WebCore/fileapi/EntrySync.cpp
@@ -38,6 +38,7 @@
#include "DirectoryEntry.h"
#include "DirectoryEntrySync.h"
#include "FileEntrySync.h"
+#include "FileException.h"
#include "Metadata.h"
#include "SyncCallbackHelper.h"
@@ -55,7 +56,7 @@ PassRefPtr<Metadata> EntrySync::getMetadata(ExceptionCode& ec)
ec = 0;
MetadataSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getMetadata(this, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return helper.getResult(ec);
@@ -66,7 +67,7 @@ PassRefPtr<EntrySync> EntrySync::moveTo(PassRefPtr<DirectoryEntrySync> parent, c
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->move(this, parent.get(), name, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return helper.getResult(ec);
@@ -77,7 +78,7 @@ PassRefPtr<EntrySync> EntrySync::copyTo(PassRefPtr<DirectoryEntrySync> parent, c
ec = 0;
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->copy(this, parent.get(), name, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
return helper.getResult(ec);
@@ -88,7 +89,7 @@ void EntrySync::remove(ExceptionCode& ec) const
ec = 0;
VoidSyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->remove(this, helper.successCallback(), helper.errorCallback())) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return;
}
helper.getResult(ec);
@@ -101,7 +102,7 @@ PassRefPtr<EntrySync> EntrySync::getParent() const
return DirectoryEntrySync::create(m_fileSystem, parentPath);
}
-EntrySync::EntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+EntrySync::EntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntryBase(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/EntrySync.h b/WebCore/fileapi/EntrySync.h
index 24a0101..175d591 100644
--- a/WebCore/fileapi/EntrySync.h
+++ b/WebCore/fileapi/EntrySync.h
@@ -49,7 +49,7 @@ class EntrySync : public EntryBase {
public:
static PassRefPtr<EntrySync> create(EntryBase*);
- DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem); }
+ DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem.get()); }
PassRefPtr<Metadata> getMetadata(ExceptionCode&);
PassRefPtr<EntrySync> moveTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const;
@@ -58,7 +58,7 @@ public:
PassRefPtr<EntrySync> getParent() const;
protected:
- EntrySync(DOMFileSystemBase*, const String& fullPath);
+ EntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/FileEntry.cpp b/WebCore/fileapi/FileEntry.cpp
index 29cbd33..a5ecff5 100644
--- a/WebCore/fileapi/FileEntry.cpp
+++ b/WebCore/fileapi/FileEntry.cpp
@@ -41,7 +41,7 @@
namespace WebCore {
-FileEntry::FileEntry(DOMFileSystemBase* fileSystem, const String& fullPath)
+FileEntry::FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: Entry(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/FileEntry.h b/WebCore/fileapi/FileEntry.h
index 216cca2..2fa4394 100644
--- a/WebCore/fileapi/FileEntry.h
+++ b/WebCore/fileapi/FileEntry.h
@@ -43,7 +43,7 @@ class DOMFileSystemBase;
class FileEntry : public Entry {
public:
- static PassRefPtr<FileEntry> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<FileEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new FileEntry(fileSystem, fullPath));
}
@@ -54,7 +54,7 @@ public:
virtual bool isFile() const { return true; }
private:
- FileEntry(DOMFileSystemBase* fileSystem, const String& fullPath);
+ FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath);
};
} // namespace
diff --git a/WebCore/fileapi/FileEntrySync.cpp b/WebCore/fileapi/FileEntrySync.cpp
index 8fc5a77..36ec735 100644
--- a/WebCore/fileapi/FileEntrySync.cpp
+++ b/WebCore/fileapi/FileEntrySync.cpp
@@ -37,7 +37,7 @@
namespace WebCore {
-FileEntrySync::FileEntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+FileEntrySync::FileEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
: EntrySync(fileSystem, fullPath)
{
}
diff --git a/WebCore/fileapi/FileEntrySync.h b/WebCore/fileapi/FileEntrySync.h
index d027f63..be12e21 100644
--- a/WebCore/fileapi/FileEntrySync.h
+++ b/WebCore/fileapi/FileEntrySync.h
@@ -44,7 +44,7 @@ class File;
class FileEntrySync : public EntrySync {
public:
- static PassRefPtr<FileEntrySync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+ static PassRefPtr<FileEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
{
return adoptRef(new FileEntrySync(fileSystem, fullPath));
}
@@ -55,7 +55,7 @@ public:
private:
friend class EntrySync;
- FileEntrySync(DOMFileSystemBase*, const String& fullPath);
+ FileEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
};
}
diff --git a/WebCore/fileapi/FileError.h b/WebCore/fileapi/FileError.h
index 3528109..27ad397 100644
--- a/WebCore/fileapi/FileError.h
+++ b/WebCore/fileapi/FileError.h
@@ -33,7 +33,6 @@
#if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
-#include "ExceptionCode.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -41,16 +40,31 @@ namespace WebCore {
class FileError : public RefCounted<FileError> {
public:
- static PassRefPtr<FileError> create(ExceptionCode code) { return adoptRef(new FileError(code)); }
+ enum ErrorCode {
+ NOT_FOUND_ERR = 1,
+ SECURITY_ERR = 2,
+ ABORT_ERR = 3,
+ NOT_READABLE_ERR = 4,
+ ENCODING_ERR = 5,
+ NO_MODIFICATION_ALLOWED_ERR = 6,
+ INVALID_STATE_ERR = 7,
+ SYNTAX_ERR = 8,
+ INVALID_MODIFICATION_ERR = 9,
+ QUOTA_EXCEEDED_ERR = 10,
+ TYPE_MISMATCH_ERR = 11,
+ PATH_EXISTS_ERR = 12,
+ };
- ExceptionCode code() const { return m_code; }
+ static PassRefPtr<FileError> create(ErrorCode code) { return adoptRef(new FileError(code)); }
+
+ ErrorCode code() const { return m_code; }
private:
- FileError(ExceptionCode code)
+ FileError(ErrorCode code)
: m_code(code)
{ }
- ExceptionCode m_code;
+ ErrorCode m_code;
};
} // namespace WebCore
diff --git a/WebCore/fileapi/FileError.idl b/WebCore/fileapi/FileError.idl
index c5dedbe..bab815a 100644
--- a/WebCore/fileapi/FileError.idl
+++ b/WebCore/fileapi/FileError.idl
@@ -31,21 +31,23 @@
module html {
interface [
Conditional=BLOB|FILE_SYSTEM,
- DontCheckEnums,
NoStaticTables
] FileError {
#if !defined(LANGUAGE_OBJECTIVE_C)
- const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
- const unsigned short NOT_FOUND_ERR = 8;
- const unsigned short INVALID_STATE_ERR = 11;
- const unsigned short SYNTAX_ERR = 12;
- const unsigned short INVALID_MODIFICATION_ERR = 13;
+ // FIXME: Some of constant names are already defined in DOMException.h for Objective-C binding and we cannot have the same names here (they are translated into a enum in the same namespace).
+ const unsigned short NOT_FOUND_ERR = 1;
+ const unsigned short SECURITY_ERR = 2;
+ const unsigned short ABORT_ERR = 3;
+ const unsigned short NOT_READABLE_ERR = 4;
+ const unsigned short ENCODING_ERR = 5;
+ const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6;
+ const unsigned short INVALID_STATE_ERR = 7;
+ const unsigned short SYNTAX_ERR = 8;
+ const unsigned short INVALID_MODIFICATION_ERR = 9;
+ const unsigned short QUOTA_EXCEEDED_ERR = 10;
+ const unsigned short TYPE_MISMATCH_ERR = 11;
+ const unsigned short PATH_EXISTS_ERR = 12;
#endif
- const unsigned short SECURITY_ERR = 18;
- const unsigned short ABORT_ERR = 20;
- const unsigned short QUOTA_EXCEEDED_ERR = 22;
- const unsigned short NOT_READABLE_ERR = 24;
- const unsigned short ENCODING_ERR = 26;
readonly attribute unsigned short code;
};
}
diff --git a/WebCore/fileapi/FileException.h b/WebCore/fileapi/FileException.h
index e90ab90..c3cc638 100644
--- a/WebCore/fileapi/FileException.h
+++ b/WebCore/fileapi/FileException.h
@@ -44,13 +44,31 @@ public:
return adoptRef(new FileException(description));
}
- static const int FileExceptionOffset = 100;
- static const int FileExceptionMax = 199;
+ static const int FileExceptionOffset = 1100;
+ static const int FileExceptionMax = 1199;
- enum EventExceptionCode {
- UNSPECIFIED_EVENT_TYPE_ERR = FileExceptionOffset
+ enum FileExceptionCode {
+ NOT_FOUND_ERR = FileExceptionOffset + 1,
+ SECURITY_ERR = FileExceptionOffset + 2,
+ ABORT_ERR = FileExceptionOffset + 3,
+ NOT_READABLE_ERR = FileExceptionOffset + 4,
+ ENCODING_ERR = FileExceptionOffset + 5,
+ NO_MODIFICATION_ALLOWED_ERR = FileExceptionOffset + 6,
+ INVALID_STATE_ERR = FileExceptionOffset + 7,
+ SYNTAX_ERR = FileExceptionOffset + 8,
+ INVALID_MODIFICATION_ERR = FileExceptionOffset + 9,
+ QUOTA_EXCEEDED_ERR = FileExceptionOffset + 10,
+ TYPE_MISMATCH_ERR = FileExceptionOffset + 11,
+ PATH_EXISTS_ERR = FileExceptionOffset + 12,
};
+ static int ErrorCodeToExceptionCode(int errorCode)
+ {
+ if (!errorCode)
+ return 0;
+ return errorCode + FileExceptionOffset;
+ }
+
private:
FileException(const ExceptionCodeDescription& description)
: ExceptionBase(description)
@@ -63,4 +81,3 @@ private:
#endif // ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
#endif // FileException_h
-
diff --git a/WebCore/fileapi/FileException.idl b/WebCore/fileapi/FileException.idl
index 0b2ab9c..10bd151 100644
--- a/WebCore/fileapi/FileException.idl
+++ b/WebCore/fileapi/FileException.idl
@@ -45,15 +45,17 @@ module html {
#endif
// FileExceptionCode
- const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
- const unsigned short NOT_FOUND_ERR = 8;
- const unsigned short INVALID_STATE_ERR = 11;
- const unsigned short SYNTAX_ERR = 12;
- const unsigned short INVALID_MODIFICATION_ERR = 13;
- const unsigned short SECURITY_ERR = 18;
- const unsigned short ABORT_ERR = 20;
- const unsigned short QUOTA_EXCEEDED_ERR = 22;
- const unsigned short NOT_READABLE_ERR = 24;
- const unsigned short ENCODING_ERR = 26;
+ const unsigned short NOT_FOUND_ERR = 1;
+ const unsigned short SECURITY_ERR = 2;
+ const unsigned short ABORT_ERR = 3;
+ const unsigned short NOT_READABLE_ERR = 4;
+ const unsigned short ENCODING_ERR = 5;
+ const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6;
+ const unsigned short INVALID_STATE_ERR = 7;
+ const unsigned short SYNTAX_ERR = 8;
+ const unsigned short INVALID_MODIFICATION_ERR = 9;
+ const unsigned short QUOTA_EXCEEDED_ERR = 10;
+ const unsigned short TYPE_MISMATCH_ERR = 11;
+ const unsigned short PATH_EXISTS_ERR = 12;
};
}
diff --git a/WebCore/fileapi/FileReader.cpp b/WebCore/fileapi/FileReader.cpp
index 0b7b46d..a54a337 100644
--- a/WebCore/fileapi/FileReader.cpp
+++ b/WebCore/fileapi/FileReader.cpp
@@ -34,21 +34,17 @@
#include "FileReader.h"
-#include "Base64.h"
+#include "ArrayBuffer.h"
#include "Blob.h"
-#include "BlobURL.h"
#include "CrossThreadTask.h"
#include "File.h"
#include "Logging.h"
#include "ProgressEvent.h"
-#include "ResourceError.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
#include "ScriptExecutionContext.h"
-#include "TextResourceDecoder.h"
-#include "ThreadableBlobRegistry.h"
-#include "ThreadableLoader.h"
#include <wtf/CurrentTime.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
namespace WebCore {
@@ -57,10 +53,7 @@ const double progressNotificationIntervalMS = 50;
FileReader::FileReader(ScriptExecutionContext* context)
: ActiveDOMObject(context, this)
, m_state(None)
- , m_readType(ReadFileAsBinaryString)
- , m_isRawDataConverted(false)
- , m_bytesLoaded(0)
- , m_totalBytes(0)
+ , m_readType(FileReaderLoader::ReadAsBinaryString)
, m_lastProgressNotificationTimeMS(0)
{
}
@@ -86,6 +79,16 @@ void FileReader::stop()
terminate();
}
+void FileReader::readAsArrayBuffer(Blob* blob)
+{
+ if (!blob)
+ return;
+
+ LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
+
+ readInternal(blob, FileReaderLoader::ReadAsArrayBuffer);
+}
+
void FileReader::readAsBinaryString(Blob* blob)
{
if (!blob)
@@ -93,7 +96,7 @@ void FileReader::readAsBinaryString(Blob* blob)
LOG(FileAPI, "FileReader: reading as binary: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
- readInternal(blob, ReadFileAsBinaryString);
+ readInternal(blob, FileReaderLoader::ReadAsBinaryString);
}
void FileReader::readAsText(Blob* blob, const String& encoding)
@@ -103,9 +106,8 @@ void FileReader::readAsText(Blob* blob, const String& encoding)
LOG(FileAPI, "FileReader: reading as text: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
- if (!encoding.isEmpty())
- m_encoding = TextEncoding(encoding);
- readInternal(blob, ReadFileAsText);
+ m_encoding = encoding;
+ readInternal(blob, FileReaderLoader::ReadAsText);
}
void FileReader::readAsDataURL(Blob* blob)
@@ -115,8 +117,7 @@ void FileReader::readAsDataURL(Blob* blob)
LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : "");
- m_fileType = blob->type();
- readInternal(blob, ReadFileAsDataURL);
+ readInternal(blob, FileReaderLoader::ReadAsDataURL);
}
static void delayedStart(ScriptExecutionContext*, FileReader* reader)
@@ -124,7 +125,7 @@ static void delayedStart(ScriptExecutionContext*, FileReader* reader)
reader->start();
}
-void FileReader::readInternal(Blob* blob, ReadType type)
+void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type)
{
// readAs*** methods() can be called multiple times. Only the last call before the actual reading happens is processed.
if (m_state != None && m_state != Starting)
@@ -138,14 +139,28 @@ void FileReader::readInternal(Blob* blob, ReadType type)
m_state = Starting;
}
+static void delayedAbort(ScriptExecutionContext*, FileReader* reader)
+{
+ reader->doAbort();
+}
+
void FileReader::abort()
{
LOG(FileAPI, "FileReader: aborting\n");
+ if (m_state == Aborting)
+ return;
+ m_state = Aborting;
+
+ // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stack.
+ scriptExecutionContext()->postTask(createCallbackTask(&delayedAbort, this));
+}
+
+void FileReader::doAbort()
+{
terminate();
- m_builder.clear();
- m_error = FileError::create(ABORT_ERR);
+ m_error = FileError::create(FileError::ABORT_ERR);
fireEvent(eventNames().errorEvent);
fireEvent(eventNames().abortEvent);
@@ -156,75 +171,29 @@ void FileReader::terminate()
{
if (m_loader) {
m_loader->cancel();
- cleanup();
+ m_loader = 0;
}
m_state = Completed;
}
-void FileReader::cleanup()
-{
- m_loader = 0;
- ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
- m_urlForReading = KURL();
-}
-
void FileReader::start()
{
m_state = Opening;
- // The blob is read by routing through the request handling layer given a temporary public url.
- m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext()->securityOrigin());
- ThreadableBlobRegistry::registerBlobURL(m_urlForReading, m_blob->url());
-
- ResourceRequest request(m_urlForReading);
- request.setHTTPMethod("GET");
-
- ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
- options.forcePreflight = false;
- options.allowCredentials = true;
- options.crossOriginRequestPolicy = DenyCrossOriginRequests;
-
- m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options);
+ m_loader = adoptPtr(new FileReaderLoader(m_readType, this));
+ m_loader->setEncoding(m_encoding);
+ m_loader->setDataType(m_blob->type());
+ m_loader->start(scriptExecutionContext(), m_blob.get());
}
-void FileReader::didReceiveResponse(const ResourceResponse& response)
+void FileReader::didStartLoading()
{
- if (response.httpStatusCode() != 200) {
- failed(response.httpStatusCode());
- return;
- }
-
m_state = Reading;
fireEvent(eventNames().loadstartEvent);
-
- m_totalBytes = response.expectedContentLength();
}
-void FileReader::didReceiveData(const char* data, int lengthReceived)
+void FileReader::didReceiveData()
{
- ASSERT(data && lengthReceived);
-
- // Bail out if we have aborted the reading.
- if (m_state == Completed)
- return;
-
- switch (m_readType) {
- case ReadFileAsBinaryString:
- m_builder.append(data, static_cast<unsigned>(lengthReceived));
- break;
- case ReadFileAsText:
- case ReadFileAsDataURL:
- m_rawData.append(data, static_cast<unsigned>(lengthReceived));
- m_isRawDataConverted = false;
- break;
- default:
- ASSERT_NOT_REACHED();
- }
-
- m_bytesLoaded += lengthReceived;
-
// Fire the progress event at least every 50ms.
double now = WTF::currentTimeMS();
if (!m_lastProgressNotificationTimeMS)
@@ -235,49 +204,33 @@ void FileReader::didReceiveData(const char* data, int lengthReceived)
}
}
-void FileReader::didFinishLoading(unsigned long)
+void FileReader::didFinishLoading()
{
m_state = Completed;
fireEvent(eventNames().loadEvent);
fireEvent(eventNames().loadendEvent);
-
- cleanup();
}
-void FileReader::didFail(const ResourceError&)
+void FileReader::didFail(int errorCode)
{
- // Treat as internal error.
- failed(500);
-}
+ // If we're aborting, do not proceed with normal error handling since it is covered in aborting code.
+ if (m_state == Aborting)
+ return;
-void FileReader::failed(int httpStatusCode)
-{
m_state = Completed;
- m_error = FileError::create(httpStatusCodeToExceptionCode(httpStatusCode));
+ m_error = FileError::create(static_cast<FileError::ErrorCode>(errorCode));
fireEvent(eventNames().errorEvent);
fireEvent(eventNames().loadendEvent);
-
- cleanup();
-}
-
-ExceptionCode FileReader::httpStatusCodeToExceptionCode(int httpStatusCode)
-{
- switch (httpStatusCode) {
- case 403:
- return SECURITY_ERR;
- case 404:
- return NOT_FOUND_ERR;
- default:
- return NOT_READABLE_ERR;
- }
}
void FileReader::fireEvent(const AtomicString& type)
{
// FIXME: the current ProgressEvent uses "unsigned long" for total and loaded attributes. Need to talk with the spec writer to resolve the issue.
- dispatchEvent(ProgressEvent::create(type, true, static_cast<unsigned>(m_bytesLoaded), static_cast<unsigned>(m_totalBytes)));
+ unsigned bytesLoaded = m_loader ? m_loader->bytesLoaded() : 0;
+ unsigned totalBytes = m_loader ? m_loader->totalBytes() : 0;
+ dispatchEvent(ProgressEvent::create(type, true, bytesLoaded, totalBytes));
}
FileReader::ReadyState FileReader::readyState() const
@@ -288,6 +241,7 @@ FileReader::ReadyState FileReader::readyState() const
return EMPTY;
case Opening:
case Reading:
+ case Aborting:
return LOADING;
case Completed:
return DONE;
@@ -296,65 +250,14 @@ FileReader::ReadyState FileReader::readyState() const
return EMPTY;
}
-String FileReader::result()
-{
- // If reading as binary string, we can return the result immediately.
- if (m_readType == ReadFileAsBinaryString)
- return m_builder.toString();
-
- // If we already convert the raw data received so far, we can return the result now.
- if (m_isRawDataConverted)
- return m_builder.toString();
- m_isRawDataConverted = true;
-
- if (m_readType == ReadFileAsText)
- convertToText();
- // For data URL, we only do the coversion until we receive all the raw data.
- else if (m_readType == ReadFileAsDataURL && m_state == Completed)
- convertToDataURL(m_rawData, m_fileType, m_builder);
-
- return m_builder.toString();
-}
-
-void FileReader::convertToText()
+PassRefPtr<ArrayBuffer> FileReader::arrayBufferResult() const
{
- if (!m_rawData.size()) {
- m_builder.clear();
- return;
- }
-
- // Decode the data.
- // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
- // requirement in order to be consistent with how WebKit decodes the web content: always has the BOM override the
- // provided encoding.
- // FIXME: consider supporting incremental decoding to improve the perf.
- if (!m_decoder)
- m_decoder = TextResourceDecoder::create("text/plain", m_encoding.isValid() ? m_encoding : UTF8Encoding());
- m_builder.clear();
- m_builder.append(m_decoder->decode(&m_rawData.at(0), m_rawData.size()));
-
- if (m_state == Completed && !m_error)
- m_builder.append(m_decoder->flush());
+ return m_loader ? m_loader->arrayBufferResult() : 0;
}
-void FileReader::convertToDataURL(const Vector<char>& rawData, const String& fileType, StringBuilder& builder)
+String FileReader::stringResult()
{
- builder.clear();
- builder.append("data:");
-
- if (!rawData.size())
- return;
-
- if (!fileType.isEmpty()) {
- builder.append(fileType);
- builder.append(";base64,");
- } else
- builder.append("base64,");
-
- Vector<char> out;
- base64Encode(rawData, out);
- out.append('\0');
- builder.append(out.data());
+ return m_loader ? m_loader->stringResult() : "";
}
} // namespace WebCore
diff --git a/WebCore/fileapi/FileReader.h b/WebCore/fileapi/FileReader.h
index f914dad..04513f3 100644
--- a/WebCore/fileapi/FileReader.h
+++ b/WebCore/fileapi/FileReader.h
@@ -36,24 +36,19 @@
#include "ActiveDOMObject.h"
#include "EventTarget.h"
#include "FileError.h"
-#include "KURL.h"
-#include "TextEncoding.h"
-#include "ThreadableLoaderClient.h"
-#include <wtf/PassRefPtr.h>
+#include "FileReaderLoader.h"
+#include "FileReaderLoaderClient.h"
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/StringBuilder.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
+class ArrayBuffer;
class Blob;
class ScriptExecutionContext;
-class TextResourceDecoder;
-class ThreadableLoader;
-class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public ThreadableLoaderClient {
+class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public FileReaderLoaderClient {
public:
static PassRefPtr<FileReader> create(ScriptExecutionContext* context)
{
@@ -68,20 +63,20 @@ public:
DONE = 2
};
+ void readAsArrayBuffer(Blob*);
void readAsBinaryString(Blob*);
void readAsText(Blob*, const String& encoding = "");
void readAsDataURL(Blob*);
void abort();
void start();
+ void doAbort();
ReadyState readyState() const;
PassRefPtr<FileError> error() { return m_error; }
- String result();
-
- // Helper methods, also used by FileReaderSync.
- static ExceptionCode httpStatusCodeToExceptionCode(int httpStatusCode);
- static void convertToDataURL(const Vector<char>& rawData, const String& fileType, StringBuilder&);
+ FileReaderLoader::ReadType readType() const { return m_readType; }
+ PassRefPtr<ArrayBuffer> arrayBufferResult() const;
+ String stringResult();
// ActiveDOMObject
virtual bool canSuspend() const;
@@ -92,11 +87,11 @@ public:
virtual FileReader* toFileReader() { return this; }
virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
- // ThreadableLoaderClient
- virtual void didReceiveResponse(const ResourceResponse&);
- virtual void didReceiveData(const char*, int);
- virtual void didFinishLoading(unsigned long identifier);
- virtual void didFail(const ResourceError&);
+ // FileReaderLoaderClient
+ virtual void didStartLoading();
+ virtual void didReceiveData();
+ virtual void didFinishLoading();
+ virtual void didFail(int errorCode);
using RefCounted<FileReader>::ref;
using RefCounted<FileReader>::deref;
@@ -109,16 +104,12 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(loadend);
private:
- enum ReadType {
- ReadFileAsBinaryString,
- ReadFileAsText,
- ReadFileAsDataURL
- };
enum InternalState {
None,
Starting,
Opening,
Reading,
+ Aborting,
Completed
};
@@ -131,38 +122,19 @@ private:
virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }
void terminate();
- void cleanup();
- void readInternal(Blob*, ReadType);
- void failed(int httpStatusCode);
+ void readInternal(Blob*, FileReaderLoader::ReadType);
void fireErrorEvent(int httpStatusCode);
void fireEvent(const AtomicString& type);
- void convertToText();
- void convertToDataURL();
InternalState m_state;
EventTargetData m_eventTargetData;
RefPtr<Blob> m_blob;
- KURL m_urlForReading;
- ReadType m_readType;
- TextEncoding m_encoding;
-
- StringBuilder m_builder;
-
- // The raw data. We have to keep track of all the raw data for it to be converted to text or data URL data.
- Vector<char> m_rawData;
- bool m_isRawDataConverted;
-
- // The decoder used to decode the text data.
- RefPtr<TextResourceDecoder> m_decoder;
-
- // Needed to create data URL.
- String m_fileType;
+ FileReaderLoader::ReadType m_readType;
+ String m_encoding;
- RefPtr<ThreadableLoader> m_loader;
+ OwnPtr<FileReaderLoader> m_loader;
RefPtr<FileError> m_error;
- long long m_bytesLoaded;
- long long m_totalBytes;
double m_lastProgressNotificationTimeMS;
};
diff --git a/WebCore/fileapi/FileReader.idl b/WebCore/fileapi/FileReader.idl
index febb231..ebc6ffd 100644
--- a/WebCore/fileapi/FileReader.idl
+++ b/WebCore/fileapi/FileReader.idl
@@ -44,6 +44,7 @@ module html {
readonly attribute unsigned short readyState;
// async read methods
+ void readAsArrayBuffer(in Blob blob);
void readAsBinaryString(in Blob blob);
void readAsText(in Blob blob, in [Optional] DOMString encoding);
void readAsDataURL(in Blob blob);
@@ -51,7 +52,7 @@ module html {
void abort();
// file data
- readonly attribute [ConvertScriptString] DOMString result;
+ readonly attribute [Custom] DOMObject result;
readonly attribute FileError error;
diff --git a/WebCore/fileapi/FileReaderLoader.cpp b/WebCore/fileapi/FileReaderLoader.cpp
new file mode 100644
index 0000000..dcd5860
--- /dev/null
+++ b/WebCore/fileapi/FileReaderLoader.cpp
@@ -0,0 +1,302 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(BLOB)
+
+#include "FileReaderLoader.h"
+
+#include "ArrayBuffer.h"
+#include "Base64.h"
+#include "Blob.h"
+#include "BlobURL.h"
+#include "FileReaderLoaderClient.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "ScriptExecutionContext.h"
+#include "TextResourceDecoder.h"
+#include "ThreadableBlobRegistry.h"
+#include "ThreadableLoader.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+FileReaderLoader::FileReaderLoader(ReadType readType, FileReaderLoaderClient* client)
+ : m_readType(readType)
+ , m_client(client)
+ , m_isRawDataConverted(false)
+ , m_stringResult("")
+ , m_bytesLoaded(0)
+ , m_totalBytes(0)
+ , m_errorCode(0)
+{
+}
+
+FileReaderLoader::~FileReaderLoader()
+{
+ terminate();
+ ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
+}
+
+void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blob* blob)
+{
+ // The blob is read by routing through the request handling layer given a temporary public url.
+ m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
+ ThreadableBlobRegistry::registerBlobURL(m_urlForReading, blob->url());
+
+ // Construct and load the request.
+ ResourceRequest request(m_urlForReading);
+ request.setHTTPMethod("GET");
+
+ ThreadableLoaderOptions options;
+ options.sendLoadCallbacks = true;
+ options.sniffContent = false;
+ options.forcePreflight = false;
+ options.allowCredentials = true;
+ options.crossOriginRequestPolicy = DenyCrossOriginRequests;
+
+ if (m_client)
+ m_loader = ThreadableLoader::create(scriptExecutionContext, this, request, options);
+ else
+ ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
+}
+
+void FileReaderLoader::cancel()
+{
+ m_errorCode = FileError::ABORT_ERR;
+ terminate();
+}
+
+void FileReaderLoader::terminate()
+{
+ if (m_loader) {
+ m_loader->cancel();
+ cleanup();
+ }
+}
+
+void FileReaderLoader::cleanup()
+{
+ m_loader = 0;
+
+ // If we get any error, we do not need to keep a buffer around.
+ if (m_errorCode) {
+ m_rawData = 0;
+ m_stringResult = "";
+ }
+}
+
+void FileReaderLoader::didReceiveResponse(const ResourceResponse& response)
+{
+ if (response.httpStatusCode() != 200) {
+ failed(httpStatusCodeToErrorCode(response.httpStatusCode()));
+ return;
+ }
+
+ // FIXME: Support reading more than the current size limit of ArrayBuffer.
+ if (static_cast<unsigned long long>(response.expectedContentLength()) > std::numeric_limits<unsigned>::max()) {
+ failed(FileError::NOT_READABLE_ERR);
+ return;
+ }
+ m_totalBytes = static_cast<unsigned>(response.expectedContentLength());
+
+ ASSERT(!m_rawData);
+ m_rawData = ArrayBuffer::create(static_cast<unsigned>(m_totalBytes), 1);
+
+ if (m_client)
+ m_client->didStartLoading();
+}
+
+void FileReaderLoader::didReceiveData(const char* data, int lengthReceived)
+{
+ ASSERT(data && lengthReceived > 0);
+
+ // Bail out if we encounter an error.
+ if (m_errorCode)
+ return;
+
+ memcpy(static_cast<char*>(m_rawData->data()) + static_cast<unsigned>(m_bytesLoaded), data, static_cast<unsigned>(lengthReceived));
+ m_bytesLoaded += static_cast<unsigned>(lengthReceived);
+
+ m_isRawDataConverted = false;
+
+ if (m_client)
+ m_client->didReceiveData();
+}
+
+void FileReaderLoader::didFinishLoading(unsigned long)
+{
+ cleanup();
+ if (m_client)
+ m_client->didFinishLoading();
+}
+
+void FileReaderLoader::didFail(const ResourceError&)
+{
+ // If we're aborting, do not proceed with normal error handling since it is covered in aborting code.
+ if (m_errorCode == FileError::ABORT_ERR)
+ return;
+
+ failed(FileError::NOT_READABLE_ERR);
+}
+
+void FileReaderLoader::failed(int errorCode)
+{
+ m_errorCode = errorCode;
+ cleanup();
+ if (m_client)
+ m_client->didFail(m_errorCode);
+}
+
+FileError::ErrorCode FileReaderLoader::httpStatusCodeToErrorCode(int httpStatusCode)
+{
+ switch (httpStatusCode) {
+ case 403:
+ return FileError::SECURITY_ERR;
+ case 404:
+ return FileError::NOT_FOUND_ERR;
+ default:
+ return FileError::NOT_READABLE_ERR;
+ }
+}
+
+PassRefPtr<ArrayBuffer> FileReaderLoader::arrayBufferResult() const
+{
+ ASSERT(m_readType == ReadAsArrayBuffer);
+
+ // If the loading is not started or an error occurs, return an empty result.
+ if (!m_rawData || m_errorCode)
+ return 0;
+
+ // If completed, we can simply return our buffer.
+ if (isCompleted())
+ return m_rawData;
+
+ // Otherwise, return a copy.
+ return ArrayBuffer::create(m_rawData.get());
+}
+
+String FileReaderLoader::stringResult()
+{
+ ASSERT(m_readType != ReadAsArrayBuffer);
+
+ // If the loading is not started or an error occurs, return an empty result.
+ if (!m_rawData || m_errorCode)
+ return m_stringResult;
+
+ // If already converted from the raw data, return the result now.
+ if (m_isRawDataConverted)
+ return m_stringResult;
+
+ switch (m_readType) {
+ case ReadAsArrayBuffer:
+ // No conversion is needed.
+ break;
+ case ReadAsBinaryString:
+ m_stringResult = String(static_cast<const char*>(m_rawData->data()), m_bytesLoaded);
+ break;
+ case ReadAsText:
+ convertToText();
+ break;
+ case ReadAsDataURL:
+ // Partial data is not supported when reading as data URL.
+ if (isCompleted())
+ convertToDataURL();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ return m_stringResult;
+}
+
+void FileReaderLoader::convertToText()
+{
+ if (!m_bytesLoaded)
+ return;
+
+ // Decode the data.
+ // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
+ // requirement in order to be consistent with how WebKit decodes the web content: always has the BOM override the
+ // provided encoding.
+ // FIXME: consider supporting incremental decoding to improve the perf.
+ StringBuilder builder;
+ if (!m_decoder)
+ m_decoder = TextResourceDecoder::create("text/plain", m_encoding.isValid() ? m_encoding : UTF8Encoding());
+ builder.append(m_decoder->decode(static_cast<const char*>(m_rawData->data()), m_bytesLoaded));
+
+ if (isCompleted())
+ builder.append(m_decoder->flush());
+
+ m_stringResult = builder.toString();
+}
+
+void FileReaderLoader::convertToDataURL()
+{
+ StringBuilder builder;
+ builder.append("data:");
+
+ if (!m_bytesLoaded) {
+ m_stringResult = builder.toString();
+ return;
+ }
+
+ if (!m_dataType.isEmpty()) {
+ builder.append(m_dataType);
+ builder.append(";base64,");
+ } else
+ builder.append("base64,");
+
+ Vector<char> out;
+ base64Encode(static_cast<const char*>(m_rawData->data()), m_bytesLoaded, out);
+ out.append('\0');
+ builder.append(out.data());
+
+ m_stringResult = builder.toString();
+}
+
+bool FileReaderLoader::isCompleted() const
+{
+ return m_bytesLoaded == m_totalBytes;
+}
+
+void FileReaderLoader::setEncoding(const String& encoding)
+{
+ if (!encoding.isEmpty())
+ m_encoding = TextEncoding(encoding);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
diff --git a/WebCore/fileapi/FileReaderLoader.h b/WebCore/fileapi/FileReaderLoader.h
new file mode 100644
index 0000000..a15ee01
--- /dev/null
+++ b/WebCore/fileapi/FileReaderLoader.h
@@ -0,0 +1,119 @@
+/*
+ * 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 FileReaderLoader_h
+#define FileReaderLoader_h
+
+#if ENABLE(BLOB)
+
+#include "FileError.h"
+#include "KURL.h"
+#include "TextEncoding.h"
+#include "ThreadableLoaderClient.h"
+#include <wtf/Forward.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class ArrayBuffer;
+class Blob;
+class FileReaderLoaderClient;
+class ScriptExecutionContext;
+class TextResourceDecoder;
+class ThreadableLoader;
+
+class FileReaderLoader : public ThreadableLoaderClient {
+public:
+ enum ReadType {
+ ReadAsArrayBuffer,
+ ReadAsBinaryString,
+ ReadAsText,
+ ReadAsDataURL
+ };
+
+ // If client is given, do the loading asynchronously. Otherwise, load synchronously.
+ FileReaderLoader(ReadType, FileReaderLoaderClient*);
+ ~FileReaderLoader();
+
+ void start(ScriptExecutionContext*, Blob*);
+ void cancel();
+
+ // ThreadableLoaderClient
+ virtual void didReceiveResponse(const ResourceResponse&);
+ virtual void didReceiveData(const char*, int);
+ virtual void didFinishLoading(unsigned long identifier);
+ virtual void didFail(const ResourceError&);
+
+ String stringResult();
+ PassRefPtr<ArrayBuffer> arrayBufferResult() const;
+ unsigned bytesLoaded() const { return m_bytesLoaded; }
+ unsigned totalBytes() const { return m_totalBytes; }
+ int errorCode() const { return m_errorCode; }
+
+ void setEncoding(const String&);
+ void setDataType(const String& dataType) { m_dataType = dataType; }
+
+private:
+ void terminate();
+ void cleanup();
+ void failed(int errorCode);
+ void convertToText();
+ void convertToDataURL();
+
+ bool isCompleted() const;
+
+ static FileError::ErrorCode httpStatusCodeToErrorCode(int);
+
+ ReadType m_readType;
+ FileReaderLoaderClient* m_client;
+ TextEncoding m_encoding;
+ String m_dataType;
+
+ KURL m_urlForReading;
+ RefPtr<ThreadableLoader> m_loader;
+
+ RefPtr<ArrayBuffer> m_rawData;
+ bool m_isRawDataConverted;
+
+ String m_stringResult;
+
+ // The decoder used to decode the text data.
+ RefPtr<TextResourceDecoder> m_decoder;
+
+ unsigned m_bytesLoaded;
+ unsigned m_totalBytes;
+ int m_errorCode;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
+
+#endif // FileReaderLoader_h
diff --git a/WebCore/fileapi/FileReaderLoaderClient.h b/WebCore/fileapi/FileReaderLoaderClient.h
new file mode 100644
index 0000000..4acb8ad
--- /dev/null
+++ b/WebCore/fileapi/FileReaderLoaderClient.h
@@ -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.
+ */
+
+#ifndef FileReaderLoaderClient_h
+#define FileReaderLoaderClient_h
+
+#if ENABLE(BLOB)
+
+namespace WebCore {
+
+class FileReaderLoaderClient {
+public:
+ virtual ~FileReaderLoaderClient() {}
+
+ virtual void didStartLoading() = 0;
+ virtual void didReceiveData() = 0;
+ virtual void didFinishLoading() = 0;
+ virtual void didFail(int errorCode) = 0;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
+
+#endif // FileReaderLoaderClient_h
diff --git a/WebCore/fileapi/FileReaderSync.cpp b/WebCore/fileapi/FileReaderSync.cpp
index 6425bcf..85e7f52 100644
--- a/WebCore/fileapi/FileReaderSync.cpp
+++ b/WebCore/fileapi/FileReaderSync.cpp
@@ -34,161 +34,66 @@
#include "FileReaderSync.h"
-#include "Base64.h"
+#include "ArrayBuffer.h"
#include "Blob.h"
#include "BlobURL.h"
-#include "FileReader.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
-#include "ScriptExecutionContext.h"
-#include "TextEncoding.h"
-#include "TextResourceDecoder.h"
-#include "ThreadableBlobRegistry.h"
-#include "ThreadableLoader.h"
+#include "FileException.h"
+#include "FileReaderLoader.h"
+#include <wtf/PassRefPtr.h>
namespace WebCore {
-class FileReaderSyncLoader : public ThreadableLoaderClient {
-public:
- // If the output result is provided, use it. Otherwise, save it as the raw data.
- FileReaderSyncLoader(StringBuilder*);
-
- // Returns the http status code.
- void start(ScriptExecutionContext*, const ResourceRequest&, ExceptionCode&);
-
- // ThreadableLoaderClient
- virtual void didReceiveResponse(const ResourceResponse&);
- virtual void didReceiveData(const char*, int);
- virtual void didFinishLoading(unsigned long identifier);
- virtual void didFail(const ResourceError&);
-
- const Vector<char>& rawData() const { return m_rawData; }
-
-private:
- // The output result. The caller provides this in order to load the binary data directly.
- StringBuilder* m_builder;
-
- // The raw data. The caller does not provide the above output result and we need to save it here.
- Vector<char> m_rawData;
-
- int m_httpStatusCode;
-};
-
-FileReaderSyncLoader::FileReaderSyncLoader(StringBuilder* builder)
- : m_builder(builder)
- , m_httpStatusCode(0)
-{
-}
-
-void FileReaderSyncLoader::start(ScriptExecutionContext* scriptExecutionContext, const ResourceRequest& request, ExceptionCode& ec)
+FileReaderSync::FileReaderSync()
{
- ThreadableLoaderOptions options;
- options.sendLoadCallbacks = true;
- options.sniffContent = false;
- options.forcePreflight = false;
- options.allowCredentials = true;
- options.crossOriginRequestPolicy = DenyCrossOriginRequests;
-
- ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
-
- ec = (m_httpStatusCode == 200) ? 0 : FileReader::httpStatusCodeToExceptionCode(m_httpStatusCode);
}
-void FileReaderSyncLoader::didReceiveResponse(const ResourceResponse& response)
+PassRefPtr<ArrayBuffer> FileReaderSync::readAsArrayBuffer(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
- m_httpStatusCode = response.httpStatusCode();
-}
+ if (!blob)
+ return 0;
-void FileReaderSyncLoader::didReceiveData(const char* data, int lengthReceived)
-{
- if (m_builder)
- m_builder->append(data, static_cast<unsigned>(lengthReceived));
- else
- m_rawData.append(data, static_cast<unsigned>(lengthReceived));
-}
+ FileReaderLoader loader(FileReaderLoader::ReadAsArrayBuffer, 0);
+ startLoading(scriptExecutionContext, loader, blob, ec);
-void FileReaderSyncLoader::didFinishLoading(unsigned long)
-{
-}
-
-void FileReaderSyncLoader::didFail(const ResourceError&)
-{
- // Treat as internal error.
- m_httpStatusCode = 500;
+ return loader.arrayBufferResult();
}
String FileReaderSync::readAsBinaryString(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
if (!blob)
- return m_builder.toString();
+ return String();
- read(scriptExecutionContext, blob, ReadAsBinaryString, ec);
- return m_builder.toString();
+ FileReaderLoader loader(FileReaderLoader::ReadAsBinaryString, 0);
+ startLoading(scriptExecutionContext, loader, blob, ec);
+ return loader.stringResult();
}
String FileReaderSync::readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, const String& encoding, ExceptionCode& ec)
{
if (!blob)
- return m_builder.toString();
+ return String();
- m_encoding = encoding;
- read(scriptExecutionContext, blob, ReadAsText, ec);
- return m_builder.toString();
+ FileReaderLoader loader(FileReaderLoader::ReadAsText, 0);
+ loader.setEncoding(encoding);
+ startLoading(scriptExecutionContext, loader, blob, ec);
+ return loader.stringResult();
}
String FileReaderSync::readAsDataURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
if (!blob)
- return m_builder.toString();
+ return String();
- read(scriptExecutionContext, blob, ReadAsDataURL, ec);
- return m_builder.toString();
-}
-
-void FileReaderSync::read(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ReadType readType, ExceptionCode& ec)
-{
- // The blob is read by routing through the request handling layer given the temporary public url.
- KURL urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
- ThreadableBlobRegistry::registerBlobURL(urlForReading, blob->url());
-
- ResourceRequest request(urlForReading);
- request.setHTTPMethod("GET");
-
- FileReaderSyncLoader loader((readType == ReadAsBinaryString) ? &m_builder : 0);
- loader.start(scriptExecutionContext, request, ec);
- ThreadableBlobRegistry::unregisterBlobURL(urlForReading);
- if (ec)
- return;
-
- switch (readType) {
- case ReadAsBinaryString:
- // Nothing to do since we need no conversion.
- return;
- case ReadAsText:
- convertToText(loader.rawData().data(), loader.rawData().size(), m_builder);
- return;
- case ReadAsDataURL:
- FileReader::convertToDataURL(loader.rawData(), blob->type(), m_builder);
- return;
- }
-
- ASSERT_NOT_REACHED();
+ FileReaderLoader loader(FileReaderLoader::ReadAsDataURL, 0);
+ loader.setDataType(blob->type());
+ startLoading(scriptExecutionContext, loader, blob, ec);
+ return loader.stringResult();
}
-void FileReaderSync::convertToText(const char* data, int size, StringBuilder& builder)
+void FileReaderSync::startLoading(ScriptExecutionContext* scriptExecutionContext, FileReaderLoader& loader, Blob* blob, ExceptionCode& ec)
{
- if (!size)
- return;
-
- // Decode the data.
- // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
- // requirement in order to be consistent with how WebKit decodes the web content: always have the BOM override the
- // provided encoding.
- // FIXME: consider supporting incremental decoding to improve the perf.
- RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", m_encoding.isEmpty() ? UTF8Encoding() : TextEncoding(m_encoding));
- builder.clear();
- builder.append(decoder->decode(data, size));
- builder.append(decoder->flush());
+ loader.start(scriptExecutionContext, blob);
+ ec = FileException::ErrorCodeToExceptionCode(loader.errorCode());
}
} // namespace WebCore
diff --git a/WebCore/fileapi/FileReaderSync.h b/WebCore/fileapi/FileReaderSync.h
index cb0e00d..79b637f 100644
--- a/WebCore/fileapi/FileReaderSync.h
+++ b/WebCore/fileapi/FileReaderSync.h
@@ -34,13 +34,15 @@
#if ENABLE(BLOB)
#include "ExceptionCode.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
-#include <wtf/text/StringBuilder.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
+class ArrayBuffer;
class Blob;
+class FileReaderLoader;
class ScriptExecutionContext;
class FileReaderSync : public RefCounted<FileReaderSync> {
@@ -52,6 +54,7 @@ public:
virtual ~FileReaderSync() { }
+ PassRefPtr<ArrayBuffer> readAsArrayBuffer(ScriptExecutionContext*, Blob*, ExceptionCode&);
String readAsBinaryString(ScriptExecutionContext*, Blob*, ExceptionCode&);
String readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
{
@@ -61,20 +64,9 @@ public:
String readAsDataURL(ScriptExecutionContext*, Blob*, ExceptionCode&);
private:
- enum ReadType {
- ReadAsBinaryString,
- ReadAsText,
- ReadAsDataURL
- };
+ FileReaderSync();
- FileReaderSync() { }
-
- void read(ScriptExecutionContext*, Blob*, ReadType, ExceptionCode&);
- void convertToText(const char* data, int size, StringBuilder&);
-
- StringBuilder m_builder;
-
- String m_encoding;
+ void startLoading(ScriptExecutionContext*, FileReaderLoader&, Blob*, ExceptionCode&);
};
} // namespace WebCore
diff --git a/WebCore/fileapi/FileReaderSync.idl b/WebCore/fileapi/FileReaderSync.idl
index 72818b1..381d483 100644
--- a/WebCore/fileapi/FileReaderSync.idl
+++ b/WebCore/fileapi/FileReaderSync.idl
@@ -34,6 +34,8 @@ module html {
CanBeConstructed,
NoStaticTables
] FileReaderSync {
+ [CallWith=ScriptExecutionContext] ArrayBuffer readAsArrayBuffer(in Blob blob)
+ raises(FileException);
[CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsBinaryString(in Blob blob)
raises(FileException);
[CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsText(in Blob blob, in [Optional] DOMString encoding)
diff --git a/WebCore/fileapi/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp
index e5f404e..6644589 100644
--- a/WebCore/fileapi/FileSystemCallbacks.cpp
+++ b/WebCore/fileapi/FileSystemCallbacks.cpp
@@ -43,9 +43,9 @@
#include "EntryArray.h"
#include "EntryCallback.h"
#include "ErrorCallback.h"
-#include "ExceptionCode.h"
#include "FileEntry.h"
#include "FileError.h"
+#include "FileMetadata.h"
#include "FileSystemCallback.h"
#include "FileWriter.h"
#include "FileWriterCallback.h"
@@ -77,7 +77,7 @@ void FileSystemCallbacksBase::didOpenFileSystem(const String&, PassOwnPtr<AsyncF
ASSERT_NOT_REACHED();
}
-void FileSystemCallbacksBase::didReadMetadata(double)
+void FileSystemCallbacksBase::didReadMetadata(const FileMetadata&)
{
// Each subclass must implement an appropriate one.
ASSERT_NOT_REACHED();
@@ -104,19 +104,19 @@ void FileSystemCallbacksBase::didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, l
void FileSystemCallbacksBase::didFail(int code)
{
if (m_errorCallback) {
- m_errorCallback->handleEvent(FileError::create(code).get());
+ m_errorCallback->handleEvent(FileError::create(static_cast<FileError::ErrorCode>(code)).get());
m_errorCallback.clear();
}
}
// EntryCallbacks -------------------------------------------------------------
-PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem, const String& expectedPath, bool isDirectory)
+PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
{
return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory));
}
-EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem, const String& expectedPath, bool isDirectory)
+EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
, m_fileSystem(fileSystem)
@@ -138,12 +138,12 @@ void EntryCallbacks::didSucceed()
// EntriesCallbacks -----------------------------------------------------------
-PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase* directoryReader, const String& basePath)
+PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
{
return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, directoryReader, basePath));
}
-EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase* directoryReader, const String& basePath)
+EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
: FileSystemCallbacksBase(errorCallback)
, m_successCallback(successCallback)
, m_directoryReader(directoryReader)
@@ -205,10 +205,10 @@ MetadataCallbacks::MetadataCallbacks(PassRefPtr<MetadataCallback> successCallbac
{
}
-void MetadataCallbacks::didReadMetadata(double modificationTime)
+void MetadataCallbacks::didReadMetadata(const FileMetadata& metadata)
{
if (m_successCallback)
- m_successCallback->handleEvent(Metadata::create(modificationTime).get());
+ m_successCallback->handleEvent(Metadata::create(metadata.modificationTime).get());
m_successCallback.clear();
}
diff --git a/WebCore/fileapi/FileSystemCallbacks.h b/WebCore/fileapi/FileSystemCallbacks.h
index c600a76..100fd0c 100644
--- a/WebCore/fileapi/FileSystemCallbacks.h
+++ b/WebCore/fileapi/FileSystemCallbacks.h
@@ -47,6 +47,7 @@ class ErrorCallback;
class EntriesCallback;
class EntryArray;
class EntryCallback;
+struct FileMetadata;
class FileSystemCallback;
class FileWriter;
class FileWriterCallback;
@@ -65,7 +66,7 @@ public:
virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);
// For MetadataCallbacks.
- virtual void didReadMetadata(double modificationTime);
+ virtual void didReadMetadata(const FileMetadata&);
// For EntriesCallbacks. didReadDirectoryEntry is called each time the API reads an entry, and didReadDirectoryDone is called when a chunk of entries have been read (i.e. good time to call back to the application). If hasMore is true there can be more chunks.
virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
@@ -86,27 +87,27 @@ protected:
class EntryCallbacks : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);
+ static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
virtual void didSucceed();
private:
- EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);
+ EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
RefPtr<EntryCallback> m_successCallback;
- DOMFileSystemBase* m_fileSystem;
+ RefPtr<DOMFileSystemBase> m_fileSystem;
String m_expectedPath;
bool m_isDirectory;
};
class EntriesCallbacks : public FileSystemCallbacksBase {
public:
- static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);
+ static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
virtual void didReadDirectoryEntries(bool hasMore);
private:
- EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);
+ EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
RefPtr<EntriesCallback> m_successCallback;
- DirectoryReaderBase* m_directoryReader;
+ RefPtr<DirectoryReaderBase> m_directoryReader;
String m_basePath;
RefPtr<EntryArray> m_entries;
};
@@ -125,7 +126,7 @@ private:
class MetadataCallbacks : public FileSystemCallbacksBase {
public:
static PassOwnPtr<MetadataCallbacks> create(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
- virtual void didReadMetadata(double modificationTime);
+ virtual void didReadMetadata(const FileMetadata&);
private:
MetadataCallbacks(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp
index bc76984..7775709 100644
--- a/WebCore/fileapi/FileWriter.cpp
+++ b/WebCore/fileapi/FileWriter.cpp
@@ -38,6 +38,7 @@
#include "Blob.h"
#include "ExceptionCode.h"
#include "FileError.h"
+#include "FileException.h"
#include "ProgressEvent.h"
namespace WebCore {
@@ -90,13 +91,11 @@ void FileWriter::write(Blob* data, ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState == WRITING) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
if (!data) {
- ec = TYPE_MISMATCH_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::TYPE_MISMATCH_ERR, ec);
return;
}
@@ -112,8 +111,7 @@ void FileWriter::seek(long long position, ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState == WRITING) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
@@ -132,8 +130,7 @@ void FileWriter::truncate(long long position, ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState == WRITING || position < 0) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
m_readyState = WRITING;
@@ -147,12 +144,11 @@ void FileWriter::abort(ExceptionCode& ec)
{
ASSERT(m_writer);
if (m_readyState != WRITING) {
- ec = INVALID_STATE_ERR;
- m_error = FileError::create(ec);
+ setError(FileError::INVALID_STATE_ERR, ec);
return;
}
-
- m_error = FileError::create(ABORT_ERR);
+
+ m_error = FileError::create(FileError::ABORT_ERR);
m_writer->abort();
}
@@ -191,11 +187,11 @@ void FileWriter::didTruncate()
fireEvent(eventNames().writeendEvent);
}
-void FileWriter::didFail(ExceptionCode ec)
+void FileWriter::didFail(FileError::ErrorCode code)
{
- m_error = FileError::create(ec);
+ m_error = FileError::create(code);
fireEvent(eventNames().errorEvent);
- if (ABORT_ERR == ec)
+ if (FileError::ABORT_ERR == code)
fireEvent(eventNames().abortEvent);
fireEvent(eventNames().errorEvent);
m_blobBeingWritten.clear();
@@ -209,6 +205,12 @@ void FileWriter::fireEvent(const AtomicString& type)
dispatchEvent(ProgressEvent::create(type, true, static_cast<unsigned>(m_bytesWritten), static_cast<unsigned>(m_bytesToWrite)));
}
+void FileWriter::setError(FileError::ErrorCode errorCode, ExceptionCode& ec)
+{
+ ec = FileException::ErrorCodeToExceptionCode(errorCode);
+ m_error = FileError::create(errorCode);
+}
+
} // namespace WebCore
-
+
#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/FileWriter.h b/WebCore/fileapi/FileWriter.h
index 454081c..0e884ea 100644
--- a/WebCore/fileapi/FileWriter.h
+++ b/WebCore/fileapi/FileWriter.h
@@ -77,7 +77,7 @@ public:
// AsyncFileWriterClient
void didWrite(long long bytes, bool complete);
void didTruncate();
- void didFail(ExceptionCode ec);
+ void didFail(FileError::ErrorCode);
// ActiveDOMObject
virtual bool canSuspend() const;
@@ -97,7 +97,7 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend);
-
+
private:
FileWriter(ScriptExecutionContext*);
@@ -113,6 +113,8 @@ private:
void fireEvent(const AtomicString& type);
+ void setError(FileError::ErrorCode, ExceptionCode&);
+
RefPtr<FileError> m_error;
EventTargetData m_eventTargetData;
OwnPtr<AsyncFileWriter> m_writer;
diff --git a/WebCore/fileapi/SyncCallbackHelper.h b/WebCore/fileapi/SyncCallbackHelper.h
index 1612e93..25e6739 100644
--- a/WebCore/fileapi/SyncCallbackHelper.h
+++ b/WebCore/fileapi/SyncCallbackHelper.h
@@ -41,6 +41,7 @@
#include "ExceptionCode.h"
#include "FileEntry.h"
#include "FileError.h"
+#include "FileException.h"
#include "FileSystemCallback.h"
#include "MetadataCallback.h"
#include "VoidCallback.h"
@@ -64,7 +65,7 @@ public:
: m_observer(observer)
, m_successCallback(SuccessCallbackImpl::create(this))
, m_errorCallback(ErrorCallbackImpl::create(this))
- , m_error(0)
+ , m_exceptionCode(0)
, m_completed(false)
{
}
@@ -74,12 +75,12 @@ public:
if (m_observer) {
while (!m_completed) {
if (!m_observer->waitForOperationToComplete()) {
- m_error = ABORT_ERR;
+ m_exceptionCode = FileException::ABORT_ERR;
break;
}
}
}
- ec = m_error;
+ ec = m_exceptionCode;
return m_result.release();
}
@@ -138,9 +139,9 @@ private:
friend class SuccessCallbackImpl;
friend class ErrorCallbackImpl;
- void setError(ExceptionCode ec)
+ void setError(int code)
{
- m_error = ec;
+ m_exceptionCode = FileException::ErrorCodeToExceptionCode(code);
m_completed = true;
}
@@ -154,7 +155,7 @@ private:
RefPtr<SuccessCallbackImpl> m_successCallback;
RefPtr<ErrorCallbackImpl> m_errorCallback;
RefPtr<ResultType> m_result;
- ExceptionCode m_error;
+ ExceptionCode m_exceptionCode;
bool m_completed;
};
diff --git a/WebCore/history/BackForwardList.h b/WebCore/history/BackForwardList.h
index 861b43b..b622a9d 100644
--- a/WebCore/history/BackForwardList.h
+++ b/WebCore/history/BackForwardList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
* Copyright (C) 2009 Google, Inc. All rights reserved.
*
@@ -36,8 +36,16 @@ namespace WebCore {
class HistoryItem;
+// FIXME: Remove this and rely on the typedef in BackForwardListImpl
+// instead, after removing the virtual functions at the bottom
+// of this class.
typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
+// FIXME: Move this class out of this file and into BackForwardListImpl.
+// FIXME: Consider replacing this BackForwardListClient concept with a
+// function that creates a BackForwardList object. The functions in
+// BackForwardList are now almost identical to this, and there is no
+// need for the extra level of indirection.
#if PLATFORM(CHROMIUM)
// In the Chromium port, the back/forward list is managed externally.
// See BackForwardListChromium.cpp
@@ -46,7 +54,6 @@ public:
virtual ~BackForwardListClient() {}
virtual void addItem(PassRefPtr<HistoryItem>) = 0;
virtual void goToItem(HistoryItem*) = 0;
- virtual HistoryItem* currentItem() = 0;
virtual HistoryItem* itemAtIndex(int) = 0;
virtual int backListCount() = 0;
virtual int forwardListCount() = 0;
@@ -54,50 +61,63 @@ public:
};
#endif
+// FIXME: Rename this class to BackForwardClient, and rename the
+// getter in Page accordingly.
class BackForwardList : public RefCounted<BackForwardList> {
public:
virtual ~BackForwardList()
{
}
- virtual bool isBackForwardListImpl() const { return false; }
-
+ // FIXME: Move this function to BackForwardListImpl, or eliminate
+ // it (see comment at definition of BackForwardListClient class).
#if PLATFORM(CHROMIUM)
// Must be called before any other methods.
virtual void setClient(BackForwardListClient*) = 0;
#endif
virtual void addItem(PassRefPtr<HistoryItem>) = 0;
- virtual void goBack() = 0;
- virtual void goForward() = 0;
+
virtual void goToItem(HistoryItem*) = 0;
- virtual HistoryItem* backItem() = 0;
- virtual HistoryItem* currentItem() = 0;
- virtual HistoryItem* forwardItem() = 0;
virtual HistoryItem* itemAtIndex(int) = 0;
-
- virtual void backListWithLimit(int, HistoryItemVector&) = 0;
- virtual void forwardListWithLimit(int, HistoryItemVector&) = 0;
-
- virtual int capacity() = 0;
- virtual void setCapacity(int) = 0;
- virtual bool enabled() = 0;
- virtual void setEnabled(bool) = 0;
virtual int backListCount() = 0;
virtual int forwardListCount() = 0;
- virtual bool containsItem(HistoryItem*) = 0;
+
+ virtual bool isActive() = 0;
virtual void close() = 0;
- virtual bool closed() = 0;
-
- virtual void removeItem(HistoryItem*) = 0;
- virtual HistoryItemVector& entries() = 0;
-
+
+ // FIXME: Rename this to just "clear" and change it so it's not
+ // WML-specific. This is the same operation as clearBackForwardList
+ // in the layout test controller; it would be reasonable to have it
+ // here even though HTML DOM interfaces don't require it.
#if ENABLE(WML)
virtual void clearWMLPageHistory() = 0;
#endif
+ HistoryItem* backItem() { return itemAtIndex(-1); }
+ HistoryItem* currentItem() { return itemAtIndex(0); }
+ HistoryItem* forwardItem() { return itemAtIndex(1); }
+
+ // FIXME: Remove these functions once all call sites are calling them
+ // directly on BackForwardListImpl instead of on BackForwardList.
+ // There is no need for any of these to be virtual functions and no
+ // need to implement them in classes other than BackForwardListImpl.
+ // Also remove the HistoryItemVector typedef in this file once this is done.
+ virtual void goBack() { }
+ virtual void goForward() { }
+ virtual void backListWithLimit(int, HistoryItemVector&) { }
+ virtual void forwardListWithLimit(int, HistoryItemVector&) { }
+ virtual int capacity() { return 0; }
+ virtual void setCapacity(int) { }
+ virtual bool enabled() { return false; }
+ virtual void setEnabled(bool) { }
+ virtual bool containsItem(HistoryItem*) { return false; }
+ virtual bool closed() { return false; }
+ virtual void removeItem(HistoryItem*) { }
+ virtual HistoryItemVector& entries() { HistoryItemVector* bogus = 0; return *bogus; }
+
protected:
BackForwardList()
{
diff --git a/WebCore/history/BackForwardListChromium.cpp b/WebCore/history/BackForwardListChromium.cpp
index dc1efc9..a22a147 100644
--- a/WebCore/history/BackForwardListChromium.cpp
+++ b/WebCore/history/BackForwardListChromium.cpp
@@ -64,23 +64,6 @@ void BackForwardListImpl::goToItem(HistoryItem* item)
m_client->goToItem(item);
}
-HistoryItem* BackForwardListImpl::backItem()
-{
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-HistoryItem* BackForwardListImpl::forwardItem()
-{
- ASSERT_NOT_REACHED();
- return 0;
-}
-
-HistoryItem* BackForwardListImpl::currentItem()
-{
- return m_client->currentItem();
-}
-
int BackForwardListImpl::capacity()
{
return m_capacity;
diff --git a/WebCore/history/BackForwardListImpl.h b/WebCore/history/BackForwardListImpl.h
index ab92710..2f08cfe 100644
--- a/WebCore/history/BackForwardListImpl.h
+++ b/WebCore/history/BackForwardListImpl.h
@@ -33,35 +33,34 @@
namespace WebCore {
-class HistoryItem;
class Page;
typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;
+// FIXME: After renaming BackForwardList to BackForwardClient,
+// rename this to BackForwardList.
class BackForwardListImpl : public BackForwardList {
public:
static PassRefPtr<BackForwardListImpl> create(Page* page) { return adoptRef(new BackForwardListImpl(page)); }
- ~BackForwardListImpl();
-
- bool isBackForwardListImpl() const { return true; }
+ virtual ~BackForwardListImpl();
#if PLATFORM(CHROMIUM)
// Must be called before any other methods.
- void setClient(BackForwardListClient* client) { m_client = client; }
+ virtual void setClient(BackForwardListClient* client) { m_client = client; }
#endif
Page* page() { return m_page; }
- void addItem(PassRefPtr<HistoryItem>);
+ virtual void addItem(PassRefPtr<HistoryItem>);
void goBack();
void goForward();
- void goToItem(HistoryItem*);
+ virtual void goToItem(HistoryItem*);
HistoryItem* backItem();
HistoryItem* currentItem();
HistoryItem* forwardItem();
- HistoryItem* itemAtIndex(int);
+ virtual HistoryItem* itemAtIndex(int);
void backListWithLimit(int, HistoryItemVector&);
void forwardListWithLimit(int, HistoryItemVector&);
@@ -70,23 +69,25 @@ public:
void setCapacity(int);
bool enabled();
void setEnabled(bool);
- int backListCount();
- int forwardListCount();
+ virtual int backListCount();
+ virtual int forwardListCount();
bool containsItem(HistoryItem*);
- void close();
+ virtual void close();
bool closed();
void removeItem(HistoryItem*);
HistoryItemVector& entries();
#if ENABLE(WML)
- void clearWMLPageHistory();
+ virtual void clearWMLPageHistory();
#endif
private:
BackForwardListImpl(Page*);
-
+
+ virtual bool isActive() { return enabled() && capacity(); }
+
Page* m_page;
#if PLATFORM(CHROMIUM)
BackForwardListClient* m_client;
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index 470e03f..a3ef401 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -115,6 +115,8 @@ void CachedFrameBase::restore()
if (m_document->hasListenerType(Document::TOUCH_LISTENER))
m_document->page()->chrome()->client()->needTouchEvents(true);
#endif
+
+ m_document->documentDidBecomeActive();
}
CachedFrame::CachedFrame(Frame* frame)
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index fedc1e3..30c3b42 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -192,12 +192,8 @@ static void logCanCachePageDecision(Page* page)
bool cannotCache = !logCanCacheFrameDecision(page->mainFrame(), 1);
FrameLoadType loadType = page->mainFrame()->loader()->loadType();
- if (!page->backForwardList()->enabled()) {
- PCLOG(" -The back/forward list is disabled");
- cannotCache = true;
- }
- if (!(page->backForwardList()->capacity() > 0)) {
- PCLOG(" -The back/forward list has a 0 capacity");
+ if (!page->backForwardList()->isActive()) {
+ PCLOG(" -The back/forward list is disabled or has 0 capacity");
cannotCache = true;
}
if (!page->settings()->usesPageCache()) {
@@ -307,8 +303,7 @@ bool PageCache::canCache(Page* page)
FrameLoadType loadType = page->mainFrame()->loader()->loadType();
return canCachePageContainingThisFrame(page->mainFrame())
- && page->backForwardList()->enabled()
- && page->backForwardList()->capacity() > 0
+ && page->backForwardList()->isActive()
&& page->settings()->usesPageCache()
#if ENABLE(DEVICE_ORIENTATION)
&& !(page->deviceMotionController() && page->deviceMotionController()->isActive())
diff --git a/WebCore/html/BaseButtonInputType.cpp b/WebCore/html/BaseButtonInputType.cpp
new file mode 100644
index 0000000..fd6a8ff
--- /dev/null
+++ b/WebCore/html/BaseButtonInputType.cpp
@@ -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.
+ */
+
+#include "config.h"
+#include "BaseButtonInputType.h"
+
+#include "HTMLInputElement.h"
+#include "RenderButton.h"
+
+namespace WebCore {
+
+bool BaseButtonInputType::appendFormData(FormDataList&, bool) const
+{
+ // Buttons except overridden types are never successful.
+ return false;
+}
+
+RenderObject* BaseButtonInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderButton(element());
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/BaseButtonInputType.h b/WebCore/html/BaseButtonInputType.h
new file mode 100644
index 0000000..e7f683b
--- /dev/null
+++ b/WebCore/html/BaseButtonInputType.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 BaseButtonInputType_h
+#define BaseButtonInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+// Base of button, file, image, reset, and submit types.
+class BaseButtonInputType : public InputType {
+protected:
+ BaseButtonInputType(HTMLInputElement* element) : InputType(element) { }
+
+private:
+ virtual bool appendFormData(FormDataList&, bool) const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
+};
+
+} // namespace WebCore
+
+#endif // BaseButtonInputType_h
diff --git a/WebCore/html/BaseCheckableInputType.cpp b/WebCore/html/BaseCheckableInputType.cpp
new file mode 100644
index 0000000..009e8e4
--- /dev/null
+++ b/WebCore/html/BaseCheckableInputType.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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 "BaseCheckableInputType.h"
+
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "RegularExpression.h"
+
+namespace WebCore {
+
+bool BaseCheckableInputType::saveFormControlState(String& result) const
+{
+ result = element()->checked() ? "on" : "off";
+ return true;
+}
+
+void BaseCheckableInputType::restoreFormControlState(const String& state) const
+{
+ element()->setChecked(state == "on");
+}
+
+bool BaseCheckableInputType::appendFormData(FormDataList& encoding, bool) const
+{
+ if (!element()->checked())
+ return false;
+ encoding.appendData(element()->name(), element()->value());
+ return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/BaseCheckableInputType.h b/WebCore/html/BaseCheckableInputType.h
new file mode 100644
index 0000000..02edf29
--- /dev/null
+++ b/WebCore/html/BaseCheckableInputType.h
@@ -0,0 +1,51 @@
+/*
+ * 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 BaseCheckableInputType_h
+#define BaseCheckableInputType_h
+
+#include "InputType.h"
+
+namespace WebCore {
+
+// Base of checkbox and radio types.
+class BaseCheckableInputType : public InputType {
+protected:
+ BaseCheckableInputType(HTMLInputElement* element) : InputType(element) { }
+
+private:
+ virtual bool saveFormControlState(String&) const;
+ virtual void restoreFormControlState(const String&) const;
+ virtual bool appendFormData(FormDataList&, bool) const;
+};
+
+} // namespace WebCore
+
+#endif // BaseCheckableInputType_h
diff --git a/WebCore/html/ButtonInputType.h b/WebCore/html/ButtonInputType.h
index 7efbad2..f016114 100644
--- a/WebCore/html/ButtonInputType.h
+++ b/WebCore/html/ButtonInputType.h
@@ -31,16 +31,16 @@
#ifndef ButtonInputType_h
#define ButtonInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class ButtonInputType : public InputType {
+class ButtonInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- ButtonInputType(HTMLInputElement* element) : InputType(element) { }
+ ButtonInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool supportsValidation() const;
};
diff --git a/WebCore/html/CheckboxInputType.h b/WebCore/html/CheckboxInputType.h
index e041a07..b68e14d 100644
--- a/WebCore/html/CheckboxInputType.h
+++ b/WebCore/html/CheckboxInputType.h
@@ -31,16 +31,16 @@
#ifndef CheckboxInputType_h
#define CheckboxInputType_h
-#include "InputType.h"
+#include "BaseCheckableInputType.h"
namespace WebCore {
-class CheckboxInputType : public InputType {
+class CheckboxInputType : public BaseCheckableInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- CheckboxInputType(HTMLInputElement* element) : InputType(element) { }
+ CheckboxInputType(HTMLInputElement* element) : BaseCheckableInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool valueMissing(const String&) const;
};
diff --git a/WebCore/html/ClassList.cpp b/WebCore/html/ClassList.cpp
new file mode 100644
index 0000000..578601b
--- /dev/null
+++ b/WebCore/html/ClassList.cpp
@@ -0,0 +1,146 @@
+/*
+ * 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 "ClassList.h"
+
+#include "Element.h"
+#include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
+#include "SpaceSplitString.h"
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+ClassList::ClassList(Element* element)
+ : m_element(element)
+{
+ if (m_element->document()->inQuirksMode())
+ m_classNamesForQuirksMode.set(m_element->fastGetAttribute(classAttr), false);
+}
+
+void ClassList::ref()
+{
+ m_element->ref();
+}
+
+void ClassList::deref()
+{
+ m_element->deref();
+}
+
+unsigned ClassList::length() const
+{
+ return m_element->hasClass() ? classNames().size() : 0;
+}
+
+const AtomicString ClassList::item(unsigned index) const
+{
+ if (index >= length())
+ return AtomicString();
+ return classNames()[index];
+}
+
+bool ClassList::contains(const AtomicString& token, ExceptionCode& ec) const
+{
+ if (!validateToken(token, ec))
+ return false;
+ return containsInternal(token);
+}
+
+bool ClassList::containsInternal(const AtomicString& token) const
+{
+ return m_element->hasClass() && classNames().contains(token);
+}
+
+void ClassList::add(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ addInternal(token);
+}
+
+void ClassList::addInternal(const AtomicString& token)
+{
+ const AtomicString& oldClassName(m_element->fastGetAttribute(classAttr));
+ if (oldClassName.isEmpty())
+ m_element->setAttribute(classAttr, token);
+ else if (!containsInternal(token)) {
+ const AtomicString& newClassName(addToken(oldClassName, token));
+ m_element->setAttribute(classAttr, newClassName);
+ }
+}
+
+void ClassList::remove(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return;
+ removeInternal(token);
+}
+
+void ClassList::removeInternal(const AtomicString& token)
+{
+ // Check using contains first since it uses AtomicString comparisons instead
+ // of character by character testing.
+ if (!containsInternal(token))
+ return;
+ const AtomicString& newClassName(removeToken(m_element->fastGetAttribute(classAttr), token));
+ m_element->setAttribute(classAttr, newClassName);
+}
+
+bool ClassList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+
+ if (containsInternal(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+String ClassList::toString() const
+{
+ return m_element->fastGetAttribute(classAttr);
+}
+
+void ClassList::reset(const String& newClassName)
+{
+ if (!m_classNamesForQuirksMode.isNull())
+ m_classNamesForQuirksMode.set(newClassName, false);
+}
+
+const SpaceSplitString& ClassList::classNames() const
+{
+ ASSERT(m_element->hasClass());
+ if (!m_classNamesForQuirksMode.isNull())
+ return m_classNamesForQuirksMode;
+ return m_element->attributeMap()->classNames();
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/ClassList.h b/WebCore/html/ClassList.h
new file mode 100644
index 0000000..93aea60
--- /dev/null
+++ b/WebCore/html/ClassList.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 ClassList_h
+#define ClassList_h
+
+#include "DOMTokenList.h"
+#include "ExceptionCode.h"
+#include "SpaceSplitString.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class Element;
+
+class ClassList : public DOMTokenList {
+public:
+ static PassOwnPtr<ClassList> create(Element* element)
+ {
+ return adoptPtr(new ClassList(element));
+ }
+
+ virtual void ref();
+ virtual void deref();
+
+ virtual unsigned length() const;
+ virtual const AtomicString item(unsigned index) const;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const;
+ virtual void add(const AtomicString&, ExceptionCode&);
+ virtual void remove(const AtomicString&, ExceptionCode&);
+ virtual bool toggle(const AtomicString&, ExceptionCode&);
+ virtual String toString() const;
+
+ virtual Element* element() { return m_element; }
+
+ void reset(const String&);
+
+private:
+ ClassList(Element*);
+
+ void addInternal(const AtomicString&);
+ bool containsInternal(const AtomicString&) const;
+ void removeInternal(const AtomicString&);
+
+ const SpaceSplitString& classNames() const;
+
+ Element* m_element;
+ SpaceSplitString m_classNamesForQuirksMode;
+};
+
+} // namespace WebCore
+
+#endif // ClassList_h
diff --git a/WebCore/html/DOMSettableTokenList.cpp b/WebCore/html/DOMSettableTokenList.cpp
new file mode 100644
index 0000000..2636bd3
--- /dev/null
+++ b/WebCore/html/DOMSettableTokenList.cpp
@@ -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.
+ *
+ * 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 "DOMSettableTokenList.h"
+
+namespace WebCore {
+
+DOMSettableTokenList::DOMSettableTokenList()
+ : m_value()
+ , m_tokens()
+{
+}
+
+DOMSettableTokenList::~DOMSettableTokenList()
+{
+}
+
+const AtomicString DOMSettableTokenList::item(unsigned index) const
+{
+ if (index >= length())
+ return AtomicString("");
+ return m_tokens[index];
+}
+
+bool DOMSettableTokenList::contains(const AtomicString& token, ExceptionCode& ec) const
+{
+ if (!validateToken(token, ec))
+ return false;
+ return m_tokens.contains(token);
+}
+
+void DOMSettableTokenList::add(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec) || m_tokens.contains(token))
+ return;
+ addInternal(token);
+}
+
+void DOMSettableTokenList::addInternal(const AtomicString& token)
+{
+ m_value = addToken(m_value, token);
+ m_tokens.add(token);
+}
+
+void DOMSettableTokenList::remove(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec) || !m_tokens.contains(token))
+ return;
+ removeInternal(token);
+}
+
+void DOMSettableTokenList::removeInternal(const AtomicString& token)
+{
+ m_value = removeToken(m_value, token);
+ m_tokens.remove(token);
+}
+
+bool DOMSettableTokenList::toggle(const AtomicString& token, ExceptionCode& ec)
+{
+ if (!validateToken(token, ec))
+ return false;
+ if (m_tokens.contains(token)) {
+ removeInternal(token);
+ return false;
+ }
+ addInternal(token);
+ return true;
+}
+
+void DOMSettableTokenList::setValue(const String& value)
+{
+ m_value = value;
+ m_tokens.set(value, true);
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/DOMSettableTokenList.h b/WebCore/html/DOMSettableTokenList.h
new file mode 100644
index 0000000..2b711b4
--- /dev/null
+++ b/WebCore/html/DOMSettableTokenList.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 DOMSettableTokenList_h
+#define DOMSettableTokenList_h
+
+#include "DOMTokenList.h"
+#include "ExceptionCode.h"
+#include "SpaceSplitString.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class DOMSettableTokenList : public DOMTokenList, public RefCounted<DOMSettableTokenList> {
+public:
+ static PassRefPtr<DOMSettableTokenList> create()
+ {
+ return adoptRef(new DOMSettableTokenList());
+ }
+ virtual ~DOMSettableTokenList();
+
+ virtual void ref() { RefCounted<DOMSettableTokenList>::ref(); }
+ virtual void deref() { RefCounted<DOMSettableTokenList>::deref(); }
+
+ virtual unsigned length() const { return m_tokens.size(); }
+ virtual const AtomicString item(unsigned index) const;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const;
+ virtual void add(const AtomicString&, ExceptionCode&);
+ virtual void remove(const AtomicString&, ExceptionCode&);
+ virtual bool toggle(const AtomicString&, ExceptionCode&);
+ virtual String toString() const { return value(); }
+
+ String value() const { return m_value; }
+ void setValue(const String&);
+
+private:
+ DOMSettableTokenList();
+
+ void removeInternal(const AtomicString&);
+ void addInternal(const AtomicString&);
+
+ String m_value;
+ SpaceSplitString m_tokens;
+};
+
+} // namespace WebCore
+
+#endif // DOMSettableTokenList_h
diff --git a/WebCore/html/DOMSettableTokenList.idl b/WebCore/html/DOMSettableTokenList.idl
new file mode 100644
index 0000000..6260623
--- /dev/null
+++ b/WebCore/html/DOMSettableTokenList.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.
+ *
+ * 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,
+ GenerateToJS
+ ] DOMSettableTokenList : DOMTokenList {
+ attribute DOMString value;
+ };
+
+}
diff --git a/WebCore/html/DOMTokenList.cpp b/WebCore/html/DOMTokenList.cpp
index aa0a74b..3c91f20 100644
--- a/WebCore/html/DOMTokenList.cpp
+++ b/WebCore/html/DOMTokenList.cpp
@@ -25,17 +25,12 @@
#include "config.h"
#include "DOMTokenList.h"
-#include "Element.h"
-#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
-#include "SpaceSplitString.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
-using namespace HTMLNames;
-
-static bool validateToken(const AtomicString& token, ExceptionCode& ec)
+bool DOMTokenList::validateToken(const AtomicString& token, ExceptionCode& ec)
{
if (token.isEmpty()) {
ec = SYNTAX_ERR;
@@ -53,86 +48,23 @@ static bool validateToken(const AtomicString& token, ExceptionCode& ec)
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 m_element->hasClass() ? classNames().size() : 0;
-}
-
-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
+String DOMTokenList::addToken(const AtomicString& input, const AtomicString& token)
{
- return m_element->hasClass() && classNames().contains(token);
-}
+ if (input.isEmpty())
+ return token;
-void DOMTokenList::add(const AtomicString& token, ExceptionCode& ec)
-{
- if (!validateToken(token, ec))
- return;
- addInternal(token);
+ StringBuilder builder;
+ builder.append(input);
+ if (input[input.length()-1] != ' ')
+ builder.append(' ');
+ builder.append(token);
+ return builder.toString();
}
-void DOMTokenList::addInternal(const AtomicString& token) const
+String DOMTokenList::removeToken(const AtomicString& input, const AtomicString& token)
{
- 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);
@@ -170,39 +102,7 @@ void DOMTokenList::removeInternal(const AtomicString& token) const
}
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
-{
- ASSERT(m_element->hasClass());
- if (!m_classNamesForQuirksMode.isNull())
- return m_classNamesForQuirksMode;
- return m_element->attributeMap()->classNames();
+ return String::adopt(output);
}
} // namespace WebCore
diff --git a/WebCore/html/DOMTokenList.h b/WebCore/html/DOMTokenList.h
index fad69ca..5df2ede 100644
--- a/WebCore/html/DOMTokenList.h
+++ b/WebCore/html/DOMTokenList.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, 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
@@ -26,9 +26,9 @@
#define DOMTokenList_h
#include "ExceptionCode.h"
-#include "SpaceSplitString.h"
+#include <wtf/text/AtomicString.h>
#include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
namespace WebCore {
@@ -36,37 +36,25 @@ class Element;
class DOMTokenList : public Noncopyable {
public:
- static PassOwnPtr<DOMTokenList> create(Element* element)
- {
- return adoptPtr(new DOMTokenList(element));
- }
+ virtual ~DOMTokenList() {};
- void ref();
- void deref();
+ virtual void ref() = 0;
+ virtual void deref() = 0;
- 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;
+ virtual unsigned length() const = 0;
+ virtual const AtomicString item(unsigned index) const = 0;
+ virtual bool contains(const AtomicString&, ExceptionCode&) const = 0;
+ virtual void add(const AtomicString&, ExceptionCode&) = 0;
+ virtual void remove(const AtomicString&, ExceptionCode&) = 0;
+ virtual bool toggle(const AtomicString&, ExceptionCode&) = 0;
+ virtual String toString() const = 0;
- void reset(const String&);
+ virtual Element* element() { return 0; }
- 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;
+protected:
+ static bool validateToken(const AtomicString&, ExceptionCode&);
+ static String addToken(const AtomicString&, const AtomicString&);
+ static String removeToken(const AtomicString&, const AtomicString&);
};
} // namespace WebCore
diff --git a/WebCore/html/FileInputType.cpp b/WebCore/html/FileInputType.cpp
index 6cb17f2..d98d3b6 100644
--- a/WebCore/html/FileInputType.cpp
+++ b/WebCore/html/FileInputType.cpp
@@ -1,36 +1,32 @@
/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * 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.
*
- * * 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 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.
*
- * 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 "File.h"
+#include "FileList.h"
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
+#include "RenderFileUploadControl.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
@@ -46,9 +42,43 @@ const AtomicString& FileInputType::formControlType() const
return InputTypeNames::file();
}
+bool FileInputType::appendFormData(FormDataList& encoding, bool multipart) const
+{
+ FileList* fileList = element()->files();
+ unsigned numFiles = fileList->length();
+ if (!multipart) {
+ // Send only the basenames.
+ // 4.10.16.4 and 4.10.16.6 sections in HTML5.
+
+ // Unlike the multipart case, we have no special handling for the empty
+ // fileList because Netscape doesn't support for non-multipart
+ // submission of file inputs, and Firefox doesn't add "name=" query
+ // parameter.
+ for (unsigned i = 0; i < numFiles; ++i)
+ encoding.appendData(element()->name(), fileList->item(i)->fileName());
+ return true;
+ }
+
+ // If no filename at all is entered, return successful but empty.
+ // Null would be more logical, but Netscape posts an empty file. Argh.
+ if (!numFiles) {
+ encoding.appendBlob(element()->name(), File::create(""));
+ return true;
+ }
+
+ for (unsigned i = 0; i < numFiles; ++i)
+ encoding.appendBlob(element()->name(), fileList->item(i));
+ return true;
+}
+
bool FileInputType::valueMissing(const String& value) const
{
return value.isEmpty();
}
+RenderObject* FileInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderFileUploadControl(element());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/FileInputType.h b/WebCore/html/FileInputType.h
index 2cbfe67..24430fb 100644
--- a/WebCore/html/FileInputType.h
+++ b/WebCore/html/FileInputType.h
@@ -31,18 +31,20 @@
#ifndef FileInputType_h
#define FileInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class FileInputType : public InputType {
+class FileInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- FileInputType(HTMLInputElement* element) : InputType(element) { }
+ FileInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool appendFormData(FormDataList&, bool) const;
virtual bool valueMissing(const String&) const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index d5c48c4..d9759fc 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -260,6 +260,7 @@ sortable
sortdirection
span
x-webkit-speech
+x-webkit-grammar
spellcheck
src
standby
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index e20e729..84ad706 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -439,7 +439,7 @@ void HTMLDocument::clear()
bool HTMLDocument::isFrameSet() const
{
HTMLElement* bodyElement = body();
- return bodyElement && bodyElement->renderer() && bodyElement->hasTagName(framesetTag);
+ return bodyElement && bodyElement->hasTagName(framesetTag);
}
#ifdef ANDROID_INSTRUMENT
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 1483fbc..bc4bf07 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -725,6 +725,17 @@ void HTMLElement::setDraggable(bool value)
setAttribute(draggableAttr, value ? "true" : "false");
}
+bool HTMLElement::spellcheck() const
+{
+ return isSpellCheckingEnabled();
+}
+
+void HTMLElement::setSpellcheck(bool enable)
+{
+ setAttribute(spellcheckAttr, enable ? "true" : "false");
+}
+
+
void HTMLElement::click()
{
dispatchSimulatedClick(0, false, false);
diff --git a/WebCore/html/HTMLElement.h b/WebCore/html/HTMLElement.h
index 52e9ecf..1660e2a 100644
--- a/WebCore/html/HTMLElement.h
+++ b/WebCore/html/HTMLElement.h
@@ -66,6 +66,9 @@ public:
virtual bool draggable() const;
void setDraggable(bool);
+ bool spellcheck() const;
+ void setSpellcheck(bool);
+
void click();
virtual void accessKeyAction(bool sendToAnyElement);
diff --git a/WebCore/html/HTMLElement.idl b/WebCore/html/HTMLElement.idl
index b127c51..77423fc 100644
--- a/WebCore/html/HTMLElement.idl
+++ b/WebCore/html/HTMLElement.idl
@@ -62,6 +62,8 @@ module html {
attribute [ConvertNullToNullString] DOMString contentEditable;
readonly attribute boolean isContentEditable;
+ attribute boolean spellcheck;
+
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
readonly attribute DOMString titleDisplayString;
#endif
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 51b9e20..710cda1 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -46,11 +46,13 @@
#include "RenderTheme.h"
#include "ScriptEventListener.h"
#include "ValidityState.h"
+#include <limits>
#include <wtf/Vector.h>
namespace WebCore {
using namespace HTMLNames;
+using namespace std;
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
: HTMLElement(tagName, document)
@@ -548,26 +550,22 @@ RenderTextControl* HTMLTextFormControlElement::textRendererAfterUpdateLayout()
void HTMLTextFormControlElement::setSelectionStart(int start)
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->setSelectionStart(start);
+ setSelectionRange(start, max(start, selectionEnd()));
}
void HTMLTextFormControlElement::setSelectionEnd(int end)
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->setSelectionEnd(end);
+ setSelectionRange(min(end, selectionStart()), end);
}
void HTMLTextFormControlElement::select()
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->select();
+ setSelectionRange(0, numeric_limits<int>::max());
}
void HTMLTextFormControlElement::setSelectionRange(int start, int end)
{
- if (RenderTextControl* renderer = textRendererAfterUpdateLayout())
- renderer->setSelectionRange(start, end);
+ WebCore::setSelectionRange(this, start, end);
}
int HTMLTextFormControlElement::selectionStart()
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 4792dba..8b721d8 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -180,6 +180,7 @@ public:
// The derived class should return true if placeholder processing is needed.
virtual bool supportsPlaceholder() const = 0;
String strippedPlaceholder() const;
+ bool placeholderShouldBeVisible() const;
int selectionStart();
int selectionEnd();
@@ -192,7 +193,6 @@ public:
protected:
HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*);
- bool placeholderShouldBeVisible() const;
void updatePlaceholderVisibility(bool);
virtual void parseMappedAttribute(Attribute*);
diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp
index f8d682c..d153845 100644
--- a/WebCore/html/HTMLFrameElementBase.cpp
+++ b/WebCore/html/HTMLFrameElementBase.cpp
@@ -166,11 +166,6 @@ void HTMLFrameElementBase::setNameAndOpenURL()
openURL();
}
-void HTMLFrameElementBase::setNameAndOpenURLCallback(Node* n)
-{
- static_cast<HTMLFrameElementBase*>(n)->setNameAndOpenURL();
-}
-
void HTMLFrameElementBase::updateOnReparenting()
{
ASSERT(m_remainsAliveOnRemovalFromTree);
diff --git a/WebCore/html/HTMLFrameElementBase.h b/WebCore/html/HTMLFrameElementBase.h
index ae41e75..ef25f30 100644
--- a/WebCore/html/HTMLFrameElementBase.h
+++ b/WebCore/html/HTMLFrameElementBase.h
@@ -70,8 +70,6 @@ private:
void setNameAndOpenURL();
void openURL(bool lockHistory = true, bool lockBackForwardList = true);
- static void setNameAndOpenURLCallback(Node*);
-
AtomicString m_URL;
AtomicString m_frameName;
diff --git a/WebCore/html/HTMLFrameSetElement.cpp b/WebCore/html/HTMLFrameSetElement.cpp
index d7a47d7..0bb6c56 100644
--- a/WebCore/html/HTMLFrameSetElement.cpp
+++ b/WebCore/html/HTMLFrameSetElement.cpp
@@ -29,6 +29,8 @@
#include "Document.h"
#include "Event.h"
#include "EventNames.h"
+#include "Frame.h"
+#include "FrameLoaderClient.h"
#include "HTMLNames.h"
#include "Length.h"
#include "MouseEvent.h"
@@ -207,4 +209,18 @@ void HTMLFrameSetElement::recalcStyle(StyleChange ch)
HTMLElement::recalcStyle(ch);
}
+void HTMLFrameSetElement::insertedIntoDocument()
+{
+ HTMLElement::insertedIntoDocument();
+ if (Frame* frame = document()->frame())
+ frame->loader()->client()->dispatchDidBecomeFrameset(document()->isFrameSet());
+}
+
+void HTMLFrameSetElement::removedFromDocument()
+{
+ HTMLElement::removedFromDocument();
+ if (Frame* frame = document()->frame())
+ frame->loader()->client()->dispatchDidBecomeFrameset(document()->isFrameSet());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/HTMLFrameSetElement.h b/WebCore/html/HTMLFrameSetElement.h
index c761414..bdbec6a 100644
--- a/WebCore/html/HTMLFrameSetElement.h
+++ b/WebCore/html/HTMLFrameSetElement.h
@@ -77,7 +77,10 @@ private:
virtual void defaultEventHandler(Event*);
virtual void recalcStyle(StyleChange);
-
+
+ virtual void insertedIntoDocument();
+ virtual void removedFromDocument();
+
OwnArrayPtr<Length> m_rowLengths;
OwnArrayPtr<Length> m_colLengths;
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index f572f4c..cd826bf 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -56,13 +56,12 @@
#include "LocalizedStrings.h"
#include "MouseEvent.h"
#include "Page.h"
-#include "RenderButton.h"
#include "RenderFileUploadControl.h"
#include "RenderImage.h"
#include "RenderSlider.h"
-#include "RenderText.h"
#include "RenderTextControlSingleLine.h"
#include "RenderTheme.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptEventListener.h"
#include "Settings.h"
#include "StepRange.h"
@@ -536,79 +535,12 @@ const AtomicString& HTMLInputElement::formControlType() const
bool HTMLInputElement::saveFormControlState(String& result) const
{
- switch (deprecatedInputType()) {
- case BUTTON:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RANGE:
- case RESET:
- case SEARCH:
- case SUBMIT:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK: {
- String currentValue = value();
- if (currentValue == defaultValue())
- return false;
- result = currentValue;
- return true;
- }
- case CHECKBOX:
- case RADIO:
- result = checked() ? "on" : "off";
- return true;
- case PASSWORD:
- return false;
- }
- ASSERT_NOT_REACHED();
- return false;
+ return m_inputType->saveFormControlState(result);
}
void HTMLInputElement::restoreFormControlState(const String& state)
{
- ASSERT(deprecatedInputType() != PASSWORD); // should never save/restore password fields
- switch (deprecatedInputType()) {
- case BUTTON:
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case FILE:
- case HIDDEN:
- case IMAGE:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case RANGE:
- case RESET:
- case SEARCH:
- case SUBMIT:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK:
- setValue(state);
- break;
- case CHECKBOX:
- case RADIO:
- setChecked(state == "on");
- break;
- case PASSWORD:
- break;
- }
+ m_inputType->restoreFormControlState(state);
}
bool HTMLInputElement::canStartSelection() const
@@ -803,46 +735,9 @@ bool HTMLInputElement::rendererIsNeeded(RenderStyle *style)
return HTMLFormControlElementWithState::rendererIsNeeded(style);
}
-RenderObject* HTMLInputElement::createRenderer(RenderArena *arena, RenderStyle *style)
+RenderObject* HTMLInputElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
- switch (deprecatedInputType()) {
- case BUTTON:
- case RESET:
- case SUBMIT:
- return new (arena) RenderButton(this);
- case CHECKBOX:
- case RADIO:
- return RenderObject::createObject(this, style);
- case FILE:
- return new (arena) RenderFileUploadControl(this);
- case HIDDEN:
- break;
- case IMAGE: {
- RenderImage* image = new (arena) RenderImage(this);
- image->setImageResource(RenderImageResource::create());
- return image;
- }
- case RANGE:
- return new (arena) RenderSlider(this);
- 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 new (arena) RenderTextControlSingleLine(this, placeholderShouldBeVisible());
- }
- ASSERT(false);
- return 0;
+ return m_inputType->createRenderer(arena, style);
}
void HTMLInputElement::attach()
@@ -919,93 +814,7 @@ void HTMLInputElement::setActivatedSubmit(bool flag)
bool HTMLInputElement::appendFormData(FormDataList& encoding, bool multipart)
{
- // image generates its own names, but for other types there is no form data unless there's a name
- if (name().isEmpty() && deprecatedInputType() != IMAGE)
- return false;
-
- switch (deprecatedInputType()) {
- case COLOR:
- case DATE:
- case DATETIME:
- case DATETIMELOCAL:
- case EMAIL:
- case HIDDEN:
- case ISINDEX:
- case MONTH:
- case NUMBER:
- case PASSWORD:
- case RANGE:
- case SEARCH:
- case TELEPHONE:
- case TEXT:
- case TIME:
- case URL:
- case WEEK:
- // always successful
- encoding.appendData(name(), value());
- return true;
-
- case CHECKBOX:
- case RADIO:
- if (checked()) {
- encoding.appendData(name(), value());
- return true;
- }
- break;
-
- case BUTTON:
- case RESET:
- // these types of buttons are never successful
- return false;
-
- case IMAGE:
- if (m_activeSubmit) {
- encoding.appendData(name().isEmpty() ? "x" : (name() + ".x"), m_xPos);
- encoding.appendData(name().isEmpty() ? "y" : (name() + ".y"), m_yPos);
- if (!name().isEmpty() && !value().isEmpty())
- encoding.appendData(name(), value());
- return true;
- }
- break;
-
- case SUBMIT:
- if (m_activeSubmit) {
- String encstr = valueWithDefault();
- encoding.appendData(name(), encstr);
- return true;
- }
- break;
-
- case FILE: {
- unsigned numFiles = m_fileList->length();
- if (!multipart) {
- // Send only the basenames.
- // 4.10.16.4 and 4.10.16.6 sections in HTML5.
-
- // Unlike the multipart case, we have no special
- // handling for the empty fileList because Netscape
- // doesn't support for non-multipart submission of
- // file inputs, and Firefox doesn't add "name=" query
- // parameter.
-
- for (unsigned i = 0; i < numFiles; ++i)
- encoding.appendData(name(), m_fileList->item(i)->fileName());
- return true;
- }
-
- // If no filename at all is entered, return successful but empty.
- // Null would be more logical, but Netscape posts an empty file. Argh.
- if (!numFiles) {
- encoding.appendBlob(name(), File::create(""));
- return true;
- }
-
- for (unsigned i = 0; i < numFiles; ++i)
- encoding.appendBlob(name(), m_fileList->item(i));
- return true;
- }
- }
- return false;
+ return m_inputType->isFormDataAppendable() && m_inputType->appendFormData(encoding, multipart);
}
void HTMLInputElement::reset()
@@ -2154,7 +1963,7 @@ bool HTMLInputElement::isSpeechEnabled() const
case SEARCH:
case TELEPHONE:
case TEXT:
- return hasAttribute(webkitspeechAttr);
+ return RuntimeEnabledFeatures::speechInputEnabled() && hasAttribute(webkitspeechAttr);
case BUTTON:
case CHECKBOX:
case COLOR:
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index e584a78..1a0490e 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -203,6 +203,10 @@ public:
return document()->checkedRadioButtons();
}
+ // FIXME: We should move m_xPos and m_yPos to ImageInputType class.
+ int xPosition() const { return m_xPos; }
+ int yPosition() const { return m_yPos; }
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement* = 0);
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index 1ca7d6c..b873826 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -101,6 +101,7 @@ module html {
#if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
attribute [Reflect, EnabledAtRuntime] boolean webkitSpeech;
+ attribute [Reflect, EnabledAtRuntime] boolean webkitGrammar;
attribute [DontEnum] EventListener onwebkitspeechchange;
#endif
};
diff --git a/WebCore/html/HTMLMeterElement.cpp b/WebCore/html/HTMLMeterElement.cpp
index 5419a22..3de69df 100644
--- a/WebCore/html/HTMLMeterElement.cpp
+++ b/WebCore/html/HTMLMeterElement.cpp
@@ -172,7 +172,7 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
double theValue = value();
double optimumValue = optimum();
- if (optimumValue <= lowValue) {
+ if (optimumValue < lowValue) {
// The optimum range stays under low
if (theValue <= lowValue)
return GaugeRegionOptimum;
@@ -181,7 +181,7 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
return GaugeRegionEvenLessGood;
}
- if (highValue <= optimumValue) {
+ if (highValue < optimumValue) {
// The optimum range stays over high
if (highValue <= theValue)
return GaugeRegionOptimum;
@@ -190,11 +190,11 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
return GaugeRegionEvenLessGood;
}
- // The optimum range stays between high and low
- if (lowValue < theValue && theValue < highValue)
+ // The optimum range stays between high and low.
+ // According to the standard, <meter> never show GaugeRegionEvenLessGood in this case
+ // because the value is never less or greater than min or max.
+ if (lowValue <= theValue && theValue <= highValue)
return GaugeRegionOptimum;
- if (theValue == min() || max() == theValue)
- return GaugeRegionEvenLessGood;
return GaugeRegionSuboptimal;
}
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 2b51286..7020517 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -116,31 +116,6 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
HTMLPlugInImageElement::parseMappedAttribute(attr);
}
-typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap;
-
-static ClassIdToTypeMap* createClassIdToTypeMap()
-{
- ClassIdToTypeMap* map = new ClassIdToTypeMap;
- map->add("clsid:D27CDB6E-AE6D-11CF-96B8-444553540000", "application/x-shockwave-flash");
- map->add("clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA", "audio/x-pn-realaudio-plugin");
- map->add("clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B", "video/quicktime");
- map->add("clsid:166B1BCA-3F9C-11CF-8075-444553540000", "application/x-director");
- map->add("clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6", "application/x-mplayer2");
- map->add("clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95", "application/x-mplayer2");
- return map;
-}
-
-static String serviceTypeForClassId(const String& classId)
-{
- // Return early if classId is empty (since we won't do anything below).
- // Furthermore, if classId is null, calling get() below will crash.
- if (classId.isEmpty())
- return String();
-
- static ClassIdToTypeMap* map = createClassIdToTypeMap();
- return map->get(classId);
-}
-
static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
{
// Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. Real and WMP
@@ -242,6 +217,19 @@ bool HTMLObjectElement::hasFallbackContent() const
}
return false;
}
+
+bool HTMLObjectElement::hasValidClassId()
+{
+ // HTML5 says that fallback content should be rendered if a non-empty
+ // classid is specified for which the UA can't find a suitable plug-in.
+ // WebKit supports no classids, with the exception of Qt plug-ins, which use
+ // classid to specify which QObject to load.
+#if PLATFORM(QT)
+ return classId().isEmpty() || equalIgnoringCase(serviceType(), "application/x-qt-plugin");
+#else
+ return classId().isEmpty();
+#endif
+}
// FIXME: This should be unified with HTMLEmbedElement::updateWidget and
// moved down into HTMLPluginImageElement.cpp
@@ -255,14 +243,9 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
// FIXME: This should ASSERT isFinishedParsingChildren() instead.
if (!isFinishedParsingChildren())
return;
-
- String url = this->url();
- // If the object does not specify a MIME type via a type attribute, but does
- // contain a classid attribute, try to map the classid to a MIME type.
+ String url = this->url();
String serviceType = this->serviceType();
- if (serviceType.isEmpty())
- serviceType = serviceTypeForClassId(classId());
// FIXME: These should be joined into a PluginParameters class.
Vector<String> paramNames;
@@ -292,7 +275,7 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
return;
SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
- bool success = beforeLoadAllowedLoad && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ bool success = beforeLoadAllowedLoad && hasValidClassId() && loader->requestObject(this, url, getAttribute(nameAttr), serviceType, paramNames, paramValues);
if (!success && fallbackContent)
renderFallbackContent();
diff --git a/WebCore/html/HTMLObjectElement.h b/WebCore/html/HTMLObjectElement.h
index 2d416c3..a4609cb 100644
--- a/WebCore/html/HTMLObjectElement.h
+++ b/WebCore/html/HTMLObjectElement.h
@@ -66,6 +66,8 @@ private:
// FIXME: This function should not deal with url or serviceType
// so that we can better share code between <object> and <embed>.
void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
+
+ bool hasValidClassId();
AtomicString m_id;
String m_classId;
diff --git a/WebCore/html/HiddenInputType.cpp b/WebCore/html/HiddenInputType.cpp
index 76742ae..6e083e6 100644
--- a/WebCore/html/HiddenInputType.cpp
+++ b/WebCore/html/HiddenInputType.cpp
@@ -49,4 +49,10 @@ bool HiddenInputType::supportsValidation() const
return false;
}
+RenderObject* HiddenInputType::createRenderer(RenderArena*, RenderStyle*) const
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
} // namespace WebCore
diff --git a/WebCore/html/HiddenInputType.h b/WebCore/html/HiddenInputType.h
index cc49f98..1617371 100644
--- a/WebCore/html/HiddenInputType.h
+++ b/WebCore/html/HiddenInputType.h
@@ -43,6 +43,7 @@ private:
HiddenInputType(HTMLInputElement* element) : InputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool supportsValidation() const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/ImageDocument.cpp b/WebCore/html/ImageDocument.cpp
index 6361f43..a42ccc8 100644
--- a/WebCore/html/ImageDocument.cpp
+++ b/WebCore/html/ImageDocument.cpp
@@ -387,7 +387,7 @@ void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event)
{
if (event->type() == eventNames().resizeEvent)
m_doc->windowSizeChanged();
- else if (event->type() == eventNames().clickEvent) {
+ else if (event->type() == eventNames().clickEvent && event->isMouseEvent()) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
m_doc->imageClicked(mouseEvent->x(), mouseEvent->y());
}
diff --git a/WebCore/html/ImageInputType.cpp b/WebCore/html/ImageInputType.cpp
index 604b052..de24188 100644
--- a/WebCore/html/ImageInputType.cpp
+++ b/WebCore/html/ImageInputType.cpp
@@ -1,36 +1,30 @@
/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2010 Google Inc. All rights reserved.
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * 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.
*
- * * 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 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.
*
- * 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 "FormDataList.h"
+#include "HTMLInputElement.h"
+#include "RenderImage.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -45,9 +39,33 @@ const AtomicString& ImageInputType::formControlType() const
return InputTypeNames::image();
}
+bool ImageInputType::isFormDataAppendable() const
+{
+ return true;
+}
+
+bool ImageInputType::appendFormData(FormDataList& encoding, bool) const
+{
+ if (!element()->isActivatedSubmit())
+ return false;
+ const AtomicString& name = element()->name();
+ encoding.appendData(name.isEmpty() ? "x" : (name + ".x"), element()->xPosition());
+ encoding.appendData(name.isEmpty() ? "y" : (name + ".y"), element()->yPosition());
+ if (!name.isEmpty() && !element()->value().isEmpty())
+ encoding.appendData(name, element()->value());
+ return true;
+}
+
bool ImageInputType::supportsValidation() const
{
return false;
}
+RenderObject* ImageInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ RenderImage* image = new (arena) RenderImage(element());
+ image->setImageResource(RenderImageResource::create());
+ return image;
+}
+
} // namespace WebCore
diff --git a/WebCore/html/ImageInputType.h b/WebCore/html/ImageInputType.h
index be308b3..cd76e72 100644
--- a/WebCore/html/ImageInputType.h
+++ b/WebCore/html/ImageInputType.h
@@ -31,18 +31,21 @@
#ifndef ImageInputType_h
#define ImageInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class ImageInputType : public InputType {
+class ImageInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- ImageInputType(HTMLInputElement* element) : InputType(element) { }
+ ImageInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool isFormDataAppendable() const;
+ virtual bool appendFormData(FormDataList&, bool) const;
virtual bool supportsValidation() const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/InputType.cpp b/WebCore/html/InputType.cpp
index 1b2303a..c870c69 100644
--- a/WebCore/html/InputType.cpp
+++ b/WebCore/html/InputType.cpp
@@ -36,6 +36,7 @@
#include "DateTimeLocalInputType.h"
#include "EmailInputType.h"
#include "FileInputType.h"
+#include "FormDataList.h"
#include "HTMLInputElement.h"
#include "HiddenInputType.h"
#include "ImageInputType.h"
@@ -46,6 +47,7 @@
#include "RadioInputType.h"
#include "RangeInputType.h"
#include "RegularExpression.h"
+#include "RenderObject.h"
#include "ResetInputType.h"
#include "SearchInputType.h"
#include "SubmitInputType.h"
@@ -122,6 +124,33 @@ bool InputType::isTextType() const
return false;
}
+bool InputType::saveFormControlState(String& result) const
+{
+ String currentValue = element()->value();
+ if (currentValue == element()->defaultValue())
+ return false;
+ result = currentValue;
+ return true;
+}
+
+void InputType::restoreFormControlState(const String& state) const
+{
+ element()->setValue(state);
+}
+
+bool InputType::isFormDataAppendable() const
+{
+ // There is no form data unless there's a name for non-image types.
+ return !element()->name().isEmpty();
+}
+
+bool InputType::appendFormData(FormDataList& encoding, bool) const
+{
+ // Always successful.
+ encoding.appendData(element()->name(), element()->value());
+ return true;
+}
+
double InputType::valueAsDate() const
{
return DateComponents::invalidMilliseconds();
@@ -228,6 +257,11 @@ bool InputType::scaledStepValeuShouldBeInteger() const
return false;
}
+RenderObject* InputType::createRenderer(RenderArena*, RenderStyle* style) const
+{
+ return RenderObject::createObject(element(), style);
+}
+
double InputType::parseToDouble(const String&, double defaultValue) const
{
return defaultValue;
diff --git a/WebCore/html/InputType.h b/WebCore/html/InputType.h
index 953b123..f601051 100644
--- a/WebCore/html/InputType.h
+++ b/WebCore/html/InputType.h
@@ -38,24 +38,42 @@
namespace WebCore {
class DateComponents;
+class FormDataList;
class HTMLInputElement;
+class RenderArena;
+class RenderObject;
+class RenderStyle;
+// An InputType object represents the type-specific part of an HTMLInputElement.
+// Do not expose instances of InputType and classes derived from it to classes
+// other than HTMLInputElement.
class InputType : public Noncopyable {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*, const AtomicString&);
static PassOwnPtr<InputType> createText(HTMLInputElement*);
virtual ~InputType();
+ // Type query functions
+
virtual bool isTextField() const;
virtual bool isTextType() const;
virtual const AtomicString& formControlType() const = 0;
+ // Form value functions
+
+ virtual bool saveFormControlState(String&) const;
+ virtual void restoreFormControlState(const String&) const;
+ virtual bool isFormDataAppendable() const;
+ virtual bool appendFormData(FormDataList&, bool multipart) const;
+
+ // DOM property functions
+
virtual double valueAsDate() const;
virtual void setValueAsDate(double, ExceptionCode&) const;
virtual double valueAsNumber() const;
virtual void setValueAsNumber(double, ExceptionCode&) const;
- // Validation-related functions
+ // Validation functions
virtual bool supportsValidation() const;
virtual bool typeMismatchFor(const String&) const;
@@ -77,6 +95,10 @@ public:
virtual bool parsedStepValueShouldBeInteger() const;
virtual bool scaledStepValeuShouldBeInteger() const;
+ // Miscellaneous functions
+
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
+
// Parses the specified string for the type, and return
// the double value for the parsing result if the parsing
// succeeds; Returns defaultValue otherwise. This function can
diff --git a/WebCore/html/NumberInputType.cpp b/WebCore/html/NumberInputType.cpp
index a4e118c..28f510c 100644
--- a/WebCore/html/NumberInputType.cpp
+++ b/WebCore/html/NumberInputType.cpp
@@ -43,11 +43,8 @@ namespace WebCore {
using namespace HTMLNames;
using namespace std;
-// FIXME: Number values should be in the range of IEEE 754 single-precision
-// floating point number.
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#real-numbers
-static const double numberDefaultMinimum = -DBL_MAX;
-static const double numberDefaultMaximum = DBL_MAX;
+static const double numberDefaultMinimum = -FLT_MAX;
+static const double numberDefaultMaximum = FLT_MAX;
static const double numberDefaultStep = 1.0;
static const double numberStepScaleFactor = 1.0;
@@ -67,8 +64,16 @@ double NumberInputType::valueAsNumber() const
return parseToDouble(element()->value(), numeric_limits<double>::quiet_NaN());
}
-void NumberInputType::setValueAsNumber(double newValue, ExceptionCode&) const
+void NumberInputType::setValueAsNumber(double newValue, ExceptionCode& ec) const
{
+ if (newValue < numberDefaultMinimum) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+ if (newValue > numberDefaultMaximum) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
element()->setValue(serialize(newValue));
}
@@ -116,12 +121,17 @@ bool NumberInputType::stepMismatch(const String& value, double step) const
if (isinf(doubleValue))
return false;
// double's fractional part size is DBL_MAN_DIG-bit. If the current value
- // is greater than step*2^DBL_MANT_DIG, the following fmod() makes no sense.
+ // is greater than step*2^DBL_MANT_DIG, the following computation for
+ // remainder makes no sense.
if (doubleValue / pow(2.0, DBL_MANT_DIG) > step)
return false;
- double remainder = fmod(doubleValue, step);
- // Accepts errors in lower 7-bit.
- double acceptableError = step / pow(2.0, DBL_MANT_DIG - 7);
+ // The computation follows HTML5 4.10.7.2.10 `The step attribute' :
+ // ... that number subtracted from the step base is not an integral multiple
+ // of the allowed value step, the element is suffering from a step mismatch.
+ double remainder = fabs(doubleValue - step * round(doubleValue / step));
+ // Accepts erros in lower fractional part which IEEE 754 single-precision
+ // can't represent.
+ double acceptableError = step / pow(2.0, FLT_MANT_DIG);
return acceptableError < remainder && remainder < (step - acceptableError);
}
diff --git a/WebCore/html/PasswordInputType.cpp b/WebCore/html/PasswordInputType.cpp
index a645f96..cda689b 100644
--- a/WebCore/html/PasswordInputType.cpp
+++ b/WebCore/html/PasswordInputType.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "PasswordInputType.h"
+#include <wtf/Assertions.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -45,4 +46,16 @@ const AtomicString& PasswordInputType::formControlType() const
return InputTypeNames::password();
}
+bool PasswordInputType::saveFormControlState(String&) const
+{
+ // Should never save/restore password fields.
+ return false;
+}
+
+void PasswordInputType::restoreFormControlState(const String&) const
+{
+ // Should never save/restore password fields.
+ ASSERT_NOT_REACHED();
+}
+
} // namespace WebCore
diff --git a/WebCore/html/PasswordInputType.h b/WebCore/html/PasswordInputType.h
index db13449..cf25525 100644
--- a/WebCore/html/PasswordInputType.h
+++ b/WebCore/html/PasswordInputType.h
@@ -42,6 +42,8 @@ public:
private:
PasswordInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool saveFormControlState(String&) const;
+ virtual void restoreFormControlState(const String&) const;
};
} // namespace WebCore
diff --git a/WebCore/html/RadioInputType.h b/WebCore/html/RadioInputType.h
index 2ff2c41..9e7ab00 100644
--- a/WebCore/html/RadioInputType.h
+++ b/WebCore/html/RadioInputType.h
@@ -31,16 +31,16 @@
#ifndef RadioInputType_h
#define RadioInputType_h
-#include "InputType.h"
+#include "BaseCheckableInputType.h"
namespace WebCore {
-class RadioInputType : public InputType {
+class RadioInputType : public BaseCheckableInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- RadioInputType(HTMLInputElement* element) : InputType(element) { }
+ RadioInputType(HTMLInputElement* element) : BaseCheckableInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool valueMissing(const String&) const;
};
diff --git a/WebCore/html/RangeInputType.cpp b/WebCore/html/RangeInputType.cpp
index 7448071..176d73b 100644
--- a/WebCore/html/RangeInputType.cpp
+++ b/WebCore/html/RangeInputType.cpp
@@ -34,6 +34,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
+#include "RenderSlider.h"
#include <limits>
#include <wtf/MathExtras.h>
#include <wtf/PassOwnPtr.h>
@@ -126,6 +127,11 @@ double RangeInputType::stepScaleFactor() const
return rangeStepScaleFactor;
}
+RenderObject* RangeInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderSlider(element());
+}
+
double RangeInputType::parseToDouble(const String& src, double defaultValue) const
{
double numberValue;
diff --git a/WebCore/html/RangeInputType.h b/WebCore/html/RangeInputType.h
index 0ff6f60..64548f6 100644
--- a/WebCore/html/RangeInputType.h
+++ b/WebCore/html/RangeInputType.h
@@ -53,6 +53,7 @@ private:
virtual double stepBase() const;
virtual double defaultStep() const;
virtual double stepScaleFactor() const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
virtual double parseToDouble(const String&, double) const;
virtual String serialize(double) const;
};
diff --git a/WebCore/html/ResetInputType.h b/WebCore/html/ResetInputType.h
index 3f883a3..ad940b4 100644
--- a/WebCore/html/ResetInputType.h
+++ b/WebCore/html/ResetInputType.h
@@ -31,16 +31,16 @@
#ifndef ResetInputType_h
#define ResetInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class ResetInputType : public InputType {
+class ResetInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- ResetInputType(HTMLInputElement* element) : InputType(element) { }
+ ResetInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool supportsValidation() const;
};
diff --git a/WebCore/html/SubmitInputType.cpp b/WebCore/html/SubmitInputType.cpp
index 65934f9..99c808e 100644
--- a/WebCore/html/SubmitInputType.cpp
+++ b/WebCore/html/SubmitInputType.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "SubmitInputType.h"
+#include "FormDataList.h"
+#include "HTMLInputElement.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -45,6 +47,14 @@ const AtomicString& SubmitInputType::formControlType() const
return InputTypeNames::submit();
}
+bool SubmitInputType::appendFormData(FormDataList& encoding, bool) const
+{
+ if (!element()->isActivatedSubmit())
+ return false;
+ encoding.appendData(element()->name(), element()->valueWithDefault());
+ return true;
+}
+
bool SubmitInputType::supportsValidation() const
{
return false;
diff --git a/WebCore/html/SubmitInputType.h b/WebCore/html/SubmitInputType.h
index 83fa5e5..2fe7ace 100644
--- a/WebCore/html/SubmitInputType.h
+++ b/WebCore/html/SubmitInputType.h
@@ -31,17 +31,18 @@
#ifndef SubmitInputType_h
#define SubmitInputType_h
-#include "InputType.h"
+#include "BaseButtonInputType.h"
namespace WebCore {
-class SubmitInputType : public InputType {
+class SubmitInputType : public BaseButtonInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
- SubmitInputType(HTMLInputElement* element) : InputType(element) { }
+ SubmitInputType(HTMLInputElement* element) : BaseButtonInputType(element) { }
virtual const AtomicString& formControlType() const;
+ virtual bool appendFormData(FormDataList&, bool) const;
virtual bool supportsValidation() const;
};
diff --git a/WebCore/html/TextFieldInputType.cpp b/WebCore/html/TextFieldInputType.cpp
index 82382ef..926d0ac 100644
--- a/WebCore/html/TextFieldInputType.cpp
+++ b/WebCore/html/TextFieldInputType.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "TextFieldInputType.h"
+#include "HTMLInputElement.h"
+#include "RenderTextControlSingleLine.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -45,4 +47,9 @@ bool TextFieldInputType::valueMissing(const String& value) const
return value.isEmpty();
}
+RenderObject* TextFieldInputType::createRenderer(RenderArena* arena, RenderStyle*) const
+{
+ return new (arena) RenderTextControlSingleLine(element(), element()->placeholderShouldBeVisible());
+}
+
} // namespace WebCore
diff --git a/WebCore/html/TextFieldInputType.h b/WebCore/html/TextFieldInputType.h
index 9108c42..78bec1d 100644
--- a/WebCore/html/TextFieldInputType.h
+++ b/WebCore/html/TextFieldInputType.h
@@ -42,6 +42,7 @@ protected:
TextFieldInputType(HTMLInputElement* element) : InputType(element) { }
virtual bool isTextField() const;
virtual bool valueMissing(const String&) const;
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/ArrayBuffer.cpp b/WebCore/html/canvas/ArrayBuffer.cpp
index 014cc1e..ee8f149 100644
--- a/WebCore/html/canvas/ArrayBuffer.cpp
+++ b/WebCore/html/canvas/ArrayBuffer.cpp
@@ -43,11 +43,16 @@ PassRefPtr<ArrayBuffer> ArrayBuffer::create(unsigned numElements, unsigned eleme
PassRefPtr<ArrayBuffer> ArrayBuffer::create(ArrayBuffer* other)
{
- void* data = tryAllocate(other->byteLength(), 1);
+ return ArrayBuffer::create(other->data(), other->byteLength());
+}
+
+PassRefPtr<ArrayBuffer> ArrayBuffer::create(void* source, unsigned byteLength)
+{
+ void* data = tryAllocate(byteLength, 1);
if (!data)
return 0;
- RefPtr<ArrayBuffer> buffer = adoptRef(new ArrayBuffer(data, other->byteLength()));
- memcpy(buffer->data(), other->data(), other->byteLength());
+ RefPtr<ArrayBuffer> buffer = adoptRef(new ArrayBuffer(data, byteLength));
+ memcpy(buffer->data(), source, byteLength);
return buffer.release();
}
diff --git a/WebCore/html/canvas/ArrayBuffer.h b/WebCore/html/canvas/ArrayBuffer.h
index f538080..ff5e599 100644
--- a/WebCore/html/canvas/ArrayBuffer.h
+++ b/WebCore/html/canvas/ArrayBuffer.h
@@ -35,6 +35,7 @@ class ArrayBuffer : public RefCounted<ArrayBuffer> {
public:
static PassRefPtr<ArrayBuffer> create(unsigned numElements, unsigned elementByteSize);
static PassRefPtr<ArrayBuffer> create(ArrayBuffer*);
+ static PassRefPtr<ArrayBuffer> create(void* source, unsigned byteLength);
void* data();
const void* data() const;
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index a709341..0fdcb99 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -177,7 +177,8 @@ void WebGLFramebuffer::initializeRenderbuffers()
float colorClearValue[] = {0, 0, 0, 0}, depthClearValue = 0;
int stencilClearValue = 0;
- unsigned char colorMask[] = {1, 1, 1, 1}, depthMask = 1, stencilMask = 1;
+ unsigned char colorMask[] = {1, 1, 1, 1}, depthMask = 1;
+ unsigned int stencilMask = 0xffffffff;
bool isScissorEnabled = false;
bool isDitherEnabled = false;
if (initColor) {
@@ -194,9 +195,9 @@ void WebGLFramebuffer::initializeRenderbuffers()
}
if (initStencil) {
g3d->getIntegerv(GraphicsContext3D::STENCIL_CLEAR_VALUE, &stencilClearValue);
- g3d->getBooleanv(GraphicsContext3D::STENCIL_WRITEMASK, &stencilMask);
+ g3d->getIntegerv(GraphicsContext3D::STENCIL_WRITEMASK, reinterpret_cast<int*>(&stencilMask));
g3d->clearStencil(0);
- g3d->stencilMask(true);
+ g3d->stencilMask(0xffffffff);
}
isScissorEnabled = g3d->isEnabled(GraphicsContext3D::SCISSOR_TEST);
g3d->disable(GraphicsContext3D::SCISSOR_TEST);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index a8751da..0b89cce 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -878,6 +878,9 @@ bool WebGLRenderingContext::validateRenderingState(long numElementsRequired)
return false;
}
+ if (numElementsRequired <= 0)
+ return true;
+
// Look in each consumed vertex attrib (by the current program) and find the smallest buffer size
long smallestNumElements = LONG_MAX;
int numActiveAttribLocations = m_currentProgram->numActiveAttribLocations();
@@ -930,6 +933,9 @@ void WebGLRenderingContext::drawArrays(unsigned long mode, long first, long coun
return;
}
+ if (!count)
+ return;
+
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state
CheckedInt<int32_t> checkedFirst(first);
@@ -939,6 +945,11 @@ void WebGLRenderingContext::drawArrays(unsigned long mode, long first, long coun
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
+ } else {
+ if (!validateRenderingState(0)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
}
bool vertexAttrib0Simulated = false;
@@ -975,6 +986,9 @@ void WebGLRenderingContext::drawElements(unsigned long mode, long count, unsigne
return;
}
+ if (!count)
+ return;
+
long numElements = 0;
if (!isErrorGeneratedOnOutOfBoundsAccesses()) {
// Ensure we have a valid rendering state
@@ -990,6 +1004,11 @@ void WebGLRenderingContext::drawElements(unsigned long mode, long count, unsigne
return;
}
}
+ } else {
+ if (!validateRenderingState(0)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
}
bool vertexAttrib0Simulated = false;
@@ -1138,7 +1157,20 @@ void WebGLRenderingContext::generateMipmap(unsigned long target)
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
+ // generateMipmap won't work properly if minFilter is not NEAREST_MIPMAP_LINEAR
+ // on Mac. Remove the hack once this driver bug is fixed.
+#if OS(DARWIN)
+ bool needToResetMinFilter = false;
+ if (tex->getMinFilter() != GraphicsContext3D::NEAREST_MIPMAP_LINEAR) {
+ m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::NEAREST_MIPMAP_LINEAR);
+ needToResetMinFilter = true;
+ }
+#endif
m_context->generateMipmap(target);
+#if OS(DARWIN)
+ if (needToResetMinFilter)
+ m_context->texParameteri(target, GraphicsContext3D::TEXTURE_MIN_FILTER, tex->getMinFilter());
+#endif
tex->generateMipmapLevelInfo();
cleanupAfterGraphicsCall(false);
}
@@ -1266,6 +1298,8 @@ WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned l
WebGLStateRestorer(this, false);
int type = 0;
m_context->getFramebufferAttachmentParameteriv(target, attachment, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &type);
+ if (!type)
+ return WebGLGetInfo();
int value = 0;
m_context->getFramebufferAttachmentParameteriv(target, attachment, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &value);
switch (type) {
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index c4c856c..ce66f6a 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -323,6 +323,7 @@ public:
// Precise but slow index validation -- only done if conservative checks fail
bool validateIndexArrayPrecise(unsigned long count, unsigned long type, long offset, long& numElementsRequired);
+ // If numElements <= 0, we only check if each enabled vertex attribute is bound to a buffer.
bool validateRenderingState(long numElements);
bool validateWebGLObject(WebGLObject* object);
diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h
index 191957d..6ee3dcc 100644
--- a/WebCore/html/canvas/WebGLTexture.h
+++ b/WebCore/html/canvas/WebGLTexture.h
@@ -44,6 +44,8 @@ public:
void setParameteri(unsigned long pname, int param);
void setParameterf(unsigned long pname, float param);
+ int getMinFilter() const { return m_minFilter; }
+
void setLevelInfo(unsigned long target, int level, unsigned long internalFormat, int width, int height, unsigned long type);
bool canGenerateMipmaps();
diff --git a/WebCore/html/parser/HTMLElementStack.cpp b/WebCore/html/parser/HTMLElementStack.cpp
index 6b96291..6aab0f7 100644
--- a/WebCore/html/parser/HTMLElementStack.cpp
+++ b/WebCore/html/parser/HTMLElementStack.cpp
@@ -32,10 +32,6 @@
#include "SVGNames.h"
#include <wtf/PassOwnPtr.h>
-#if ENABLE(SVG)
-#include "SVGNames.h"
-#endif
-
namespace WebCore {
using namespace HTMLNames;
@@ -56,15 +52,21 @@ inline bool isScopeMarker(Element* element)
{
return element->hasTagName(appletTag)
|| element->hasTagName(captionTag)
-#if ENABLE(SVG_FOREIGN_OBJECT)
- || element->hasTagName(SVGNames::foreignObjectTag)
-#endif
|| element->hasTagName(htmlTag)
|| element->hasTagName(marqueeTag)
|| element->hasTagName(objectTag)
|| element->hasTagName(tableTag)
|| element->hasTagName(tdTag)
- || element->hasTagName(thTag);
+ || element->hasTagName(thTag)
+ || element->hasTagName(MathMLNames::miTag)
+ || element->hasTagName(MathMLNames::moTag)
+ || element->hasTagName(MathMLNames::mnTag)
+ || element->hasTagName(MathMLNames::msTag)
+ || element->hasTagName(MathMLNames::mtextTag)
+ || element->hasTagName(MathMLNames::annotation_xmlTag)
+ || element->hasTagName(SVGNames::foreignObjectTag)
+ || element->hasTagName(SVGNames::descTag)
+ || element->hasTagName(SVGNames::titleTag);
}
inline bool isListItemScopeMarker(Element* element)
diff --git a/WebCore/html/parser/HTMLParserIdioms.cpp b/WebCore/html/parser/HTMLParserIdioms.cpp
index f093eb2..0ce5e4d 100644
--- a/WebCore/html/parser/HTMLParserIdioms.cpp
+++ b/WebCore/html/parser/HTMLParserIdioms.cpp
@@ -83,6 +83,11 @@ bool parseToDoubleForNumberType(const String& string, double* result)
if (!isfinite(value))
return false;
+ // Numbers are considered finite IEEE 754 single-precision floating point values.
+ // See HTML5 2.4.4.3 `Real numbers.'
+ if (-FLT_MAX > value || value > FLT_MAX)
+ return false;
+
if (result) {
// The following expression converts -0 to +0.
*result = value ? value : 0;
diff --git a/WebCore/html/parser/HTMLScriptRunner.cpp b/WebCore/html/parser/HTMLScriptRunner.cpp
index 4f54f42..75db644 100644
--- a/WebCore/html/parser/HTMLScriptRunner.cpp
+++ b/WebCore/html/parser/HTMLScriptRunner.cpp
@@ -35,6 +35,7 @@
#include "HTMLScriptRunnerHost.h"
#include "HTMLInputStream.h"
#include "HTMLNames.h"
+#include "IgnoreDestructiveWriteCountIncrementer.h"
#include "NestingLevelIncrementer.h"
#include "NotImplemented.h"
#include "ScriptElement.h"
@@ -135,6 +136,7 @@ void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendi
RefPtr<Element> scriptElement = pendingScript.releaseElementAndClear();
{
NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
+ IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrementer(m_document);
if (errorOccurred)
scriptElement->dispatchEvent(createScriptErrorEvent());
else {
diff --git a/WebCore/html/parser/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp
index 5f90285..310ff60 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.cpp
+++ b/WebCore/html/parser/HTMLTreeBuilder.cpp
@@ -105,7 +105,15 @@ bool isTableBodyContextTag(const AtomicString& tagName)
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#special
bool isSpecialNode(Node* node)
{
- if (node->hasTagName(SVGNames::foreignObjectTag))
+ if (node->hasTagName(MathMLNames::miTag)
+ || node->hasTagName(MathMLNames::moTag)
+ || node->hasTagName(MathMLNames::mnTag)
+ || node->hasTagName(MathMLNames::msTag)
+ || node->hasTagName(MathMLNames::mtextTag)
+ || node->hasTagName(MathMLNames::annotation_xmlTag)
+ || node->hasTagName(SVGNames::foreignObjectTag)
+ || node->hasTagName(SVGNames::descTag)
+ || node->hasTagName(SVGNames::titleTag))
return true;
if (node->namespaceURI() != xhtmlNamespaceURI)
return false;
@@ -331,11 +339,11 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* documen
, m_isPaused(false)
, m_insertionMode(InitialMode)
, m_originalInsertionMode(InitialMode)
- , m_secondaryInsertionMode(InitialMode)
, m_tokenizer(tokenizer)
, m_scriptToProcessStartLine(uninitializedLineNumberValue)
, m_lastScriptElementStartLine(uninitializedLineNumberValue)
, m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
+ , m_hasPendingForeignInsertionModeSteps(false)
{
}
@@ -350,11 +358,11 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fra
, m_isPaused(false)
, m_insertionMode(InitialMode)
, m_originalInsertionMode(InitialMode)
- , m_secondaryInsertionMode(InitialMode)
, m_tokenizer(tokenizer)
, m_scriptToProcessStartLine(uninitializedLineNumberValue)
, m_lastScriptElementStartLine(uninitializedLineNumberValue)
, m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
+ , m_hasPendingForeignInsertionModeSteps(false)
{
if (contextElement) {
// Steps 4.2-4.6 of the HTML5 Fragment Case parsing algorithm:
@@ -815,7 +823,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
if (m_tree.openElements()->inScope(buttonTag)) {
parseError(token);
processFakeEndTag(buttonTag);
- processStartTag(token); // FIXME: Could we just fall through here?
+ reprocessStartTag(token); // FIXME: Could we just fall through here?
return;
}
m_tree.reconstructTheActiveFormattingElements();
@@ -872,6 +880,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
parseError(token);
// Apparently we're not supposed to ask.
token.setName(imgTag.localName());
+ prepareToReprocessToken();
// Note the fall through to the imgTag handling below!
}
if (token.name() == areaTag
@@ -971,10 +980,8 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
adjustMathMLAttributes(token);
adjustForeignAttributes(token);
m_tree.insertForeignElement(token, MathMLNames::mathmlNamespaceURI);
- if (m_insertionMode != InForeignContentMode) {
- setSecondaryInsertionMode(m_insertionMode);
+ if (m_insertionMode != InForeignContentMode)
setInsertionMode(InForeignContentMode);
- }
return;
}
if (token.name() == SVGNames::svgTag.localName()) {
@@ -982,10 +989,8 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token)
adjustSVGAttributes(token);
adjustForeignAttributes(token);
m_tree.insertForeignElement(token, SVGNames::svgNamespaceURI);
- if (m_insertionMode != InForeignContentMode) {
- setSecondaryInsertionMode(m_insertionMode);
+ if (m_insertionMode != InForeignContentMode)
setInsertionMode(InForeignContentMode);
- }
return;
}
if (isCaptionColOrColgroupTag(token.name())
@@ -1046,7 +1051,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
if (token.name() == colTag) {
processFakeStartTag(colgroupTag);
ASSERT(InColumnGroupMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (isTableBodyContextTag(token.name())) {
@@ -1059,7 +1064,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
|| token.name() == trTag) {
processFakeStartTag(tbodyTag);
ASSERT(insertionMode() == InTableBodyMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (token.name() == tableTag) {
@@ -1068,7 +1073,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (token.name() == styleTag || token.name() == scriptTag) {
@@ -1099,7 +1104,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token)
namespace {
-bool shouldProcessUsingSecondaryInsertionMode(AtomicHTMLToken& token, Element* currentElement)
+bool shouldProcessForeignContentUsingInBodyInsertionMode(AtomicHTMLToken& token, Element* currentElement)
{
ASSERT(token.type() == HTMLToken::StartTag);
if (currentElement->hasTagName(MathMLNames::miTag)
@@ -1215,7 +1220,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInBody(token);
@@ -1234,7 +1239,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processStartTag(token);
+ reprocessStartTag(token);
break;
case InTableBodyMode:
ASSERT(insertionMode() == InTableBodyMode);
@@ -1248,7 +1253,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
parseError(token);
processFakeStartTag(trTag);
ASSERT(insertionMode() == InRowMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (isCaptionColOrColgroupTag(token.name()) || isTableBodyContextTag(token.name())) {
@@ -1261,7 +1266,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
m_tree.openElements()->popUntilTableBodyScopeMarker();
ASSERT(isTableBodyContextTag(m_tree.currentElement()->localName()));
processFakeEndTag(m_tree.currentElement()->tagQName());
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInTable(token);
@@ -1283,7 +1288,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
ASSERT(insertionMode() == InTableBodyMode);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInTable(token);
@@ -1301,7 +1306,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
closeTheCell();
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
processStartTagForInBody(token);
@@ -1314,7 +1319,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
return;
}
setInsertionMode(InBodyMode);
- processStartTag(token);
+ reprocessStartTag(token);
break;
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
@@ -1382,7 +1387,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
parseError(token);
AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
processEndTag(endSelect);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
// Fall through
@@ -1428,7 +1433,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
}
AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
processEndTag(endSelect);
- processStartTag(token);
+ reprocessStartTag(token);
return;
}
if (token.name() == scriptTag) {
@@ -1442,8 +1447,8 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
processStartTag(token);
break;
case InForeignContentMode: {
- if (shouldProcessUsingSecondaryInsertionMode(token, m_tree.currentElement())) {
- processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
+ if (shouldProcessForeignContentUsingInBodyInsertionMode(token, m_tree.currentElement())) {
+ processForeignContentUsingInBodyModeAndResetMode(token);
return;
}
if (token.name() == bTag
@@ -1488,15 +1493,14 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
|| (token.name() == fontTag && (token.getAttributeItem(colorAttr) || token.getAttributeItem(faceAttr) || token.getAttributeItem(sizeAttr)))) {
parseError(token);
m_tree.openElements()->popUntilForeignContentScopeMarker();
- if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
- setInsertionMode(m_secondaryInsertionMode);
- processStartTag(token);
+ resetInsertionModeAppropriately();
+ reprocessStartTag(token);
return;
}
const AtomicString& currentNamespace = m_tree.currentElement()->namespaceURI();
if (currentNamespace == MathMLNames::mathmlNamespaceURI)
adjustMathMLAttributes(token);
- if (currentNamespace == SVGNames::svgNamespaceURI) {
+ if (currentNamespace == SVGNames::svgNamespaceURI) {
adjustSVGTagNameCase(token);
adjustSVGAttributes(token);
}
@@ -1679,26 +1683,10 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
}
}
-void HTMLTreeBuilder::setSecondaryInsertionMode(InsertionMode mode)
-{
- ASSERT(mode != InForeignContentMode);
- m_secondaryInsertionMode = mode;
-}
-
-void HTMLTreeBuilder::setInsertionModeAndEnd(InsertionMode newInsertionMode, bool foreign)
-{
- setInsertionMode(newInsertionMode);
- if (foreign) {
- setSecondaryInsertionMode(m_insertionMode);
- setInsertionMode(InForeignContentMode);
- }
-}
-
void HTMLTreeBuilder::resetInsertionModeAppropriately()
{
// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#reset-the-insertion-mode-appropriately
bool last = false;
- bool foreign = false;
HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()->topRecord();
while (1) {
Element* node = nodeRecord->element();
@@ -1709,42 +1697,42 @@ void HTMLTreeBuilder::resetInsertionModeAppropriately()
}
if (node->hasTagName(selectTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InSelectMode, foreign);
+ return setInsertionMode(InSelectMode);
}
if (node->hasTagName(tdTag) || node->hasTagName(thTag))
- return setInsertionModeAndEnd(InCellMode, foreign);
+ return setInsertionMode(InCellMode);
if (node->hasTagName(trTag))
- return setInsertionModeAndEnd(InRowMode, foreign);
- if (isTableBodyContextTag(node->localName()))
- return setInsertionModeAndEnd(InTableBodyMode, foreign);
+ return setInsertionMode(InRowMode);
+ if (node->hasTagName(tbodyTag) || node->hasTagName(theadTag) || node->hasTagName(tfootTag))
+ return setInsertionMode(InTableBodyMode);
if (node->hasTagName(captionTag))
- return setInsertionModeAndEnd(InCaptionMode, foreign);
+ return setInsertionMode(InCaptionMode);
if (node->hasTagName(colgroupTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InColumnGroupMode, foreign);
+ return setInsertionMode(InColumnGroupMode);
}
if (node->hasTagName(tableTag))
- return setInsertionModeAndEnd(InTableMode, foreign);
+ return setInsertionMode(InTableMode);
if (node->hasTagName(headTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InBodyMode, foreign);
+ return setInsertionMode(InBodyMode);
}
if (node->hasTagName(bodyTag))
- return setInsertionModeAndEnd(InBodyMode, foreign);
+ return setInsertionMode(InBodyMode);
if (node->hasTagName(framesetTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InFramesetMode, foreign);
+ return setInsertionMode(InFramesetMode);
}
if (node->hasTagName(htmlTag)) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(BeforeHeadMode, foreign);
+ return setInsertionMode(BeforeHeadMode);
}
if (node->namespaceURI() == SVGNames::svgNamespaceURI
|| node->namespaceURI() == MathMLNames::mathmlNamespaceURI)
- foreign = true;
+ return setInsertionMode(InForeignContentMode);
if (last) {
ASSERT(isParsingFragment());
- return setInsertionModeAndEnd(InBodyMode, foreign);
+ return setInsertionMode(InBodyMode);
}
nodeRecord = nodeRecord->next();
}
@@ -1773,7 +1761,7 @@ void HTMLTreeBuilder::processEndTagForInTableBody(AtomicHTMLToken& token)
m_tree.openElements()->popUntilTableBodyScopeMarker();
ASSERT(isTableBodyContextTag(m_tree.currentElement()->localName()));
processFakeEndTag(m_tree.currentElement()->tagQName());
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == bodyTag
@@ -1800,7 +1788,7 @@ void HTMLTreeBuilder::processEndTagForInRow(AtomicHTMLToken& token)
return;
}
ASSERT(insertionMode() == InTableBodyMode);
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (isTableBodyContextTag(token.name())) {
@@ -1810,7 +1798,7 @@ void HTMLTreeBuilder::processEndTagForInRow(AtomicHTMLToken& token)
}
processFakeEndTag(trTag);
ASSERT(insertionMode() == InTableBodyMode);
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == bodyTag
@@ -1854,7 +1842,7 @@ void HTMLTreeBuilder::processEndTagForInCell(AtomicHTMLToken& token)
return;
}
closeTheCell();
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
processEndTagForInBody(token);
@@ -1870,7 +1858,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
if (token.name() == htmlTag) {
AtomicHTMLToken endBody(HTMLToken::EndTag, bodyTag.localName());
if (processBodyEndTagForInBody(endBody))
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == addressTag
@@ -1923,7 +1911,7 @@ void HTMLTreeBuilder::processEndTagForInBody(AtomicHTMLToken& token)
parseError(token);
processFakeStartTag(pTag);
ASSERT(m_tree.openElements()->inScope(token.name()));
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
m_tree.generateImpliedEndTagsWithExclusion(token.name());
@@ -2119,7 +2107,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processEndTag(token);
+ reprocessEndTag(token);
return;
}
if (token.name() == bodyTag
@@ -2148,7 +2136,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
- processEndTag(token);
+ reprocessEndTag(token);
break;
case InRowMode:
ASSERT(insertionMode() == InRowMode);
@@ -2172,12 +2160,13 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
setInsertionMode(AfterAfterBodyMode);
return;
}
+ prepareToReprocessToken();
// Fall through.
case AfterAfterBodyMode:
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
parseError(token);
setInsertionMode(InBodyMode);
- processEndTag(token);
+ reprocessEndTag(token);
break;
case InHeadNoscriptMode:
ASSERT(insertionMode() == InHeadNoscriptMode);
@@ -2253,7 +2242,7 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
if (m_tree.openElements()->inTableScope(token.name())) {
AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
processEndTag(endSelect);
- processEndTag(token);
+ reprocessEndTag(token);
}
return;
}
@@ -2314,11 +2303,31 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
}
}
// Any other end tag (also the last two steps of "An end tag, if the current node is not an element in the HTML namespace."
- processUsingSecondaryInsertionModeAndAdjustInsertionMode(token);
+ processForeignContentUsingInBodyModeAndResetMode(token);
break;
}
}
+void HTMLTreeBuilder::prepareToReprocessToken()
+{
+ if (m_hasPendingForeignInsertionModeSteps) {
+ resetForeignInsertionMode();
+ m_hasPendingForeignInsertionModeSteps = false;
+ }
+}
+
+void HTMLTreeBuilder::reprocessStartTag(AtomicHTMLToken& token)
+{
+ prepareToReprocessToken();
+ processStartTag(token);
+}
+
+void HTMLTreeBuilder::reprocessEndTag(AtomicHTMLToken& token)
+{
+ prepareToReprocessToken();
+ processEndTag(token);
+}
+
class HTMLTreeBuilder::FakeInsertionMode : public Noncopyable {
public:
FakeInsertionMode(HTMLTreeBuilder* treeBuilder, InsertionMode mode)
@@ -2339,18 +2348,21 @@ private:
InsertionMode m_originalMode;
};
-// This handles both secondary insertion mode processing, as well as updating
-// the insertion mode. These are separate steps in the spec, but always occur
-// right after one another.
-void HTMLTreeBuilder::processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken& token)
+void HTMLTreeBuilder::processForeignContentUsingInBodyModeAndResetMode(AtomicHTMLToken& token)
{
- ASSERT(token.type() == HTMLToken::StartTag || token.type() == HTMLToken::EndTag);
+ m_hasPendingForeignInsertionModeSteps = true;
{
- FakeInsertionMode fakeMode(this, m_secondaryInsertionMode);
+ FakeInsertionMode fakeMode(this, InBodyMode);
processToken(token);
}
- if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
- setInsertionMode(m_secondaryInsertionMode);
+ if (m_hasPendingForeignInsertionModeSteps)
+ resetForeignInsertionMode();
+}
+
+void HTMLTreeBuilder::resetForeignInsertionMode()
+{
+ if (insertionMode() == InForeignContentMode)
+ resetInsertionModeAppropriately();
}
void HTMLTreeBuilder::processComment(AtomicHTMLToken& token)
@@ -2448,6 +2460,7 @@ ReprocessBuffer:
ASSERT(m_pendingTableCharacters.isEmpty());
m_originalInsertionMode = m_insertionMode;
setInsertionMode(InTableTextMode);
+ prepareToReprocessToken();
// Fall through.
}
case InTableTextMode: {
@@ -2468,6 +2481,7 @@ ReprocessBuffer:
if (buffer.isEmpty())
return;
}
+ prepareToReprocessToken();
goto ReprocessBuffer;
}
case AfterBodyMode:
@@ -2475,6 +2489,7 @@ ReprocessBuffer:
ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfterBodyMode);
// FIXME: parse error
setInsertionMode(InBodyMode);
+ prepareToReprocessToken();
goto ReprocessBuffer;
break;
}
@@ -2593,16 +2608,11 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
ASSERT(isParsingFragment());
return;
}
+ prepareToReprocessToken();
processEndOfFile(token);
return;
case InForeignContentMode:
- parseError(token);
- m_tree.openElements()->popUntilForeignContentScopeMarker();
- // FIXME: The spec adds the following condition before setting the
- // insertion mode. However, this condition causes an infinite loop.
- // See http://www.w3.org/Bugs/Public/show_bug.cgi?id=10621
- // if (insertionMode() == InForeignContentMode && m_tree.openElements()->hasOnlyHTMLElementsInScope())
- setInsertionMode(m_secondaryInsertionMode);
+ setInsertionMode(InBodyMode);
processEndOfFile(token);
return;
case InTableTextMode:
@@ -2615,6 +2625,7 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
notImplemented(); // mark the script element as "already started".
m_tree.openElements()->pop();
setInsertionMode(m_originalInsertionMode);
+ prepareToReprocessToken();
processEndOfFile(token);
return;
}
@@ -2629,6 +2640,7 @@ void HTMLTreeBuilder::defaultForInitial()
m_document->setCompatibilityMode(Document::QuirksMode);
// FIXME: parse error
setInsertionMode(BeforeHTMLMode);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForBeforeHTML()
@@ -2636,24 +2648,28 @@ void HTMLTreeBuilder::defaultForBeforeHTML()
AtomicHTMLToken startHTML(HTMLToken::StartTag, htmlTag.localName());
m_tree.insertHTMLHtmlStartTagBeforeHTML(startHTML);
setInsertionMode(BeforeHeadMode);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForBeforeHead()
{
AtomicHTMLToken startHead(HTMLToken::StartTag, headTag.localName());
processStartTag(startHead);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForInHead()
{
AtomicHTMLToken endHead(HTMLToken::EndTag, headTag.localName());
processEndTag(endHead);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForInHeadNoscript()
{
AtomicHTMLToken endNoscript(HTMLToken::EndTag, noscriptTag.localName());
processEndTag(endNoscript);
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForAfterHead()
@@ -2661,6 +2677,7 @@ void HTMLTreeBuilder::defaultForAfterHead()
AtomicHTMLToken startBody(HTMLToken::StartTag, bodyTag.localName());
processStartTag(startBody);
m_framesetOk = true;
+ prepareToReprocessToken();
}
void HTMLTreeBuilder::defaultForInTableText()
@@ -2673,10 +2690,12 @@ void HTMLTreeBuilder::defaultForInTableText()
m_tree.insertTextNode(characters);
m_framesetOk = false;
setInsertionMode(m_originalInsertionMode);
+ prepareToReprocessToken();
return;
}
m_tree.insertTextNode(characters);
setInsertionMode(m_originalInsertionMode);
+ prepareToReprocessToken();
}
bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken& token)
diff --git a/WebCore/html/parser/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h
index e61fe73..c6fcdfd 100644
--- a/WebCore/html/parser/HTMLTreeBuilder.h
+++ b/WebCore/html/parser/HTMLTreeBuilder.h
@@ -163,7 +163,10 @@ private:
void defaultForAfterHead();
void defaultForInTableText();
- void processUsingSecondaryInsertionModeAndAdjustInsertionMode(AtomicHTMLToken&);
+ void prepareToReprocessToken();
+
+ void reprocessStartTag(AtomicHTMLToken&);
+ void reprocessEndTag(AtomicHTMLToken&);
PassRefPtr<NamedNodeMap> attributesForIsindexInput(AtomicHTMLToken&);
@@ -194,11 +197,11 @@ private:
m_isFakeInsertionMode = true;
}
- void setSecondaryInsertionMode(InsertionMode);
-
- void setInsertionModeAndEnd(InsertionMode, bool foreign); // Helper for resetInsertionModeAppropriately
void resetInsertionModeAppropriately();
+ void processForeignContentUsingInBodyModeAndResetMode(AtomicHTMLToken& token);
+ void resetForeignInsertionMode();
+
class FragmentParsingContext : public Noncopyable {
public:
FragmentParsingContext();
@@ -236,7 +239,6 @@ private:
// setInsertionMode and never set m_insertionMode directly.
InsertionMode m_insertionMode;
InsertionMode m_originalInsertionMode;
- InsertionMode m_secondaryInsertionMode;
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#pending-table-character-tokens
Vector<UChar> m_pendingTableCharacters;
@@ -252,8 +254,10 @@ 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;
+
+ bool m_hasPendingForeignInsertionModeSteps;
};
}
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 85c30a8..331e504 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -94,12 +94,7 @@ module core {
// This method is going to be broken down into smaller parts.
[handler=Controller] void populateScriptObjects();
- [handler=Controller] void getSettings(out Object settings);
[handler=Controller] void getInspectorState(out Object state);
- [handler=Controller] void storeLastActivePanel(in String panelName);
-
- [handler=Controller] void saveApplicationSettings(in String settings);
- [handler=Controller] void saveSessionSettings(in String settings);
[handler=Controller] void setSearchingForNode(in boolean enabled, out boolean newState);
@@ -112,19 +107,19 @@ module core {
[handler=Controller] void startTimelineProfiler();
[handler=Controller] void stopTimelineProfiler();
- [handler=Resource] void cachedResources(out Array resources);
- [handler=Resource] void resourceContent(in unsigned long frameID, in String url, out String content);
- [notify] void identifierForInitialRequest(out long identifier, out String url, out unsigned long frameID, out boolean isMainResource);
+ [handler=Resource] void cachedResources(out Object resources);
+ [handler=Resource] void resourceContent(in unsigned long frameId, in String url, in boolean base64Encode, out String content);
+ [notify] void identifierForInitialRequest(out long identifier, out String url, out Object loader);
[notify] void willSendRequest(out long identifier, out double time, out Object request, out Object redirectResponse);
[notify] void markResourceAsCached(out long identifier);
[notify] void didReceiveResponse(out long identifier, out double time, out String resourceType, out Object response);
[notify] void didReceiveContentLength(out long identifier, out double time, out long lengthReceived);
[notify] void didFinishLoading(out long identifier, out double finishTime);
[notify] void didFailLoading(out long identifier, out double time, out String localizedDescription);
- [notify] void didLoadResourceFromMemoryCache(out double time, out unsigned long frameID, out Object resource);
+ [notify] void didLoadResourceFromMemoryCache(out double time, out Object resource);
[notify] void setOverrideContent(out long identifier, out String sourceString, out String type);
- [notify] void didCommitLoad(out unsigned long frameID);
- [notify] void frameDetachedFromParent(out unsigned long frameID);
+ [notify] void didCommitLoadForFrame(out unsigned long parentFrameId, out Object loader);
+ [notify] void frameDetachedFromParent(out unsigned long frameId);
[notify] void didCreateWebSocket(out unsigned long identifier, out String requestURL);
[notify] void willSendWebSocketHandshakeRequest(out unsigned long identifier, out double time, out Object request);
diff --git a/WebCore/inspector/InspectorCSSAgent.cpp b/WebCore/inspector/InspectorCSSAgent.cpp
index e0fab85..d1f7412 100644
--- a/WebCore/inspector/InspectorCSSAgent.cpp
+++ b/WebCore/inspector/InspectorCSSAgent.cpp
@@ -49,7 +49,8 @@
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
-
+// Currently implemented model:
+//
// cssProperty = {
// name : <string>,
// value : <string>,
@@ -62,85 +63,57 @@
// endOffset : <number>, // Optional - property text end offset in enclosing style declaration. Absent for computed styles and such.
// }
//
+// name + value + priority : present when the property is enabled
+// text : present when the property is disabled
+//
+// For disabled properties, startOffset === endOffset === insertion point for the property.
+//
// status:
// "disabled" == property disabled by user
// "active" == property participates in the computed style calculation
// "inactive" == property does no participate in the computed style calculation (i.e. overridden by a subsequent property with the same name)
// "style" == property is active and originates from the WebCore CSSStyleDeclaration rather than CSS source code (e.g. implicit longhand properties)
//
-//
// cssStyle = {
-// styleId : <number>, // Optional
-// styleSheetId : <number>, // Parent: -1 for inline styles (<foo style="..">)
-// cssProperties : [
+// styleId : <string>, // Optional
+// cssProperties : [
// #cssProperty,
// ...
// #cssProperty
-// ],
-// shorthandValues : {
+// ],
+// shorthandValues : {
// shorthandName1 : shorthandValue1,
// shorthandName2 : shorthandValue2
-// },
-// cssText : <string>, // declaration text
-// properties : { } // ???
+// },
+// cssText : <string>, // Optional - declaration text
+// properties : { width, height }
// }
//
-// // TODO:
-// // - convert disabledProperties to enabled flag.
-// // - convert width, height to properties
-//
// cssRule = {
-// ruleId : <number>,
-// selectorText : <string>
-// sourceURL : <string>
-// sourceLine : <string>
-// styleSheetId : <number> // also found in style
-// origin : <string> // "" || "user-agent" || "user" || "inspector"
+// ruleId : <string>, // Optional
+// selectorText : <string>,
+// sourceURL : <string>,
+// sourceLine : <string>,
+// origin : <string>, // "" || "user-agent" || "user" || "inspector"
// style : #cssStyle
// }
//
-// // TODO:
-// // - fix origin
-// // - add sourceURL
-// // - fix parentStyleSheetId
-//
// cssStyleSheet = {
// styleSheetId : <number>
-// href : <string>
+// sourceURL : <string>
// title : <string>
// disabled : <boolean>
-// documentNodeId : <number>
// rules : [
// #cssRule,
// ...
// #cssRule
// ]
+// text : <string> // Optional - whenever the text is available for a text-based stylesheet
// }
namespace WebCore {
// static
-PassRefPtr<InspectorObject> InspectorCSSAgent::buildObjectForStyle(CSSStyleDeclaration* style, const String& fullStyleId, CSSStyleSourceData* sourceData)
-{
- RefPtr<InspectorObject> result = InspectorObject::create();
- if (!fullStyleId.isEmpty())
- result->setString("id", fullStyleId);
-
- result->setString("width", style->getPropertyValue("width"));
- result->setString("height", style->getPropertyValue("height"));
- Vector<CSSPropertySourceData>* propertyData = 0;
-
- if (sourceData) {
- result->setNumber("startOffset", sourceData->styleBodyRange.start);
- result->setNumber("endOffset", sourceData->styleBodyRange.end);
- propertyData = &sourceData->propertyData;
- }
- populateObjectWithStyleProperties(style, result.get(), propertyData);
-
- return result.release();
-}
-
-// static
CSSStyleSheet* InspectorCSSAgent::parentStyleSheet(StyleBase* styleBase)
{
if (!styleBase)
@@ -164,7 +137,6 @@ CSSStyleRule* InspectorCSSAgent::asCSSStyleRule(StyleBase* styleBase)
return static_cast<CSSStyleRule*>(rule);
}
-
InspectorCSSAgent::InspectorCSSAgent(InspectorDOMAgent* domAgent, InspectorFrontend* frontend)
: m_domAgent(domAgent)
, m_frontend(frontend)
@@ -246,7 +218,10 @@ void InspectorCSSAgent::getComputedStyleForNode2(long nodeId, RefPtr<InspectorVa
if (!defaultView)
return;
- *style = buildObjectForStyle(defaultView->getComputedStyle(element, "").get(), "");
+ RefPtr<CSSStyleDeclaration> computedStyle = defaultView->getComputedStyle(element, "");
+ Vector<InspectorStyleProperty> properties;
+ RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), computedStyle.get(), 0);
+ *style = inspectorStyle->buildObjectForStyle();
}
void InspectorCSSAgent::getInheritedStylesForNode2(long nodeId, RefPtr<InspectorArray>* style)
@@ -263,7 +238,7 @@ void InspectorCSSAgent::getInheritedStylesForNode2(long nodeId, RefPtr<Inspector
if (parentElement->style() && parentElement->style()->length()) {
InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyleSheet(element);
if (styleSheet)
- parentStyle->setObject("inlineStyle", styleSheet->buildObjectForStyle(styleSheet->styleForId("0")));
+ parentStyle->setObject("inlineStyle", styleSheet->buildObjectForStyle(styleSheet->styleForId(InspectorCSSId::createFromParts(styleSheet->id(), "0"))));
}
CSSStyleSelector* parentSelector = parentElement->ownerDocument()->styleSelector();
@@ -308,43 +283,48 @@ void InspectorCSSAgent::setStyleSheetText2(const String& styleSheetId, const Str
inspectorStyleSheet->setText(text);
}
-void InspectorCSSAgent::setStyleText2(const String& fullStyleId, const String& text, RefPtr<InspectorValue>* result)
+void InspectorCSSAgent::setPropertyText2(const String& fullStyleId, long propertyIndex, const String& text, bool overwrite, RefPtr<InspectorValue>* result)
{
- Vector<String> idParts;
- fullStyleId.split(':', idParts);
- ASSERT(idParts.size() == 2);
+ InspectorCSSId compoundId(fullStyleId);
+ ASSERT(!compoundId.isEmpty());
- InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(idParts.at(0));
+ InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(compoundId.styleSheetId());
if (!inspectorStyleSheet)
return;
- if (!inspectorStyleSheet->setStyleText(idParts.at(1), text))
- return;
-
- *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(idParts.at(1)));
+ bool success = inspectorStyleSheet->setPropertyText(compoundId, propertyIndex, text, overwrite);
+ if (success)
+ *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
}
-void InspectorCSSAgent::toggleProperty2(const String&, long, bool)
+void InspectorCSSAgent::toggleProperty2(const String& fullStyleId, long propertyIndex, bool disable, RefPtr<InspectorValue>* result)
{
- // FIXME(apavlov): implement
+ InspectorCSSId compoundId(fullStyleId);
+ ASSERT(!compoundId.isEmpty());
+
+ InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(compoundId.styleSheetId());
+ if (!inspectorStyleSheet)
+ return;
+
+ bool success = inspectorStyleSheet->toggleProperty(compoundId, propertyIndex, disable);
+ if (success)
+ *result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
}
void InspectorCSSAgent::setRuleSelector2(const String& fullRuleId, const String& selector, RefPtr<InspectorValue>* result)
{
- Vector<String> idParts;
- fullRuleId.split(':', idParts);
- ASSERT(idParts.size() == 2);
+ InspectorCSSId compoundId(fullRuleId);
+ ASSERT(!compoundId.isEmpty());
- InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(idParts.at(0));
+ InspectorStyleSheet* inspectorStyleSheet = styleSheetForId(compoundId.styleSheetId());
if (!inspectorStyleSheet)
return;
- const String& ruleId = idParts.at(1);
- bool success = inspectorStyleSheet->setRuleSelector(ruleId, selector);
+ bool success = inspectorStyleSheet->setRuleSelector(compoundId, selector);
if (!success)
return;
- *result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(ruleId));
+ *result = inspectorStyleSheet->buildObjectForRule(inspectorStyleSheet->ruleForId(compoundId));
}
void InspectorCSSAgent::addRule2(const long contextNodeId, const String& selector, RefPtr<InspectorValue>* result)
@@ -379,130 +359,6 @@ Element* InspectorCSSAgent::inlineStyleElement(CSSStyleDeclaration* style)
return static_cast<Element*>(node);
}
-// static
-void InspectorCSSAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* style, InspectorObject* result, Vector<CSSPropertySourceData>* propertyData)
-{
- RefPtr<InspectorArray> properties = InspectorArray::create();
- RefPtr<InspectorObject> shorthandValues = InspectorObject::create();
- HashMap<String, RefPtr<InspectorObject> > propertyNameToPreviousActiveProperty;
- HashSet<String> foundShorthands;
- HashSet<String> sourcePropertyNames;
- if (propertyData) {
- for (Vector<CSSPropertySourceData>::const_iterator it = propertyData->begin(); it != propertyData->end(); ++it) {
- const CSSPropertySourceData& propertyEntry = *it;
- RefPtr<InspectorObject> property = InspectorObject::create();
- properties->pushObject(property);
- const String& name = propertyEntry.name;
- sourcePropertyNames.add(name);
- property->setString("name", name);
- property->setString("value", propertyEntry.value);
- property->setString("priority", propertyEntry.important ? "important" : "");
- property->setString("status", "active");
- property->setBoolean("parsedOk", propertyEntry.parsedOk);
- property->setNumber("startOffset", propertyEntry.range.start);
- property->setNumber("endOffset", propertyEntry.range.end);
- if (propertyEntry.parsedOk) {
- property->setBoolean("implicit", false);
- String shorthand = style->getPropertyShorthand(name);
- property->setString("shorthandName", shorthand);
- if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
- foundShorthands.add(shorthand);
- shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
- }
- } else {
- property->setBoolean("implicit", false);
- property->setString("shorthandName", "");
- }
- HashMap<String, RefPtr<InspectorObject> >::iterator activeIt = propertyNameToPreviousActiveProperty.find(name);
- if (activeIt != propertyNameToPreviousActiveProperty.end()) {
- activeIt->second->setString("status", "inactive");
- activeIt->second->setString("shorthandName", "");
- }
- propertyNameToPreviousActiveProperty.set(name, property);
- }
- }
-
- for (int i = 0, size = style->length(); i < size; ++i) {
- String name = style->item(i);
- if (sourcePropertyNames.contains(name))
- continue;
-
- sourcePropertyNames.add(name);
- RefPtr<InspectorObject> property = InspectorObject::create();
- properties->pushObject(property);
- property->setString("name", name);
- property->setString("value", style->getPropertyValue(name));
- property->setString("priority", style->getPropertyPriority("name"));
- property->setBoolean("implicit", style->isPropertyImplicit(name));
- property->setBoolean("parsedOk", true);
- property->setString("status", "style");
- String shorthand = style->getPropertyShorthand(name);
- property->setString("shorthandName", shorthand);
- if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
- foundShorthands.add(shorthand);
- shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
- }
- }
-
- result->setArray("properties", properties);
- result->setObject("shorthandValues", shorthandValues);
-}
-
-// static
-String InspectorCSSAgent::shorthandValue(CSSStyleDeclaration* style, const String& shorthandProperty)
-{
- String value = style->getPropertyValue(shorthandProperty);
- if (value.isEmpty()) {
- for (unsigned i = 0; i < style->length(); ++i) {
- String individualProperty = style->item(i);
- if (style->getPropertyShorthand(individualProperty) != shorthandProperty)
- continue;
- if (style->isPropertyImplicit(individualProperty))
- continue;
- String individualValue = style->getPropertyValue(individualProperty);
- if (individualValue == "initial")
- continue;
- if (value.length())
- value.append(" ");
- value.append(individualValue);
- }
- }
- return value;
-}
-
-// static
-String InspectorCSSAgent::shorthandPriority(CSSStyleDeclaration* style, const String& shorthandProperty)
-{
- String priority = style->getPropertyPriority(shorthandProperty);
- if (priority.isEmpty()) {
- for (unsigned i = 0; i < style->length(); ++i) {
- String individualProperty = style->item(i);
- if (style->getPropertyShorthand(individualProperty) != shorthandProperty)
- continue;
- priority = style->getPropertyPriority(individualProperty);
- break;
- }
- }
- return priority;
-}
-
-
-// static
-Vector<String> InspectorCSSAgent::longhandProperties(CSSStyleDeclaration* style, const String& shorthandProperty)
-{
- Vector<String> properties;
- HashSet<String> foundProperties;
- for (unsigned i = 0; i < style->length(); ++i) {
- String individualProperty = style->item(i);
- if (foundProperties.contains(individualProperty) || style->getPropertyShorthand(individualProperty) != shorthandProperty)
- continue;
-
- foundProperties.add(individualProperty);
- properties.append(individualProperty);
- }
- return properties;
-}
-
InspectorStyleSheetForInlineStyle* InspectorCSSAgent::asInspectorStyleSheet(Element* element)
{
NodeToInspectorStyleSheet::iterator it = m_nodeToInspectorStyleSheet.find(element);
@@ -622,7 +478,8 @@ PassRefPtr<InspectorObject> InspectorCSSAgent::buildObjectForAttributeStyles(Ele
Attribute* attribute = attributes->attributeItem(i);
if (attribute->style()) {
String attributeName = attribute->localName();
- styleAttributes->setObject(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), ""));
+ RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(InspectorCSSId(), attribute->style(), 0);
+ styleAttributes->setObject(attributeName.utf8().data(), inspectorStyle->buildObjectForStyle());
}
}
diff --git a/WebCore/inspector/InspectorCSSAgent.h b/WebCore/inspector/InspectorCSSAgent.h
index eb6013b..341d09a 100644
--- a/WebCore/inspector/InspectorCSSAgent.h
+++ b/WebCore/inspector/InspectorCSSAgent.h
@@ -56,7 +56,6 @@ public:
return adoptRef(new InspectorCSSAgent(domAgent, frontend));
}
- static PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*, const String& fullStyleId, CSSStyleSourceData* = 0);
static CSSStyleSheet* parentStyleSheet(StyleBase*);
static CSSStyleRule* asCSSStyleRule(StyleBase*);
@@ -73,8 +72,8 @@ public:
void getAllStyles2(RefPtr<InspectorArray>* styles);
void getStyleSheet2(const String& styleSheetId, RefPtr<InspectorValue>* result);
void setStyleSheetText2(const String& styleSheetId, const String& text);
- void setStyleText2(const String& styleId, const String& text, RefPtr<InspectorValue>* result);
- void toggleProperty2(const String& styleId, long propertyOrdinal, bool disabled);
+ void setPropertyText2(const String& styleId, long propertyIndex, const String& text, bool overwrite, RefPtr<InspectorValue>* result);
+ void toggleProperty2(const String& styleId, long propertyIndex, bool disable, RefPtr<InspectorValue>* result);
void setRuleSelector2(const String& ruleId, const String& selector, RefPtr<InspectorValue>* result);
void addRule2(const long contextNodeId, const String& selector, RefPtr<InspectorValue>* result);
void getSupportedCSSProperties(RefPtr<InspectorArray>* result);
@@ -82,21 +81,17 @@ public:
private:
typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleSheet;
typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToInspectorStyleSheet;
- typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // for bogus "stylesheets" with inline node styles
+ typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets" with elements' inline styles
typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToViaInspectorStyleSheet; // "via inspector" stylesheets
static Element* inlineStyleElement(CSSStyleDeclaration*);
- static void populateObjectWithStyleProperties(CSSStyleDeclaration*, InspectorObject* result, Vector<CSSPropertySourceData>* propertyData);
- static String shorthandValue(CSSStyleDeclaration*, const String& shorthandProperty);
- static String shorthandPriority(CSSStyleDeclaration*, const String& shorthandProperty);
- static Vector<String> longhandProperties(CSSStyleDeclaration*, const String& shorthandProperty);
InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element);
Element* elementForId(long nodeId);
InspectorStyleSheet* bindStyleSheet(CSSStyleSheet*);
InspectorStyleSheet* viaInspectorStyleSheet(Document*, bool createIfAbsent);
- InspectorStyleSheet* styleSheetForId(const String& styleSheetId);
+ InspectorStyleSheet* styleSheetForId(const String&);
String detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
PassRefPtr<InspectorArray> buildArrayForRuleList(CSSRuleList* ruleList);
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index e0b658f..b75f11b 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -44,6 +44,7 @@
#include "HTMLHeadElement.h"
#include "InspectorController.h"
#include "InspectorResource.h"
+#include "InspectorResourceAgent.h"
#include "Node.h"
#include "PlatformString.h"
#include "SharedBuffer.h"
@@ -142,7 +143,7 @@ String InspectorCSSStore::styleSheetText(long styleSheetId)
bool InspectorCSSStore::resourceStyleSheetText(CSSStyleSheet* styleSheet, String* result)
{
- return m_inspectorController->resourceContentForURL(styleSheet->finalURL(), styleSheet->document(), result);
+ return InspectorResourceAgent::resourceContent(styleSheet->document()->frame(), styleSheet->finalURL(), result);
}
String InspectorCSSStore::inlineStyleSheetText(CSSStyleSheet* styleSheet)
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index f99d487..956ef7e 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -24,7 +24,7 @@
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
@@ -68,7 +68,6 @@
#include "InspectorFrontendClient.h"
#include "InspectorInstrumentation.h"
#include "InspectorProfilerAgent.h"
-#include "InspectorResource.h"
#include "InspectorResourceAgent.h"
#include "InspectorState.h"
#include "InspectorStorageAgent.h"
@@ -101,6 +100,11 @@
#include <wtf/ListHashSet.h>
#include <wtf/RefCounted.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/UnusedParam.h>
+
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+#include "InspectorResource.h"
+#endif
#if ENABLE(DATABASE)
#include "Database.h"
@@ -123,8 +127,6 @@ static const char* const domNativeBreakpointType = "DOM";
static const char* const eventListenerNativeBreakpointType = "EventListener";
static const char* const xhrNativeBreakpointType = "XHR";
-// FIXME: move last panel setting to the front-end
-const char* const InspectorController::LastActivePanel = "lastActivePanel";
const char* const InspectorController::ElementsPanel = "elements";
const char* const InspectorController::ConsolePanel = "console";
const char* const InspectorController::ScriptsPanel = "scripts";
@@ -140,11 +142,10 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
, m_client(client)
, m_openingFrontend(false)
, m_cssStore(new InspectorCSSStore(this))
+ , m_mainResourceIdentifier(0)
, m_loadEventTime(-1.0)
, m_domContentEventTime(-1.0)
, m_expiredConsoleMessageCount(0)
- , m_showAfterVisible(LastActivePanel)
- , m_sessionSettings(InspectorObject::create())
, m_groupLevel(0)
, m_previousMessage(0)
, m_settingsLoaded(false)
@@ -169,7 +170,9 @@ InspectorController::~InspectorController()
ASSERT(!m_inspectedPage);
ASSERT(!m_highlightedNode);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
deleteAllValues(m_frameResources);
+#endif
releaseFrontendLifetimeAgents();
@@ -226,20 +229,12 @@ bool InspectorController::searchingForNodeInPage() const
return m_state->getBoolean(InspectorState::searchingForNode);
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
bool InspectorController::resourceTrackingEnabled() const
{
return m_state->getBoolean(InspectorState::resourceTrackingEnabled);
}
-
-void InspectorController::saveApplicationSettings(const String& settings)
-{
- m_state->setString(InspectorState::frontendSettings, settings);
-}
-
-void InspectorController::saveSessionSettings(const String& settingsJSON)
-{
- m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
-}
+#endif
void InspectorController::getInspectorState(RefPtr<InspectorObject>* state)
{
@@ -257,13 +252,6 @@ void InspectorController::restoreInspectorStateFromCookie(const String& inspecto
startTimelineProfiler();
}
-void InspectorController::getSettings(RefPtr<InspectorObject>* settings)
-{
- *settings = InspectorObject::create();
- (*settings)->setString("application", m_state->getString(InspectorState::frontendSettings));
- (*settings)->setString("session", m_sessionSettings->toJSONString());
-}
-
void InspectorController::inspect(Node* node)
{
if (!enabled())
@@ -275,10 +263,8 @@ void InspectorController::inspect(Node* node)
node = node->parentNode();
m_nodeToFocus = node;
- if (!m_frontend) {
- m_showAfterVisible = ElementsPanel;
+ if (!m_frontend)
return;
- }
focusNode();
}
@@ -414,11 +400,6 @@ void InspectorController::markTimeline(const String& message)
timelineAgent()->didMarkTimeline(message);
}
-void InspectorController::storeLastActivePanel(const String& panelName)
-{
- m_state->setString(InspectorState::lastActivePanel, panelName);
-}
-
void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
{
if (!enabled() || !searchingForNodeInPage())
@@ -500,8 +481,10 @@ void InspectorController::connectFrontend()
releaseFrontendLifetimeAgents();
m_frontend = new InspectorFrontend(m_client);
m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_frontend.get());
- // FIXME: enable resource agent once front-end is ready.
- // m_resourceAgent = InspectorResourceAgent::create(m_inspectedPage, m_frontend.get());
+
+#if !LEGACY_RESOURCE_TRACKING_ENABLED
+ m_resourceAgent = InspectorResourceAgent::create(m_inspectedPage, m_frontend.get());
+#endif
#if ENABLE(DATABASE)
m_storageAgent = InspectorStorageAgent::create(m_frontend.get());
@@ -556,10 +539,6 @@ void InspectorController::showPanel(const String& panel)
m_showAfterVisible = panel;
return;
}
-
- if (panel == LastActivePanel)
- return;
-
m_frontend->showPanel(panel);
}
@@ -576,8 +555,6 @@ void InspectorController::disconnectFrontend()
if (!m_frontend)
return;
- setConsoleMessagesEnabled(false);
-
m_frontend.clear();
InspectorInstrumentation::frontendDeleted();
@@ -596,8 +573,6 @@ void InspectorController::disconnectFrontend()
unbindAllResources();
stopTimelineProfiler();
- m_showAfterVisible = LastActivePanel;
-
hideHighlight();
#if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -611,7 +586,9 @@ void InspectorController::disconnectFrontend()
void InspectorController::releaseFrontendLifetimeAgents()
{
+#if !LEGACY_RESOURCE_TRACKING_ENABLED
m_resourceAgent.clear();
+#endif
// m_domAgent is RefPtr. Remove DOM listeners first to ensure that there are
// no references to the DOM agent from the DOM tree.
@@ -636,19 +613,22 @@ void InspectorController::populateScriptObjects()
if (!m_frontend)
return;
- if (m_showAfterVisible == LastActivePanel)
- m_showAfterVisible = m_state->getString(InspectorState::lastActivePanel);
-
- showPanel(m_showAfterVisible);
+ if (!m_showAfterVisible.isEmpty()) {
+ showPanel(m_showAfterVisible);
+ m_showAfterVisible = "";
+ }
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerAgent->enabled())
m_frontend->profilerWasEnabled();
#endif
+#if LEGACY_RESOURCE_TRACKING_ENABLED
ResourcesMap::iterator resourcesEnd = m_resources.end();
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
it->second->updateScriptObject(m_frontend.get());
+#endif
+
if (m_domContentEventTime != -1.0)
m_frontend->domContentEventFired(m_domContentEventTime);
if (m_loadEventTime != -1.0)
@@ -711,10 +691,12 @@ void InspectorController::restoreProfiler()
void InspectorController::unbindAllResources()
{
+#if LEGACY_RESOURCE_TRACKING_ENABLED
ResourcesMap::iterator resourcesEnd = m_resources.end();
for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it)
it->second->releaseScriptObject(0);
-
+#endif
+
#if ENABLE(DATABASE)
DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
@@ -729,6 +711,7 @@ void InspectorController::unbindAllResources()
m_timelineAgent->reset();
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoader* loaderToKeep)
{
ASSERT_ARG(resourceMap, resourceMap);
@@ -747,15 +730,18 @@ void InspectorController::pruneResources(ResourcesMap* resourceMap, DocumentLoad
}
}
}
+#endif
void InspectorController::didCommitLoad(DocumentLoader* loader)
{
if (!enabled())
return;
+#if !LEGACY_RESOURCE_TRACKING_ENABLED
if (m_resourceAgent)
m_resourceAgent->didCommitLoad(loader);
-
+#endif
+
ASSERT(m_inspectedPage);
if (loader->frame() == m_inspectedPage->mainFrame()) {
@@ -787,7 +773,6 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
unbindAllResources();
m_cssStore->reset();
- m_sessionSettings = InspectorObject::create();
if (m_frontend) {
m_frontend->reset();
m_domAgent->reset();
@@ -803,6 +788,7 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
#endif
if (m_frontend) {
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (!loader->frameLoader()->isLoadingFromCachedPage()) {
ASSERT(m_mainResource && m_mainResource->isSameLoader(loader));
// We don't add the main resource until its load is committed. This is
@@ -816,28 +802,36 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
// identifierForInitialRequest.
m_mainResource = 0;
}
+#endif
+ m_mainResourceIdentifier = 0;
m_frontend->didCommitLoad();
m_domAgent->setDocument(m_inspectedPage->mainFrame()->document());
}
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
for (Frame* frame = loader->frame(); frame; frame = frame->tree()->traverseNext(loader->frame()))
if (ResourcesMap* resourceMap = m_frameResources.get(frame))
pruneResources(resourceMap, loader);
+#endif
}
-void InspectorController::frameDetachedFromParent(Frame* frame)
+void InspectorController::frameDetachedFromParent(Frame* rootFrame)
{
if (!enabled())
return;
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+ for (Frame* frame = rootFrame; frame; frame = frame->tree()->traverseNext(rootFrame))
+ if (ResourcesMap* resourceMap = m_frameResources.get(frame))
+ removeAllResources(resourceMap);
+#else
if (m_resourceAgent)
- m_resourceAgent->frameDetachedFromParent(frame);
-
- if (ResourcesMap* resourceMap = m_frameResources.get(frame))
- removeAllResources(resourceMap);
+ m_resourceAgent->frameDetachedFromParent(rootFrame);
+#endif
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void InspectorController::addResource(InspectorResource* resource)
{
m_resources.set(resource->identifier(), resource);
@@ -893,24 +887,14 @@ InspectorResource* InspectorController::getTrackedResource(unsigned long identif
return 0;
}
-
-InspectorResource* InspectorController::resourceForURL(const String& url)
-{
- for (InspectorController::ResourcesMap::iterator resIt = m_resources.begin(); resIt != m_resources.end(); ++resIt) {
- if (resIt->second->requestURL().string() == url)
- return resIt->second.get();
- }
- return 0;
-}
+#endif
void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* cachedResource)
{
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didLoadResourceFromMemoryCache(loader, cachedResource);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
// If the resource URL is already known, we don't need to add it again since this is just a cached load.
if (m_knownResources.contains(cachedResource->url()))
return;
@@ -932,6 +916,10 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didLoadResourceFromMemoryCache(loader, cachedResource);
+#endif
}
void InspectorController::identifierForInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request)
@@ -941,9 +929,10 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
ASSERT(m_inspectedPage);
bool isMainResource = isMainResourceLoader(loader, request.url());
+ if (isMainResource)
+ m_mainResourceIdentifier = identifier;
- if (m_resourceAgent)
- m_resourceAgent->identifierForInitialRequest(identifier, request.url(), loader, isMainResource);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
ensureSettingsLoaded();
if (!isMainResource && !resourceTrackingEnabled())
@@ -960,6 +949,10 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
if (m_frontend && loader->frameLoader()->isLoadingFromCachedPage() && resource == m_mainResource)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->identifierForInitialRequest(identifier, request.url(), loader);
+#endif
}
void InspectorController::mainResourceFiredDOMContentEvent(DocumentLoader* loader, const KURL& url)
@@ -996,23 +989,22 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->willSendRequest(identifier, request, redirectResponse);
+ request.setReportLoadTiming(true);
+ // Only enable raw headers if front-end is attached, as otherwise we may lack
+ // permissions to fetch the headers.
+ if (m_frontend)
+ request.setReportRawHeaders(true);
+
+ bool isMainResource = m_mainResourceIdentifier == identifier;
- bool isMainResource = (m_mainResource && m_mainResource->identifier() == identifier);
if (m_timelineAgent)
m_timelineAgent->willSendResourceRequest(identifier, isMainResource, request);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
- request.setReportLoadTiming(true);
- // Only enable raw headers if front-end is attached, as otherwise we may lack
- // permissions to fetch the headers.
- if (m_frontend)
- request.setReportRawHeaders(true);
-
if (!redirectResponse.isNull()) {
// Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.
// See http/tests/misc/will-send-request-returns-null-on-redirect.html
@@ -1038,6 +1030,10 @@ void InspectorController::willSendRequest(unsigned long identifier, ResourceRequ
if (resource != m_mainResource && m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->willSendRequest(identifier, request, redirectResponse);
+#endif
}
void InspectorController::markResourceAsCached(unsigned long identifier)
@@ -1045,11 +1041,13 @@ void InspectorController::markResourceAsCached(unsigned long identifier)
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->markResourceAsCached(identifier);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (RefPtr<InspectorResource> resource = getTrackedResource(identifier))
resource->markAsCached();
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->markResourceAsCached(identifier);
+#endif
}
void InspectorController::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
@@ -1057,15 +1055,19 @@ void InspectorController::didReceiveResponse(unsigned long identifier, DocumentL
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didReceiveResponse(identifier, loader, response);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (RefPtr<InspectorResource> resource = getTrackedResource(identifier)) {
resource->updateResponse(response);
if (resource != m_mainResource && m_frontend)
resource->updateScriptObject(m_frontend.get());
}
+ UNUSED_PARAM(loader);
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didReceiveResponse(identifier, loader, response);
+#endif
+
if (response.httpStatusCode() >= 400) {
String message = makeString("Failed to load resource: the server responded with a status of ", String::number(response.httpStatusCode()), " (", response.httpStatusText(), ')');
addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, response.url().string());
@@ -1077,9 +1079,7 @@ void InspectorController::didReceiveContentLength(unsigned long identifier, int
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didReceiveContentLength(identifier, lengthReceived);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1088,6 +1088,10 @@ void InspectorController::didReceiveContentLength(unsigned long identifier, int
if (resource != m_mainResource && m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didReceiveContentLength(identifier, lengthReceived);
+#endif
}
void InspectorController::didFinishLoading(unsigned long identifier, double finishTime)
@@ -1095,12 +1099,10 @@ void InspectorController::didFinishLoading(unsigned long identifier, double fini
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didFinishLoading(identifier, finishTime);
-
if (m_timelineAgent)
m_timelineAgent->didFinishLoadingResource(identifier, false, finishTime);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1110,6 +1112,10 @@ void InspectorController::didFinishLoading(unsigned long identifier, double fini
// No need to mute this event for main resource since it happens after did commit load.
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didFinishLoading(identifier, finishTime);
+#endif
}
void InspectorController::didFailLoading(unsigned long identifier, const ResourceError& error)
@@ -1117,27 +1123,29 @@ void InspectorController::didFailLoading(unsigned long identifier, const Resourc
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->didFailLoading(identifier, error);
-
if (m_timelineAgent)
m_timelineAgent->didFinishLoadingResource(identifier, true, 0);
String message = "Failed to load resource";
- if (!error.localizedDescription().isEmpty())
- message += ": " + error.localizedDescription();
- addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, error.failingURL());
+ if (!error.localizedDescription().isEmpty())
+ message += ": " + error.localizedDescription();
+ addMessageToConsole(OtherMessageSource, LogMessageType, ErrorMessageLevel, message, 0, error.failingURL());
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
- resource->markFailed();
+ resource->markFailed(error.localizedDescription());
resource->endTiming(0);
// No need to mute this event for main resource since it happens after did commit load.
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didFailLoading(identifier, error);
+#endif
}
void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
@@ -1145,12 +1153,10 @@ void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identi
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::XHR);
-
if (m_state->getBoolean(InspectorState::monitoringXHR))
addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, "XHR finished loading: \"" + url + "\".", sendLineNumber, sendURL);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (!resourceTrackingEnabled())
return;
@@ -1162,6 +1168,10 @@ void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identi
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::XHR);
+#endif
}
void InspectorController::scriptImported(unsigned long identifier, const String& sourceString)
@@ -1169,9 +1179,7 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
if (!enabled())
return;
- if (m_resourceAgent)
- m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::Script);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
if (!resourceTrackingEnabled())
return;
@@ -1183,8 +1191,13 @@ void InspectorController::scriptImported(unsigned long identifier, const String&
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->setOverrideContent(identifier, sourceString, InspectorResource::Script);
+#endif
}
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void InspectorController::setResourceTrackingEnabled(bool enable)
{
if (!enabled())
@@ -1193,9 +1206,11 @@ void InspectorController::setResourceTrackingEnabled(bool enable)
ASSERT(m_inspectedPage);
m_state->setBoolean(InspectorState::resourceTrackingEnabled, enable);
}
+#endif
void InspectorController::setResourceTrackingEnabled(bool enable, bool always, bool* newState)
{
+#if LEGACY_RESOURCE_TRACKING_ENABLED
*newState = enable;
if (always)
@@ -1209,6 +1224,11 @@ void InspectorController::setResourceTrackingEnabled(bool enable, bool always, b
if (enable)
reloadPage();
+#else
+ UNUSED_PARAM(enable);
+ UNUSED_PARAM(always);
+ UNUSED_PARAM(newState);
+#endif
}
void InspectorController::ensureSettingsLoaded()
@@ -1368,33 +1388,35 @@ void InspectorController::getCookies(RefPtr<InspectorArray>* cookies, WTF::Strin
// always return the same true/false value.
bool rawCookiesImplemented = false;
- ResourcesMap::iterator resourcesEnd = m_resources.end();
- for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
- Document* document = it->second->frame()->document();
- Vector<Cookie> docCookiesList;
- rawCookiesImplemented = getRawCookies(document, it->second->requestURL(), docCookiesList);
-
- if (!rawCookiesImplemented) {
- // FIXME: We need duplication checking for the String representation of cookies.
- ExceptionCode ec = 0;
- stringCookiesList += document->cookie(ec);
- // Exceptions are thrown by cookie() in sandboxed frames. That won't happen here
- // because "document" is the document of the main frame of the page.
- ASSERT(!ec);
- } else {
- int cookiesSize = docCookiesList.size();
- for (int i = 0; i < cookiesSize; i++) {
- if (!rawCookiesList.contains(docCookiesList[i]))
- rawCookiesList.add(docCookiesList[i]);
+ for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree()->traverseNext(m_inspectedPage->mainFrame())) {
+ Document* document = frame->document();
+ const CachedResourceLoader::DocumentResourceMap& allResources = document->cachedResourceLoader()->allCachedResources();
+ CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
+ for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
+ Vector<Cookie> docCookiesList;
+ rawCookiesImplemented = getRawCookies(document, KURL(ParsedURLString, it->second->url()), docCookiesList);
+
+ if (!rawCookiesImplemented) {
+ // FIXME: We need duplication checking for the String representation of cookies.
+ ExceptionCode ec = 0;
+ stringCookiesList += document->cookie(ec);
+ // Exceptions are thrown by cookie() in sandboxed frames. That won't happen here
+ // because "document" is the document of the main frame of the page.
+ ASSERT(!ec);
+ } else {
+ int cookiesSize = docCookiesList.size();
+ for (int i = 0; i < cookiesSize; i++) {
+ if (!rawCookiesList.contains(docCookiesList[i]))
+ rawCookiesList.add(docCookiesList[i]);
+ }
}
}
}
if (rawCookiesImplemented)
*cookies = buildArrayForCookies(rawCookiesList);
- else {
+ else
*cookiesString = stringCookiesList;
- }
}
PassRefPtr<InspectorArray> InspectorController::buildArrayForCookies(ListHashSet<Cookie>& cookiesList)
@@ -1426,11 +1448,14 @@ PassRefPtr<InspectorObject> InspectorController::buildObjectForCookie(const Cook
void InspectorController::deleteCookie(const String& cookieName, const String& domain)
{
- ResourcesMap::iterator resourcesEnd = m_resources.end();
- for (ResourcesMap::iterator it = m_resources.begin(); it != resourcesEnd; ++it) {
- Document* document = it->second->frame()->document();
- if (document->url().host() == domain)
- WebCore::deleteCookie(document, it->second->requestURL(), cookieName);
+ for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree()->traverseNext(m_inspectedPage->mainFrame())) {
+ Document* document = frame->document();
+ if (document->url().host() != domain)
+ continue;
+ const CachedResourceLoader::DocumentResourceMap& allResources = document->cachedResourceLoader()->allCachedResources();
+ CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
+ for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it)
+ WebCore::deleteCookie(document, KURL(ParsedURLString, it->second->url()), cookieName);
}
}
@@ -1528,21 +1553,22 @@ void InspectorController::didCreateWebSocket(unsigned long identifier, const KUR
return;
ASSERT(m_inspectedPage);
- if (m_resourceAgent)
- m_resourceAgent->didCreateWebSocket(identifier, requestURL);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = InspectorResource::createWebSocket(identifier, requestURL, documentURL);
addResource(resource.get());
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didCreateWebSocket(identifier, requestURL);
+ UNUSED_PARAM(documentURL);
+#endif
}
void InspectorController::willSendWebSocketHandshakeRequest(unsigned long identifier, const WebSocketHandshakeRequest& request)
{
- if (m_resourceAgent)
- m_resourceAgent->willSendWebSocketHandshakeRequest(identifier, request);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1550,13 +1576,15 @@ void InspectorController::willSendWebSocketHandshakeRequest(unsigned long identi
resource->updateWebSocketRequest(request);
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->willSendWebSocketHandshakeRequest(identifier, request);
+#endif
}
void InspectorController::didReceiveWebSocketHandshakeResponse(unsigned long identifier, const WebSocketHandshakeResponse& response)
{
- if (m_resourceAgent)
- m_resourceAgent->didReceiveWebSocketHandshakeResponse(identifier, response);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1566,13 +1594,15 @@ void InspectorController::didReceiveWebSocketHandshakeResponse(unsigned long ide
resource->updateWebSocketResponse(response);
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didReceiveWebSocketHandshakeResponse(identifier, response);
+#endif
}
void InspectorController::didCloseWebSocket(unsigned long identifier)
{
- if (m_resourceAgent)
- m_resourceAgent->didCloseWebSocket(identifier);
-
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = getTrackedResource(identifier);
if (!resource)
return;
@@ -1580,6 +1610,10 @@ void InspectorController::didCloseWebSocket(unsigned long identifier)
resource->endTiming(0);
if (m_frontend)
resource->updateScriptObject(m_frontend.get());
+#else
+ if (m_resourceAgent)
+ m_resourceAgent->didCloseWebSocket(identifier);
+#endif
}
#endif // ENABLE(WEB_SOCKETS)
@@ -1793,9 +1827,7 @@ void InspectorController::didEvaluateForTestInFrontend(long callId, const String
String InspectorController::breakpointsSettingKey()
{
DEFINE_STATIC_LOCAL(String, keyPrefix, ("breakpoints:"));
- if (!m_mainResource)
- return "";
- return keyPrefix + InspectorDebuggerAgent::md5Base16(m_mainResource->requestURL());
+ return keyPrefix + InspectorDebuggerAgent::md5Base16(m_inspectedPage->mainFrame()->loader()->url().string());
}
PassRefPtr<InspectorValue> InspectorController::loadBreakpoints()
@@ -2127,55 +2159,18 @@ void InspectorController::setInspectorExtensionAPI(const String& source)
void InspectorController::getResourceContent(unsigned long identifier, bool encode, String* content)
{
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> resource = m_resources.get(identifier);
if (!resource) {
*content = String();
return;
}
*content = encode ? resource->sourceBytes() : resource->sourceString();
-}
-
-bool InspectorController::resourceContentForURL(const KURL& url, Document* frameDocument, String* result)
-{
- if (!frameDocument)
- return false;
-
- String textEncodingName;
- RefPtr<SharedBuffer> buffer;
- if (equalIgnoringFragmentIdentifier(url, frameDocument->frame()->loader()->documentLoader()->requestURL())) {
- textEncodingName = frameDocument->inputEncoding();
- buffer = frameDocument->frame()->loader()->provisionalDocumentLoader()->mainResourceData();
- } else {
- const String& urlString = url.string();
- CachedResource* cachedResource = frameDocument->cachedResourceLoader()->cachedResource(urlString);
- if (!cachedResource)
- cachedResource = cache()->resourceForURL(urlString);
-
- ASSERT(cachedResource); // FIXME(apavlov): This might be too aggressive.
-
- bool isUnpurgeable = true;
- if (cachedResource->isPurgeable()) {
- // If the resource is purgeable then make it unpurgeable to get
- // its data. This might fail, in which case we return an
- // empty String.
- if (!cachedResource->makePurgeable(false))
- isUnpurgeable = false;
- }
- if (isUnpurgeable) {
- textEncodingName = cachedResource->encoding();
- buffer = cachedResource->data();
- }
- }
-
- if (buffer) {
- TextEncoding encoding(textEncodingName);
- if (!encoding.isValid())
- encoding = WindowsLatin1Encoding();
- *result = encoding.decode(buffer->data(), buffer->size());
- return true;
- }
-
- return false;
+#else
+ UNUSED_PARAM(identifier);
+ UNUSED_PARAM(encode);
+ UNUSED_PARAM(content);
+#endif
}
void InspectorController::reloadPage()
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 6d4d9e0..80d094f 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -67,7 +67,6 @@ class InspectorFrontend;
class InspectorFrontendClient;
class InspectorObject;
class InspectorProfilerAgent;
-class InspectorResource;
class InspectorResourceAgent;
class InspectorState;
class InspectorStorageAgent;
@@ -87,6 +86,12 @@ class SharedBuffer;
class Storage;
class StorageArea;
+#define LEGACY_RESOURCE_TRACKING_ENABLED 1
+
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+class InspectorResource;
+#endif
+
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
class InspectorApplicationCacheAgent;
#endif
@@ -98,12 +103,13 @@ class WebSocketHandshakeResponse;
class InspectorController : public Noncopyable {
public:
+#if LEGACY_RESOURCE_TRACKING_ENABLED
typedef HashMap<unsigned long, RefPtr<InspectorResource> > ResourcesMap;
typedef HashMap<RefPtr<Frame>, ResourcesMap*> FrameResourcesMap;
+#endif
typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
- static const char* const LastActivePanel;
static const char* const ConsolePanel;
static const char* const ElementsPanel;
static const char* const ProfilesPanel;
@@ -124,10 +130,6 @@ public:
Page* inspectedPage() const { return m_inspectedPage; }
void reloadPage();
- void saveApplicationSettings(const String& settings);
- void saveSessionSettings(const String&);
- void getSettings(RefPtr<InspectorObject>*);
-
void restoreInspectorStateFromCookie(const String& inspectorCookie);
void inspect(Node*);
@@ -173,9 +175,11 @@ public:
void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
void scriptImported(unsigned long identifier, const String& sourceString);
- void setResourceTrackingEnabled(bool enabled);
void setResourceTrackingEnabled(bool enabled, bool always, bool* newState);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
+ void setResourceTrackingEnabled(bool enabled);
bool resourceTrackingEnabled() const;
+#endif
void ensureSettingsLoaded();
@@ -218,9 +222,10 @@ public:
void didCloseWebSocket(unsigned long identifier);
#endif
+#if LEGACY_RESOURCE_TRACKING_ENABLED
const ResourcesMap& resources() const { return m_resources; }
- InspectorResource* resourceForURL(const String& url);
- bool resourceContentForURL(const KURL& url, Document* loaderDocument, String* result);
+#endif
+
bool hasFrontend() const { return m_frontend; }
void drawNodeHighlight(GraphicsContext&) const;
@@ -294,7 +299,6 @@ private:
void setSearchingForNode(bool enabled, bool* newState);
void setMonitoringXHREnabled(bool enabled, bool* newState);
- void storeLastActivePanel(const String& panelName);
InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
void releaseFrontendLifetimeAgents();
@@ -320,13 +324,14 @@ private:
void addConsoleMessage(PassOwnPtr<ConsoleMessage>);
+#if LEGACY_RESOURCE_TRACKING_ENABLED
void addResource(InspectorResource*);
void removeResource(InspectorResource*);
InspectorResource* getTrackedResource(unsigned long identifier);
- void getResourceContent(unsigned long identifier, bool encode, String* content);
-
void pruneResources(ResourcesMap*, DocumentLoader* loaderToKeep = 0);
void removeAllResources(ResourcesMap* map) { pruneResources(map); }
+#endif
+ void getResourceContent(unsigned long identifier, bool encode, String* content);
bool isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl);
@@ -345,7 +350,6 @@ private:
bool m_openingFrontend;
OwnPtr<InspectorFrontend> m_frontend;
RefPtr<InspectorDOMAgent> m_domAgent;
- RefPtr<InspectorResourceAgent> m_resourceAgent;
RefPtr<InspectorStorageAgent> m_storageAgent;
OwnPtr<InspectorCSSStore> m_cssStore;
OwnPtr<InspectorTimelineAgent> m_timelineAgent;
@@ -354,12 +358,15 @@ private:
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
OwnPtr<InspectorApplicationCacheAgent> m_applicationCacheAgent;
#endif
-
RefPtr<Node> m_nodeToFocus;
+#if LEGACY_RESOURCE_TRACKING_ENABLED
RefPtr<InspectorResource> m_mainResource;
ResourcesMap m_resources;
HashSet<String> m_knownResources;
FrameResourcesMap m_frameResources;
+#endif
+ RefPtr<InspectorResourceAgent> m_resourceAgent;
+ unsigned long m_mainResourceIdentifier;
double m_loadEventTime;
double m_domContentEventTime;
Vector<OwnPtr<ConsoleMessage> > m_consoleMessages;
@@ -374,9 +381,6 @@ private:
#endif
String m_showAfterVisible;
RefPtr<Node> m_highlightedNode;
-#if ENABLE(INSPECTOR)
- RefPtr<InspectorValue> m_sessionSettings;
-#endif
unsigned m_groupLevel;
ConsoleMessage* m_previousMessage;
bool m_settingsLoaded;
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index f5c5f8b..cfb55fc 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -1219,11 +1219,11 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
result->setObject("styleAttributes", buildObjectForAttributeStyles(element));
result->setArray("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
- RefPtr<InspectorObject> currentStyle = result;
+ RefPtr<InspectorArray> inheritedStyles = InspectorArray::create();
Element* parentElement = element->parentElement();
while (parentElement) {
RefPtr<InspectorObject> parentStyle = InspectorObject::create();
- currentStyle->setObject("parent", parentStyle);
+ inheritedStyles->pushObject(parentStyle);
if (parentElement->style() && parentElement->style()->length())
parentStyle->setObject("inlineStyle", buildObjectForStyle(parentElement->style(), true));
@@ -1232,8 +1232,8 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
parentStyle->setArray("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
parentElement = parentElement->parentElement();
- currentStyle = parentStyle;
}
+ result->setArray("inherited", inheritedStyles);
*styles = result.release();
}
@@ -1396,6 +1396,7 @@ void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, co
// Notify caller that the property was successfully deleted.
if (!styleTextLength) {
*success = true;
+ *styleObject = buildObjectForStyle(style, true);
return;
}
@@ -1544,18 +1545,15 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyle(CSSStyleDecla
{
RefPtr<InspectorObject> result = InspectorObject::create();
if (bind) {
- long styleId = cssStore()->bindStyle(style);
- result->setNumber("id", styleId);
- CSSStyleSheet* parentStyleSheet = InspectorCSSStore::getParentStyleSheet(style);
- if (parentStyleSheet)
- result->setNumber("parentStyleSheetId", cssStore()->bindStyleSheet(parentStyleSheet));
-
- DisabledStyleDeclaration* disabledStyle = cssStore()->disabledStyleForId(styleId, false);
- if (disabledStyle)
- result->setArray("disabled", buildArrayForDisabledStyleProperties(disabledStyle));
+ result->setNumber("styleId", cssStore()->bindStyle(style));
+ CSSStyleSheet* styleSheet = InspectorCSSStore::getParentStyleSheet(style);
+ if (styleSheet)
+ result->setNumber("styleSheetId", cssStore()->bindStyleSheet(styleSheet));
}
- result->setString("width", style->getPropertyValue("width"));
- result->setString("height", style->getPropertyValue("height"));
+ RefPtr<InspectorObject> properties = InspectorObject::create();
+ properties->setString("width", style->getPropertyValue("width"));
+ properties->setString("height", style->getPropertyValue("height"));
+ result->setObject("properties", properties);
populateObjectWithStyleProperties(style, result.get());
return result.release();
}
@@ -1569,44 +1567,55 @@ void InspectorDOMAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* s
for (unsigned i = 0; i < style->length(); ++i) {
RefPtr<InspectorObject> property = InspectorObject::create();
String name = style->item(i);
+ String value = style->getPropertyValue(name);
+ String priority = style->getPropertyPriority(name);
property->setString("name", name);
- property->setString("priority", style->getPropertyPriority(name));
+ property->setString("value", value);
+ property->setString("priority", priority);
+ property->setString("text", name + ": " + value + (priority.length() ? " !" + priority : "") + ";");
property->setBoolean("implicit", style->isPropertyImplicit(name));
+ property->setBoolean("parsedOk", true);
+ property->setString("status", "style");
String shorthand = style->getPropertyShorthand(name);
- property->setString("shorthand", shorthand);
+ property->setString("shorthandName", shorthand);
if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
foundShorthands.add(shorthand);
shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
}
- property->setString("value", style->getPropertyValue(name));
properties->pushObject(property.release());
}
- result->setArray("properties", properties);
+ result->setArray("cssProperties", properties);
+ result->setString("cssText", style->cssText());
result->setObject("shorthandValues", shorthandValues);
-}
-PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForDisabledStyleProperties(DisabledStyleDeclaration* declaration)
-{
- RefPtr<InspectorArray> properties = InspectorArray::create();
- for (DisabledStyleDeclaration::iterator it = declaration->begin(); it != declaration->end(); ++it) {
+ DisabledStyleDeclaration* disabledStyle = cssStore()->disabledStyleForId(cssStore()->bindStyle(style), false);
+ if (!disabledStyle)
+ return;
+
+ for (DisabledStyleDeclaration::iterator it = disabledStyle->begin(); it != disabledStyle->end(); ++it) {
RefPtr<InspectorObject> property = InspectorObject::create();
- property->setString("name", it->first);
- property->setString("value", it->second.first);
- property->setString("priority", it->second.second);
+ String name = it->first;
+ String value = it->second.first;
+ String priority = it->second.second;
+ property->setString("name", name);
+ property->setString("value", value);
+ property->setString("priority", priority);
+ property->setString("text", name + ": " + value + (priority.length() ? " !" + priority : "") + ";");
+ property->setBoolean("implicit", false);
+ property->setBoolean("parsedOk", true);
+ property->setString("status", "disabled");
properties->pushObject(property.release());
}
- return properties.release();
}
PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document* ownerDocument, CSSStyleSheet* styleSheet)
{
RefPtr<InspectorObject> result = InspectorObject::create();
long id = cssStore()->bindStyleSheet(styleSheet);
- result->setNumber("id", id);
- result->setBoolean("disabled", styleSheet->disabled());
- result->setString("href", styleSheet->href());
+ result->setNumber("styleSheetId", id);
+ result->setString("sourceURL", styleSheet->href());
result->setString("title", styleSheet->title());
- result->setNumber("documentElementId", m_documentNodeToIdMap.get(styleSheet->document()));
+ result->setBoolean("disabled", styleSheet->disabled());
RefPtr<InspectorArray> cssRules = InspectorArray::create();
PassRefPtr<CSSRuleList> cssRuleList = CSSRuleList::create(styleSheet, true);
if (cssRuleList) {
@@ -1616,7 +1625,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document
cssRules->pushObject(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
}
}
- result->setArray("cssRules", cssRules.release());
+ result->setArray("rules", cssRules.release());
return result.release();
}
@@ -1626,27 +1635,28 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne
RefPtr<InspectorObject> result = InspectorObject::create();
result->setString("selectorText", rule->selectorText());
- result->setString("cssText", rule->cssText());
result->setNumber("sourceLine", rule->sourceLine());
- result->setString("documentURL", documentURLString(ownerDocument));
- if (parentStyleSheet) {
- RefPtr<InspectorObject> parentStyleSheetValue = InspectorObject::create();
- parentStyleSheetValue->setString("href", parentStyleSheet->href());
- parentStyleSheetValue->setNumber("id", cssStore()->bindStyleSheet(parentStyleSheet));
- result->setObject("parentStyleSheet", parentStyleSheetValue.release());
- }
- bool isUserAgent = parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty();
- bool isUser = parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document";
- result->setBoolean("isUserAgent", isUserAgent);
- result->setBoolean("isUser", isUser);
- result->setBoolean("isViaInspector", rule->parentStyleSheet() == cssStore()->inspectorStyleSheet(ownerDocument, false));
+
+ String origin;
+ bool canBind = true;
+ if (parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty()) {
+ origin = "user-agent";
+ canBind = false;
+ } else if (parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document") {
+ origin = "user";
+ canBind = false;
+ } else if (rule->parentStyleSheet() == cssStore()->inspectorStyleSheet(ownerDocument, false))
+ origin = "inspector";
+ result->setString("origin", origin);
+
+ if (origin.isEmpty())
+ result->setString("sourceURL", parentStyleSheet && !parentStyleSheet->href().isEmpty() ? parentStyleSheet->href() : (ownerDocument ? ownerDocument->url().string() : ""));
// Bind editable scripts only.
- bool bind = !isUserAgent && !isUser;
- result->setObject("style", buildObjectForStyle(rule->style(), bind));
+ result->setObject("style", buildObjectForStyle(rule->style(), canBind));
- if (bind)
- result->setNumber("id", cssStore()->bindRule(rule));
+ if (canBind)
+ result->setNumber("ruleId", cssStore()->bindRule(rule));
return result.release();
}
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 03e4d8d..6c5fd4b 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -207,7 +207,6 @@ namespace WebCore {
PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*, bool bind);
void populateObjectWithStyleProperties(CSSStyleDeclaration*, InspectorObject* result);
- PassRefPtr<InspectorArray> buildArrayForDisabledStyleProperties(DisabledStyleDeclaration*);
PassRefPtr<InspectorObject> buildObjectForRule(Document* ownerDocument, CSSStyleRule*);
PassRefPtr<InspectorObject> buildObjectForStyleSheet(Document* ownerDocument, CSSStyleSheet*);
Vector<String> longhandProperties(CSSStyleDeclaration*, const String& shorthandProperty);
diff --git a/WebCore/inspector/InspectorDOMStorageResource.cpp b/WebCore/inspector/InspectorDOMStorageResource.cpp
index c8d76ba..cfd5f9f 100644
--- a/WebCore/inspector/InspectorDOMStorageResource.cpp
+++ b/WebCore/inspector/InspectorDOMStorageResource.cpp
@@ -100,7 +100,9 @@ void InspectorDOMStorageResource::startReportingChangesToFrontend()
void InspectorDOMStorageResource::handleEvent(ScriptExecutionContext*, Event* event)
{
ASSERT(m_frontend);
- ASSERT(eventNames().storageEvent == event->type());
+ if (event->type() != eventNames().storageEvent || !event->isStorageEvent())
+ return;
+
StorageEvent* storageEvent = static_cast<StorageEvent*>(event);
Storage* storage = storageEvent->storageArea();
ExceptionCode ec = 0;
diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp
index a7eacf6..ebd03e6 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -62,6 +62,7 @@ InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorCon
, m_frontend(frontend)
, m_pausedScriptState(0)
, m_breakpointsLoaded(false)
+ , m_javaScriptPauseScheduled(false)
{
}
@@ -144,6 +145,8 @@ void InspectorDebuggerAgent::getScriptSource(const String& sourceID, String* scr
void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data)
{
+ if (m_javaScriptPauseScheduled)
+ return;
m_breakProgramDetails = InspectorObject::create();
m_breakProgramDetails->setNumber("eventType", type);
m_breakProgramDetails->setValue("eventData", data);
@@ -152,6 +155,8 @@ void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type
void InspectorDebuggerAgent::cancelPauseOnNextStatement()
{
+ if (m_javaScriptPauseScheduled)
+ return;
m_breakProgramDetails = 0;
ScriptDebugServer::shared().setPauseOnNextStatement(false);
}
@@ -159,6 +164,7 @@ void InspectorDebuggerAgent::cancelPauseOnNextStatement()
void InspectorDebuggerAgent::pause()
{
schedulePauseOnNextStatement(JavaScriptPauseEventType, InspectorObject::create());
+ m_javaScriptPauseScheduled = true;
}
void InspectorDebuggerAgent::resume()
@@ -309,6 +315,7 @@ void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
m_breakProgramDetails->setValue("callFrames", currentCallFrames());
m_frontend->pausedScript(m_breakProgramDetails);
+ m_javaScriptPauseScheduled = false;
}
void InspectorDebuggerAgent::didContinue()
diff --git a/WebCore/inspector/InspectorDebuggerAgent.h b/WebCore/inspector/InspectorDebuggerAgent.h
index 3825042..9501ac8 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/WebCore/inspector/InspectorDebuggerAgent.h
@@ -106,6 +106,7 @@ private:
bool m_breakpointsLoaded;
static InspectorDebuggerAgent* s_debuggerAgentOnBreakpoint;
RefPtr<InspectorObject> m_breakProgramDetails;
+ bool m_javaScriptPauseScheduled;
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorInstrumentation.cpp b/WebCore/inspector/InspectorInstrumentation.cpp
index ae89266..94202c1 100644
--- a/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/WebCore/inspector/InspectorInstrumentation.cpp
@@ -412,6 +412,28 @@ void InspectorInstrumentation::didWriteHTMLImpl(const InspectorInstrumentationCo
timelineAgent->didWriteHTML(endLine);
}
+#if ENABLE(WEB_SOCKETS)
+void InspectorInstrumentation::didCreateWebSocketImpl(InspectorController* inspectorController, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+{
+ inspectorController->didCreateWebSocket(identifier, requestURL, documentURL);
+}
+
+void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeRequest& request)
+{
+ inspectorController->willSendWebSocketHandshakeRequest(identifier, request);
+}
+
+void InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeResponse& response)
+{
+ inspectorController->didReceiveWebSocketHandshakeResponse(identifier, response);
+}
+
+void InspectorInstrumentation::didCloseWebSocketImpl(InspectorController* inspectorController, unsigned long identifier)
+{
+ inspectorController->didCloseWebSocket(identifier);
+}
+#endif
+
bool InspectorInstrumentation::hasFrontend(InspectorController* inspectorController)
{
return inspectorController->hasFrontend();
diff --git a/WebCore/inspector/InspectorInstrumentation.h b/WebCore/inspector/InspectorInstrumentation.h
index e728a5e..1b62ecb 100644
--- a/WebCore/inspector/InspectorInstrumentation.h
+++ b/WebCore/inspector/InspectorInstrumentation.h
@@ -42,11 +42,17 @@ class CharacterData;
class Element;
class InspectorController;
class InspectorTimelineAgent;
+class KURL;
class Node;
class ResourceRequest;
class ResourceResponse;
class XMLHttpRequest;
+#if ENABLE(WEB_SOCKETS)
+class WebSocketHandshakeRequest;
+class WebSocketHandshakeResponse;
+#endif
+
typedef pair<InspectorController*, int> InspectorInstrumentationCookie;
class InspectorInstrumentation {
@@ -90,6 +96,13 @@ public:
static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
+#if ENABLE(WEB_SOCKETS)
+ static void didCreateWebSocket(ScriptExecutionContext*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
+ static void willSendWebSocketHandshakeRequest(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeRequest&);
+ static void didReceiveWebSocketHandshakeResponse(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeResponse&);
+ static void didCloseWebSocket(ScriptExecutionContext*, unsigned long identifier);
+#endif
+
#if ENABLE(INSPECTOR)
static void frontendCreated() { s_frontendCounter += 1; }
static void frontendDeleted() { s_frontendCounter -= 1; }
@@ -140,6 +153,13 @@ private:
static InspectorInstrumentationCookie willWriteHTMLImpl(InspectorController*, unsigned int length, unsigned int startLine);
static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
+#if ENABLE(WEB_SOCKETS)
+ static void didCreateWebSocketImpl(InspectorController*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
+ static void willSendWebSocketHandshakeRequestImpl(InspectorController*, unsigned long identifier, const WebSocketHandshakeRequest&);
+ static void didReceiveWebSocketHandshakeResponseImpl(InspectorController*, unsigned long identifier, const WebSocketHandshakeResponse&);
+ static void didCloseWebSocketImpl(InspectorController*, unsigned long identifier);
+#endif
+
static InspectorController* inspectorControllerForContext(ScriptExecutionContext*);
static InspectorController* inspectorControllerForDocument(Document*);
static InspectorController* inspectorControllerForFrame(Frame*);
@@ -460,6 +480,39 @@ inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentatio
#endif
}
+#if ENABLE(WEB_SOCKETS)
+inline void InspectorInstrumentation::didCreateWebSocket(ScriptExecutionContext* context, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ didCreateWebSocketImpl(inspectorController, identifier, requestURL, documentURL);
+#endif
+}
+
+inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeRequest& request)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ willSendWebSocketHandshakeRequestImpl(inspectorController, identifier, request);
+#endif
+}
+
+inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeResponse& response)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ didReceiveWebSocketHandshakeResponseImpl(inspectorController, identifier, response);
+#endif
+}
+
+inline void InspectorInstrumentation::didCloseWebSocket(ScriptExecutionContext* context, unsigned long identifier)
+{
+#if ENABLE(INSPECTOR)
+ if (InspectorController* inspectorController = inspectorControllerForContext(context))
+ didCloseWebSocketImpl(inspectorController, identifier);
+#endif
+}
+#endif
#if ENABLE(INSPECTOR)
inline InspectorController* InspectorInstrumentation::inspectorControllerForContext(ScriptExecutionContext* context)
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 05b1bff..9b3f95d 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -302,6 +302,7 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend)
if (m_changes.hasChange(CompletionChange)) {
jsonObject->setBoolean("failed", m_failed);
+ jsonObject->setString("localizedFailDescription", m_localizedFailDescription);
jsonObject->setBoolean("finished", m_finished);
jsonObject->setBoolean("didCompletionChange", true);
}
@@ -436,9 +437,10 @@ void InspectorResource::endTiming(double actualEndTime)
m_changes.set(CompletionChange);
}
-void InspectorResource::markFailed()
+void InspectorResource::markFailed(const String& localizedDescription)
{
m_failed = true;
+ m_localizedFailDescription = localizedDescription;
m_changes.set(CompletionChange);
}
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
index aa6001f..aa4c3b1 100644
--- a/WebCore/inspector/InspectorResource.h
+++ b/WebCore/inspector/InspectorResource.h
@@ -116,7 +116,7 @@ namespace WebCore {
void startTiming();
void endTiming(double actualEndTime);
- void markFailed();
+ void markFailed(const String& localizedDescription);
void addLength(int lengthReceived);
private:
@@ -175,6 +175,7 @@ namespace WebCore {
bool m_cached;
bool m_finished;
bool m_failed;
+ String m_localizedFailDescription;
int m_length;
int m_responseStatusCode;
String m_responseStatusText;
diff --git a/WebCore/inspector/InspectorResourceAgent.cpp b/WebCore/inspector/InspectorResourceAgent.cpp
index f49e1d7..2e965b6 100644
--- a/WebCore/inspector/InspectorResourceAgent.cpp
+++ b/WebCore/inspector/InspectorResourceAgent.cpp
@@ -199,17 +199,23 @@ static PassRefPtr<InspectorObject> buildObjectForResourceResponse(const Resource
return responseObject;
}
-static PassRefPtr<InspectorObject> buildObjectForMainResource(Frame* frame)
+static PassRefPtr<InspectorObject> buildObjectForDocumentLoader(DocumentLoader* loader)
+{
+ RefPtr<InspectorObject> documentLoaderObject = InspectorObject::create();
+ documentLoaderObject->setNumber("frameId", reinterpret_cast<uintptr_t>(loader->frame()));
+ documentLoaderObject->setNumber("loaderId", reinterpret_cast<uintptr_t>(loader));
+ documentLoaderObject->setString("url", loader->requestURL().string());
+ return documentLoaderObject;
+}
+
+static PassRefPtr<InspectorObject> buildObjectForFrameResource(Frame* frame)
{
FrameLoader* frameLoader = frame->loader();
DocumentLoader* loader = frameLoader->documentLoader();
RefPtr<InspectorObject> resourceObject = InspectorObject::create();
resourceObject->setString("url", loader->url().string());
- resourceObject->setString("host", loader->url().host());
- resourceObject->setString("path", loader->url().path());
- resourceObject->setString("lastPathComponent", loader->url().lastPathComponent());
- resourceObject->setString("type", "Document");
+ resourceObject->setObject("loader", buildObjectForDocumentLoader(loader));
resourceObject->setObject("request", buildObjectForResourceRequest(loader->request()));
resourceObject->setObject("response", buildObjectForResourceResponse(loader->response()));
return resourceObject;
@@ -236,21 +242,20 @@ static String cachedResourceTypeString(const CachedResource& cachedResource)
}
}
-static PassRefPtr<InspectorObject> buildObjectForCachedResource(const CachedResource& cachedResource)
+static PassRefPtr<InspectorObject> buildObjectForCachedResource(DocumentLoader* loader, const CachedResource& cachedResource)
{
RefPtr<InspectorObject> resourceObject = InspectorObject::create();
resourceObject->setString("url", cachedResource.url());
resourceObject->setString("type", cachedResourceTypeString(cachedResource));
resourceObject->setNumber("encodedSize", cachedResource.encodedSize());
resourceObject->setObject("response", buildObjectForResourceResponse(cachedResource.response()));
+ resourceObject->setObject("loader", buildObjectForDocumentLoader(loader));
return resourceObject;
}
-static PassRefPtr<InspectorObject> buildObjectForFrameResources(Frame* frame)
+static void populateObjectWithFrameResources(Frame* frame, PassRefPtr<InspectorObject> frameResources)
{
- RefPtr<InspectorObject> frameResources = InspectorObject::create();
- frameResources->setNumber("frameID", reinterpret_cast<uintptr_t>(frame));
- frameResources->setObject("mainResource", buildObjectForMainResource(frame));
+ frameResources->setObject("resource", buildObjectForFrameResource(frame));
RefPtr<InspectorArray> subresources = InspectorArray::create();
frameResources->setArray("subresources", subresources);
@@ -258,19 +263,19 @@ static PassRefPtr<InspectorObject> buildObjectForFrameResources(Frame* frame)
CachedResourceLoader::DocumentResourceMap::const_iterator end = allResources.end();
for (CachedResourceLoader::DocumentResourceMap::const_iterator it = allResources.begin(); it != end; ++it) {
CachedResource* cachedResource = it->second.get();
- if (cachedResource)
- subresources->pushValue(buildObjectForCachedResource(*cachedResource));
+ RefPtr<InspectorObject> cachedResourceObject = buildObjectForCachedResource(frame->loader()->documentLoader(), *cachedResource);
+ subresources->pushValue(cachedResourceObject);
}
- return frameResources;
}
InspectorResourceAgent::~InspectorResourceAgent()
{
}
-void InspectorResourceAgent::identifierForInitialRequest(unsigned long identifier, const KURL& url, DocumentLoader* loader, bool isMainResource)
+void InspectorResourceAgent::identifierForInitialRequest(unsigned long identifier, const KURL& url, DocumentLoader* loader)
{
- m_frontend->identifierForInitialRequest(identifier, url.string(), reinterpret_cast<uintptr_t>(loader->frame()), isMainResource);
+ RefPtr<InspectorObject> loaderObject = buildObjectForDocumentLoader(loader);
+ m_frontend->identifierForInitialRequest(identifier, url.string(), loaderObject);
}
void InspectorResourceAgent::willSendRequest(unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
@@ -321,8 +326,7 @@ void InspectorResourceAgent::didFailLoading(unsigned long identifier, const Reso
void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* loader, const CachedResource* resource)
{
- Frame* frame = loader->frame();
- m_frontend->didLoadResourceFromMemoryCache(currentTime(), reinterpret_cast<uintptr_t>(frame), buildObjectForCachedResource(*resource));
+ m_frontend->didLoadResourceFromMemoryCache(currentTime(), buildObjectForCachedResource(loader, *resource));
}
void InspectorResourceAgent::setOverrideContent(unsigned long identifier, const String& sourceString, InspectorResource::Type type)
@@ -342,10 +346,28 @@ void InspectorResourceAgent::setOverrideContent(unsigned long identifier, const
m_frontend->setOverrideContent(identifier, sourceString, typeString);
}
+static PassRefPtr<InspectorObject> buildObjectForFrameTree(Frame* frame, bool dumpResources)
+{
+ RefPtr<InspectorObject> frameObject = InspectorObject::create();
+ frameObject->setNumber("parentId", reinterpret_cast<uintptr_t>(frame->tree()->parent()));
+ frameObject->setNumber("id", reinterpret_cast<uintptr_t>(frame));
+ if (dumpResources)
+ populateObjectWithFrameResources(frame, frameObject);
+ RefPtr<InspectorArray> childrenArray;
+ for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+ if (!childrenArray) {
+ childrenArray = InspectorArray::create();
+ frameObject->setArray("children", childrenArray);
+ }
+ childrenArray->pushObject(buildObjectForFrameTree(child, dumpResources));
+ }
+ return frameObject;
+}
+
void InspectorResourceAgent::didCommitLoad(DocumentLoader* loader)
{
- Frame* frame = loader->frame();
- m_frontend->didCommitLoad(reinterpret_cast<uintptr_t>(frame));
+ Frame* parentFrame = loader->frame()->tree()->parent();
+ m_frontend->didCommitLoadForFrame(reinterpret_cast<uintptr_t>(parentFrame), buildObjectForDocumentLoader(loader));
}
void InspectorResourceAgent::frameDetachedFromParent(Frame* frame)
@@ -353,7 +375,6 @@ void InspectorResourceAgent::frameDetachedFromParent(Frame* frame)
m_frontend->frameDetachedFromParent(reinterpret_cast<uintptr_t>(frame));
}
-
#if ENABLE(WEB_SOCKETS)
// FIXME: More this into the front-end?
@@ -404,19 +425,20 @@ void InspectorResourceAgent::didCloseWebSocket(unsigned long identifier)
}
#endif // ENABLE(WEB_SOCKETS)
-void InspectorResourceAgent::cachedResources(RefPtr<InspectorArray>* resources)
+void InspectorResourceAgent::cachedResources(RefPtr<InspectorObject>* object)
{
- for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame()))
- (*resources)->pushObject(buildObjectForFrameResources(frame));
+ *object = buildObjectForFrameTree(m_page->mainFrame(), true);
}
-void InspectorResourceAgent::resourceContent(unsigned long frameID, const String& url, String* content)
+void InspectorResourceAgent::resourceContent(unsigned long frameId, const String& url, bool base64Encode, String* content)
{
- RefPtr<InspectorArray> frameResources = InspectorArray::create();
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame())) {
- if (reinterpret_cast<uintptr_t>(frame) != frameID)
+ if (reinterpret_cast<uintptr_t>(frame) != frameId)
continue;
- InspectorResourceAgent::resourceContent(frame, KURL(ParsedURLString, url), content);
+ if (base64Encode)
+ InspectorResourceAgent::resourceContentBase64(frame, KURL(ParsedURLString, url), content);
+ else
+ InspectorResourceAgent::resourceContent(frame, KURL(ParsedURLString, url), content);
break;
}
}
diff --git a/WebCore/inspector/InspectorResourceAgent.h b/WebCore/inspector/InspectorResourceAgent.h
index f0bead8..1cdd292 100644
--- a/WebCore/inspector/InspectorResourceAgent.h
+++ b/WebCore/inspector/InspectorResourceAgent.h
@@ -77,7 +77,7 @@ public:
~InspectorResourceAgent();
- void identifierForInitialRequest(unsigned long identifier, const KURL&, DocumentLoader*, bool isMainResource);
+ void identifierForInitialRequest(unsigned long identifier, const KURL&, DocumentLoader*);
void willSendRequest(unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
void markResourceAsCached(unsigned long identifier);
void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&);
@@ -97,8 +97,8 @@ public:
#endif
// Called from frontend
- void cachedResources(RefPtr<InspectorArray>*);
- void resourceContent(unsigned long frameID, const String& url, String* content);
+ void cachedResources(RefPtr<InspectorObject>*);
+ void resourceContent(unsigned long frameID, const String& url, bool base64Encode, String* content);
private:
InspectorResourceAgent(Page* page, InspectorFrontend* frontend);
diff --git a/WebCore/inspector/InspectorState.cpp b/WebCore/inspector/InspectorState.cpp
index 44065c0..e6d3044 100644
--- a/WebCore/inspector/InspectorState.cpp
+++ b/WebCore/inspector/InspectorState.cpp
@@ -45,9 +45,7 @@ InspectorState::InspectorState(InspectorClient* client)
registerBoolean(timelineProfilerEnabled, false, "timelineProfilerEnabled", (const char*)0);
registerBoolean(searchingForNode, false, "searchingForNodeEnabled", (const char*)0);
registerBoolean(profilerAlwaysEnabled, false, (const char*)0, "profilerEnabled");
- registerString(frontendSettings, "", (const char*)0, "frontendSettings");
registerBoolean(debuggerAlwaysEnabled, false, (const char*)0, "debuggerEnabled");
- registerString(lastActivePanel, InspectorController::LastActivePanel, (const char*)0, "lastActivePanel");
registerBoolean(inspectorStartsAttached, true, (const char*)0, "InspectorStartsAttached");
registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, (const char*)0, "inspectorAttachedHeight");
registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", (const char*)0);
diff --git a/WebCore/inspector/InspectorState.h b/WebCore/inspector/InspectorState.h
index 5707600..387f3c7 100644
--- a/WebCore/inspector/InspectorState.h
+++ b/WebCore/inspector/InspectorState.h
@@ -1,101 +1,100 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 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 GOOGLE 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 InspectorState_h
-#define InspectorState_h
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorValues.h"
-#include "PlatformString.h"
-
-#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class InspectorClient;
-
-class InspectorState {
-public:
- enum InspectorPropertyId {
- monitoringXHR = 1,
- resourceTrackingEnabled,
- resourceTrackingAlwaysEnabled,
- timelineProfilerEnabled,
- searchingForNode,
- profilerAlwaysEnabled,
- frontendSettings,
- debuggerAlwaysEnabled,
- lastActivePanel,
- inspectorStartsAttached,
- inspectorAttachedHeight,
- pauseOnExceptionsState,
- consoleMessagesEnabled,
- lastPropertyId
- };
-
- InspectorState(InspectorClient* client);
-
- PassRefPtr<InspectorObject> generateStateObjectForFrontend();
- void restoreFromInspectorCookie(const String& jsonString);
- void loadFromSettings();
- String getFrontendAlias(InspectorPropertyId propertyId);
-
- bool getBoolean(InspectorPropertyId propertyId);
- String getString(InspectorPropertyId propertyId);
- long getLong(InspectorPropertyId propertyId);
-
- void setBoolean(InspectorPropertyId propertyId, bool value) { setValue(propertyId, InspectorBasicValue::create(value), value ? "true" : "false"); }
- void setString(InspectorPropertyId propertyId, const String& value) { setValue(propertyId, InspectorString::create(value), value); }
- void setLong(InspectorPropertyId propertyId, long value) { setValue(propertyId, InspectorBasicValue::create((double)value), String::number(value)); }
-
-private:
- void updateCookie();
- void setValue(InspectorPropertyId propertyId, PassRefPtr<InspectorValue> value, const String& stringValue);
-
- struct Property {
- static Property create(PassRefPtr<InspectorValue> value, const String& frontendAlias, const String& preferenceName);
- String m_frontendAlias;
- String m_preferenceName;
- RefPtr<InspectorValue> m_value;
- };
- typedef HashMap<long, Property> PropertyMap;
- PropertyMap m_properties;
-
- void registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName);
- void registerString(InspectorPropertyId propertyId, const String& value, const String& frontendAlias, const String& preferenceName);
- void registerLong(InspectorPropertyId propertyId, long value, const String& frontendAlias, const String& preferenceName);
-
- InspectorClient* m_client;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
-#endif // !defined(InspectorState_h)
+/*
+ * 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 GOOGLE 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 InspectorState_h
+#define InspectorState_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorValues.h"
+#include "PlatformString.h"
+
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class InspectorClient;
+
+class InspectorState {
+public:
+ enum InspectorPropertyId {
+ monitoringXHR = 1,
+ resourceTrackingEnabled,
+ resourceTrackingAlwaysEnabled,
+ timelineProfilerEnabled,
+ searchingForNode,
+ profilerAlwaysEnabled,
+ debuggerAlwaysEnabled,
+ lastActivePanel,
+ inspectorStartsAttached,
+ inspectorAttachedHeight,
+ pauseOnExceptionsState,
+ consoleMessagesEnabled,
+ lastPropertyId
+ };
+
+ InspectorState(InspectorClient* client);
+
+ PassRefPtr<InspectorObject> generateStateObjectForFrontend();
+ void restoreFromInspectorCookie(const String& jsonString);
+ void loadFromSettings();
+ String getFrontendAlias(InspectorPropertyId propertyId);
+
+ bool getBoolean(InspectorPropertyId propertyId);
+ String getString(InspectorPropertyId propertyId);
+ long getLong(InspectorPropertyId propertyId);
+
+ void setBoolean(InspectorPropertyId propertyId, bool value) { setValue(propertyId, InspectorBasicValue::create(value), value ? "true" : "false"); }
+ void setString(InspectorPropertyId propertyId, const String& value) { setValue(propertyId, InspectorString::create(value), value); }
+ void setLong(InspectorPropertyId propertyId, long value) { setValue(propertyId, InspectorBasicValue::create((double)value), String::number(value)); }
+
+private:
+ void updateCookie();
+ void setValue(InspectorPropertyId propertyId, PassRefPtr<InspectorValue> value, const String& stringValue);
+
+ struct Property {
+ static Property create(PassRefPtr<InspectorValue> value, const String& frontendAlias, const String& preferenceName);
+ String m_frontendAlias;
+ String m_preferenceName;
+ RefPtr<InspectorValue> m_value;
+ };
+ typedef HashMap<long, Property> PropertyMap;
+ PropertyMap m_properties;
+
+ void registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName);
+ void registerString(InspectorPropertyId propertyId, const String& value, const String& frontendAlias, const String& preferenceName);
+ void registerLong(InspectorPropertyId propertyId, long value, const String& frontendAlias, const String& preferenceName);
+
+ InspectorClient* m_client;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
+#endif // !defined(InspectorState_h)
diff --git a/WebCore/inspector/InspectorStyleSheet.cpp b/WebCore/inspector/InspectorStyleSheet.cpp
index 11cd649..dc2a47a 100644
--- a/WebCore/inspector/InspectorStyleSheet.cpp
+++ b/WebCore/inspector/InspectorStyleSheet.cpp
@@ -98,6 +98,369 @@ RefPtr<WebCore::CSSRuleSourceData> ParsedStyleSheet::ruleSourceDataAt(unsigned i
namespace WebCore {
+PassRefPtr<InspectorObject> InspectorStyle::buildObjectForStyle() const
+{
+ RefPtr<InspectorObject> result = InspectorObject::create();
+ if (!m_styleId.isEmpty())
+ result->setString("styleId", m_styleId.asString());
+
+ RefPtr<InspectorObject> propertiesObject = InspectorObject::create();
+ propertiesObject->setString("width", m_style->getPropertyValue("width"));
+ propertiesObject->setString("height", m_style->getPropertyValue("height"));
+
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet ? m_parentStyleSheet->ruleSourceDataFor(m_style) : 0;
+ if (sourceData) {
+ propertiesObject->setNumber("startOffset", sourceData->styleSourceData->styleBodyRange.start);
+ propertiesObject->setNumber("endOffset", sourceData->styleSourceData->styleBodyRange.end);
+ }
+ result->setObject("properties", propertiesObject);
+
+ populateObjectWithStyleProperties(result.get());
+
+ return result.release();
+}
+
+bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText, bool overwrite)
+{
+ ASSERT(m_parentStyleSheet);
+ if (!m_parentStyleSheet->ensureParsedDataReady())
+ return false;
+
+ Vector<InspectorStyleProperty> allProperties;
+ populateAllProperties(&allProperties);
+
+ unsigned propertyStart = 0; // Need to initialize to make the compiler happy.
+ long propertyLengthDelta;
+
+ if (overwrite) {
+ ASSERT(index < allProperties.size());
+ InspectorStyleProperty& property = allProperties.at(index);
+ propertyStart = property.sourceData.range.start;
+ unsigned propertyEnd = property.sourceData.range.end;
+ unsigned oldLength = propertyEnd - propertyStart;
+ unsigned newLength = propertyText.length();
+ propertyLengthDelta = newLength - oldLength;
+
+ if (!property.disabled) {
+ bool success = replacePropertyInStyleText(property, propertyText);
+ if (!success)
+ return false;
+ } else {
+ property.rawText = propertyText;
+ if (!propertyText.length()) {
+ bool success = enableProperty(index, allProperties);
+ return success;
+ }
+ }
+ } else {
+ // Insert at index.
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet->ruleSourceDataFor(m_style);
+ if (!sourceData)
+ return false;
+ String text;
+ bool success = styleText(&text);
+ if (!success)
+ return false;
+ propertyLengthDelta = propertyText.length();
+
+ bool insertLast = true;
+ if (index < allProperties.size()) {
+ InspectorStyleProperty& property = allProperties.at(index);
+ if (property.hasSource) {
+ propertyStart = property.sourceData.range.start;
+ // If inserting before a disabled property, it should be shifted, too.
+ insertLast = false;
+ }
+ }
+ if (insertLast)
+ propertyStart = sourceData->styleSourceData->styleBodyRange.end;
+
+ text.insert(propertyText, propertyStart);
+ m_parentStyleSheet->setStyleText(m_style, text);
+ }
+
+ // Recompute subsequent disabled property ranges.
+ shiftDisabledProperties(disabledIndexByOrdinal(index, true, allProperties), propertyLengthDelta);
+
+ return true;
+}
+
+bool InspectorStyle::toggleProperty(unsigned index, bool disable)
+{
+ ASSERT(m_parentStyleSheet);
+ if (!m_parentStyleSheet->ensureParsedDataReady())
+ return false; // Can toggle only source-based properties.
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet->ruleSourceDataFor(m_style);
+ if (!sourceData)
+ return false; // No source data for the style.
+
+ Vector<InspectorStyleProperty> allProperties;
+ populateAllProperties(&allProperties);
+ if (index >= allProperties.size())
+ return false; // Outside of property range.
+
+ InspectorStyleProperty& property = allProperties.at(index);
+ if (property.disabled == disable)
+ return true; // Idempotent operation.
+
+ bool success;
+ if (!disable)
+ success = enableProperty(index, allProperties);
+ else
+ success = disableProperty(index, allProperties);
+
+ return success;
+}
+
+// static
+unsigned InspectorStyle::disabledIndexByOrdinal(unsigned ordinal, bool canUseSubsequent, Vector<InspectorStyleProperty>& allProperties)
+{
+ unsigned disabledIndex = 0;
+ for (unsigned i = 0, size = allProperties.size(); i < size; ++i) {
+ InspectorStyleProperty& property = allProperties.at(i);
+ if (property.disabled) {
+ if (i == ordinal || (canUseSubsequent && i > ordinal))
+ return disabledIndex;
+ ++disabledIndex;
+ }
+ }
+
+ return UINT_MAX;
+}
+
+bool InspectorStyle::styleText(String* result)
+{
+ // Precondition: m_parentStyleSheet->ensureParsedDataReady() has been called successfully.
+ RefPtr<CSSRuleSourceData> sourceData = m_parentStyleSheet->ruleSourceDataFor(m_style);
+ if (!sourceData)
+ return false;
+
+ String styleSheetText;
+ bool success = m_parentStyleSheet->text(&styleSheetText);
+ if (!success)
+ return false;
+
+ SourceRange& bodyRange = sourceData->styleSourceData->styleBodyRange;
+ *result = styleSheetText.substring(bodyRange.start, bodyRange.end - bodyRange.start);
+ return true;
+}
+
+bool InspectorStyle::disableProperty(unsigned indexToDisable, Vector<InspectorStyleProperty>& allProperties)
+{
+ // Precondition: |indexToEnable| points to an enabled property.
+ const InspectorStyleProperty& property = allProperties.at(indexToDisable);
+ InspectorStyleProperty disabledProperty(property);
+ disabledProperty.disabled = true;
+ unsigned propertyStart = property.sourceData.range.start;
+ // This may have to be negated below.
+ long propertyLength = property.sourceData.range.end - propertyStart;
+ disabledProperty.sourceData.range.end = propertyStart;
+ String oldStyleText;
+ bool success = styleText(&oldStyleText);
+ if (!success)
+ return false;
+ disabledProperty.rawText = oldStyleText.substring(propertyStart, propertyLength);
+ success = replacePropertyInStyleText(property, "");
+ if (!success)
+ return false;
+
+ // Add disabled property at correct position.
+ unsigned insertionIndex = disabledIndexByOrdinal(indexToDisable, true, allProperties);
+ if (insertionIndex == UINT_MAX)
+ m_disabledProperties.append(disabledProperty);
+ else {
+ m_disabledProperties.insert(insertionIndex, disabledProperty);
+ shiftDisabledProperties(insertionIndex + 1, -propertyLength); // Property removed from text - shift these back.
+ }
+ return true;
+}
+
+bool InspectorStyle::enableProperty(unsigned indexToEnable, Vector<InspectorStyleProperty>& allProperties)
+{
+ // Precondition: |indexToEnable| points to a disabled property.
+ unsigned disabledIndex = disabledIndexByOrdinal(indexToEnable, false, allProperties);
+ if (disabledIndex == UINT_MAX)
+ return false;
+
+ InspectorStyleProperty disabledProperty = m_disabledProperties.at(disabledIndex);
+ m_disabledProperties.remove(disabledIndex);
+ bool success = replacePropertyInStyleText(disabledProperty, disabledProperty.rawText);
+ if (success)
+ shiftDisabledProperties(disabledIndex, disabledProperty.rawText.length());
+ return success;
+}
+
+bool InspectorStyle::populateAllProperties(Vector<InspectorStyleProperty>* result) const
+{
+ HashSet<String> foundShorthands;
+ HashSet<String> sourcePropertyNames;
+ unsigned disabledIndex = 0;
+ unsigned disabledLength = m_disabledProperties.size();
+ InspectorStyleProperty disabledProperty;
+ if (disabledIndex < disabledLength)
+ disabledProperty = m_disabledProperties.at(disabledIndex);
+
+ RefPtr<CSSRuleSourceData> sourceData = (m_parentStyleSheet && m_parentStyleSheet->ensureParsedDataReady()) ? m_parentStyleSheet->ruleSourceDataFor(m_style) : 0;
+ Vector<CSSPropertySourceData>* sourcePropertyData = sourceData ? &(sourceData->styleSourceData->propertyData) : 0;
+ if (sourcePropertyData) {
+ for (Vector<CSSPropertySourceData>::const_iterator it = sourcePropertyData->begin(); it != sourcePropertyData->end(); ++it) {
+ while (disabledIndex < disabledLength && disabledProperty.sourceData.range.start <= it->range.start) {
+ result->append(disabledProperty);
+ if (++disabledIndex < disabledLength)
+ disabledProperty = m_disabledProperties.at(disabledIndex);
+ }
+ result->append(InspectorStyleProperty(*it, true, false));
+ sourcePropertyNames.add(it->name);
+ }
+ }
+
+ while (disabledIndex < disabledLength) {
+ disabledProperty = m_disabledProperties.at(disabledIndex++);
+ result->append(disabledProperty);
+ }
+
+ for (int i = 0, size = m_style->length(); i < size; ++i) {
+ String name = m_style->item(i);
+ if (sourcePropertyNames.contains(name))
+ continue;
+
+ sourcePropertyNames.add(name);
+ result->append(InspectorStyleProperty(CSSPropertySourceData(name, m_style->getPropertyValue(name), !m_style->getPropertyPriority(name).isEmpty(), true, SourceRange()), false, false));
+ }
+
+ return true;
+}
+
+void InspectorStyle::populateObjectWithStyleProperties(InspectorObject* result) const
+{
+ Vector<InspectorStyleProperty> properties;
+ populateAllProperties(&properties);
+
+ RefPtr<InspectorArray> propertiesObject = InspectorArray::create();
+ RefPtr<InspectorObject> shorthandValues = InspectorObject::create();
+ HashMap<String, RefPtr<InspectorObject> > propertyNameToPreviousActiveProperty;
+ HashSet<String> foundShorthands;
+
+ for (Vector<InspectorStyleProperty>::iterator it = properties.begin(), itEnd = properties.end(); it != itEnd; ++it) {
+ const CSSPropertySourceData& propertyEntry = it->sourceData;
+ const String& name = propertyEntry.name;
+
+ RefPtr<InspectorObject> property = InspectorObject::create();
+ propertiesObject->pushObject(property);
+ property->setString("status", it->disabled ? "disabled" : "active");
+ property->setBoolean("parsedOk", propertyEntry.parsedOk);
+ if (!it->disabled) {
+ property->setString("name", name);
+ property->setString("value", propertyEntry.value);
+ property->setString("priority", propertyEntry.important ? "important" : "");
+ if (it->hasSource) {
+ property->setBoolean("implicit", false);
+ property->setNumber("startOffset", propertyEntry.range.start);
+ property->setNumber("endOffset", propertyEntry.range.end);
+
+ HashMap<String, RefPtr<InspectorObject> >::iterator activeIt = propertyNameToPreviousActiveProperty.find(name);
+ if (activeIt != propertyNameToPreviousActiveProperty.end()) {
+ activeIt->second->setString("status", "inactive");
+ activeIt->second->setString("shorthandName", "");
+ }
+ propertyNameToPreviousActiveProperty.set(name, property);
+ } else {
+ property->setBoolean("implicit", m_style->isPropertyImplicit(name));
+ property->setString("status", "style");
+ }
+ } else
+ property->setString("text", it->rawText);
+
+ if (propertyEntry.parsedOk) {
+ // Both for style-originated and parsed source properties.
+ String shorthand = m_style->getPropertyShorthand(name);
+ property->setString("shorthandName", shorthand);
+ if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) {
+ foundShorthands.add(shorthand);
+ shorthandValues->setString(shorthand, shorthandValue(shorthand));
+ }
+ } else
+ property->setString("shorthandName", "");
+ }
+
+ result->setArray("cssProperties", propertiesObject);
+ result->setObject("shorthandValues", shorthandValues);
+}
+
+
+void InspectorStyle::shiftDisabledProperties(unsigned fromIndex, long delta)
+{
+ for (unsigned i = fromIndex, size = m_disabledProperties.size(); i < size; ++i) {
+ SourceRange& range = m_disabledProperties.at(i).sourceData.range;
+ range.start += delta;
+ range.end += delta;
+ }
+}
+
+bool InspectorStyle::replacePropertyInStyleText(const InspectorStyleProperty& property, const String& newText)
+{
+ // Precondition: m_parentStyleSheet->ensureParsedDataReady() has been called successfully.
+ String text;
+ bool success = styleText(&text);
+ if (!success)
+ return false;
+ const SourceRange& range = property.sourceData.range;
+ text.replace(range.start, range.end - range.start, newText);
+ success = m_parentStyleSheet->setStyleText(m_style, text);
+ return success;
+}
+
+String InspectorStyle::shorthandValue(const String& shorthandProperty) const
+{
+ String value = m_style->getPropertyValue(shorthandProperty);
+ if (value.isEmpty()) {
+ for (unsigned i = 0; i < m_style->length(); ++i) {
+ String individualProperty = m_style->item(i);
+ if (m_style->getPropertyShorthand(individualProperty) != shorthandProperty)
+ continue;
+ if (m_style->isPropertyImplicit(individualProperty))
+ continue;
+ String individualValue = m_style->getPropertyValue(individualProperty);
+ if (individualValue == "initial")
+ continue;
+ if (value.length())
+ value.append(" ");
+ value.append(individualValue);
+ }
+ }
+ return value;
+}
+
+String InspectorStyle::shorthandPriority(const String& shorthandProperty) const
+{
+ String priority = m_style->getPropertyPriority(shorthandProperty);
+ if (priority.isEmpty()) {
+ for (unsigned i = 0; i < m_style->length(); ++i) {
+ String individualProperty = m_style->item(i);
+ if (m_style->getPropertyShorthand(individualProperty) != shorthandProperty)
+ continue;
+ priority = m_style->getPropertyPriority(individualProperty);
+ break;
+ }
+ }
+ return priority;
+}
+
+Vector<String> InspectorStyle::longhandProperties(const String& shorthandProperty) const
+{
+ Vector<String> properties;
+ HashSet<String> foundProperties;
+ for (unsigned i = 0; i < m_style->length(); ++i) {
+ String individualProperty = m_style->item(i);
+ if (foundProperties.contains(individualProperty) || m_style->getPropertyShorthand(individualProperty) != shorthandProperty)
+ continue;
+
+ foundProperties.add(individualProperty);
+ properties.append(individualProperty);
+ }
+ return properties;
+}
+
InspectorStyleSheet::InspectorStyleSheet(const String& id, CSSStyleSheet* pageStyleSheet, const String& origin, const String& documentURL)
: m_id(id)
, m_pageStyleSheet(pageStyleSheet)
@@ -121,14 +484,15 @@ bool InspectorStyleSheet::setText(const String& text)
m_parsedStyleSheet->setText(text);
for (unsigned i = 0, size = m_pageStyleSheet->length(); i < size; ++i)
m_pageStyleSheet->remove(i);
+ m_inspectorStyles.clear();
m_pageStyleSheet->parseString(text, m_pageStyleSheet->useStrictParsing());
return true;
}
-bool InspectorStyleSheet::setRuleSelector(const String& ruleId, const String& selector)
+bool InspectorStyleSheet::setRuleSelector(const InspectorCSSId& id, const String& selector)
{
- CSSStyleRule* rule = ruleForId(ruleId);
+ CSSStyleRule* rule = ruleForId(id);
if (!rule)
return false;
CSSStyleSheet* styleSheet = InspectorCSSAgent::parentStyleSheet(rule);
@@ -140,18 +504,16 @@ bool InspectorStyleSheet::setRuleSelector(const String& ruleId, const String& se
if (!sourceData)
return false;
- const String& sheetText = m_parsedStyleSheet->text();
- String newStyleSheetText = sheetText.substring(0, sourceData->selectorListRange.start);
- newStyleSheetText += selector;
- newStyleSheetText += sheetText.right(sheetText.length() - sourceData->selectorListRange.end);
- m_parsedStyleSheet->setText(newStyleSheetText);
+ String sheetText = m_parsedStyleSheet->text();
+ sheetText.replace(sourceData->selectorListRange.start, sourceData->selectorListRange.end - sourceData->selectorListRange.start, selector);
+ m_parsedStyleSheet->setText(sheetText);
return true;
}
CSSStyleRule* InspectorStyleSheet::addRule(const String& selector)
{
- String text;
- bool success = styleSheetText(&text);
+ String styleSheetText;
+ bool success = text(&styleSheetText);
if (!success)
return 0;
@@ -164,23 +526,24 @@ CSSStyleRule* InspectorStyleSheet::addRule(const String& selector)
CSSStyleRule* rule = InspectorCSSAgent::asCSSStyleRule(rules->item(rules->length() - 1));
ASSERT(rule);
- if (text.length())
- text += "\n";
+ if (styleSheetText.length())
+ styleSheetText += "\n";
- text += selector;
- text += " {}";
- m_parsedStyleSheet->setText(text);
+ styleSheetText += selector;
+ styleSheetText += " {}";
+ m_parsedStyleSheet->setText(styleSheetText);
return rule;
}
-CSSStyleRule* InspectorStyleSheet::ruleForId(const String& id) const
+CSSStyleRule* InspectorStyleSheet::ruleForId(const InspectorCSSId& id) const
{
if (!m_pageStyleSheet)
return 0;
+ ASSERT(!id.isEmpty());
bool ok;
- unsigned index = id.toUInt(&ok);
+ unsigned index = id.ordinal().toUInt(&ok);
if (!ok)
return 0;
@@ -204,19 +567,20 @@ PassRefPtr<InspectorObject> InspectorStyleSheet::buildObjectForStyleSheet()
return 0;
RefPtr<InspectorObject> result = InspectorObject::create();
- result->setString("id", id());
result->setBoolean("disabled", styleSheet->disabled());
- result->setString("href", styleSheet->href());
+ result->setString("sourceURL", styleSheet->href());
result->setString("title", styleSheet->title());
RefPtr<CSSRuleList> cssRuleList = CSSRuleList::create(styleSheet, true);
RefPtr<InspectorArray> cssRules = buildArrayForRuleList(cssRuleList.get());
- result->setArray("cssRules", cssRules.release());
+ result->setArray("rules", cssRules.release());
String styleSheetText;
bool success = text(&styleSheetText);
if (success)
result->setString("text", styleSheetText);
+ result->setString("styleSheetId", id());
+
return result.release();
}
@@ -228,27 +592,13 @@ PassRefPtr<InspectorObject> InspectorStyleSheet::buildObjectForRule(CSSStyleRule
RefPtr<InspectorObject> result = InspectorObject::create();
result->setString("selectorText", rule->selectorText());
- result->setString("cssText", rule->cssText());
+ result->setString("sourceURL", !styleSheet->href().isEmpty() ? styleSheet->href() : m_documentURL);
result->setNumber("sourceLine", rule->sourceLine());
- result->setString("documentURL", m_documentURL);
-
- RefPtr<InspectorObject> parentStyleSheetValue = InspectorObject::create();
- parentStyleSheetValue->setString("id", id());
- parentStyleSheetValue->setString("href", styleSheet->href());
- result->setObject("parentStyleSheet", parentStyleSheetValue.release());
result->setString("origin", m_origin);
- RefPtr<CSSRuleSourceData> sourceData;
- if (ensureParsedDataReady())
- sourceData = ruleSourceDataFor(rule->style());
- if (sourceData) {
- result->setNumber("selectorStartOffset", sourceData->selectorListRange.start);
- result->setNumber("selectorEndOffset", sourceData->selectorListRange.end);
- }
-
result->setObject("style", buildObjectForStyle(rule->style()));
if (canBind())
- result->setString("id", fullRuleId(rule));
+ result->setString("ruleId", ruleId(rule).asString());
return result.release();
}
@@ -259,12 +609,48 @@ PassRefPtr<InspectorObject> InspectorStyleSheet::buildObjectForStyle(CSSStyleDec
if (ensureParsedDataReady())
sourceData = ruleSourceDataFor(style);
- RefPtr<InspectorObject> result = InspectorCSSAgent::buildObjectForStyle(style, fullStyleId(style), sourceData ? sourceData->styleSourceData.get() : 0);
- result->setString("parentStyleSheetId", id());
+ RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(ruleOrStyleId(style));
+ RefPtr<InspectorObject> result = inspectorStyle->buildObjectForStyle();
+
+ // Style text cannot be retrieved without stylesheet, so set cssText here.
+ if (sourceData) {
+ String sheetText;
+ bool success = text(&sheetText);
+ if (success) {
+ const SourceRange& bodyRange = sourceData->styleSourceData->styleBodyRange;
+ result->setString("cssText", sheetText.substring(bodyRange.start, bodyRange.end - bodyRange.start));
+ }
+ }
+
return result.release();
}
-CSSStyleDeclaration* InspectorStyleSheet::styleForId(const String& id) const
+bool InspectorStyleSheet::setPropertyText(const InspectorCSSId& id, unsigned propertyIndex, const String& text, bool overwrite)
+{
+ RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
+ if (!inspectorStyle)
+ return false;
+
+ return inspectorStyle->setPropertyText(propertyIndex, text, overwrite);
+}
+
+bool InspectorStyleSheet::toggleProperty(const InspectorCSSId& id, unsigned propertyIndex, bool disable)
+{
+ RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
+ if (!inspectorStyle)
+ return false;
+
+ bool success = inspectorStyle->toggleProperty(propertyIndex, disable);
+ if (success) {
+ if (disable)
+ rememberInspectorStyle(inspectorStyle);
+ else if (!inspectorStyle->hasDisabledProperties())
+ forgetInspectorStyle(inspectorStyle->cssStyle());
+ }
+ return success;
+}
+
+CSSStyleDeclaration* InspectorStyleSheet::styleForId(const InspectorCSSId& id) const
{
CSSStyleRule* rule = ruleForId(id);
if (!rule)
@@ -273,13 +659,36 @@ CSSStyleDeclaration* InspectorStyleSheet::styleForId(const String& id) const
return rule->style();
}
-bool InspectorStyleSheet::setStyleText(const String& styleId, const String& newText)
+PassRefPtr<InspectorStyle> InspectorStyleSheet::inspectorStyleForId(const InspectorCSSId& id)
{
- CSSStyleDeclaration* style = styleForId(styleId);
+ CSSStyleDeclaration* style = styleForId(id);
if (!style)
- return false;
+ return 0;
+
+ InspectorStyleMap::iterator it = m_inspectorStyles.find(style);
+ if (it == m_inspectorStyles.end()) {
+ RefPtr<InspectorStyle> inspectorStyle = InspectorStyle::create(id, style, this);
+ return inspectorStyle.release();
+ }
+ return it->second;
+}
- return innerSetStyleText(style, newText);
+void InspectorStyleSheet::rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle)
+{
+ m_inspectorStyles.set(inspectorStyle->cssStyle(), inspectorStyle);
+}
+
+void InspectorStyleSheet::forgetInspectorStyle(CSSStyleDeclaration* style)
+{
+ m_inspectorStyles.remove(style);
+}
+
+InspectorCSSId InspectorStyleSheet::ruleOrStyleId(CSSStyleDeclaration* style) const
+{
+ unsigned index = ruleIndexByStyle(style);
+ if (index != UINT_MAX)
+ return InspectorCSSId::createFromParts(id(), String::number(index));
+ return InspectorCSSId();
}
Document* InspectorStyleSheet::ownerDocument() const
@@ -328,7 +737,7 @@ bool InspectorStyleSheet::ensureText() const
return true;
String text;
- bool success = styleSheetText(&text);
+ bool success = originalStyleSheetText(&text);
if (success)
m_parsedStyleSheet->setText(text);
@@ -362,12 +771,7 @@ bool InspectorStyleSheet::ensureSourceData(Node* ownerNode)
return m_parsedStyleSheet->hasSourceData();
}
-void InspectorStyleSheet::innerSetStyleSheetText(const String& newText)
-{
- m_parsedStyleSheet->setText(newText);
-}
-
-bool InspectorStyleSheet::innerSetStyleText(CSSStyleDeclaration* style, const String& text)
+bool InspectorStyleSheet::setStyleText(CSSStyleDeclaration* style, const String& text)
{
if (!pageStyleSheet())
return false;
@@ -379,14 +783,14 @@ bool InspectorStyleSheet::innerSetStyleText(CSSStyleDeclaration* style, const St
if (!success)
return false;
- String id = ruleOrStyleId(style);
+ InspectorCSSId id = ruleOrStyleId(style);
if (id.isEmpty())
return false;
ExceptionCode ec = 0;
style->setCssText(text, ec);
if (!ec)
- innerSetStyleSheetText(patchedStyleSheetText);
+ m_parsedStyleSheet->setText(patchedStyleSheetText);
return !ec;
}
@@ -407,10 +811,8 @@ bool InspectorStyleSheet::styleSheetTextWithChangedStyle(CSSStyleDeclaration* st
String text = m_parsedStyleSheet->text();
ASSERT(bodyEnd <= text.length()); // bodyEnd is exclusive
- String patchedText = text.substring(0, bodyStart);
- patchedText += newStyleText;
- patchedText += text.substring(bodyEnd, text.length());
- *result = patchedText;
+ text.replace(bodyStart, bodyEnd - bodyStart, newStyleText);
+ *result = text;
return true;
}
@@ -426,9 +828,9 @@ CSSStyleRule* InspectorStyleSheet::findPageRuleWithStyle(CSSStyleDeclaration* st
return 0;
}
-String InspectorStyleSheet::fullRuleId(CSSStyleRule* rule) const
+InspectorCSSId InspectorStyleSheet::ruleId(CSSStyleRule* rule) const
{
- return fullRuleOrStyleId(rule->style());
+ return ruleOrStyleId(rule->style());
}
void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle)
@@ -444,15 +846,18 @@ void InspectorStyleSheet::revalidateStyle(CSSStyleDeclaration* pageStyle)
if (!parsedRule)
continue;
if (parsedRule->style() == pageStyle) {
- if (parsedRule->style()->cssText() != pageStyle->cssText())
- innerSetStyleText(pageStyle, pageStyle->cssText());
+ if (parsedRule->style()->cssText() != pageStyle->cssText()) {
+ // Clear the disabled properties for the invalid style here.
+ m_inspectorStyles.remove(pageStyle);
+ setStyleText(pageStyle, pageStyle->cssText());
+ }
break;
}
}
m_isRevalidating = false;
}
-bool InspectorStyleSheet::styleSheetText(String* result) const
+bool InspectorStyleSheet::originalStyleSheetText(String* result) const
{
String text;
bool success = inlineStyleSheetText(&text);
@@ -465,7 +870,7 @@ bool InspectorStyleSheet::styleSheetText(String* result) const
bool InspectorStyleSheet::resourceStyleSheetText(String* result) const
{
- if (!m_pageStyleSheet)
+ if (!m_pageStyleSheet || !ownerDocument())
return false;
return InspectorResourceAgent::resourceContent(ownerDocument()->frame(), m_pageStyleSheet->finalURL(), result);
@@ -509,12 +914,12 @@ InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(const Strin
, m_ruleSourceData(0)
{
ASSERT(element);
+ m_inspectorStyle = InspectorStyle::create(InspectorCSSId::createFromParts(id, "0"), inlineStyle(), this);
}
-bool InspectorStyleSheetForInlineStyle::setStyleText(const String& styleId, const String& text)
+bool InspectorStyleSheetForInlineStyle::setStyleText(CSSStyleDeclaration* style, const String& text)
{
- ASSERT(styleId == "0");
- UNUSED_PARAM(styleId);
+ ASSERT_UNUSED(style, style == inlineStyle());
ExceptionCode ec = 0;
m_element->setAttribute("style", text, ec);
m_ruleSourceData.clear();
@@ -541,6 +946,12 @@ bool InspectorStyleSheetForInlineStyle::ensureParsedDataReady()
return true;
}
+PassRefPtr<InspectorStyle> InspectorStyleSheetForInlineStyle::inspectorStyleForId(const InspectorCSSId& id)
+{
+ ASSERT_UNUSED(id, id.ordinal() == "0");
+ return m_inspectorStyle;
+}
+
CSSStyleDeclaration* InspectorStyleSheetForInlineStyle::inlineStyle() const
{
return m_element->style();
diff --git a/WebCore/inspector/InspectorStyleSheet.h b/WebCore/inspector/InspectorStyleSheet.h
index 38ab777..06c4093 100644
--- a/WebCore/inspector/InspectorStyleSheet.h
+++ b/WebCore/inspector/InspectorStyleSheet.h
@@ -26,16 +26,14 @@
#define InspectorStyleSheet_h
#include "CSSPropertySourceData.h"
-#include "Document.h"
#include "InspectorValues.h"
#include "PlatformString.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
-#include <wtf/UnusedParam.h>
+#include <wtf/Vector.h>
class ParsedStyleSheet;
@@ -43,13 +41,102 @@ namespace WebCore {
class CSSRuleList;
class CSSStyleDeclaration;
+class CSSStyleSheet;
+class Document;
class Element;
+class InspectorStyleSheet;
class Node;
#if ENABLE(INSPECTOR)
+class InspectorCSSId {
+public:
+ static InspectorCSSId createFromParts(const String& styleSheetId, const String& ordinal) { return InspectorCSSId(styleSheetId + ":" + ordinal); }
+
+ InspectorCSSId() { }
+ explicit InspectorCSSId(const String& id)
+ {
+ id.split(':', m_idParts);
+ ASSERT(m_idParts.size() == 2);
+ }
+
+ const String& styleSheetId() const { ASSERT(m_idParts.size() == 2); return m_idParts.at(0); }
+ const String& ordinal() const { ASSERT(m_idParts.size() == 2); return m_idParts.at(1); }
+ bool isEmpty() const { return m_idParts.isEmpty(); }
+ String asString() const
+ {
+ if (isEmpty())
+ return String();
+
+ return m_idParts.at(0) + ":" + m_idParts.at(1);
+ }
+
+private:
+ Vector<String> m_idParts;
+};
+
+struct InspectorStyleProperty {
+ InspectorStyleProperty()
+ {
+ }
+
+ InspectorStyleProperty(CSSPropertySourceData sourceData, bool hasSource, bool disabled)
+ : sourceData(sourceData)
+ , hasSource(hasSource)
+ , disabled(disabled)
+ {
+ }
+
+ CSSPropertySourceData sourceData;
+ bool hasSource;
+ bool disabled;
+ String rawText;
+};
+
+class InspectorStyle : public RefCounted<InspectorStyle> {
+public:
+ static PassRefPtr<InspectorStyle> create(const InspectorCSSId& styleId, CSSStyleDeclaration* style, InspectorStyleSheet* parentStyleSheet)
+ {
+ return adoptRef(new InspectorStyle(styleId, style, parentStyleSheet));
+ }
+
+ InspectorStyle(const InspectorCSSId& styleId, CSSStyleDeclaration* style, InspectorStyleSheet* parentStyleSheet)
+ : m_styleId(styleId)
+ , m_style(style)
+ , m_parentStyleSheet(parentStyleSheet)
+ {
+ ASSERT(style);
+ }
+
+ CSSStyleDeclaration* cssStyle() const { return m_style; }
+ PassRefPtr<InspectorObject> buildObjectForStyle() const;
+ bool hasDisabledProperties() const { return !m_disabledProperties.isEmpty(); }
+ bool setPropertyText(unsigned index, const String& text, bool overwrite);
+ bool toggleProperty(unsigned index, bool disable);
+
+private:
+ static unsigned disabledIndexByOrdinal(unsigned ordinal, bool canUseSubsequent, Vector<InspectorStyleProperty>& allProperties);
+
+ bool styleText(String* result);
+ bool disableProperty(unsigned indexToDisable, Vector<InspectorStyleProperty>& allProperties);
+ bool enableProperty(unsigned indexToEnable, Vector<InspectorStyleProperty>& allProperties);
+ bool populateAllProperties(Vector<InspectorStyleProperty>* result) const;
+ void populateObjectWithStyleProperties(InspectorObject* result) const;
+ void shiftDisabledProperties(unsigned fromIndex, long offset);
+ bool replacePropertyInStyleText(const InspectorStyleProperty& property, const String& newText);
+ String shorthandValue(const String& shorthandProperty) const;
+ String shorthandPriority(const String& shorthandProperty) const;
+ Vector<String> longhandProperties(const String& shorthandProperty) const;
+
+ InspectorCSSId m_styleId;
+ CSSStyleDeclaration* m_style;
+ InspectorStyleSheet* m_parentStyleSheet;
+ Vector<InspectorStyleProperty> m_disabledProperties;
+};
+
class InspectorStyleSheet : public RefCounted<InspectorStyleSheet> {
public:
+ typedef HashMap<CSSStyleDeclaration*, RefPtr<InspectorStyle> > InspectorStyleMap;
static PassRefPtr<InspectorStyleSheet> create(const String& id, CSSStyleSheet* pageStyleSheet, const String& origin, const String& documentURL)
{
return adoptRef(new InspectorStyleSheet(id, pageStyleSheet, origin, documentURL));
@@ -61,46 +148,55 @@ public:
const String& id() const { return m_id; }
CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet; }
bool setText(const String&);
- bool setRuleSelector(const String& ruleId, const String& selector);
+ bool setRuleSelector(const InspectorCSSId&, const String& selector);
CSSStyleRule* addRule(const String& selector);
- CSSStyleRule* ruleForId(const String&) const;
+ CSSStyleRule* ruleForId(const InspectorCSSId&) const;
PassRefPtr<InspectorObject> buildObjectForStyleSheet();
PassRefPtr<InspectorObject> buildObjectForRule(CSSStyleRule*);
PassRefPtr<InspectorObject> buildObjectForStyle(CSSStyleDeclaration*);
- virtual CSSStyleDeclaration* styleForId(const String&) const;
- virtual bool setStyleText(const String& styleId, const String& text);
+ bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const String& text, bool overwrite);
+ bool toggleProperty(const InspectorCSSId&, unsigned propertyIndex, bool disable);
+
+ virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const;
protected:
bool canBind() const { return m_origin != "userAgent" && m_origin != "user"; }
- String fullRuleOrStyleId(CSSStyleDeclaration* style) const { return id() + ":" + ruleOrStyleId(style); }
- String ruleOrStyleId(CSSStyleDeclaration* style) const { unsigned index = ruleIndexByStyle(style); return index == UINT_MAX ? "" : String::number(index); }
+ InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const;
virtual Document* ownerDocument() const;
virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const;
virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
virtual bool ensureParsedDataReady();
+ virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&);
+ virtual void rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle);
+ virtual void forgetInspectorStyle(CSSStyleDeclaration* style);
+
+ // Also accessed by friend class InspectorStyle.
+ virtual bool setStyleText(CSSStyleDeclaration*, const String&);
private:
bool text(String* result) const;
bool ensureText() const;
bool ensureSourceData(Node* ownerNode);
- void innerSetStyleSheetText(const String& newText);
- bool innerSetStyleText(CSSStyleDeclaration*, const String&);
bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newStyleText, String* result);
CSSStyleRule* findPageRuleWithStyle(CSSStyleDeclaration*);
- String fullRuleId(CSSStyleRule* rule) const;
- String fullStyleId(CSSStyleDeclaration* style) const { return fullRuleOrStyleId(style); }
+ InspectorCSSId ruleId(CSSStyleRule* rule) const;
+ InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyleId(style); }
void revalidateStyle(CSSStyleDeclaration*);
- bool styleSheetText(String* result) const;
+ bool originalStyleSheetText(String* result) const;
bool resourceStyleSheetText(String* result) const;
bool inlineStyleSheetText(String* result) const;
PassRefPtr<InspectorArray> buildArrayForRuleList(CSSRuleList*);
+
String m_id;
CSSStyleSheet* m_pageStyleSheet;
String m_origin;
String m_documentURL;
bool m_isRevalidating;
ParsedStyleSheet* m_parsedStyleSheet;
+ InspectorStyleMap m_inspectorStyles;
+
+ friend class InspectorStyle;
};
class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet {
@@ -111,14 +207,19 @@ public:
}
InspectorStyleSheetForInlineStyle(const String& id, Element* element, const String& origin);
- virtual CSSStyleDeclaration* styleForId(const String& id) const { ASSERT(id == "0"); UNUSED_PARAM(id); return inlineStyle(); }
- virtual bool setStyleText(const String& styleId, const String& text);
+ virtual CSSStyleDeclaration* styleForId(const InspectorCSSId& id) const { ASSERT_UNUSED(id, id.ordinal() == "0"); return inlineStyle(); }
protected:
virtual Document* ownerDocument() const;
- virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const { ASSERT(style == inlineStyle()); UNUSED_PARAM(style); return m_ruleSourceData; }
+ virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const { ASSERT_UNUSED(style, style == inlineStyle()); return m_ruleSourceData; }
virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const { return 0; }
virtual bool ensureParsedDataReady();
+ virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId&);
+ virtual void rememberInspectorStyle(RefPtr<InspectorStyle>) { }
+ virtual void forgetInspectorStyle(CSSStyleDeclaration*) { }
+
+ // Also accessed by friend class InspectorStyle.
+ virtual bool setStyleText(CSSStyleDeclaration*, const String&);
private:
CSSStyleDeclaration* inlineStyle() const;
@@ -126,6 +227,7 @@ private:
Element* m_element;
RefPtr<CSSRuleSourceData> m_ruleSourceData;
+ RefPtr<InspectorStyle> m_inspectorStyle;
};
#endif
diff --git a/WebCore/inspector/front-end/ApplicationCacheItemsView.js b/WebCore/inspector/front-end/ApplicationCacheItemsView.js
index f450938..f5147e3 100644
--- a/WebCore/inspector/front-end/ApplicationCacheItemsView.js
+++ b/WebCore/inspector/front-end/ApplicationCacheItemsView.js
@@ -64,7 +64,7 @@ WebInspector.ApplicationCacheItemsView = function(treeElement, appcacheDomain)
this._appcacheDomain = appcacheDomain;
this._emptyMsgElement = document.createElement("div");
- this._emptyMsgElement.className = "storage-table-empty";
+ this._emptyMsgElement.className = "storage-empty-view";
this._emptyMsgElement.textContent = WebInspector.UIString("No Application Cache information available.");
this.element.appendChild(this._emptyMsgElement);
diff --git a/WebCore/inspector/front-end/AuditLauncherView.js b/WebCore/inspector/front-end/AuditLauncherView.js
index a922715..d4bbf90 100644
--- a/WebCore/inspector/front-end/AuditLauncherView.js
+++ b/WebCore/inspector/front-end/AuditLauncherView.js
@@ -269,6 +269,7 @@ WebInspector.AuditLauncherView.prototype = {
this._selectAllClicked(this._selectAllCheckboxElement.checked);
this.updateResourceTrackingState();
this._updateButton();
+ this._updateResourceProgress();
},
_updateResourceProgress: function()
diff --git a/WebCore/inspector/front-end/AuditRules.js b/WebCore/inspector/front-end/AuditRules.js
index cd9f13e..515ce8e 100644
--- a/WebCore/inspector/front-end/AuditRules.js
+++ b/WebCore/inspector/front-end/AuditRules.js
@@ -286,8 +286,8 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
var testedSelectors = {};
for (var i = 0; i < styleSheets.length; ++i) {
var styleSheet = styleSheets[i];
- for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
- var rule = styleSheet.cssRules[curRule];
+ for (var curRule = 0; curRule < styleSheet.rules.length; ++curRule) {
+ var rule = styleSheet.rules[curRule];
if (rule.selectorText.match(pseudoSelectorRegexp))
continue;
selectors.push(rule.selectorText);
@@ -307,9 +307,10 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
var stylesheetSize = 0;
var unusedStylesheetSize = 0;
var unusedRules = [];
- for (var curRule = 0; curRule < styleSheet.cssRules.length; ++curRule) {
- var rule = styleSheet.cssRules[curRule];
- var textLength = rule.cssText ? rule.cssText.length : 0;
+ for (var curRule = 0; curRule < styleSheet.rules.length; ++curRule) {
+ var rule = styleSheet.rules[curRule];
+ // FIXME: replace this by an exact computation once source ranges are available
+ var textLength = rule.style.cssText ? rule.style.cssText.length + rule.selectorText.length : 0;
stylesheetSize += textLength;
if (!testedSelectors[rule.selectorText] || foundSelectors[rule.selectorText])
continue;
@@ -322,7 +323,7 @@ WebInspector.AuditRules.UnusedCssRule.prototype = {
if (!unusedRules.length)
continue;
- var url = styleSheet.href ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.href) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
+ var url = styleSheet.sourceURL ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal);
var pctUnused = Math.round(100 * unusedStylesheetSize / stylesheetSize);
if (!summary)
summary = result.addChild("", true);
@@ -657,7 +658,7 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
if (completeSrc)
src = completeSrc;
- const computedStyle = new WebInspector.CSSStyleDeclaration(styles.computedStyle);
+ const computedStyle = WebInspector.CSSStyleDeclaration.parsePayload(styles.computedStyle);
if (computedStyle.getPropertyValue("position") === "absolute") {
if (!context.imagesLeft)
doneCallback(context);
@@ -668,7 +669,7 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = {
var heightFound = "height" in styles.styleAttributes;
for (var i = styles.matchedCSSRules.length - 1; i >= 0 && !(widthFound && heightFound); --i) {
- var style = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]).style;
+ var style = WebInspector.CSSRule.parsePayload(styles.matchedCSSRules[i]).style;
if (style.getPropertyValue("width") !== "")
widthFound = true;
if (style.getPropertyValue("height") !== "")
diff --git a/WebCore/inspector/front-end/AuditsPanel.js b/WebCore/inspector/front-end/AuditsPanel.js
index f6cbed0..b4eb202 100644
--- a/WebCore/inspector/front-end/AuditsPanel.js
+++ b/WebCore/inspector/front-end/AuditsPanel.js
@@ -130,8 +130,8 @@ WebInspector.AuditsPanel.prototype = {
_executeAudit: function(categories, resultCallback)
{
var resources = [];
- for (var id in WebInspector.resources)
- resources.push(WebInspector.resources[id]);
+ for (var id in WebInspector.networkResources)
+ resources.push(WebInspector.networkResources[id]);
var rulesRemaining = 0;
for (var i = 0; i < categories.length; ++i)
@@ -205,8 +205,8 @@ WebInspector.AuditsPanel.prototype = {
{
this._resourceTrackingCallback = callback;
- if (!WebInspector.panels.resources.resourceTrackingEnabled) {
- InspectorBackend.enableResourceTracking(false);
+ if (WebInspector.panels.resources && !WebInspector.panels.resources.resourceTrackingEnabled) {
+ WebInspector.panels.resources.toggleResourceTracking(false);
this._updateLauncherViewControls(true);
} else
InspectorBackend.reloadPage();
@@ -256,7 +256,7 @@ WebInspector.AuditsPanel.prototype = {
show: function()
{
WebInspector.Panel.prototype.show.call(this);
- this._updateLauncherViewControls(WebInspector.panels.resources.resourceTrackingEnabled);
+ this._updateLauncherViewControls(!WebInspector.panels.resources || WebInspector.panels.resources.resourceTrackingEnabled);
},
reset: function()
diff --git a/WebCore/inspector/front-end/CSSStyleModel.js b/WebCore/inspector/front-end/CSSStyleModel.js
index e3e9b4f..702c923 100644
--- a/WebCore/inspector/front-end/CSSStyleModel.js
+++ b/WebCore/inspector/front-end/CSSStyleModel.js
@@ -32,15 +32,84 @@ WebInspector.CSSStyleModel = function()
{
}
+WebInspector.CSSStyleModel.parseRuleArrayPayload = function(ruleArray)
+{
+ var result = [];
+ for (var i = 0; i < ruleArray.length; ++i)
+ result.push(WebInspector.CSSRule.parsePayload(ruleArray[i]));
+ return result;
+}
+
WebInspector.CSSStyleModel.prototype = {
- getStylesAsync: function(nodeId, authOnly, userCallback)
+ getStylesAsync: function(nodeId, userCallback)
{
- InspectorBackend.getStyles(nodeId, authOnly, userCallback);
+ function callback(userCallback, payload)
+ {
+ if (!payload) {
+ if (userCallback)
+ userCallback(null);
+ return;
+ }
+
+ var result = {};
+ if ("inlineStyle" in payload)
+ result.inlineStyle = WebInspector.CSSStyleDeclaration.parsePayload(payload.inlineStyle);
+
+ result.computedStyle = WebInspector.CSSStyleDeclaration.parsePayload(payload.computedStyle);
+ result.matchedCSSRules = WebInspector.CSSStyleModel.parseRuleArrayPayload(payload.matchedCSSRules);
+
+ result.styleAttributes = {};
+ for (var name in payload.styleAttributes)
+ result.styleAttributes[name] = WebInspector.CSSStyleDeclaration.parsePayload(payload.styleAttributes[name]);
+
+ result.pseudoElements = [];
+ for (var i = 0; i < payload.pseudoElements.length; ++i) {
+ var entryPayload = payload.pseudoElements[i];
+ result.pseudoElements.push({ pseudoId: entryPayload.pseudoId, rules: WebInspector.CSSStyleModel.parseRuleArrayPayload(entryPayload.rules) });
+ }
+
+ result.inherited = [];
+ for (var i = 0; i < payload.inherited.length; ++i) {
+ var entryPayload = payload.inherited[i];
+ var entry = {};
+ if ("inlineStyle" in entryPayload)
+ entry.inlineStyle = WebInspector.CSSStyleDeclaration.parsePayload(entryPayload.inlineStyle);
+ if ("matchedCSSRules" in entryPayload)
+ entry.matchedCSSRules = WebInspector.CSSStyleModel.parseRuleArrayPayload(entryPayload.matchedCSSRules);
+ result.inherited.push(entry);
+ }
+
+ if (userCallback)
+ userCallback(result);
+ }
+
+ InspectorBackend.getStyles(nodeId, false, callback.bind(null, userCallback));
},
getComputedStyleAsync: function(nodeId, userCallback)
{
- InspectorBackend.getComputedStyle(nodeId, userCallback);
+ function callback(userCallback, stylePayload)
+ {
+ if (!stylePayload)
+ userCallback(null);
+ else
+ userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
+ }
+
+ InspectorBackend.getComputedStyle(nodeId, callback.bind(null, userCallback));
+ },
+
+ getInlineStyleAsync: function(nodeId, userCallback)
+ {
+ function callback(userCallback, stylePayload)
+ {
+ if (!stylePayload)
+ userCallback(null);
+ else
+ userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
+ }
+
+ InspectorBackend.getInlineStyle(nodeId, callback.bind(null, userCallback));
},
setRuleSelector: function(ruleId, newContent, nodeId, successCallback, failureCallback)
@@ -73,39 +142,8 @@ WebInspector.CSSStyleModel.prototype = {
InspectorBackend.addRule(newContent, nodeId, callback);
},
- toggleStyleEnabled: function(styleId, propertyName, disabled, userCallback)
- {
- function callback(newPayload)
- {
- if (!newPayload) {
- userCallback(null);
- return;
- }
-
- var newStyle = WebInspector.CSSStyleDeclaration.parseStyle(newPayload);
- userCallback(newStyle);
- }
-
- InspectorBackend.toggleStyleEnabled(styleId, propertyName, disabled, callback);
- },
-
setCSSText: function(styleId, cssText)
{
InspectorBackend.setStyleText(styleId, cssText);
- },
-
- applyStyleText: function(styleId, styleText, propertyName, successCallback, failureCallback)
- {
- function callback(success, newPayload)
- {
- if (!success)
- failureCallback();
- else {
- var newStyle = newPayload ? WebInspector.CSSStyleDeclaration.parseStyle(newPayload) : null;
- successCallback(newStyle);
- }
- }
-
- InspectorBackend.applyStyleText(styleId, styleText, propertyName, callback);
}
}
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 8cd5d52..deca21c 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -48,7 +48,7 @@ WebInspector.ConsoleView = function(drawer)
this.promptElement.className = "source-code";
this.promptElement.addEventListener("keydown", this._promptKeyDown.bind(this), true);
this.prompt = new WebInspector.TextPrompt(this.promptElement, this.completions.bind(this), ExpressionStopCharacters + ".");
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ this.prompt.history = WebInspector.applicationSettings.consoleHistory;
this.topGroup = new WebInspector.ConsoleGroup(null, 0);
this.messagesElement.insertBefore(this.topGroup.element, this.promptElement);
@@ -102,11 +102,6 @@ WebInspector.ConsoleView = function(drawer)
}
WebInspector.ConsoleView.prototype = {
- _settingsLoaded: function()
- {
- this.prompt.history = WebInspector.applicationSettings.consoleHistory;
- },
-
_updateFilter: function(e)
{
var isMac = WebInspector.isMac();
@@ -225,11 +220,15 @@ WebInspector.ConsoleView.prototype = {
this._incrementErrorWarningCount(msg);
// Add message to the resource panel
- if (msg.url in WebInspector.resourceURLMap) {
- msg.resource = WebInspector.resourceURLMap[msg.url];
- if (WebInspector.panels.resources)
- WebInspector.panels.resources.addMessageToResource(msg.resource, msg);
- }
+ if (!Preferences.networkPanelEnabled) {
+ var resource = WebInspector.resourceForURL(msg.url);
+ if (resource) {
+ msg.resource = resource;
+ if (WebInspector.panels.resources)
+ WebInspector.panels.resources.addMessageToResource(msg.resource, msg);
+ }
+ } else
+ WebInspector.resourceManager.addConsoleMessage(msg);
this.commandSincePreviousMessage = false;
this.previousMessage = msg;
@@ -303,6 +302,8 @@ WebInspector.ConsoleView.prototype = {
{
if (WebInspector.panels.resources)
WebInspector.panels.resources.clearMessages();
+ if (WebInspector.resourceManager)
+ WebInspector.resourceManager.clearConsoleMessages();
this.messages = [];
@@ -678,7 +679,7 @@ WebInspector.ConsoleMessage.prototype = {
case WebInspector.ConsoleMessage.MessageType.Trace:
case WebInspector.ConsoleMessage.MessageType.UncaughtException:
var ol = document.createElement("ol");
- ol.addStyleClass("stack-trace");
+ ol.className = "outline-disclosure";
var treeOutline = new TreeOutline(ol);
var messageText;
if (this.type === WebInspector.ConsoleMessage.MessageType.Assert)
diff --git a/WebCore/inspector/front-end/CookieItemsView.js b/WebCore/inspector/front-end/CookieItemsView.js
index 88cbe05..b2da875 100644
--- a/WebCore/inspector/front-end/CookieItemsView.js
+++ b/WebCore/inspector/front-end/CookieItemsView.js
@@ -27,12 +27,141 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.CookieItemsView = function(treeElement, cookieDomain)
+WebInspector.CookiesTable = function()
{
WebInspector.View.call(this);
- this.element.addStyleClass("storage-view");
this.element.addStyleClass("table");
+}
+
+WebInspector.CookiesTable.prototype = {
+ resize: function()
+ {
+ if (!this._dataGrid)
+ return;
+
+ if (this._autoSizingDone)
+ this._dataGrid.updateWidths();
+ else {
+ this._autoSizingDone = true;
+ this._dataGrid.autoSizeColumns(4, 45, 1);
+ }
+ },
+
+ _createDataGrid: function(expandable)
+ {
+ var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
+ columns[0].title = WebInspector.UIString("Name");
+ columns[0].sortable = true;
+ columns[0].disclosure = expandable;
+ columns[1].title = WebInspector.UIString("Value");
+ columns[1].sortable = true;
+ columns[2].title = WebInspector.UIString("Domain");
+ columns[2].sortable = true;
+ columns[3].title = WebInspector.UIString("Path");
+ columns[3].sortable = true;
+ columns[4].title = WebInspector.UIString("Expires");
+ columns[4].sortable = true;
+ columns[5].title = WebInspector.UIString("Size");
+ columns[5].aligned = "right";
+ columns[5].sortable = true;
+ columns[6].title = WebInspector.UIString("HTTP");
+ columns[6].aligned = "centered";
+ columns[6].sortable = true;
+ columns[7].title = WebInspector.UIString("Secure");
+ columns[7].aligned = "centered";
+ columns[7].sortable = true;
+
+ var deleteCallback = this._deleteCookieCallback ? this._deleteCookieCallback.bind(this) : null;
+ this._dataGrid = new WebInspector.DataGrid(columns, null, deleteCallback);
+ this._dataGrid.addEventListener("sorting changed", this._populateDataGrid, this);
+ this.element.appendChild(this._dataGrid.element);
+ },
+
+ _populateCookies: function(parentNode, cookies)
+ {
+ var selectedCookie = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.cookie : null;
+ parentNode.removeChildren();
+ if (!cookies)
+ return;
+ this._sortCookies(cookies);
+ var totalSize = 0;
+ for (var i = 0; i < cookies.length; ++i) {
+ var cookieNode = this._createGridNode(cookies[i]);
+ parentNode.appendChild(cookieNode);
+ if (selectedCookie === cookies[i])
+ cookieNode.selected = true;
+ }
+ },
+
+ _sortCookies: function(cookies)
+ {
+ var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
+
+ function localeCompare(field, cookie1, cookie2)
+ {
+ return sortDirection * (cookie1[field] + "").localeCompare(cookie2[field] + "")
+ }
+
+ function numberCompare(field, cookie1, cookie2)
+ {
+ return sortDirection * (cookie1[field] - cookie2[field]);
+ }
+
+ function expiresCompare(cookie1, cookie2)
+ {
+ if (cookie1.session !== cookie2.session)
+ return sortDirection * (cookie1.session ? 1 : -1);
+
+ if (cookie1.session)
+ return 0;
+
+ return sortDirection * (cookie1.expires - cookie2.expires);
+ }
+
+ var comparator;
+ switch (parseInt(this._dataGrid.sortColumnIdentifier)) {
+ case 0: comparator = localeCompare.bind(this, "name"); break;
+ case 1: comparator = localeCompare.bind(this, "value"); break;
+ case 2: comparator = localeCompare.bind(this, "domain"); break;
+ case 3: comparator = localeCompare.bind(this, "path"); break;
+ case 4: comparator = expiresCompare; break;
+ case 5: comparator = numberCompare.bind(this, "size"); break;
+ case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
+ case 7: comparator = localeCompare.bind(this, "secure"); break;
+ default: localeCompare.bind(this, "name");
+ }
+
+ cookies.sort(comparator);
+ },
+
+ _createGridNode: function(cookie)
+ {
+ var data = {};
+ data[0] = cookie.name;
+ data[1] = cookie.value;
+ data[2] = cookie.domain || "";
+ data[3] = cookie.path || "";
+ data[4] = cookie.type === WebInspector.Cookie.Type.Request ? "" :
+ (cookie.session ? WebInspector.UIString("Session") : new Date(cookie.expires).toGMTString());
+ data[5] = cookie.size;
+ data[6] = (cookie.httpOnly ? "\u2713" : ""); // Checkmark
+ data[7] = (cookie.secure ? "\u2713" : ""); // Checkmark
+
+ var node = new WebInspector.DataGridNode(data);
+ node.cookie = cookie;
+ node.selectable = true;
+ return node;
+ }
+};
+
+WebInspector.CookiesTable.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.CookieItemsView = function(treeElement, cookieDomain)
+{
+ WebInspector.CookiesTable.call(this);
+
+ this.element.addStyleClass("storage-view");
this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString("Delete"), "delete-storage-status-bar-item");
this.deleteButton.visible = false;
@@ -45,7 +174,7 @@ WebInspector.CookieItemsView = function(treeElement, cookieDomain)
this._cookieDomain = cookieDomain;
this._emptyMsgElement = document.createElement("div");
- this._emptyMsgElement.className = "storage-table-empty";
+ this._emptyMsgElement.className = "storage-empty-view";
this._emptyMsgElement.textContent = WebInspector.UIString("This site has no cookies.");
this.element.appendChild(this._emptyMsgElement);
}
@@ -79,7 +208,6 @@ WebInspector.CookieItemsView.prototype = {
this._filterCookiesForDomain(allCookies);
else
this._cookies = allCookies;
-
if (!this._cookies.length) {
// Nothing to show.
this._emptyMsgElement.removeStyleClass("hidden");
@@ -120,12 +248,13 @@ WebInspector.CookieItemsView.prototype = {
var resourceURLsForDocumentURL = [];
this._totalSize = 0;
- for (var id in WebInspector.resources) {
- var resource = WebInspector.resources[id];
+ function populateResourcesForDocuments(resource)
+ {
var url = resource.documentURL.asParsedURL();
if (url && url.host == this._cookieDomain)
resourceURLsForDocumentURL.push(resource.url);
}
+ WebInspector.forAllResources(populateResourcesForDocuments.bind(this));
for (var i = 0; i < allCookies.length; ++i) {
var pushed = false;
@@ -143,101 +272,9 @@ WebInspector.CookieItemsView.prototype = {
}
},
- _createDataGrid: function()
- {
- var columns = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {} };
- columns[0].title = WebInspector.UIString("Name");
- columns[0].sortable = true;
- columns[1].title = WebInspector.UIString("Value");
- columns[1].sortable = true;
- columns[2].title = WebInspector.UIString("Domain");
- columns[2].sortable = true;
- columns[3].title = WebInspector.UIString("Path");
- columns[3].sortable = true;
- columns[4].title = WebInspector.UIString("Expires");
- columns[4].sortable = true;
- columns[5].title = WebInspector.UIString("Size");
- columns[5].aligned = "right";
- columns[5].sortable = true;
- columns[6].title = WebInspector.UIString("HTTP");
- columns[6].aligned = "centered";
- columns[6].sortable = true;
- columns[7].title = WebInspector.UIString("Secure");
- columns[7].aligned = "centered";
- columns[7].sortable = true;
-
- this._dataGrid = new WebInspector.DataGrid(columns, null, this._deleteCookieCallback.bind(this));
- this._dataGrid.addEventListener("sorting changed", this._populateDataGrid, this);
- this.element.appendChild(this._dataGrid.element);
- this._dataGrid.updateWidths();
- },
-
_populateDataGrid: function()
{
- var selectedCookie = this._dataGrid.selectedNode ? this._dataGrid.selectedNode.cookie : null;
- var sortDirection = this._dataGrid.sortOrder === "ascending" ? 1 : -1;
-
- function localeCompare(field, cookie1, cookie2)
- {
- return sortDirection * (cookie1[field] + "").localeCompare(cookie2[field] + "")
- }
-
- function numberCompare(field, cookie1, cookie2)
- {
- return sortDirection * (cookie1[field] - cookie2[field]);
- }
-
- function expiresCompare(cookie1, cookie2)
- {
- if (cookie1.session !== cookie2.session)
- return sortDirection * (cookie1.session ? 1 : -1);
-
- if (cookie1.session)
- return 0;
-
- return sortDirection * (cookie1.expires - cookie2.expires);
- }
-
- var comparator;
- switch (parseInt(this._dataGrid.sortColumnIdentifier)) {
- case 0: comparator = localeCompare.bind(this, "name"); break;
- case 1: comparator = localeCompare.bind(this, "value"); break;
- case 2: comparator = localeCompare.bind(this, "domain"); break;
- case 3: comparator = localeCompare.bind(this, "path"); break;
- case 4: comparator = expiresCompare; break;
- case 5: comparator = numberCompare.bind(this, "size"); break;
- case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
- case 7: comparator = localeCompare.bind(this, "secure"); break;
- default: localeCompare.bind(this, "name");
- }
-
- this._cookies.sort(comparator);
-
- this._dataGrid.removeChildren();
- var nodeToSelect;
- for (var i = 0; i < this._cookies.length; ++i) {
- var data = {};
- var cookie = this._cookies[i];
- data[0] = cookie.name;
- data[1] = cookie.value;
- data[2] = cookie.domain;
- data[3] = cookie.path;
- data[4] = (cookie.session ? WebInspector.UIString("Session") : new Date(cookie.expires).toGMTString());
- data[5] = Number.bytesToString(cookie.size, WebInspector.UIString);
- data[6] = (cookie.httpOnly ? "\u2713" : ""); // Checkmark
- data[7] = (cookie.secure ? "\u2713" : ""); // Checkmark
-
- var node = new WebInspector.DataGridNode(data);
- node.cookie = cookie;
- node.selectable = true;
- this._dataGrid.appendChild(node);
- if (cookie === selectedCookie)
- nodeToSelect = node;
- }
- if (nodeToSelect)
- nodeToSelect.selected = true;
- else
- this._dataGrid.children[0].selected = true;
+ this._populateCookies(this._dataGrid, this._cookies);
},
_createSimpleDataGrid: function()
@@ -273,12 +310,6 @@ WebInspector.CookieItemsView.prototype = {
this._dataGrid.children[0].selected = true;
},
- resize: function()
- {
- if (this._dataGrid)
- this._dataGrid.updateWidths();
- },
-
_deleteButtonClicked: function(event)
{
if (!this._dataGrid || !this._dataGrid.selectedNode)
@@ -300,4 +331,5 @@ WebInspector.CookieItemsView.prototype = {
}
}
-WebInspector.CookieItemsView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.CookieItemsView.prototype.__proto__ = WebInspector.CookiesTable.prototype;
+
diff --git a/WebCore/inspector/front-end/CookieParser.js b/WebCore/inspector/front-end/CookieParser.js
index 2be5df7..f96be0b 100755
--- a/WebCore/inspector/front-end/CookieParser.js
+++ b/WebCore/inspector/front-end/CookieParser.js
@@ -54,7 +54,7 @@ WebInspector.CookieParser.prototype = {
if (kv.key.charAt(0) === "$" && this._lastCookie)
this._lastCookie.addAttribute(kv.key.slice(1), kv.value);
else if (kv.key.toLowerCase() !== "$version" && typeof kv.value === "string")
- this._addCookie(kv);
+ this._addCookie(kv, WebInspector.Cookie.Type.Request);
this._advanceAndCheckCookieDelimiter();
}
this._flushCookie();
@@ -69,7 +69,7 @@ WebInspector.CookieParser.prototype = {
if (this._lastCookie)
this._lastCookie.addAttribute(kv.key, kv.value);
else
- this._addCookie(kv);
+ this._addCookie(kv, WebInspector.Cookie.Type.Response);
if (this._advanceAndCheckCookieDelimiter())
this._flushCookie();
}
@@ -128,14 +128,14 @@ WebInspector.CookieParser.prototype = {
return match[0].match("\n") !== null;
},
- _addCookie: function(keyValue)
+ _addCookie: function(keyValue, type)
{
if (this._lastCookie)
this._lastCookie.size = keyValue.position - this._lastCookiePosition;
- // Mozilla bug 169091: Mozilla, IE and Chrome treat signle token (w/o "=") as
+ // Mozilla bug 169091: Mozilla, IE and Chrome treat single token (w/o "=") as
// specifying a value for a cookie with empty name.
- this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value) :
- new WebInspector.Cookie("", keyValue.key);
+ this._lastCookie = keyValue.value ? new WebInspector.Cookie(keyValue.key, keyValue.value, type) :
+ new WebInspector.Cookie("", keyValue.key, type);
this._lastCookiePosition = keyValue.position;
this._cookies.push(this._lastCookie);
}
@@ -151,10 +151,11 @@ WebInspector.CookieParser.parseSetCookie = function(header)
return (new WebInspector.CookieParser()).parseSetCookie(header);
}
-WebInspector.Cookie = function(name, value)
+WebInspector.Cookie = function(name, value, type)
{
this.name = name;
this.value = value;
+ this.type = type;
this._attributes = {};
}
@@ -202,3 +203,8 @@ WebInspector.Cookie.prototype = {
this._attributes[key.toLowerCase()] = value;
}
}
+
+WebInspector.Cookie.Type = {
+ Request: 0,
+ Response: 1
+};
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 5153fb1..470e775 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -526,90 +526,78 @@ WebInspector.EventListeners.getEventListenersForNodeAsync = function(node, callb
WebInspector.CSSStyleDeclaration = function(payload)
{
- this.id = payload.id;
- this.parentStyleSheetId = payload.parentStyleSheetId;
- this.width = payload.width;
- this.height = payload.height;
- this.__disabledProperties = {};
- this.__disabledPropertyValues = {};
- this.__disabledPropertyPriorities = {};
- if (payload.disabled) {
- for (var i = 0; i < payload.disabled.length; ++i) {
- var property = payload.disabled[i];
- this.__disabledProperties[property.name] = true;
- this.__disabledPropertyValues[property.name] = property.value;
- this.__disabledPropertyPriorities[property.name] = property.priority;
- }
- }
-
+ this.id = payload.styleId;
+ this.properties = payload.properties;
this._shorthandValues = payload.shorthandValues;
- this._propertyMap = {};
- this._longhandProperties = {};
- this.length = payload.properties.length;
-
- for (var i = 0; i < this.length; ++i) {
- var property = payload.properties[i];
+ this._livePropertyMap = {}; // LIVE properties (source-based or style-based) : { name -> CSSProperty }
+ this._allProperties = []; // ALL properties: [ CSSProperty ]
+ this._longhandProperties = {}; // shorthandName -> [ CSSProperty ]
+ this.__disabledProperties = {}; // DISABLED properties: { index -> CSSProperty }
+ var payloadPropertyCount = payload.cssProperties.length;
+
+ var propertyIndex = 0;
+ for (var i = 0; i < payloadPropertyCount; ++i) {
+ var property = new WebInspector.CSSProperty.parsePayload(this, i, payload.cssProperties[i]);
+ this._allProperties.push(property);
+ if (property.disabled)
+ this.__disabledProperties[i] = property;
+ if (!property.active && !property.styleBased)
+ continue;
var name = property.name;
- this[i] = name;
- this._propertyMap[name] = property;
+ this[propertyIndex] = name;
+ this._livePropertyMap[name] = property;
// Index longhand properties.
- if (property.shorthand) {
+ if (property.shorthand) { // only for parsed
var longhands = this._longhandProperties[property.shorthand];
if (!longhands) {
longhands = [];
this._longhandProperties[property.shorthand] = longhands;
}
- longhands.push(name);
+ longhands.push(property);
}
+ ++propertyIndex;
}
+ this.length = propertyIndex;
}
-WebInspector.CSSStyleDeclaration.parseStyle = function(payload)
+WebInspector.CSSStyleDeclaration.parsePayload = function(payload)
{
return new WebInspector.CSSStyleDeclaration(payload);
}
-WebInspector.CSSStyleDeclaration.parseRule = function(payload)
-{
- var rule = {};
- rule.id = payload.id;
- rule.selectorText = payload.selectorText;
- rule.style = new WebInspector.CSSStyleDeclaration(payload.style);
- rule.style.parentRule = rule;
- rule.isUserAgent = payload.isUserAgent;
- rule.isUser = payload.isUser;
- rule.isViaInspector = payload.isViaInspector;
- rule.sourceLine = payload.sourceLine;
- rule.documentURL = payload.documentURL;
- if (payload.parentStyleSheet)
- rule.parentStyleSheet = { href: payload.parentStyleSheet.href };
-
- return rule;
-}
-
WebInspector.CSSStyleDeclaration.prototype = {
+ get allProperties()
+ {
+ return this._allProperties;
+ },
+
+ getLiveProperty: function(name)
+ {
+ return this._livePropertyMap[name];
+ },
+
getPropertyValue: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.value : "";
},
getPropertyPriority: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.priority : "";
},
getPropertyShorthand: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.shorthand : "";
},
isPropertyImplicit: function(name)
{
- var property = this._propertyMap[name];
+ var property = this._livePropertyMap[name];
return property ? property.implicit : "";
},
@@ -651,7 +639,8 @@ WebInspector.CSSStyleDeclaration.prototype = {
getShorthandValue: function(shorthandProperty)
{
- return this._shorthandValues[shorthandProperty];
+ var property = this.getLiveProperty(shorthandProperty);
+ return property ? property.value : this._shorthandValues[shorthandProperty];
},
getShorthandPriority: function(shorthandProperty)
@@ -662,6 +651,166 @@ WebInspector.CSSStyleDeclaration.prototype = {
var longhands = this._longhandProperties[shorthandProperty];
return longhands ? this.getPropertyPriority(longhands[0]) : null;
+ },
+
+ appendProperty: function(propertyName, propertyValue, userCallback)
+ {
+ function setPropertyCallback(userCallback, success, stylePayload)
+ {
+ if (!success)
+ userCallback(null);
+ else
+ userCallback(WebInspector.CSSStyleDeclaration.parsePayload(stylePayload));
+ }
+
+ // FIXME(apavlov): this should be migrated to the new InspectorCSSAgent API once it is enabled.
+ InspectorBackend.applyStyleText(this.id, propertyName + ": " + propertyValue + ";", propertyName, setPropertyCallback.bind(this, userCallback));
+ },
+
+ propertyAt: function(index)
+ {
+ return (index < this.allProperties.length) ? this.allProperties[index] : null;
+ }
+}
+
+WebInspector.CSSRule = function(payload)
+{
+ this.id = payload.ruleId;
+ this.selectorText = payload.selectorText;
+ this.sourceLine = payload.sourceLine;
+ this.sourceURL = payload.sourceURL;
+ this.origin = payload.origin;
+ this.style = WebInspector.CSSStyleDeclaration.parsePayload(payload.style);
+ this.style.parentRule = this;
+}
+
+WebInspector.CSSRule.parsePayload = function(payload)
+{
+ return new WebInspector.CSSRule(payload);
+}
+
+WebInspector.CSSRule.prototype = {
+ get isUserAgent()
+ {
+ return this.origin === "user-agent";
+ },
+
+ get isUser()
+ {
+ return this.origin === "user";
+ },
+
+ get isViaInspector()
+ {
+ return this.origin === "inspector";
+ },
+
+ get isRegular()
+ {
+ return this.origin === "";
+ }
+}
+
+WebInspector.CSSProperty = function(ownerStyle, index, name, value, priority, status, parsedOk, implicit, shorthand, text)
+{
+ this.ownerStyle = ownerStyle;
+ this.index = index;
+ this.name = name;
+ this.value = value;
+ this.priority = priority;
+ this.status = status;
+ this.parsedOk = parsedOk;
+ this.implicit = implicit;
+ this.shorthand = shorthand;
+ this.text = text;
+}
+
+WebInspector.CSSProperty.parsePayload = function(ownerStyle, index, payload)
+{
+ var result = new WebInspector.CSSProperty(
+ ownerStyle, index, payload.name, payload.value, payload.priority, payload.status, payload.parsedOk, payload.implicit, payload.shorthandName, payload.text);
+ return result;
+}
+
+WebInspector.CSSProperty.prototype = {
+ get propertyText()
+ {
+ if (this.text !== undefined)
+ return this.text;
+
+ return this.name + ": " + this.value + (this.priority ? " !" + this.priority : "") + ";";
+ },
+
+ get isLive()
+ {
+ return this.active || this.styleBased;
+ },
+
+ get active()
+ {
+ return this.status === "active";
+ },
+
+ get styleBased()
+ {
+ return this.status === "style";
+ },
+
+ get inactive()
+ {
+ return this.status === "inactive";
+ },
+
+ get disabled()
+ {
+ return this.status === "disabled";
+ },
+
+ // Replaces "propertyName: propertyValue [!important];" in the stylesheet by an arbitrary propertyText.
+ setText: function(propertyText, userCallback)
+ {
+ function callback(userCallback, success, stylePayload)
+ {
+ if (!userCallback)
+ return;
+ if (!success)
+ userCallback(null);
+ else {
+ var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);
+ userCallback(style);
+ }
+ }
+
+ if (!this.ownerStyle)
+ throw "No ownerStyle for property";
+ InspectorBackend.applyStyleText(this.ownerStyle.id, propertyText, this.name, callback.bind(this, userCallback));
+ },
+
+ setValue: function(newValue, userCallback)
+ {
+ var text = this.name + ": " + newValue + (this.priority ? " !" + this.priority : "") + ";"
+ this.setText(text, userCallback);
+ },
+
+ setDisabled: function(disabled, userCallback)
+ {
+ if (!this.ownerStyle && userCallback)
+ userCallback(null);
+ if (disabled === this.disabled && userCallback)
+ userCallback(this.ownerStyle);
+
+ function callback(userCallback, stylePayload)
+ {
+ if (!userCallback)
+ return;
+ if (!stylePayload)
+ userCallback(null);
+ else {
+ var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);
+ userCallback(style);
+ }
+ }
+ InspectorBackend.toggleStyleEnabled(this.ownerStyle.id, this.name, disabled, callback.bind(this, userCallback));
}
}
diff --git a/WebCore/inspector/front-end/DataGrid.js b/WebCore/inspector/front-end/DataGrid.js
index 3007497..bc429d9 100644
--- a/WebCore/inspector/front-end/DataGrid.js
+++ b/WebCore/inspector/front-end/DataGrid.js
@@ -308,7 +308,7 @@ WebInspector.DataGrid.prototype = {
return this._dataTableBody;
},
- autoSizeColumns: function(minPercent, maxPercent)
+ autoSizeColumns: function(minPercent, maxPercent, maxDescentLevel)
{
if (minPercent)
minPercent = Math.min(minPercent, Math.floor(100 / this._columnCount));
@@ -317,8 +317,9 @@ WebInspector.DataGrid.prototype = {
for (var columnIdentifier in columns)
widths[columnIdentifier] = (columns[columnIdentifier].title || "").length;
- for (var i = 0; i < this.children.length; ++i) {
- var node = this.children[i];
+ var children = maxDescentLevel ? this._enumerateChildren(this, [], maxDescentLevel + 1) : this.children;
+ for (var i = 0; i < children.length; ++i) {
+ var node = children[i];
for (var columnIdentifier in columns) {
var text = node.data[columnIdentifier] || "";
if (text.length > widths[columnIdentifier])
@@ -371,6 +372,17 @@ WebInspector.DataGrid.prototype = {
this.updateWidths();
},
+ _enumerateChildren: function(rootNode, result, maxLevel)
+ {
+ if (!rootNode.root)
+ result.push(rootNode);
+ if (!maxLevel)
+ return;
+ for (var i = 0; i < rootNode.children.length; ++i)
+ this._enumerateChildren(rootNode.children[i], result, maxLevel - 1);
+ return result;
+ },
+
// Updates the widths of the table, including the positions of the column
// resizers.
//
@@ -388,7 +400,8 @@ WebInspector.DataGrid.prototype = {
var tableWidth = this._dataTable.offsetWidth;
var numColumns = headerTableColumns.length;
- if (!this._columnWidthsInitialized) {
+ // Do not attempt to use offsetes if we're not attached to the document tree yet.
+ if (!this._columnWidthsInitialized && this.element.offsetWidth) {
// Give all the columns initial widths now so that during a resize,
// when the two columns that get resized get a percent value for
// their widths, all the other columns already have percent values
diff --git a/WebCore/inspector/front-end/DatabaseTableView.js b/WebCore/inspector/front-end/DatabaseTableView.js
index 5440763..b234b9a 100644
--- a/WebCore/inspector/front-end/DatabaseTableView.js
+++ b/WebCore/inspector/front-end/DatabaseTableView.js
@@ -61,7 +61,7 @@ WebInspector.DatabaseTableView.prototype = {
var dataGrid = WebInspector.panels.storage.dataGridForResult(columnNames, values);
if (!dataGrid) {
var emptyMsgElement = document.createElement("div");
- emptyMsgElement.className = "storage-table-empty";
+ emptyMsgElement.className = "storage-empty-view";
emptyMsgElement.textContent = WebInspector.UIString("The “%s”\ntable is empty.", this.tableName);
this.element.appendChild(emptyMsgElement);
return;
diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js
index e2ad259..3354191 100644
--- a/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -46,7 +46,11 @@ WebInspector.EventListenersSidebarPane = function()
option.label = WebInspector.UIString("Selected Node Only");
this.settingsSelectElement.appendChild(option);
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ var filter = WebInspector.applicationSettings.eventListenersFilter;
+ if (filter === "all")
+ this.settingsSelectElement[0].selected = true;
+ else if (filter === "selected")
+ this.settingsSelectElement[1].selected = true;
this.settingsSelectElement.addEventListener("click", function(event) { event.stopPropagation() }, false);
this.settingsSelectElement.addEventListener("change", this._changeSetting.bind(this), false);
@@ -54,15 +58,6 @@ WebInspector.EventListenersSidebarPane = function()
}
WebInspector.EventListenersSidebarPane.prototype = {
- _settingsLoaded: function()
- {
- var filter = WebInspector.applicationSettings.eventListenersFilter;
- if (filter === "all")
- this.settingsSelectElement[0].selected = true;
- if (filter === "selected")
- this.settingsSelectElement[1].selected = true;
- },
-
update: function(node)
{
var body = this.bodyElement;
diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js
index 9ab4c0c..5e593f7 100644
--- a/WebCore/inspector/front-end/ExtensionServer.js
+++ b/WebCore/inspector/front-end/ExtensionServer.js
@@ -240,11 +240,16 @@ WebInspector.ExtensionServer.prototype = {
var id = message.id;
var resource = null;
- resource = WebInspector.resources[id] || WebInspector.resourceForURL(id);
+ resource = WebInspector.networkResources[id] || WebInspector.resourceForURL(id);
if (!resource)
return this._status.E_NOTFOUND(typeof id + ": " + id);
- WebInspector.panels.resources.showResource(resource, message.line);
- WebInspector.showPanel("resources");
+ if (Preferences.networkPanelEnabled) {
+ WebInspector.panels.storage.showResource(resource, message.line);
+ WebInspector.showPanel("storage");
+ } else {
+ WebInspector.panels.resources.showResource(resource, message.line);
+ WebInspector.showPanel("resources");
+ }
},
_dispatchCallback: function(requestId, port, result)
@@ -256,14 +261,14 @@ WebInspector.ExtensionServer.prototype = {
{
function resourceWrapper(id)
{
- return WebInspector.extensionServer._convertResource(WebInspector.resources[id]);
+ return WebInspector.extensionServer._convertResource(WebInspector.networkResources[id]);
}
var response;
if (request.id)
- response = WebInspector.resources[request.id] ? resourceWrapper(request.id) : this._status.E_NOTFOUND(request.id);
+ response = WebInspector.networkResources[request.id] ? resourceWrapper(request.id) : this._status.E_NOTFOUND(request.id);
else
- response = Object.keys(WebInspector.resources).map(resourceWrapper);
+ response = Object.keys(WebInspector.networkResources).map(resourceWrapper);
return response;
},
@@ -272,7 +277,7 @@ WebInspector.ExtensionServer.prototype = {
var ids;
var response = [];
- function onContentAvailable(id, encoded, content)
+ function onContentAvailable(id, content, encoded)
{
var resourceContent = {
id: id,
@@ -293,13 +298,12 @@ WebInspector.ExtensionServer.prototype = {
for (var i = 0; i < ids.length; ++i) {
var id = ids[i];
- var resource = WebInspector.resources[id];
+ var resource = WebInspector.networkResources[id];
+
if (!resource)
response.push(this._status.E_NOTFOUND(id));
- else {
- var encode = !WebInspector.Resource.Type.isTextType(resource.type);
- WebInspector.getEncodedResourceContent(id, encode, onContentAvailable.bind(this, id, encode));
- }
+ else
+ resource.getContent(onContentAvailable.bind(this, id));
}
if (response.length === ids.length)
this._dispatchCallback(message.requestId, port, response);
@@ -446,8 +450,3 @@ WebInspector.addExtensions = function(extensions)
}
WebInspector.extensionServer = new WebInspector.ExtensionServer();
-
-WebInspector.getEncodedResourceContent = function(identifier, encode, callback)
-{
- InspectorBackend.getResourceContent(identifier, encode, callback);
-}
diff --git a/WebCore/inspector/front-end/FontView.js b/WebCore/inspector/front-end/FontView.js
index b011204..78a7e70 100644
--- a/WebCore/inspector/front-end/FontView.js
+++ b/WebCore/inspector/front-end/FontView.js
@@ -69,6 +69,7 @@ WebInspector.FontView.prototype = {
resize: function()
{
this.updateFontPreviewSize();
+ WebInspector.ResourceView.prototype.resize.call(this);
},
updateFontPreviewSize: function()
diff --git a/WebCore/inspector/front-end/HAREntry.js b/WebCore/inspector/front-end/HAREntry.js
index 2b8f41b..f3bfb06 100644
--- a/WebCore/inspector/front-end/HAREntry.js
+++ b/WebCore/inspector/front-end/HAREntry.js
@@ -180,7 +180,7 @@ WebInspector.HAREntry.prototype = {
var startTime = timing[start];
return typeof startTime !== "number" || startTime === -1 ? -1 : Math.round(timing[end] - startTime);
}
-};
+}
WebInspector.HAREntry._toMilliseconds = function(time)
{
@@ -203,7 +203,7 @@ WebInspector.HARLog.prototype = {
version: webKitVersion ? webKitVersion[1] : "n/a"
},
pages: this._buildPages(),
- entries: Object.keys(WebInspector.resources).map(this._convertResource)
+ entries: Object.keys(WebInspector.networkResources).map(this._convertResource)
}
},
@@ -221,17 +221,15 @@ WebInspector.HARLog.prototype = {
buildMainResourceTimings: function()
{
- var resourcesPanel = WebInspector.panels.resources;
- var startTime = WebInspector.mainResource.startTime;
return {
- onContentLoad: this._pageEventTime(resourcesPanel.mainResourceDOMContentTime),
- onLoad: this._pageEventTime(resourcesPanel.mainResourceLoadTime),
+ onContentLoad: this._pageEventTime(WebInspector.mainResourceDOMContentTime),
+ onLoad: this._pageEventTime(WebInspector.mainResourceLoadTime),
}
},
_convertResource: function(id)
{
- return (new WebInspector.HAREntry(WebInspector.resources[id])).build();
+ return (new WebInspector.HAREntry(WebInspector.networkResources[id])).build();
},
_pageEventTime: function(time)
@@ -241,4 +239,4 @@ WebInspector.HARLog.prototype = {
return -1;
return WebInspector.HAREntry._toMilliseconds(time - startTime);
}
-};
+}
diff --git a/WebCore/inspector/front-end/ImageView.js b/WebCore/inspector/front-end/ImageView.js
index 06ca4a4..7cff056 100644
--- a/WebCore/inspector/front-end/ImageView.js
+++ b/WebCore/inspector/front-end/ImageView.js
@@ -49,10 +49,14 @@ WebInspector.ImageView.prototype = {
this.imagePreviewElement = document.createElement("img");
this.imagePreviewElement.addStyleClass("resource-image-view");
- this.imagePreviewElement.setAttribute("src", this.resource.url);
-
this._container.appendChild(this.imagePreviewElement);
+ function onResourceContent(element, content)
+ {
+ this.imagePreviewElement.setAttribute("src", this.resource.contentURL);
+ }
+ this.resource.getContent(onResourceContent.bind(this));
+
this._container = document.createElement("div");
this._container.className = "info";
this.contentElement.appendChild(this._container);
diff --git a/WebCore/inspector/front-end/Images/frame.png b/WebCore/inspector/front-end/Images/frame.png
new file mode 100644
index 0000000..0d1953c
--- /dev/null
+++ b/WebCore/inspector/front-end/Images/frame.png
Binary files differ
diff --git a/WebCore/inspector/front-end/Images/networkIcon.png b/WebCore/inspector/front-end/Images/networkIcon.png
index 982424d..ba10bba 100644
--- a/WebCore/inspector/front-end/Images/networkIcon.png
+++ b/WebCore/inspector/front-end/Images/networkIcon.png
Binary files differ
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 24b270b..2d60f69 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -268,7 +268,7 @@ InjectedScript.prototype = {
// We don't want local variables to be shadowed by global ones when evaluating on CallFrame.
if (!isEvalOnCallFrame)
expression = "with (window) {\n" + expression + "\n} ";
- expression = "with (window.console._commandLineAPI) {\n" + expression + "\n}";
+ expression = "with (window ? window.console._commandLineAPI : {}) {\n" + expression + "\n}";
var value = evalFunction.call(object, expression);
delete inspectedWindow.console._commandLineAPI;
diff --git a/WebCore/inspector/front-end/MetricsSidebarPane.js b/WebCore/inspector/front-end/MetricsSidebarPane.js
index 18bc240..3784ce8 100644
--- a/WebCore/inspector/front-end/MetricsSidebarPane.js
+++ b/WebCore/inspector/front-end/MetricsSidebarPane.js
@@ -46,24 +46,24 @@ WebInspector.MetricsSidebarPane.prototype = {
}
var self = this;
- var callback = function(stylePayload) {
- if (!stylePayload)
+ var callback = function(style) {
+ if (!style)
return;
- var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload);
self._update(style);
};
- InspectorBackend.getComputedStyle(node.id, callback);
+ WebInspector.cssModel.getComputedStyleAsync(node.id, callback);
- var inlineStyleCallback = function(stylePayload) {
- if (!stylePayload)
+ var inlineStyleCallback = function(style) {
+ if (!style)
return;
- self._inlineStyleId = stylePayload.id;
+ self.inlineStyle = style;
};
- InspectorBackend.getInlineStyle(node.id, inlineStyleCallback);
+ WebInspector.cssModel.getInlineStyleAsync(node.id, inlineStyleCallback);
},
_update: function(style)
{
+ // Updating with computed style.
var metricsElement = document.createElement("div");
metricsElement.className = "metrics";
@@ -116,23 +116,23 @@ WebInspector.MetricsSidebarPane.prototype = {
for (var i = 0; i < boxes.length; ++i) {
var name = boxes[i];
- if (name === "margin" && noMarginDisplayType[style.display])
+ if (name === "margin" && noMarginDisplayType[style.getPropertyValue("display")])
continue;
- if (name === "padding" && noPaddingDisplayType[style.display])
+ if (name === "padding" && noPaddingDisplayType[style.getPropertyValue("display")])
continue;
- if (name === "position" && noPositionType[style.position])
+ if (name === "position" && noPositionType[style.getPropertyValue("position")])
continue;
var boxElement = document.createElement("div");
boxElement.className = name;
if (name === "content") {
- var width = style.width.replace(/px$/, "");
+ var width = style.getPropertyValue("width").replace(/px$/, "");
var widthElement = document.createElement("span");
widthElement.textContent = width;
widthElement.addEventListener("dblclick", this.startEditing.bind(this, widthElement, "width", "width"), false);
- var height = style.height.replace(/px$/, "");
+ var height = style.getPropertyValue("height").replace(/px$/, "");
var heightElement = document.createElement("span");
heightElement.textContent = height;
heightElement.addEventListener("dblclick", this.startEditing.bind(this, heightElement, "height", "height"), false);
@@ -185,7 +185,7 @@ WebInspector.MetricsSidebarPane.prototype = {
editingCommitted: function(element, userInput, previousContent, context)
{
- if (!this._inlineStyleId) {
+ if (!this.inlineStyle) {
// Element has no renderer.
return this.editingCancelled(element, context); // nothing changed, so cancel
}
@@ -203,14 +203,36 @@ WebInspector.MetricsSidebarPane.prototype = {
userInput += "px";
var self = this;
- var callback = function(success) {
- if (!success)
+ var callback = function(style) {
+ if (!style)
return;
+ self.inlineStyle = style;
self.dispatchEventToListeners("metrics edited");
self.update();
};
- InspectorBackend.setStyleProperty(this._inlineStyleId, context.styleProperty, userInput, callback);
+ function setEnabledValueCallback(context, style)
+ {
+ var property = style.getLiveProperty(context.styleProperty);
+ if (!property)
+ style.appendProperty(context.styleProperty, userInput, callback);
+ else
+ property.setValue(userInput, callback);
+ }
+
+ var allProperties = this.inlineStyle.allProperties;
+ for (var i = 0; i < allProperties.length; ++i) {
+ var property = allProperties[i];
+ if (property.name !== context.styleProperty || property.inactive)
+ continue;
+ if (property.disabled)
+ property.setDisabled(false, setEnabledValueCallback.bind(null, context));
+ else
+ property.setValue(userInput, callback);
+ return;
+ }
+
+ this.inlineStyle.appendProperty(context.styleProperty, userInput, callback);
}
}
diff --git a/WebCore/inspector/front-end/NetworkPanel.js b/WebCore/inspector/front-end/NetworkPanel.js
index 8eed425..c666e54 100644
--- a/WebCore/inspector/front-end/NetworkPanel.js
+++ b/WebCore/inspector/front-end/NetworkPanel.js
@@ -36,6 +36,8 @@ WebInspector.NetworkPanel = function()
this.sidebarElement.className = "network-sidebar";
this._resources = [];
+ this._resourcesById = {};
+ this._lastIdentifier = 0;
this._staleResources = [];
this._resourceGridNodes = {};
this._mainResourceLoadTime = -1;
@@ -51,9 +53,13 @@ WebInspector.NetworkPanel = function()
this._viewsContainerElement = document.createElement("div");
this._viewsContainerElement.id = "network-views";
this._viewsContainerElement.className = "hidden";
-
this.element.appendChild(this._viewsContainerElement);
+ var closeButtonElement = document.createElement("button");
+ closeButtonElement.className = "network-close-button";
+ closeButtonElement.addEventListener("click", this._toggleGridMode.bind(this), false);
+ this._viewsContainerElement.appendChild(closeButtonElement);
+
this._createSortingFunctions();
this._createTable();
this._createTimelineGrid();
@@ -180,7 +186,7 @@ WebInspector.NetworkPanel.prototype = {
columns.type.title = WebInspector.UIString("Type");
columns.type.sortable = true;
- columns.type.width = "7%";
+ columns.type.width = "10%";
columns.size.titleDOMFragment = this._makeHeaderFragment(WebInspector.UIString("Size"), WebInspector.UIString("Transfer"));
columns.size.sortable = true;
@@ -194,7 +200,7 @@ WebInspector.NetworkPanel.prototype = {
columns.timeline.title = "";
columns.timeline.sortable = false;
- columns.timeline.width = "40%";
+ columns.timeline.width = "37%";
columns.timeline.sort = "ascending";
this._dataGrid = new WebInspector.DataGrid(columns);
@@ -251,7 +257,7 @@ WebInspector.NetworkPanel.prototype = {
timelineSorting.appendChild(option);
var header = this._dataGrid.headerTableHeader("timeline");
- header.firstChild.appendChild(timelineSorting);
+ header.replaceChild(timelineSorting, header.firstChild);
timelineSorting.addEventListener("click", function(event) { event.stopPropagation() }, false);
timelineSorting.addEventListener("change", this._sortByTimeline.bind(this), false);
@@ -609,15 +615,10 @@ WebInspector.NetworkPanel.prototype = {
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);
+ this._largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
},
set mainResourceLoadTime(x)
@@ -758,6 +759,7 @@ WebInspector.NetworkPanel.prototype = {
this._calculator.reset();
this._resources = [];
+ this._resourcesById = {};
this._staleResources = [];
this._resourceGridNodes = {};
@@ -773,9 +775,17 @@ WebInspector.NetworkPanel.prototype = {
this._resetSummaryBar();
},
+ get resources()
+ {
+ return this._resourcesById;
+ },
+
addResource: function(resource)
{
this._resources.push(resource);
+ if (!resource.identifier)
+ resource.identifier = "network:" + this._lastIdentifier++;
+ this._resourcesById[resource.identifier] = resource;
this.refreshResource(resource);
},
@@ -787,12 +797,9 @@ WebInspector.NetworkPanel.prototype = {
if (!resource || !resource._resourcesView)
return;
- if (this._resourceViewTypeMatchesResource(resource, resource._resourcesView))
- return;
-
- var newView = this._createResourceView(resource);
- if (newView.__proto__ === resource._resourcesView.__proto__)
+ if (WebInspector.ResourceManager.resourceViewTypeMatchesResource(resource, resource._resourcesView))
return;
+ var newView = WebInspector.ResourceManager.createResourceView(resource);
var oldView = resource._resourcesView;
var oldViewParentNode = oldView.visible ? oldView.element.parentNode : null;
@@ -831,7 +838,7 @@ WebInspector.NetworkPanel.prototype = {
if (this.visibleResource && this.visibleResource._resourcesView)
this.visibleResource._resourcesView.hide();
- var view = this._resourceViewForResource(resource);
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
view.headersVisible = true;
view.show(this._viewsContainerElement);
@@ -861,15 +868,6 @@ WebInspector.NetworkPanel.prototype = {
this.updateSidebarWidth();
},
- _resourceViewForResource: function(resource)
- {
- if (!resource)
- return null;
- if (!resource._resourcesView)
- resource._resourcesView = this._createResourceView(resource);
- return resource._resourcesView;
- },
-
_toggleLargerResources: function()
{
WebInspector.applicationSettings.resourcesLargeRows = !WebInspector.applicationSettings.resourcesLargeRows;
@@ -883,48 +881,15 @@ WebInspector.NetworkPanel.prototype = {
this._largerResourcesButton.title = WebInspector.UIString("Use large resource rows.");
this._dataGrid.element.addStyleClass("small");
this._timelineGrid.element.addStyleClass("small");
+ this._viewsContainerElement.addStyleClass("small");
} else {
this._largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
this._dataGrid.element.removeStyleClass("small");
this._timelineGrid.element.removeStyleClass("small");
+ this._viewsContainerElement.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);
- }
- },
-
- _resourceViewTypeMatchesResource: function(resource, resourceView)
- {
- switch (resource.category) {
- case WebInspector.resourceCategories.documents:
- case WebInspector.resourceCategories.stylesheets:
- case WebInspector.resourceCategories.scripts:
- case WebInspector.resourceCategories.xhr:
- return resourceView instanceof WebInspector.SourceView;
- case WebInspector.resourceCategories.images:
- return resourceView instanceof WebInspector.ImageView;
- case WebInspector.resourceCategories.fonts:
- return resourceView instanceof WebInspector.FontView;
- default:
- return resourceView instanceof WebInspector.ResourceView;
- }
- return false;
- },
-
_getPopoverAnchor: function(element)
{
var anchor = element.enclosingNodeOrSelfWithClass("network-graph-bar") || element.enclosingNodeOrSelfWithClass("network-graph-label");
@@ -1060,10 +1025,10 @@ WebInspector.NetworkPanel.prototype = {
widths.name = 20;
widths.method = 7;
widths.status = 8;
- widths.type = 7;
+ widths.type = 10;
widths.size = 10;
widths.time = 10;
- widths.timeline = 40;
+ widths.timeline = 37;
}
this._dataGrid.showColumn("timeline");
@@ -1496,7 +1461,15 @@ WebInspector.NetworkDataGridNode.prototype = {
if (this._resource.category === WebInspector.resourceCategories.images) {
var previewImage = document.createElement("img");
previewImage.className = "image-network-icon-preview";
- previewImage.src = this._resource.url;
+
+ function onResourceContent()
+ {
+ previewImage.src = this._resource.contentURL;
+ }
+ if (Preferences.useDataURLForResourceImageIcons)
+ this._resource.getContent(onResourceContent.bind(this));
+ else
+ previewImage.src = this._resource.url;
var iconElement = document.createElement("div");
iconElement.className = "icon";
diff --git a/WebCore/inspector/front-end/Panel.js b/WebCore/inspector/front-end/Panel.js
index 2a4104f..ec9250c 100644
--- a/WebCore/inspector/front-end/Panel.js
+++ b/WebCore/inspector/front-end/Panel.js
@@ -34,7 +34,7 @@ WebInspector.Panel = function(name)
this.element.addStyleClass(name);
this._panelName = name;
- WebInspector.applicationSettings.installSetting(this._sidebarWidthSettingName(), this._panelName + "-sidebar-width", undefined);
+ WebInspector.applicationSettings.installApplicationSetting(this._sidebarWidthSettingName(), undefined);
}
// Should by in sync with style declarations.
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index fe2f7d2..1a2ce96 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -34,6 +34,7 @@ WebInspector.Resource = function(identifier, url)
this._endTime = -1;
this._requestMethod = "";
this._category = WebInspector.resourceCategories.other;
+ this._pendingContentCallbacks = [];
}
// Keep these in sync with WebCore::InspectorResource::Type
@@ -74,11 +75,11 @@ WebInspector.Resource.Type = {
case this.Script:
return "script";
case this.XHR:
- return "XHR";
+ return "xhr";
case this.Media:
return "media";
case this.WebSocket:
- return "WebSocket";
+ return "websocket";
case this.Other:
default:
return "other";
@@ -105,9 +106,16 @@ WebInspector.Resource.prototype = {
this.path = parsedURL ? parsedURL.path : "";
this.lastPathComponent = "";
if (parsedURL && parsedURL.path) {
- var lastSlashIndex = parsedURL.path.lastIndexOf("/");
+ // First cut the query params.
+ var path = parsedURL.path;
+ var indexOfQuery = path.indexOf("?");
+ if (indexOfQuery !== -1)
+ path = path.substring(0, indexOfQuery);
+
+ // Then take last path component.
+ var lastSlashIndex = path.lastIndexOf("/");
if (lastSlashIndex !== -1)
- this.lastPathComponent = parsedURL.path.substring(lastSlashIndex + 1);
+ this.lastPathComponent = path.substring(lastSlashIndex + 1);
}
this.lastPathComponentLowerCase = this.lastPathComponent.toLowerCase();
},
@@ -247,6 +255,8 @@ WebInspector.Resource.prototype = {
if (x) {
this._checkWarnings();
this.dispatchEventToListeners("finished");
+ if (this._pendingContentCallbacks.length)
+ this._requestContent();
}
},
@@ -267,17 +277,7 @@ WebInspector.Resource.prototype = {
set category(x)
{
- if (this._category === x)
- return;
-
- var oldCategory = this._category;
- if (oldCategory)
- oldCategory.removeResource(this);
-
this._category = x;
-
- if (this._category)
- this._category.addResource(this);
},
get cached()
@@ -530,6 +530,7 @@ WebInspector.Resource.prototype = {
set errors(x)
{
this._errors = x;
+ this.dispatchEventToListeners("errors-warnings-updated");
},
get warnings()
@@ -540,6 +541,14 @@ WebInspector.Resource.prototype = {
set warnings(x)
{
this._warnings = x;
+ this.dispatchEventToListeners("errors-warnings-updated");
+ },
+
+ clearErrorsAndWarnings: function()
+ {
+ this._warnings = 0;
+ this._errors = 0;
+ this.dispatchEventToListeners("errors-warnings-updated");
},
_mimeTypeIsConsistentWithType: function()
@@ -556,6 +565,9 @@ WebInspector.Resource.prototype = {
|| this.type === WebInspector.Resource.Type.WebSocket)
return true;
+ if (!this.mimeType)
+ return true; // Might be not known for cached resources with null responses.
+
if (this.mimeType in WebInspector.MIMETypes)
return this.type in WebInspector.MIMETypes[this.mimeType];
@@ -575,7 +587,7 @@ WebInspector.Resource.prototype = {
case WebInspector.Warnings.IncorrectMIMEType.id:
if (!this._mimeTypeIsConsistentWithType())
msg = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other,
- WebInspector.ConsoleMessage.MessageType.Log,
+ WebInspector.ConsoleMessage.MessageType.Log,
WebInspector.ConsoleMessage.MessageLevel.Warning,
-1,
this.url,
@@ -591,13 +603,48 @@ WebInspector.Resource.prototype = {
WebInspector.console.addMessage(msg);
},
- getContents: function(callback)
+ set content(content)
+ {
+ this._content = content;
+ },
+
+ getContent: function(callback)
+ {
+ if (this._content) {
+ callback(this._content, this._contentEncoded);
+ return;
+ }
+ this._pendingContentCallbacks.push(callback);
+ if (this.finished)
+ this._requestContent();
+ },
+
+ get contentURL()
+ {
+ const maxDataUrlSize = 1024 * 1024;
+ // If resource content is not available or won't fit a data URL, fall back to using original URL.
+ if (!this._content || this._content.length > maxDataUrlSize)
+ return this.url;
+
+ return "data:" + this.mimeType + (this._contentEncoded ? ";base64," : ",") + this._content;
+ },
+
+ _requestContent: function()
{
- // FIXME: eventually, cached resources will have no identifiers.
- if (this.frameID)
- InspectorBackend.resourceContent(this.frameID, this.url, callback);
- else
- InspectorBackend.getResourceContent(this.identifier, false, callback);
+ if (this._contentRequested)
+ return;
+ this._contentRequested = true;
+ this._contentEncoded = !WebInspector.Resource.Type.isTextType(this.type);
+
+ function onResourceContent(data)
+ {
+ this._content = data;
+ var callbacks = this._pendingContentCallbacks.slice();
+ for (var i = 0; i < callbacks.length; ++i)
+ callbacks[i](this._content, this._contentEncoded);
+ this._pendingContentCallbacks.length = 0;
+ }
+ WebInspector.ResourceManager.getContent(this, this._contentEncoded, onResourceContent.bind(this));
}
}
diff --git a/WebCore/inspector/front-end/ResourceCategory.js b/WebCore/inspector/front-end/ResourceCategory.js
index 7d95a1f..43c7c2b 100644
--- a/WebCore/inspector/front-end/ResourceCategory.js
+++ b/WebCore/inspector/front-end/ResourceCategory.js
@@ -31,40 +31,11 @@ WebInspector.ResourceCategory = function(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;
- var resourcesLength = this.resources.length;
- for (var i = 0; i < resourcesLength; ++i) {
- var b = this.resources[i];
- if (a.lastPathComponentLowerCase && b.lastPathComponentLowerCase)
- if (a.lastPathComponentLowerCase < b.lastPathComponentLowerCase)
- break;
- else if (a.name && b.name)
- if (a.name < b.name)
- break;
- }
-
- this.resources.splice(i, 0, resource);
- },
-
- removeResource: function(resource)
- {
- this.resources.remove(resource, true);
- },
-
- removeAllResources: function(resource)
- {
- this.resources = [];
}
}
diff --git a/WebCore/inspector/front-end/ResourceManager.js b/WebCore/inspector/front-end/ResourceManager.js
index 7244cea..62273ee 100644
--- a/WebCore/inspector/front-end/ResourceManager.js
+++ b/WebCore/inspector/front-end/ResourceManager.js
@@ -40,16 +40,17 @@ WebInspector.ResourceManager = function()
"didFailLoading",
"didLoadResourceFromMemoryCache",
"setOverrideContent",
- "didCommitLoad",
+ "didCommitLoadForFrame",
"frameDetachedFromParent",
"didCreateWebSocket",
"willSendWebSocketHandshakeRequest",
"didReceiveWebSocketHandshakeResponse",
"didCloseWebSocket");
- this._resources = {};
- this._resourcesByFrame = {};
- this._lastCachedId = 0;
+ this._resourcesById = {};
+ this._resourcesByURL = {};
+ this._resourceTreeModel = new WebInspector.ResourceTreeModel();
+ InspectorBackend.cachedResources(this._processCachedResources.bind(this));
}
WebInspector.ResourceManager.prototype = {
@@ -59,62 +60,69 @@ WebInspector.ResourceManager.prototype = {
WebInspector[arguments[i]] = this[arguments[i]].bind(this);
},
- identifierForInitialRequest: function(identifier, url, frameID, isMainResource)
+ identifierForInitialRequest: function(identifier, url, loader)
{
- var resource = new WebInspector.Resource(identifier, url);
- if (isMainResource)
+ var resource = this._createResource(identifier, url, loader);
+ if (loader.url === url) {
resource.isMainResource = true;
- this._resources[identifier] = resource;
-
- if (frameID) {
- resource.frameID = frameID;
- var resourcesForFrame = this._resourcesByFrame[frameID];
- if (!resourcesForFrame) {
- resourcesForFrame = [];
- this._resourcesByFrame[frameID] = resourcesForFrame;
- }
- resourcesForFrame.push(resource);
+ WebInspector.mainResource = resource;
}
- if (WebInspector.panels.network)
- WebInspector.panels.network.addResource(resource);
+ // It is important to bind resource url early (before scripts compile).
+ this._bindResourceURL(resource);
+
+ WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.audits.resourceStarted(resource);
+ },
+
+ _createResource: function(identifier, url, loader)
+ {
+ var resource = new WebInspector.Resource(identifier, url);
+ resource.loader = loader;
+ resource.documentURL = loader.url;
+
+ this._resourcesById[identifier] = resource;
+ return resource;
},
willSendRequest: function(identifier, time, request, redirectResponse)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
// Redirect may have empty URL and we'd like to not crash with invalid HashMap entry.
// See http/tests/misc/will-send-request-returns-null-on-redirect.html
- if (!redirectResponse.isNull && request.url.length) {
+ var isRedirect = !redirectResponse.isNull && request.url.length;
+ if (isRedirect) {
resource.endTime = time;
this.didReceiveResponse(identifier, time, "Other", redirectResponse);
resource = this._appendRedirect(resource.identifier, request.url);
}
- resource.requestMethod = request.httpMethod;
- resource.requestHeaders = request.httpHeaderFields;
- resource.requestFormData = request.requestFormData;
+ this._updateResourceWithRequest(resource, request);
resource.startTime = time;
- if (WebInspector.panels.network)
+ if (isRedirect) {
+ WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.audits.resourceStarted(resource);
+ } else
WebInspector.panels.network.refreshResource(resource);
},
- _appendRedirect: function(identifier, redirectURL)
+ _updateResourceWithRequest: function(resource, request)
{
- // We always store last redirect by the original id key. Rest of the redirects are referenced from within the last one.
-
- var originalResource = this._resources[identifier];
- var redirectIdentifier = originalResource.identifier + ":" + (originalResource.redirects ? originalResource.redirects.length : 0);
- originalResource.identifier = redirectIdentifier;
- this._resources[redirectIdentifier] = originalResource;
+ resource.requestMethod = request.httpMethod;
+ resource.requestHeaders = request.httpHeaderFields;
+ resource.requestFormData = request.requestFormData;
+ },
- this.identifierForInitialRequest(identifier, redirectURL, originalResource.frameID);
+ _appendRedirect: function(identifier, redirectURL)
+ {
+ var originalResource = this._resourcesById[identifier];
+ originalResource.identifier = null;
- var newResource = this._resources[identifier];
+ var newResource = this._createResource(identifier, redirectURL, originalResource.loader);
newResource.redirects = originalResource.redirects || [];
delete originalResource.redirects;
newResource.redirects.push(originalResource);
@@ -123,23 +131,32 @@ WebInspector.ResourceManager.prototype = {
markResourceAsCached: function(identifier)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.cached = true;
-
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didReceiveResponse: function(identifier, time, resourceType, response)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
-
+ this._updateResourceWithResponse(resource, response);
resource.type = WebInspector.Resource.Type[resourceType];
+ resource.responseReceivedTime = time;
+
+ WebInspector.panels.network.refreshResource(resource);
+ this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);
+ },
+
+ _updateResourceWithResponse: function(resource, response)
+ {
+ if (resource.isNull)
+ return;
+
resource.mimeType = response.mimeType;
resource.expectedContentLength = response.expectedContentLength;
resource.textEncodingName = response.textEncodingName;
@@ -150,7 +167,6 @@ WebInspector.ResourceManager.prototype = {
resource.responseHeaders = response.httpHeaderFields;
resource.connectionReused = response.connectionReused;
resource.connectionID = response.connectionID;
- resource.responseReceivedTime = time;
if (response.wasCached)
resource.cached = true;
@@ -161,101 +177,105 @@ WebInspector.ResourceManager.prototype = {
resource.requestHeaders = response.rawHeaders.requestHeaders;
resource.responseHeaders = response.rawHeaders.responseHeaders;
}
-
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
},
didReceiveContentLength: function(identifier, time, lengthReceived)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.resourceSize += lengthReceived;
resource.endTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didFinishLoading: function(identifier, finishTime)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.finished = true;
resource.endTime = finishTime;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.audits.resourceFinished(resource);
+ WebInspector.extensionServer.notifyResourceFinished(resource);
+ delete this._resourcesById[identifier];
},
didFailLoading: function(identifier, time, localizedDescription)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.failed = true;
+ resource.localizedFailDescription = localizedDescription;
+ resource.finished = true;
resource.endTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.audits.resourceFinished(resource);
+ WebInspector.extensionServer.notifyResourceFinished(resource);
+ delete this._resourcesById[identifier];
},
- didLoadResourceFromMemoryCache: function(time, frameID, cachedResource)
+ didLoadResourceFromMemoryCache: function(time, cachedResource)
{
- var identifier = "cached:" + this._lastCachedId++;
- this.identifierForInitialRequest(identifier, cachedResource.url, frameID);
-
- var resource = this._resources[identifier];
+ var resource = this._createResource(null, cachedResource.url, cachedResource.loader);
+ this._updateResourceWithCachedResource(resource, cachedResource);
resource.cached = true;
- resource.startTime = resource.responseReceivedTime = time;
- resource.resourceSize = cachedResource.encodedSize();
+ resource.startTime = resource.responseReceivedTime = resource.endTime = time;
- this.didReceiveResponse(identifier, time, cachedResource.response);
+ WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.audits.resourceStarted(resource);
+ WebInspector.panels.audits.resourceFinished(resource);
+ this._resourceTreeModel.addResourceToFrame(resource.loader.frameId, resource);
+ },
+
+ _updateResourceWithCachedResource: function(resource, cachedResource)
+ {
+ resource.type = WebInspector.Resource.Type[cachedResource.type];
+ resource.resourceSize = cachedResource.encodedSize;
+ this._updateResourceWithResponse(resource, cachedResource.response);
},
setOverrideContent: function(identifier, sourceString, type)
{
- var resource = this._resources[identifier];
+ var resource = WebInspector.panels.network.resources[identifier];
if (!resource)
return;
resource.type = WebInspector.Resource.Type[type];
- resource.overridenContent = sourceString;
-
- if (WebInspector.panels.network)
- WebInspector.panels.network.addResource(resource);
+ resource.content = sourceString;
+ WebInspector.panels.network.refreshResource(resource);
},
- didCommitLoad: function(frameID)
+ didCommitLoadForFrame: function(parentFrameId, loader)
{
+ this._resourceTreeModel.didCommitLoadForFrame(parentFrameId, loader);
},
- frameDetachedFromParent: function(frameID)
+ frameDetachedFromParent: function(frameId)
{
- var resourcesForFrame = this._resourcesByFrame[frameID];
- for (var i = 0; resourcesForFrame && i < resourcesForFrame.length; ++i)
- delete this._resources[resourcesForFrame[i].identifier];
- delete this._resourcesByFrame[frameID];
+ this._resourceTreeModel.frameDetachedFromParent(frameId);
},
didCreateWebSocket: function(identifier, requestURL)
{
this.identifierForInitialRequest(identifier, requestURL);
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
resource.type = WebInspector.Resource.Type.WebSocket;
- if (WebInspector.panels.network)
- WebInspector.panels.network.addResource(resource);
+ WebInspector.panels.network.addResource(resource);
},
willSendWebSocketHandshakeRequest: function(identifier, time, request)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
@@ -264,13 +284,12 @@ WebInspector.ResourceManager.prototype = {
resource.webSocketRequestKey3 = request.webSocketRequestKey3;
resource.startTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didReceiveWebSocketHandshakeResponse: function(identifier, time, response)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
@@ -280,18 +299,293 @@ WebInspector.ResourceManager.prototype = {
resource.webSocketChallengeResponse = response.webSocketChallengeResponse;
resource.responseReceivedTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
},
didCloseWebSocket: function(identifier, time)
{
- var resource = this._resources[identifier];
+ var resource = this._resourcesById[identifier];
if (!resource)
return;
resource.endTime = time;
- if (WebInspector.panels.network)
- WebInspector.panels.network.refreshResource(resource);
+ WebInspector.panels.network.refreshResource(resource);
+ },
+
+ _processCachedResources: function(mainFramePayload)
+ {
+ var mainResource = this._addFramesRecursively(null, mainFramePayload);
+ WebInspector.mainResource = mainResource;
+ mainResource.isMainResource = true;
+ },
+
+ _addFramesRecursively: function(parentFrameId, framePayload)
+ {
+ var frameResource = this._createResource(null, framePayload.resource.url, framePayload.resource.loader);
+ this._updateResourceWithRequest(frameResource, framePayload.resource.request);
+ this._updateResourceWithResponse(frameResource, framePayload.resource.response);
+ frameResource.type = WebInspector.Resource.Type["Document"];
+ frameResource.finished = true;
+ this._bindResourceURL(frameResource);
+
+ this._resourceTreeModel.addOrUpdateFrame(parentFrameId, framePayload.id, frameResource.displayName);
+ this._resourceTreeModel.addResourceToFrame(framePayload.id, frameResource);
+
+ for (var i = 0; framePayload.children && i < framePayload.children.length; ++i)
+ this._addFramesRecursively(framePayload.id, framePayload.children[i]);
+
+ if (!framePayload.subresources)
+ return;
+
+ for (var i = 0; i < framePayload.subresources.length; ++i) {
+ var cachedResource = framePayload.subresources[i];
+ var resource = this._createResource(null, cachedResource.url, cachedResource.loader);
+ this._updateResourceWithCachedResource(resource, cachedResource);
+ resource.finished = true;
+ this._bindResourceURL(resource);
+ this._resourceTreeModel.addResourceToFrame(framePayload.id, resource);
+ }
+ return frameResource;
+ },
+
+ resourceForURL: function(url)
+ {
+ // FIXME: receive frameId here.
+ var entry = this._resourcesByURL[url];
+ if (entry instanceof Array)
+ return entry[0];
+ return entry;
+ },
+
+ addConsoleMessage: function(msg)
+ {
+ var resource = this.resourceForURL(msg.url);
+ if (!resource)
+ return;
+
+ switch (msg.level) {
+ case WebInspector.ConsoleMessage.MessageLevel.Warning:
+ resource.warnings += msg.repeatDelta;
+ break;
+ case WebInspector.ConsoleMessage.MessageLevel.Error:
+ resource.errors += msg.repeatDelta;
+ break;
+ }
+
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ if (view.addMessage)
+ view.addMessage(msg);
+ },
+
+ clearConsoleMessages: function()
+ {
+ function callback(resource)
+ {
+ resource.clearErrorsAndWarnings();
+ }
+ this._resourceTreeModel.forAllResources(callback);
+ },
+
+ forAllResources: function(callback)
+ {
+ this._resourceTreeModel.forAllResources(callback);
+ },
+
+ _bindResourceURL: function(resource)
+ {
+ var resourceForURL = this._resourcesByURL[resource.url];
+ if (!resourceForURL)
+ this._resourcesByURL[resource.url] = resource;
+ else if (resourceForURL instanceof Array)
+ resourceForURL.push(resource);
+ else
+ this._resourcesByURL[resource.url] = [resourceForURL];
+ },
+
+ _unbindResourceURL: function(resource)
+ {
+ var resourceForURL = this._resourcesByURL[resource.url];
+ if (!resourceForURL)
+ return;
+
+ if (resourceForURL instanceof Array) {
+ resourceForURL.remove(resource, true);
+ if (resourceForURL.length === 1)
+ this._resourcesByURL[resource.url] = resourceForURL[0];
+ return;
+ }
+
+ delete this._resourcesByURL[resource.url];
+ }
+}
+
+WebInspector.ResourceManager.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);
+ }
+}
+
+WebInspector.ResourceManager.resourceViewTypeMatchesResource = function(resource, resourceView)
+{
+ switch (resource.category) {
+ case WebInspector.resourceCategories.documents:
+ case WebInspector.resourceCategories.stylesheets:
+ case WebInspector.resourceCategories.scripts:
+ case WebInspector.resourceCategories.xhr:
+ return resourceView.__proto__ === WebInspector.SourceView.prototype;
+ case WebInspector.resourceCategories.images:
+ return resourceView.__proto__ === WebInspector.ImageView.prototype;
+ case WebInspector.resourceCategories.fonts:
+ return resourceView.__proto__ === WebInspector.FontView.prototype;
+ default:
+ return resourceView.__proto__ === WebInspector.ResourceView.prototype;
+ }
+}
+
+WebInspector.ResourceManager.resourceViewForResource = function(resource)
+{
+ if (!resource)
+ return null;
+ if (!resource._resourcesView)
+ resource._resourcesView = WebInspector.ResourceManager.createResourceView(resource);
+ return resource._resourcesView;
+}
+
+WebInspector.ResourceManager.existingResourceViewForResource = function(resource)
+{
+ if (!resource)
+ return null;
+ return resource._resourcesView;
+}
+
+WebInspector.ResourceManager.getContent = function(resource, base64Encode, callback)
+{
+ // FIXME: eventually, cached resources will have no identifiers.
+ if (resource.loader)
+ InspectorBackend.resourceContent(resource.loader.frameId, resource.url, base64Encode, callback);
+ else
+ InspectorBackend.getResourceContent(resource.identifier, base64Encode, callback);
+}
+
+WebInspector.ResourceTreeModel = function()
+{
+ this._resourcesByFrameId = {};
+ this._subframes = {};
+}
+
+WebInspector.ResourceTreeModel.prototype = {
+ addOrUpdateFrame: function(parentFrameId, frameId, displayName)
+ {
+ WebInspector.panels.storage.addOrUpdateFrame(parentFrameId, frameId, displayName);
+ var subframes = this._subframes[parentFrameId];
+ if (!subframes) {
+ subframes = {};
+ this._subframes[parentFrameId || 0] = subframes;
+ }
+ subframes[frameId] = true;
+ },
+
+ didCommitLoadForFrame: function(parentFrameId, loader)
+ {
+ // parentFrameId === 0 is when main frame navigation happens.
+ this._clearChildFramesAndResources(parentFrameId ? loader.frameId : 0, loader.loaderId);
+
+ var tmpResource = new WebInspector.Resource(null, loader.url);
+ this.addOrUpdateFrame(parentFrameId, loader.frameId, tmpResource.displayName);
+
+ var resourcesForFrame = this._resourcesByFrameId[loader.frameId];
+ for (var i = 0; resourcesForFrame && i < resourcesForFrame.length; ++i) {
+ WebInspector.resourceManager._bindResourceURL(resourcesForFrame[i]);
+ WebInspector.panels.storage.addResourceToFrame(loader.frameId, resourcesForFrame[i]);
+ }
+ },
+
+ frameDetachedFromParent: function(frameId)
+ {
+ this._clearChildFramesAndResources(frameId, 0);
+ WebInspector.panels.storage.removeFrame(frameId);
+ },
+
+ _clearChildFramesAndResources: function(frameId, loaderId)
+ {
+ WebInspector.panels.storage.removeResourcesFromFrame(frameId);
+
+ this._clearResources(frameId, loaderId);
+ var subframes = this._subframes[frameId];
+ if (!subframes)
+ return;
+
+ for (var childFrameId in subframes) {
+ WebInspector.panels.storage.removeFrame(childFrameId);
+ this._clearChildFramesAndResources(childFrameId, loaderId);
+ }
+ delete this._subframes[frameId];
+ },
+
+ addResourceToFrame: function(frameId, resource)
+ {
+ var resourcesForFrame = this._resourcesByFrameId[frameId];
+ if (!resourcesForFrame) {
+ resourcesForFrame = [];
+ this._resourcesByFrameId[frameId] = resourcesForFrame;
+ }
+ resourcesForFrame.push(resource);
+
+ WebInspector.panels.storage.addResourceToFrame(frameId, resource);
+ },
+
+ _clearResources: function(frameId, loaderToPreserveId)
+ {
+ var resourcesForFrame = this._resourcesByFrameId[frameId];
+ if (!resourcesForFrame)
+ return;
+
+ var preservedResourcesForFrame = [];
+ for (var i = 0; i < resourcesForFrame.length; ++i) {
+ var resource = resourcesForFrame[i];
+ if (resource.loader.loaderId === loaderToPreserveId) {
+ preservedResourcesForFrame.push(resource);
+ continue;
+ }
+ WebInspector.resourceManager._unbindResourceURL(resource);
+ }
+
+ delete this._resourcesByFrameId[frameId];
+ if (preservedResourcesForFrame.length)
+ this._resourcesByFrameId[frameId] = preservedResourcesForFrame;
+ },
+
+ forAllResources: function(callback)
+ {
+ this._callForFrameResources(0, callback);
+ },
+
+ _callForFrameResources: function(frameId, callback)
+ {
+ var resources = this._resourcesByFrameId[frameId];
+ for (var i = 0; resources && i < resources.length; ++i) {
+ if (callback(resources[i]))
+ return true;
+ }
+
+ var frames = this._subframes[frameId];
+ if (frames) {
+ for (var id in frames) {
+ if (this._callForFrameResources(id, callback))
+ return true;
+ }
+ }
+ return false;
}
}
diff --git a/WebCore/inspector/front-end/ResourceView.js b/WebCore/inspector/front-end/ResourceView.js
index 862569f..ffb229d 100644
--- a/WebCore/inspector/front-end/ResourceView.js
+++ b/WebCore/inspector/front-end/ResourceView.js
@@ -139,14 +139,20 @@ WebInspector.ResourceView.prototype = {
this._selectTab();
},
+ resize: function()
+ {
+ if (this._cookiesView && !this._cookiesView.element.hasStyleClass("hidden"))
+ this._cookiesView.resize();
+ },
+
_selectTab: function()
{
- if (this._headersVisible) {
- if (!this.hasContentTab() || WebInspector.applicationSettings.resourceViewTab === "headers")
- this._selectHeadersTab();
- else
- this.selectContentTab();
- } else
+ var preferredTab = WebInspector.applicationSettings.resourceViewTab;
+ if (this._headersVisible && this._cookiesView && preferredTab === "cookies")
+ this._selectCookiesTab();
+ else if (this._headersVisible && (!this.hasContentTab() || preferredTab === "headers"))
+ this._selectHeadersTab();
+ else
this._innerSelectContentTab();
},
@@ -170,11 +176,18 @@ WebInspector.ResourceView.prototype = {
return false;
},
+ _selectCookiesTab: function(updatePrefs)
+ {
+ if (updatePrefs)
+ WebInspector.applicationSettings.resourceViewTab = "cookies";
+ this.tabbedPane.selectTabById("cookies");
+ this._cookiesView.resize();
+ },
+
_innerSelectContentTab: function()
{
this.tabbedPane.selectTabById("content");
- if ("resize" in this)
- this.resize();
+ this.resize();
if (this.hasContentTab())
this.contentTabSelected();
},
@@ -283,6 +296,7 @@ WebInspector.ResourceView.prototype = {
additionalRow = {header: "(Key3)", value: this.resource.webSocketRequestKey3};
this._refreshHeaders(WebInspector.UIString("Request Headers"), this.resource.sortedRequestHeaders, additionalRow, this.requestHeadersTreeElement);
this._refreshFormData();
+ this._refreshCookies();
},
_refreshResponseHeaders: function()
@@ -291,6 +305,7 @@ WebInspector.ResourceView.prototype = {
if (typeof this.resource.webSocketChallengeResponse !== "undefined")
additionalRow = {header: "(Challenge Response)", value: this.resource.webSocketChallengeResponse};
this._refreshHeaders(WebInspector.UIString("Response Headers"), this.resource.sortedResponseHeaders, additionalRow, this.responseHeadersTreeElement);
+ this._refreshCookies();
},
_refreshHTTPInformation: function()
@@ -347,7 +362,80 @@ WebInspector.ResourceView.prototype = {
headerTreeElement.selectable = false;
headersTreeElement.appendChild(headerTreeElement);
}
+ },
+
+ _refreshCookies: function()
+ {
+ if (!this._cookiesView) {
+ if (!this.resource.requestCookies && !this.resource.responseCookies)
+ return;
+ this._cookiesView = new WebInspector.ResourceCookiesTab();
+ this.tabbedPane.appendTab("cookies", WebInspector.UIString("Cookies"), this._cookiesView.element, this._selectCookiesTab.bind(this, true));
+ }
+ this._cookiesView.requestCookies = this.resource.requestCookies;
+ this._cookiesView.responseCookies = this.resource.responseCookies;
}
}
WebInspector.ResourceView.prototype.__proto__ = WebInspector.View.prototype;
+
+WebInspector.ResourceCookiesTab = function()
+{
+ WebInspector.CookiesTable.call(this);
+ this.element.addStyleClass("resource-view-cookies");
+ this._requestCookies = [];
+ this._responseCookies = [];
+ this._createDataGrid(true);
+ this._requestCookiesNode = this._createFolder(WebInspector.UIString("Request Cookies"));
+ this._responseCookiesNode = this._createFolder(WebInspector.UIString("Response Cookies"));
+}
+
+WebInspector.ResourceCookiesTab.prototype = {
+ set requestCookies(cookies)
+ {
+ if (this._requestCookies === cookies)
+ return;
+ this._requestCookies = cookies;
+ this._populateCookies(this._requestCookiesNode, this._requestCookies);
+ },
+
+ set responseCookies(cookies)
+ {
+ if (this._responseCookies === cookies)
+ return;
+ this._responseCookies = cookies;
+ this._populateCookies(this._responseCookiesNode, this._responseCookies);
+ },
+
+ _populateDataGrid: function()
+ {
+ this._populateCookies(this._requestCookiesNode, this._requestCookies);
+ this._populateCookies(this._responseCookiesNode, this._responseCookies);
+ },
+
+ _populateCookies: function(parentNode, cookies)
+ {
+ WebInspector.CookiesTable.prototype._populateCookies.call(this, parentNode, cookies);
+ var totalSize = 0;
+ if (cookies) {
+ for (var i = 0; i < cookies.length; ++i)
+ totalSize += cookies[i].size;
+ }
+ parentNode.expanded = true;
+ parentNode.data[5] = totalSize;
+ parentNode.refresh();
+ },
+
+ _createFolder: function(name)
+ {
+ var data = [ name, "", "", "", "", 0, "", "" ];
+ var node = new WebInspector.DataGridNode(data);
+ node.selectable = true;
+ node.expanded = true;
+ this._dataGrid.appendChild(node);
+ node.element.addStyleClass("row-group");
+ return node;
+ }
+};
+
+WebInspector.ResourceCookiesTab.prototype.__proto__ = WebInspector.CookiesTable.prototype;
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index ae67bef..b35fc4b 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -30,7 +30,7 @@
WebInspector.ResourcesPanel = function()
{
WebInspector.Panel.call(this, "resources");
-
+ this.resourceURLMap = {};
this._items = [];
this._staleItems = [];
@@ -439,26 +439,22 @@ WebInspector.ResourcesPanel.prototype = {
this.element.appendChild(this.panelEnablerView.element);
this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item");
- this.enableToggleButton.addEventListener("click", this._toggleResourceTracking.bind(this), false);
+ this.enableToggleButton.addEventListener("click", this.toggleResourceTracking.bind(this), false);
},
_createStatusbarButtons: function()
{
this.largerResourcesButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "resources-larger-resources-status-bar-item");
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
- this.largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
- this.sortingSelectElement = document.createElement("select");
- this.sortingSelectElement.className = "status-bar-item";
- this.sortingSelectElement.addEventListener("change", this._changeSortingFunction.bind(this), false);
- },
-
- _settingsLoaded: function()
- {
this.largerResourcesButton.toggled = WebInspector.applicationSettings.resourcesLargeRows;
if (!WebInspector.applicationSettings.resourcesLargeRows)
this._setLargerResources(WebInspector.applicationSettings.resourcesLargeRows);
this._loadSortOptions();
+
+ this.largerResourcesButton.addEventListener("click", this._toggleLargerResources.bind(this), false);
+ this.sortingSelectElement = document.createElement("select");
+ this.sortingSelectElement.className = "status-bar-item";
+ this.sortingSelectElement.addEventListener("change", this._changeSortingFunction.bind(this), false);
},
_loadSortOptions: function()
@@ -557,7 +553,7 @@ WebInspector.ResourcesPanel.prototype = {
var resource = this._resources[i];
if (!resource._itemsTreeElement || !resource._itemsTreeElement.selectable)
continue;
- var resourceView = this.resourceViewForResource(resource);
+ var resourceView = WebInspector.ResourceManager.resourceViewForResource(resource);
if (!resourceView.performSearch || resourceView === visibleView)
continue;
views.push(resourceView);
@@ -752,10 +748,12 @@ WebInspector.ResourcesPanel.prototype = {
this.sortingSelectElement.addStyleClass("hidden");
this.panelEnablerView.visible = true;
}
+ this.resourceURLMap = {};
},
addResource: function(resource)
{
+ this.resourceURLMap[resource.url] = resource;
this._resources.push(resource);
},
@@ -770,6 +768,7 @@ WebInspector.ResourcesPanel.prototype = {
resource.errors = 0;
delete resource._resourcesView;
+ delete this.resourceURLMap[resource.url];
},
addMessageToResource: function(resource, msg)
@@ -789,7 +788,7 @@ WebInspector.ResourcesPanel.prototype = {
if (!this.currentQuery && resource._itemsTreeElement)
resource._itemsTreeElement.updateErrorsAndWarnings();
- var view = this.resourceViewForResource(resource);
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
if (view.addMessage)
view.addMessage(msg);
},
@@ -823,10 +822,10 @@ WebInspector.ResourcesPanel.prototype = {
if (!resource || !resource._resourcesView)
return;
- if (this._resourceViewIsConsistentWithCategory(resource, resource._resourcesView))
+ if (WebInspector.ResourceManager.resourceViewTypeMatchesResource(resource, resource._resourcesView))
return;
+ var newView = WebInspector.ResourceManager.createResourceView(resource);
- var newView = this._createResourceView(resource);
if (!this.currentQuery && resource._itemsTreeElement)
resource._itemsTreeElement.updateErrorsAndWarnings();
@@ -868,7 +867,7 @@ WebInspector.ResourcesPanel.prototype = {
if (this.visibleResource && this.visibleResource._resourcesView)
this.visibleResource._resourcesView.hide();
- var view = this.resourceViewForResource(resource);
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
view.headersVisible = true;
view.show(this.viewsContainerElement);
@@ -909,32 +908,6 @@ WebInspector.ResourcesPanel.prototype = {
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;
- },
-
_sortResourcesIfNeeded: function()
{
this.sortItems(this.sortingFunction);
@@ -1068,40 +1041,6 @@ WebInspector.ResourcesPanel.prototype = {
this.calculator = this.summaryBar.calculator = selectedOption.calculator;
},
- _resourceViewIsConsistentWithCategory: function(resource, resourceView)
- {
- switch (resource.category) {
- case WebInspector.resourceCategories.documents:
- case WebInspector.resourceCategories.stylesheets:
- case WebInspector.resourceCategories.scripts:
- case WebInspector.resourceCategories.xhr:
- return resourceView.__proto__ === WebInspector.SourceView.prototype;
- case WebInspector.resourceCategories.images:
- return resourceView.__proto__ === WebInspector.ImageView.prototype;
- case WebInspector.resourceCategories.fonts:
- return resourceView.__proto__ === WebInspector.FontView.prototype;
- default:
- return resourceView.__proto__ === WebInspector.ResourceView.prototype;
- }
- },
-
- _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);
- }
- },
-
setSidebarWidth: function(width)
{
if (this.visibleResource) {
@@ -1126,10 +1065,10 @@ WebInspector.ResourcesPanel.prototype = {
{
if (this._resourceTrackingEnabled)
return;
- this._toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
+ this.toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
},
- _toggleResourceTracking: function(optionalAlways)
+ toggleResourceTracking: function(optionalAlways)
{
function callback(newState) {
if (newState)
@@ -1142,7 +1081,7 @@ WebInspector.ResourcesPanel.prototype = {
this.largerResourcesButton.visible = false;
this.sortingSelectElement.visible = false;
WebInspector.resources = {};
- WebInspector.resourceURLMap = {};
+ this.resourceURLMap = {};
InspectorBackend.setResourceTrackingEnabled(false, true, callback);
} else {
this.largerResourcesButton.visible = true;
@@ -1723,7 +1662,15 @@ WebInspector.ResourceSidebarTreeElement.prototype = {
if (this.resource.category === WebInspector.resourceCategories.images) {
var previewImage = document.createElement("img");
previewImage.className = "image-resource-icon-preview";
- previewImage.src = this.resource.url;
+
+ function onResourceContent()
+ {
+ previewImage.src = this.resource.contentURL;
+ }
+ if (Preferences.useDataURLForResourceImageIcons)
+ this.resource.getContent(onResourceContent.bind(this));
+ else
+ previewImage.src = this.resource.url;
this.iconElement = document.createElement("div");
this.iconElement.className = "icon";
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 0a653c9..8125c1e 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -241,7 +241,7 @@ WebInspector.ScriptsPanel.prototype = {
var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, errorLine, errorMessage, scriptWorldType);
this._sourceIDMap[sourceID] = script;
- var resource = WebInspector.resourceURLMap[sourceURL];
+ var resource = WebInspector.resourceForURL(sourceURL);
if (resource) {
if (resource.finished) {
// Resource is finished, bind the script right away.
@@ -289,7 +289,7 @@ WebInspector.ScriptsPanel.prototype = {
var sourceFrame;
if (breakpoint.url) {
- var resource = WebInspector.resourceURLMap[breakpoint.url];
+ var resource = WebInspector.resourceForURL(breakpoint.url);
if (resource && resource.finished)
sourceFrame = this._sourceFrameForScriptOrResource(resource);
}
@@ -570,11 +570,24 @@ WebInspector.ScriptsPanel.prototype = {
_sourceFrameForScriptOrResource: function(scriptOrResource)
{
if (scriptOrResource instanceof WebInspector.Resource)
- return WebInspector.panels.resources.sourceFrameForResource(scriptOrResource);
+ return this._sourceFrameForResource(scriptOrResource);
if (scriptOrResource instanceof WebInspector.Script)
return this.sourceFrameForScript(scriptOrResource);
},
+ _sourceFrameForResource: function(resource)
+ {
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ if (!view)
+ return null;
+
+ if (!view.setupSourceFrameIfNeeded)
+ return null;
+
+ view.setupSourceFrameIfNeeded();
+ return view.sourceFrame;
+ },
+
_showScriptOrResource: function(scriptOrResource, options)
{
// options = {line:, shouldHighlightLine:, fromBackForwardAction:, initialLoad:}
@@ -585,9 +598,7 @@ WebInspector.ScriptsPanel.prototype = {
var view;
if (scriptOrResource instanceof WebInspector.Resource) {
- if (!WebInspector.panels.resources)
- return null;
- view = WebInspector.panels.resources.resourceViewForResource(scriptOrResource);
+ view = WebInspector.ResourceManager.resourceViewForResource(scriptOrResource);
view.headersVisible = false;
} else if (scriptOrResource instanceof WebInspector.Script)
view = this.scriptViewForScript(scriptOrResource);
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index c6da14d..3fb81f5 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -45,96 +45,74 @@ var Preferences = {
onlineDetectionEnabled: true,
nativeInstrumentationEnabled: false,
resourceExportEnabled: false,
- networkPanelEnabled: false
+ networkPanelEnabled: false,
+ useDataURLForResourceImageIcons: true
}
-WebInspector.Settings = function(sessionScope)
+WebInspector.Settings = function()
{
- this._sessionScope = sessionScope;
- this._store = {};
-}
+ this.installApplicationSetting("colorFormat", "hex");
+ this.installApplicationSetting("consoleHistory", []);
+ this.installApplicationSetting("eventListenersFilter", "all");
+ this.installApplicationSetting("lastViewedScriptFile", "application");
+ this.installApplicationSetting("resourcesLargeRows", true);
+ this.installApplicationSetting("resourcesSortOptions", {timeOption: "responseTime", sizeOption: "transferSize"});
+ this.installApplicationSetting("resourceViewTab", "content");
+ this.installApplicationSetting("showInheritedComputedStyleProperties", false);
+ this.installApplicationSetting("showUserAgentStyles", true);
+ this.installApplicationSetting("watchExpressions", []);
+ this.installApplicationSetting("lastActivePanel", "elements");
-WebInspector.Settings.initialize = function()
-{
- WebInspector.applicationSettings = new WebInspector.Settings(false);
- WebInspector.sessionSettings = new WebInspector.Settings(true);
+ this.installProjectSetting("breakpoints", {});
+}
- function populateApplicationSettings(settingsString)
+WebInspector.Settings.prototype = {
+ installApplicationSetting: function(key, defaultValue)
{
- WebInspector.applicationSettings._load(settingsString);
- WebInspector.applicationSettings.installSetting("eventListenersFilter", "event-listeners-filter", "all");
- WebInspector.applicationSettings.installSetting("colorFormat", "color-format", "hex");
- WebInspector.applicationSettings.installSetting("resourcesLargeRows", "resources-large-rows", true);
- WebInspector.applicationSettings.installSetting("watchExpressions", "watch-expressions", []);
- WebInspector.applicationSettings.installSetting("lastViewedScriptFile", "last-viewed-script-file");
- WebInspector.applicationSettings.installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false);
- WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true);
- WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content");
- WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []);
- WebInspector.applicationSettings.installSetting("resourcesSortOptions", "resources-sort-options", {timeOption: "responseTime", sizeOption: "transferSize"});
-
- WebInspector.applicationSettings.dispatchEventToListeners("loaded");
- }
+ this.__defineGetter__(key, this._get.bind(this, key, defaultValue));
+ this.__defineSetter__(key, this._set.bind(this, key));
+ },
- function populateSessionSettings(settingsString)
+ installProjectSetting: function(key, defaultValue)
{
- WebInspector.sessionSettings._load(settingsString);
- WebInspector.sessionSettings.dispatchEventToListeners("loaded");
- }
-
- InspectorBackend.getSettings(function(settings) {
- populateApplicationSettings(settings.application);
- populateSessionSettings(settings.session);
- });
-}
+ this.__defineGetter__(key, this._getProjectSetting.bind(this, key, defaultValue));
+ this.__defineSetter__(key, this._setProjectSetting.bind(this, key));
+ },
-WebInspector.Settings.prototype = {
- reset: function()
+ _get: function(key, defaultValue)
{
- this._store = {};
- // FIXME: restore default values (bug 42820)
- this.dispatchEventToListeners("loaded");
+ if (key in window.localStorage) {
+ try {
+ return JSON.parse(window.localStorage[key]);
+ } catch(e) {
+ window.localStorage.removeItem(key);
+ }
+ }
+ return defaultValue;
},
- _load: function(settingsString)
+ _set: function(key, value)
{
- try {
- var loadedStore = JSON.parse(settingsString);
- } catch (e) {
- // May fail;
- loadedStore = {};
- }
- if (!loadedStore)
- return;
- for (var propertyName in loadedStore)
- this._store[propertyName] = loadedStore[propertyName];
+ window.localStorage[key] = JSON.stringify(value);
},
- installSetting: function(name, propertyName, defaultValue)
+ _getProjectSetting: function(key, defaultValue)
{
- this.__defineGetter__(name, this._get.bind(this, propertyName));
- this.__defineSetter__(name, this._set.bind(this, propertyName));
- if (!(propertyName in this._store))
- this._store[propertyName] = defaultValue;
+ return this._get(this._formatProjectKey(key), defaultValue);
},
- _get: function(propertyName)
+ _setProjectSetting: function(key, value)
{
- return this._store[propertyName];
+ return this._set(this._formatProjectKey(key), value);
},
- _set: function(propertyName, newValue)
+ _formatProjectKey: function(key)
{
- this._store[propertyName] = newValue;
- try {
- var store = JSON.stringify(this._store);
- if (this._sessionScope)
- InspectorBackend.saveSessionSettings(store);
- else
- InspectorBackend.saveApplicationSettings(store);
- } catch (e) {
- // May fail;
- }
+ var url = this._mainResourceURL;
+ var fragmentIndex = url.indexOf("#");
+ if (fragmentIndex !== -1)
+ url = url.substring(0, fragmentIndex);
+ return key + "." + url;
}
}
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index 8092505..bfdc058 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -73,6 +73,7 @@ WebInspector.SourceView.prototype = {
this.sourceFrame.resize();
if (this.localSourceFrame)
this.localSourceFrame.resize();
+ WebInspector.ResourceView.prototype.resize.call(this);
},
setupSourceFrameIfNeeded: function()
@@ -83,7 +84,7 @@ WebInspector.SourceView.prototype = {
this.attach();
delete this._frameNeedsSetup;
- this.resource.getContents(this._contentLoaded.bind(this));
+ this.resource.getContent(this._contentLoaded.bind(this));
},
hasContentTab: function()
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index e033b57..2fa54c2 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -32,28 +32,36 @@ WebInspector.StoragePanel = function(database)
WebInspector.Panel.call(this, "storage");
this.createSidebar();
+ this.sidebarElement.addStyleClass("outline-disclosure filter-all children small");
+ this.sidebarTreeElement.removeStyleClass("sidebar-tree");
+
+ if (Preferences.networkPanelEnabled) {
+ this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "frame-storage-tree-item");
+ this.sidebarTree.appendChild(this.resourcesListTreeElement);
+ this.resourcesListTreeElement.expand();
+ this._treeElementForFrameId = {};
+ }
- this.databasesListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("DATABASES"), {}, true);
+ this.databasesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Databases"), "database-storage-tree-item");
this.sidebarTree.appendChild(this.databasesListTreeElement);
this.databasesListTreeElement.expand();
- this.localStorageListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("LOCAL STORAGE"), {}, true);
+ this.localStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Local Storage"), "domstorage-storage-tree-item local-storage");
this.sidebarTree.appendChild(this.localStorageListTreeElement);
this.localStorageListTreeElement.expand();
- this.sessionStorageListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("SESSION STORAGE"), {}, true);
+ this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Session Storage"), "domstorage-storage-tree-item session-storage");
this.sidebarTree.appendChild(this.sessionStorageListTreeElement);
this.sessionStorageListTreeElement.expand();
- this.cookieListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("COOKIES"), {}, true);
+ this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Cookies"), "cookie-storage-tree-item");
this.sidebarTree.appendChild(this.cookieListTreeElement);
this.cookieListTreeElement.expand();
-
- this.applicationCacheListTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("APPLICATION CACHE"), {}, true);
+ this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Application Cache"), "application-cache-storage-tree-item");
this.sidebarTree.appendChild(this.applicationCacheListTreeElement);
this.applicationCacheListTreeElement.expand();
-
+
this.storageViews = document.createElement("div");
this.storageViews.id = "storage-views";
this.element.appendChild(this.storageViews);
@@ -61,13 +69,15 @@ WebInspector.StoragePanel = function(database)
this.storageViewStatusBarItemsContainer = document.createElement("div");
this.storageViewStatusBarItemsContainer.className = "status-bar-items";
- this.reset();
+ this._databases = [];
+ this._domStorage = [];
+ this._cookieViews = {};
}
WebInspector.StoragePanel.prototype = {
get toolbarItemLabel()
{
- return WebInspector.UIString("Storage");
+ return Preferences.networkPanelEnabled ? WebInspector.UIString("Resources") : WebInspector.UIString("Storage");
},
get statusBarItems()
@@ -77,27 +87,18 @@ WebInspector.StoragePanel.prototype = {
reset: function()
{
- if (this._databases) {
- var databasesLength = this._databases.length;
- for (var i = 0; i < databasesLength; ++i) {
- var database = this._databases[i];
-
- delete database._tableViews;
- delete database._queryView;
- }
+ for (var i = 0; i < this._databases.length; ++i) {
+ var database = this._databases[i];
+ delete database._tableViews;
+ delete database._queryView;
}
-
this._databases = [];
- if (this._domStorage) {
- var domStorageLength = this._domStorage.length;
- for (var i = 0; i < domStorageLength; ++i) {
- var domStorage = this._domStorage[i];
-
- delete domStorage._domStorageView;
- }
+ var domStorageLength = this._domStorage.length;
+ for (var i = 0; i < this._domStorage.length; ++i) {
+ var domStorage = this._domStorage[i];
+ delete domStorage._domStorageView;
}
-
this._domStorage = [];
this._cookieViews = {};
@@ -109,36 +110,112 @@ WebInspector.StoragePanel.prototype = {
this.localStorageListTreeElement.removeChildren();
this.sessionStorageListTreeElement.removeChildren();
this.cookieListTreeElement.removeChildren();
-
this.applicationCacheListTreeElement.removeChildren();
this.storageViews.removeChildren();
this.storageViewStatusBarItemsContainer.removeChildren();
-
+
if (this.sidebarTree.selectedTreeElement)
this.sidebarTree.selectedTreeElement.deselect();
},
+ addOrUpdateFrame: function(parentFrameId, frameId, displayName)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (frameTreeElement) {
+ frameTreeElement.displayName = displayName;
+ return;
+ }
+
+ var parentTreeElement = parentFrameId ? this._treeElementForFrameId[parentFrameId] : this.resourcesListTreeElement;
+ if (!parentTreeElement) {
+ console.warning("No frame with id:" + parentFrameId + " to route " + displayName + " to.")
+ return;
+ }
+
+ var frameTreeElement = new WebInspector.FrameTreeElement(this, frameId, displayName);
+ this._treeElementForFrameId[frameId] = frameTreeElement;
+
+ // Insert in the alphabetical order, first frames, then resources.
+ var children = parentTreeElement.children;
+ for (var i = 0; i < children.length; ++i) {
+ var child = children[i];
+ if (!(child instanceof WebInspector.FrameTreeElement)) {
+ parentTreeElement.insertChild(frameTreeElement, i);
+ return;
+ }
+ if (child.displayName.localeCompare(frameTreeElement.displayName) > 0) {
+ parentTreeElement.insertChild(frameTreeElement, i);
+ return;
+ }
+ }
+ parentTreeElement.appendChild(frameTreeElement);
+ },
+
+ removeFrame: function(frameId)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (!frameTreeElement)
+ return;
+ delete this._treeElementForFrameId[frameId];
+ if (frameTreeElement.parent)
+ frameTreeElement.parent.removeChild(frameTreeElement);
+ },
+
+ addResourceToFrame: function(frameId, resource)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (!frameTreeElement) {
+ // This is a frame's main resource, it will be retained
+ // and re-added by the resource manager;
+ return;
+ }
+
+ var resourceTreeElement = new WebInspector.FrameResourceTreeElement(this, resource);
+
+ // Insert in the alphabetical order, first frames, then resources. Document resource goes first.
+ var children = frameTreeElement.children;
+ for (var i = 0; i < children.length; ++i) {
+ var child = children[i];
+ if (!(child instanceof WebInspector.FrameResourceTreeElement))
+ continue;
+
+ if (resource.type === WebInspector.Resource.Type.Document ||
+ (child._resource.type !== WebInspector.Resource.Type.Document && child._resource.displayName.localeCompare(resource.displayName) > 0)) {
+ frameTreeElement.insertChild(resourceTreeElement, i);
+ return;
+ }
+ }
+ frameTreeElement.appendChild(resourceTreeElement);
+ },
+
+ removeResourcesFromFrame: function(frameId)
+ {
+ var frameTreeElement = this._treeElementForFrameId[frameId];
+ if (frameTreeElement)
+ frameTreeElement.removeChildren();
+ },
+
addDatabase: function(database)
{
this._databases.push(database);
- var databaseTreeElement = new WebInspector.DatabaseSidebarTreeElement(database);
+ var databaseTreeElement = new WebInspector.DatabaseTreeElement(this, database);
database._databasesTreeElement = databaseTreeElement;
this.databasesListTreeElement.appendChild(databaseTreeElement);
},
addCookieDomain: function(domain)
{
- var cookieDomainTreeElement = new WebInspector.CookieSidebarTreeElement(domain);
+ var cookieDomainTreeElement = new WebInspector.CookieTreeElement(this, domain);
this.cookieListTreeElement.appendChild(cookieDomainTreeElement);
},
addDOMStorage: function(domStorage)
{
this._domStorage.push(domStorage);
- var domStorageTreeElement = new WebInspector.DOMStorageSidebarTreeElement(domStorage, (domStorage.isLocalStorage ? "local-storage" : "session-storage"));
+ var domStorageTreeElement = new WebInspector.DOMStorageTreeElement(this, domStorage, (domStorage.isLocalStorage ? "local-storage" : "session-storage"));
domStorage._domStorageTreeElement = domStorageTreeElement;
if (domStorage.isLocalStorage)
this.localStorageListTreeElement.appendChild(domStorageTreeElement);
@@ -148,7 +225,7 @@ WebInspector.StoragePanel.prototype = {
addApplicationCache: function(domain)
{
- var applicationCacheTreeElement = new WebInspector.ApplicationCacheSidebarTreeElement(domain);
+ var applicationCacheTreeElement = new WebInspector.ApplicationCacheTreeElement(this, domain);
this.applicationCacheListTreeElement.appendChild(applicationCacheTreeElement);
},
@@ -174,14 +251,47 @@ WebInspector.StoragePanel.prototype = {
}
},
+ canShowSourceLine: function(url, line)
+ {
+ return !!WebInspector.resourceManager.resourceForURL(url);
+ },
+
+ showSourceLine: function(url, line)
+ {
+ this.showResource(WebInspector.resourceManager.resourceForURL(url), line);
+ },
+
+ showResource: function(resource, line)
+ {
+ var resourceTreeElement = this._findTreeElementForResource(resource);
+ if (resourceTreeElement) {
+ resourceTreeElement.reveal();
+ resourceTreeElement.select();
+ }
+
+ if (line) {
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ view.selectContentTab(true);
+ if (view.revealLine)
+ view.revealLine(line);
+ if (view.highlightLine)
+ view.highlightLine(line);
+ }
+ return true;
+ },
+
+ _showResourceView: function(resource)
+ {
+ var view = WebInspector.ResourceManager.resourceViewForResource(resource);
+ view.headersVisible = false;
+ this._innerShowView(view);
+ },
+
showDatabase: function(database, tableName)
{
if (!database)
return;
- if (this.visibleView)
- this.visibleView.hide();
-
var view;
if (tableName) {
if (!("_tableViews" in database))
@@ -199,7 +309,7 @@ WebInspector.StoragePanel.prototype = {
}
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
},
showDOMStorage: function(domStorage)
@@ -207,9 +317,6 @@ WebInspector.StoragePanel.prototype = {
if (!domStorage)
return;
- if (this.visibleView)
- this.visibleView.hide();
-
var view;
view = domStorage._domStorageView;
if (!view) {
@@ -217,42 +324,47 @@ WebInspector.StoragePanel.prototype = {
domStorage._domStorageView = view;
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
},
showCookies: function(treeElement, cookieDomain)
{
- if (this.visibleView)
- this.visibleView.hide();
-
var view = this._cookieViews[cookieDomain];
if (!view) {
view = new WebInspector.CookieItemsView(treeElement, cookieDomain);
this._cookieViews[cookieDomain] = view;
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
},
showApplicationCache: function(treeElement, appcacheDomain)
{
- if (this.visibleView)
- this.visibleView.hide();
-
var view = this._applicationCacheView;
if (!view) {
view = new WebInspector.ApplicationCacheItemsView(treeElement, appcacheDomain);
this._applicationCacheView = view;
}
- this._genericViewSetup(view);
+ this._innerShowView(view);
if ("_cachedApplicationCacheViewStatus" in this)
this._applicationCacheView.updateStatus(this._cachedApplicationCacheViewStatus);
},
- _genericViewSetup: function(view)
+ showCategoryView: function(categoryName)
+ {
+ if (!this._categoryView)
+ this._categoryView = new WebInspector.StorageCategoryView();
+ this._categoryView.setText(categoryName);
+ this._innerShowView(this._categoryView);
+ },
+
+ _innerShowView: function(view)
{
+ if (this.visibleView)
+ this.visibleView.hide();
+
view.show(this.storageViews);
this.visibleView = view;
@@ -418,201 +530,413 @@ WebInspector.StoragePanel.prototype = {
this.storageViews.style.left = width + "px";
this.storageViewStatusBarItemsContainer.style.left = width + "px";
this.resize();
- }
-}
+ },
-WebInspector.StoragePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+ get searchableViews()
+ {
+ var views = [];
-WebInspector.DatabaseSidebarTreeElement = function(database)
-{
- this.database = database;
+ if (!Preferences.networkPanelEnabled)
+ return views;
- WebInspector.SidebarTreeElement.call(this, "database-sidebar-tree-item", "", "", database, true);
+ const visibleView = this.visibleView;
+ if (visibleView instanceof WebInspector.ResourceView && visibleView.performSearch)
+ views.push(visibleView);
- this.refreshTitles();
-}
+ function callback(resourceTreeElement)
+ {
+ var resource = resourceTreeElement._resource;
+ var resourceView = WebInspector.ResourceManager.resourceViewForResource(resource);
+ if (resourceView.performSearch && resourceView !== visibleView)
+ views.push(resourceView);
+ }
+ this._forAllResourceTreeElements(callback);
+ return views;
+ },
-WebInspector.DatabaseSidebarTreeElement.prototype = {
- onselect: function()
+ _forAllResourceTreeElements: function(callback)
{
- WebInspector.panels.storage.showDatabase(this.database);
+ var stop = false;
+ for (var treeElement = this.resourcesListTreeElement; !stop && treeElement; treeElement = treeElement.traverseNextTreeElement(false, this.resourcesListTreeElement, true)) {
+ if (treeElement instanceof WebInspector.FrameResourceTreeElement)
+ stop = callback(treeElement);
+ }
},
- oncollapse: function()
+ searchMatchFound: function(view, matches)
{
- // Request a refresh after every collapse so the next
- // expand will have an updated table list.
- this.shouldRefreshChildren = true;
+ if (!view.resource)
+ return;
+ var treeElement = this._findTreeElementForResource(view.resource);
+ if (treeElement)
+ treeElement.searchMatchFound(matches);
},
- onpopulate: function()
+ _findTreeElementForResource: function(resource)
{
- this.removeChildren();
+ function isAncestor(ancestor, object)
+ {
+ console.error("There should be no calls to isAncestor, but there was one for ", object);
+ return false;
+ }
- var self = this;
- function tableNamesCallback(tableNames)
+ function getParent(object)
{
- var tableNamesLength = tableNames.length;
- for (var i = 0; i < tableNamesLength; ++i)
- self.appendChild(new WebInspector.SidebarDatabaseTableTreeElement(self.database, tableNames[i]));
+ console.error("There should be no calls to getParent, but there was one for ", object);
+ return null;
+ }
+
+ return this.sidebarTree.findTreeElement(resource, isAncestor, getParent);
+ },
+
+ searchCanceled: function(startingNewSearch)
+ {
+ WebInspector.Panel.prototype.searchCanceled.call(this, startingNewSearch);
+
+ if (startingNewSearch)
+ return;
+
+ function callback(resourceTreeElement)
+ {
+ resourceTreeElement._errorsWarningsUpdated();
+ }
+ this._forAllResourceTreeElements(callback);
+ },
+
+ performSearch: function(query)
+ {
+ function callback(resourceTreeElement)
+ {
+ resourceTreeElement._resetBubble();
}
- this.database.getTableNames(tableNamesCallback);
+ this._forAllResourceTreeElements(callback);
+ WebInspector.Panel.prototype.performSearch.call(this, query);
},
- get mainTitle()
+ showView: function(view)
+ {
+ if (view)
+ this.showResource(view.resource);
+ }
+}
+
+WebInspector.StoragePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+
+WebInspector.BaseStorageTreeElement = function(storagePanel, representedObject, title, iconClass, hasChildren)
+{
+ TreeElement.call(this, "", representedObject, hasChildren);
+ this._storagePanel = storagePanel;
+ this._titleText = title;
+ this._iconClass = iconClass;
+}
+
+WebInspector.BaseStorageTreeElement.prototype = {
+ onattach: function()
{
- return this.database.name;
+ this.listItemElement.removeChildren();
+ this.listItemElement.addStyleClass(this._iconClass);
+
+ var selectionElement = document.createElement("div");
+ selectionElement.className = "selection";
+ this.listItemElement.appendChild(selectionElement);
+
+ this.imageElement = document.createElement("img");
+ this.imageElement.className = "icon";
+ this.listItemElement.appendChild(this.imageElement);
+
+ this.titleElement = document.createElement("div");
+ this.titleElement.className = "base-storage-tree-element-title";
+ this.titleElement.textContent = this._titleText;
+ this.listItemElement.appendChild(this.titleElement);
},
- set mainTitle(x)
+ onreveal: function()
{
- // Do nothing.
+ if (this.listItemElement)
+ this.listItemElement.scrollIntoViewIfNeeded(false);
},
- get subtitle()
+ set titleText(titleText)
{
- return this.database.displayDomain;
+ this._titleText = titleText;
+ this.titleElement.textContent = this._titleText;
},
- set subtitle(x)
+ isEventWithinDisclosureTriangle: function()
{
- // Do nothing.
+ // Override it since we use margin-left in place of treeoutline's text-indent.
+ // Hence we need to take padding into consideration. This all is needed for leading
+ // icons in the tree.
+ const paddingLeft = 14;
+ var left = this.listItemElement.totalOffsetLeft + paddingLeft;
+ return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;
}
}
-WebInspector.DatabaseSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.BaseStorageTreeElement.prototype.__proto__ = TreeElement.prototype;
-WebInspector.SidebarDatabaseTableTreeElement = function(database, tableName)
+WebInspector.StorageCategoryTreeElement = function(storagePanel, categoryName, iconClass)
{
- this.database = database;
- this.tableName = tableName;
-
- WebInspector.SidebarTreeElement.call(this, "database-table-sidebar-tree-item small", tableName, "", null, false);
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, categoryName, iconClass, true);
+ this._categoryName = categoryName;
}
-WebInspector.SidebarDatabaseTableTreeElement.prototype = {
+WebInspector.StorageCategoryTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showDatabase(this.database, this.tableName);
+ this._storagePanel.showCategoryView(this._categoryName);
}
}
+WebInspector.StorageCategoryTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-WebInspector.SidebarDatabaseTableTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
-
-WebInspector.DOMStorageSidebarTreeElement = function(domStorage, className)
+WebInspector.FrameTreeElement = function(storagePanel, frameId, displayName)
{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, displayName, "frame-storage-tree-item");
+ this._frameId = frameId;
+ this._displayName = displayName;
+}
- this.domStorage = domStorage;
+WebInspector.FrameTreeElement.prototype = {
+ onselect: function()
+ {
+ this._storagePanel.showCategoryView(this._displayName);
+ },
- WebInspector.SidebarTreeElement.call(this, "domstorage-sidebar-tree-item " + className, domStorage, "", null, false);
+ get displayName()
+ {
+ return this._displayName;
+ },
- this.refreshTitles();
+ set displayName(displayName)
+ {
+ this._displayName = displayName;
+ this.titleText = displayName;
+ }
+}
+WebInspector.FrameTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.FrameResourceTreeElement = function(storagePanel, resource)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, resource, resource.displayName, "resource-sidebar-tree-item resources-category-" + resource.category.name);
+ this._resource = resource;
+ this._resource.addEventListener("errors-warnings-updated", this._errorsWarningsUpdated, this);
+ this.tooltip = resource.url;
}
-WebInspector.DOMStorageSidebarTreeElement.prototype = {
+WebInspector.FrameResourceTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showDOMStorage(this.domStorage);
+ this._storagePanel._showResourceView(this._resource);
},
- get mainTitle()
+ ondblclick: function(event)
{
- return this.domStorage.domain ? this.domStorage.domain : WebInspector.UIString("Local Files");
+ InspectorBackend.openInInspectedWindow(this._resource.url);
},
- set mainTitle(x)
+ onattach: function()
{
- // Do nothing.
+ WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
+
+ if (this._resource.category === WebInspector.resourceCategories.images) {
+ var previewImage = document.createElement("img");
+ previewImage.className = "image-resource-icon-preview";
+ previewImage.src = this._resource.url;
+
+ var iconElement = document.createElement("div");
+ iconElement.className = "icon";
+ iconElement.appendChild(previewImage);
+ this.listItemElement.replaceChild(iconElement, this.imageElement);
+ }
+
+ this._statusElement = document.createElement("div");
+ this._statusElement.className = "status";
+ this.listItemElement.insertBefore(this._statusElement, this.titleElement);
+
+ this.listItemElement.draggable = true;
+ this.listItemElement.addEventListener("dragstart", this._ondragstart.bind(this), false);
},
- get subtitle()
+ _ondragstart: function(event)
{
- return ""; //this.database.displayDomain;
+ event.dataTransfer.setData("text/plain", this._resource.url);
+ event.dataTransfer.setData("text/uri-list", this._resource.url + "\r\n");
+ event.dataTransfer.effectAllowed = "copy";
+ return true;
+ },
+
+ _setBubbleText: function(x)
+ {
+ if (!this._bubbleElement) {
+ this._bubbleElement = document.createElement("div");
+ this._bubbleElement.className = "bubble";
+ this._statusElement.appendChild(this._bubbleElement);
+ }
+
+ this._bubbleElement.textContent = x;
+ },
+
+ _resetBubble: function()
+ {
+ if (this._bubbleElement) {
+ this._bubbleElement.textContent = "";
+ this._bubbleElement.removeStyleClass("search-matches");
+ this._bubbleElement.removeStyleClass("warning");
+ this._bubbleElement.removeStyleClass("error");
+ }
+ },
+
+ searchMatchFound: function(matches)
+ {
+ this._resetBubble();
+
+ this._setBubbleText(matches);
+ this._bubbleElement.addStyleClass("search-matches");
+
+ // Expand, do not scroll into view.
+ var currentAncestor = this.parent;
+ while (currentAncestor && !currentAncestor.root) {
+ if (!currentAncestor.expanded)
+ currentAncestor.expand();
+ currentAncestor = currentAncestor.parent;
+ }
},
- set subtitle(x)
+ _errorsWarningsUpdated: function()
{
- // Do nothing.
+ // FIXME: move to the Script/SourceView.
+ if (!this._resource.warnings && !this._resource.errors) {
+ var view = WebInspector.ResourceManager.existingResourceViewForResource(this._resource);
+ if (view && view.clearMessages)
+ view.clearMessages();
+ }
+
+ if (this._storagePanel.currentQuery)
+ return;
+
+ this._resetBubble();
+
+ if (this._resource.warnings || this._resource.errors)
+ this._setBubbleText(this._resource.warnings + this._resource.errors);
+
+ if (this._resource.warnings)
+ this._bubbleElement.addStyleClass("warning");
+
+ if (this._resource.errors)
+ this._bubbleElement.addStyleClass("error");
}
}
-WebInspector.DOMStorageSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.FrameResourceTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-WebInspector.CookieSidebarTreeElement = function(cookieDomain)
+WebInspector.DatabaseTreeElement = function(storagePanel, database)
{
- WebInspector.SidebarTreeElement.call(this, "cookie-sidebar-tree-item", cookieDomain, "", null, false);
- this._cookieDomain = cookieDomain;
- this._subtitle = "";
-
- this.refreshTitles();
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, database.name, "database-storage-tree-item", true);
+ this._database = database;
}
-WebInspector.CookieSidebarTreeElement.prototype = {
+WebInspector.DatabaseTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showCookies(this, this._cookieDomain);
+ this._storagePanel.showDatabase(this._database);
},
- get mainTitle()
+ oncollapse: function()
{
- return this._cookieDomain ? this._cookieDomain : WebInspector.UIString("Local Files");
+ // Request a refresh after every collapse so the next
+ // expand will have an updated table list.
+ this.shouldRefreshChildren = true;
},
- set mainTitle(x)
+ onpopulate: function()
{
- // Do nothing.
- },
+ this.removeChildren();
+
+ function tableNamesCallback(tableNames)
+ {
+ var tableNamesLength = tableNames.length;
+ for (var i = 0; i < tableNamesLength; ++i)
+ this.appendChild(new WebInspector.DatabaseTableTreeElement(this._storagePanel, this._database, tableNames[i]));
+ }
+ this._database.getTableNames(tableNamesCallback.bind(this));
+ }
+
+}
+WebInspector.DatabaseTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.DatabaseTableTreeElement = function(storagePanel, database, tableName)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, tableName, "database-storage-tree-item");
+ this._database = database;
+ this._tableName = tableName;
+}
- get subtitle()
+WebInspector.DatabaseTableTreeElement.prototype = {
+ onselect: function()
{
- return this._subtitle;
- },
+ this._storagePanel.showDatabase(this._database, this._tableName);
+ }
+}
+WebInspector.DatabaseTableTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.DOMStorageTreeElement = function(storagePanel, domStorage, className)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, domStorage.domain ? domStorage.domain : WebInspector.UIString("Local Files"), "domstorage-storage-tree-item " + className);
+ this._domStorage = domStorage;
+}
- set subtitle(x)
+WebInspector.DOMStorageTreeElement.prototype = {
+ onselect: function()
{
- this._subtitle = x;
- this.refreshTitles();
+ this._storagePanel.showDOMStorage(this._domStorage);
}
}
+WebInspector.DOMStorageTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-WebInspector.CookieSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.CookieTreeElement = function(storagePanel, cookieDomain)
+{
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, cookieDomain ? cookieDomain : WebInspector.UIString("Local Files"), "cookie-storage-tree-item");
+ this._cookieDomain = cookieDomain;
+}
-WebInspector.ApplicationCacheSidebarTreeElement = function(appcacheDomain)
+WebInspector.CookieTreeElement.prototype = {
+ onselect: function()
+ {
+ this._storagePanel.showCookies(this, this._cookieDomain);
+ }
+}
+WebInspector.CookieTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
+
+WebInspector.ApplicationCacheTreeElement = function(storagePanel, appcacheDomain)
{
- WebInspector.SidebarTreeElement.call(this, "application-cache-sidebar-tree-item", appcacheDomain, "", null, false);
+ WebInspector.BaseStorageTreeElement.call(this, storagePanel, null, appcacheDomain ? appcacheDomain : WebInspector.UIString("Local Files"), "application-cache-storage-tree-item");
this._appcacheDomain = appcacheDomain;
- this._subtitle = "";
- this._mainTitle = this._appcacheDomain;
- this.refreshTitles();
}
-WebInspector.ApplicationCacheSidebarTreeElement.prototype = {
+WebInspector.ApplicationCacheTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.storage.showApplicationCache(this, this._appcacheDomain);
- },
+ this._storagePanel.showApplicationCache(this, this._appcacheDomain);
+ }
+}
+WebInspector.ApplicationCacheTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
- get mainTitle()
- {
- return this._mainTitle;
- },
+WebInspector.StorageCategoryView = function()
+{
+ WebInspector.View.call(this);
- set mainTitle(x)
- {
- this._mainTitle = x;
- this.refreshTitles();
- },
+ this.element.addStyleClass("storage-view");
- get subtitle()
- {
- return this._subtitle;
- },
+ this._emptyMsgElement = document.createElement("div");
+ this._emptyMsgElement.className = "storage-empty-view";
+ this.element.appendChild(this._emptyMsgElement);
+}
- set subtitle(x)
+WebInspector.StorageCategoryView.prototype = {
+ setText: function(text)
{
- this._subtitle = x;
- this.refreshTitles();
+ this._emptyMsgElement.textContent = text;
}
}
-WebInspector.ApplicationCacheSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype;
+WebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototype;
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 36d854c..cc97520 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -60,7 +60,13 @@ WebInspector.StylesSidebarPane = function(computedStylePane)
this.settingsSelectElement.addEventListener("click", function(event) { event.stopPropagation() }, false);
this.settingsSelectElement.addEventListener("change", this._changeSetting.bind(this), false);
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ var format = WebInspector.applicationSettings.colorFormat;
+ if (format === "hex")
+ this.settingsSelectElement[0].selected = true;
+ else if (format === "rgb")
+ this.settingsSelectElement[1].selected = true;
+ else if (format === "hsl")
+ this.settingsSelectElement[2].selected = true;
this.titleElement.appendChild(this.settingsSelectElement);
this._computedStylePane = computedStylePane;
@@ -95,17 +101,6 @@ WebInspector.StylesSidebarPane.PseudoIdNames = [
];
WebInspector.StylesSidebarPane.prototype = {
- _settingsLoaded: function()
- {
- var format = WebInspector.applicationSettings.colorFormat;
- if (format === "hex")
- this.settingsSelectElement[0].selected = true;
- if (format === "rgb")
- this.settingsSelectElement[1].selected = true;
- if (format === "hsl")
- this.settingsSelectElement[2].selected = true;
- },
-
_contextMenuEventFired: function(event)
{
var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
@@ -160,7 +155,7 @@ WebInspector.StylesSidebarPane.prototype = {
if (refresh)
WebInspector.cssModel.getComputedStyleAsync(node.id, computedStyleCallback.bind(this));
else
- WebInspector.cssModel.getStylesAsync(node.id, !WebInspector.applicationSettings.showUserAgentStyles, stylesCallback.bind(this));
+ WebInspector.cssModel.getStylesAsync(node.id, stylesCallback.bind(this));
},
_refreshUpdate: function(node, computedStyle, editedSection)
@@ -201,8 +196,8 @@ WebInspector.StylesSidebarPane.prototype = {
// Add rules in reverse order to match the cascade order.
for (var j = pseudoElementCSSRules.rules.length - 1; j >= 0; --j) {
- var rule = WebInspector.CSSStyleDeclaration.parseRule(pseudoElementCSSRules.rules[j]);
- styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
+ var rule = pseudoElementCSSRules.rules[j];
+ styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule });
}
usedProperties = {};
disabledComputedProperties = {};
@@ -213,7 +208,7 @@ WebInspector.StylesSidebarPane.prototype = {
_refreshStyleRules: function(sections, computedStyle)
{
- var nodeComputedStyle = new WebInspector.CSSStyleDeclaration(computedStyle);
+ var nodeComputedStyle = computedStyle;
var styleRules = [];
for (var i = 0; sections && i < sections.length; ++i) {
var section = sections[i];
@@ -229,7 +224,7 @@ WebInspector.StylesSidebarPane.prototype = {
_rebuildStyleRules: function(node, styles)
{
- var nodeComputedStyle = new WebInspector.CSSStyleDeclaration(styles.computedStyle);
+ var nodeComputedStyle = styles.computedStyle;
this.sections = {};
var styleRules = [];
@@ -238,7 +233,7 @@ WebInspector.StylesSidebarPane.prototype = {
var styleAttributes = {};
for (var name in styles.styleAttributes) {
- var attrStyle = { style: new WebInspector.CSSStyleDeclaration(styles.styleAttributes[name]), editable: false };
+ var attrStyle = { style: styles.styleAttributes[name], editable: false };
attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName) + "[" + name;
if (node.getAttribute(name))
attrStyle.selectorText += "=" + node.getAttribute(name);
@@ -248,7 +243,7 @@ WebInspector.StylesSidebarPane.prototype = {
// Show element's Style Attributes
if (styles.inlineStyle && node.nodeType === Node.ELEMENT_NODE) {
- var inlineStyle = { selectorText: "element.style", style: new WebInspector.CSSStyleDeclaration(styles.inlineStyle), isAttribute: true };
+ var inlineStyle = { selectorText: "element.style", style: styles.inlineStyle, isAttribute: true };
styleRules.push(inlineStyle);
}
@@ -256,12 +251,11 @@ WebInspector.StylesSidebarPane.prototype = {
if (styles.matchedCSSRules.length)
styleRules.push({ isStyleSeparator: true, text: WebInspector.UIString("Matched CSS Rules") });
for (var i = styles.matchedCSSRules.length - 1; i >= 0; --i) {
- var rule = WebInspector.CSSStyleDeclaration.parseRule(styles.matchedCSSRules[i]);
- styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule });
+ var rule = styles.matchedCSSRules[i];
+ styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule });
}
// Walk the node structure and identify styles with inherited properties.
- var parentStyles = styles.parent;
var parentNode = node.parentNode;
function insertInheritedNodeSeparator(node)
{
@@ -271,11 +265,12 @@ WebInspector.StylesSidebarPane.prototype = {
styleRules.push(entry);
}
- while (parentStyles) {
+ for (var parentOrdinal = 0; parentOrdinal < styles.inherited.length; ++parentOrdinal) {
+ var parentStyles = styles.inherited[parentOrdinal];
var separatorInserted = false;
if (parentStyles.inlineStyle) {
if (this._containsInherited(parentStyles.inlineStyle)) {
- var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: new WebInspector.CSSStyleDeclaration(parentStyles.inlineStyle), isAttribute: true, isInherited: true };
+ var inlineStyle = { selectorText: WebInspector.UIString("Style Attribute"), style: parentStyles.inlineStyle, isAttribute: true, isInherited: true };
if (!separatorInserted) {
insertInheritedNodeSeparator(parentNode);
separatorInserted = true;
@@ -288,14 +283,13 @@ WebInspector.StylesSidebarPane.prototype = {
var rulePayload = parentStyles.matchedCSSRules[i];
if (!this._containsInherited(rulePayload.style))
continue;
- var rule = WebInspector.CSSStyleDeclaration.parseRule(rulePayload);
+ var rule = rulePayload;
if (!separatorInserted) {
insertInheritedNodeSeparator(parentNode);
separatorInserted = true;
}
- styleRules.push({ style: rule.style, selectorText: rule.selectorText, parentStyleSheet: rule.parentStyleSheet, rule: rule, isInherited: true });
+ styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, isInherited: true });
}
- parentStyles = parentStyles.parent;
parentNode = parentNode.parentNode;
}
return styleRules;
@@ -303,18 +297,6 @@ WebInspector.StylesSidebarPane.prototype = {
_markUsedProperties: function(styleRules, usedProperties, disabledComputedProperties)
{
- function deleteDisabledProperty(style, name)
- {
- if (!style || !name)
- return;
- if (style.__disabledPropertyValues)
- delete style.__disabledPropertyValues[name];
- if (style.__disabledPropertyPriorities)
- delete style.__disabledPropertyPriorities[name];
- if (style.__disabledProperties)
- delete style.__disabledProperties[name];
- }
-
var priorityUsed = false;
// Walk the style rules and make a list of all used and overloaded properties.
@@ -328,10 +310,14 @@ WebInspector.StylesSidebarPane.prototype = {
styleRule.usedProperties = {};
var style = styleRule.style;
- for (var j = 0; j < style.length; ++j) {
- var name = style[j];
+ var allProperties = style.allProperties;
+ for (var j = 0; j < allProperties.length; ++j) {
+ var property = allProperties[j];
+ if (!property.isLive)
+ continue;
+ var name = property.name;
- if (!priorityUsed && style.getPropertyPriority(name).length)
+ if (!priorityUsed && property.priority.length)
priorityUsed = true;
// If the property name is already used by another rule then this rule's
@@ -350,22 +336,12 @@ WebInspector.StylesSidebarPane.prototype = {
styleRule.usedProperties["font-weight"] = true;
styleRule.usedProperties["line-height"] = true;
}
-
- // Delete any disabled properties, since the property does exist.
- // This prevents it from showing twice.
- deleteDisabledProperty(style, name);
- deleteDisabledProperty(style, style.getPropertyShorthand(name));
}
// Add all the properties found in this style to the used properties list.
// Do this here so only future rules are affect by properties used in this rule.
for (var name in styleRules[i].usedProperties)
usedProperties[name] = true;
-
- // Remember all disabled properties so they show up in computed style.
- if (style.__disabledProperties)
- for (var name in style.__disabledProperties)
- disabledComputedProperties[name] = true;
}
if (priorityUsed) {
@@ -378,9 +354,13 @@ WebInspector.StylesSidebarPane.prototype = {
continue;
var style = styleRules[i].style;
- for (var j = 0; j < style.length; ++j) {
- var name = style[j];
- if (style.getPropertyPriority(name).length) {
+ var allProperties = style.allProperties;
+ for (var j = 0; j < allProperties.length; ++j) {
+ var property = allProperties[j];
+ if (!property.isLive)
+ continue;
+ var name = property.name;
+ if (property.priority.length) {
if (!(name in foundPriorityProperties))
styleRules[i].usedProperties[name] = true;
else
@@ -464,21 +444,13 @@ WebInspector.StylesSidebarPane.prototype = {
return sections;
},
- _containsInherited: function(payload)
- {
- if (this._arrayContainsInheritedProperty(payload.properties))
- return true;
- if (payload.disabled && this._arrayContainsInheritedProperty(payload.disabled))
- return true;
- return false;
- },
-
- _arrayContainsInheritedProperty: function(properties)
+ _containsInherited: function(style)
{
+ var properties = style.allProperties;
for (var i = 0; i < properties.length; ++i) {
var property = properties[i];
// Does this style contain non-overridden inherited property?
- if (property.name in WebInspector.StylesSidebarPane.InheritedProperties)
+ if (property.isLive && property.name in WebInspector.StylesSidebarPane.InheritedProperties)
return true;
}
return false;
@@ -590,16 +562,11 @@ WebInspector.ComputedStyleSidebarPane = function()
var showInheritedCheckbox = new WebInspector.Checkbox(WebInspector.UIString("Show inherited"), "sidebar-pane-subtitle");
this.titleElement.appendChild(showInheritedCheckbox.element);
- function settingsLoaded()
- {
- if (WebInspector.applicationSettings.showInheritedComputedStyleProperties) {
- this.bodyElement.addStyleClass("show-inherited");
- showInheritedCheckbox.checked = true;
- }
+ if (WebInspector.applicationSettings.showInheritedComputedStyleProperties) {
+ this.bodyElement.addStyleClass("show-inherited");
+ showInheritedCheckbox.checked = true;
}
- WebInspector.applicationSettings.addEventListener("loaded", settingsLoaded.bind(this));
-
function showInheritedToggleFunction(event)
{
WebInspector.applicationSettings.showInheritedComputedStyleProperties = showInheritedCheckbox.checked;
@@ -661,16 +628,16 @@ WebInspector.StylePropertiesSection = function(styleRule, editable, isInherited,
}
var subtitle = "";
- if (this.styleRule.parentStyleSheet && this.styleRule.parentStyleSheet.href)
- this.subtitleElement.appendChild(linkifyUncopyable(this.styleRule.parentStyleSheet.href, this.rule.sourceLine));
+ if (this.styleRule.sourceURL)
+ this.subtitleElement.appendChild(linkifyUncopyable(this.styleRule.sourceURL, this.rule.sourceLine));
else if (isUserAgent)
subtitle = WebInspector.UIString("user agent stylesheet");
else if (isUser)
subtitle = WebInspector.UIString("user stylesheet");
else if (isViaInspector)
subtitle = WebInspector.UIString("via inspector");
- else if (this.rule && this.rule.documentURL)
- this.subtitleElement.appendChild(linkifyUncopyable(this.rule.documentURL, this.rule.sourceLine));
+ else if (this.rule && this.rule.sourceURL)
+ this.subtitleElement.appendChild(linkifyUncopyable(this.rule.sourceURL, this.rule.sourceLine));
if (isInherited)
this.element.addStyleClass("show-inherited"); // This one is related to inherited rules, not compted style.
@@ -691,49 +658,42 @@ WebInspector.StylePropertiesSection.prototype = {
// Overriding with empty body.
},
- isPropertyInherited: function(property)
+ isPropertyInherited: function(propertyName)
{
if (this.isInherited) {
// While rendering inherited stylesheet, reverse meaning of this property.
// Render truly inherited properties with black, i.e. return them as non-inherited.
- return !(property in WebInspector.StylesSidebarPane.InheritedProperties);
+ return !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties);
}
return false;
},
- isPropertyOverloaded: function(property, shorthand)
+ isPropertyOverloaded: function(propertyName, shorthand)
{
if (!this._usedProperties || this.noAffect)
return false;
- if (this.isInherited && !(property in WebInspector.StylesSidebarPane.InheritedProperties)) {
+ if (this.isInherited && !(propertyName in WebInspector.StylesSidebarPane.InheritedProperties)) {
// In the inherited sections, only show overrides for the potentially inherited properties.
return false;
}
- var used = (property in this._usedProperties);
+ var used = (propertyName in this._usedProperties);
if (used || !shorthand)
return !used;
// Find out if any of the individual longhand properties of the shorthand
// are used, if none are then the shorthand is overloaded too.
- var longhandProperties = this.styleRule.style.getLonghandProperties(property);
+ var longhandProperties = this.styleRule.style.getLonghandProperties(propertyName);
for (var j = 0; j < longhandProperties.length; ++j) {
var individualProperty = longhandProperties[j];
- if (individualProperty in this._usedProperties)
+ if (individualProperty.name in this._usedProperties)
return false;
}
return true;
},
- isPropertyDisabled: function(property)
- {
- if (!this.styleRule.style.__disabledPropertyValues)
- return false;
- return property in this.styleRule.style.__disabledPropertyValues;
- },
-
update: function(full)
{
if (full) {
@@ -759,39 +719,56 @@ WebInspector.StylePropertiesSection.prototype = {
onpopulate: function()
{
+ function sorter(a, b)
+ {
+ return a.name.localeCompare(b.name);
+ }
+
var style = this.styleRule.style;
- var foundShorthands = {};
- var disabledProperties = style.__disabledPropertyValues || {};
+ var handledProperties = {};
+ var shorthandNames = {};
this.uniqueProperties = [];
- for (var i = 0; i < style.length; ++i)
- this.uniqueProperties.push(style[i]);
+ var allProperties = style.allProperties;
+ for (var i = 0; i < allProperties.length; ++i)
+ this.uniqueProperties.push(allProperties[i]);
- for (var name in disabledProperties)
- this.uniqueProperties.push(name);
+ this.uniqueProperties.sort(sorter);
- this.uniqueProperties.sort();
+ // Collect all shorthand names.
+ for (var i = 0; i < this.uniqueProperties.length; ++i) {
+ var property = this.uniqueProperties[i];
+ if (property.disabled)
+ continue;
+ if (property.shorthand)
+ shorthandNames[property.shorthand] = true;
+ }
for (var i = 0; i < this.uniqueProperties.length; ++i) {
- var name = this.uniqueProperties[i];
- var disabled = name in disabledProperties;
- var shorthand = !disabled ? style.getPropertyShorthand(name) : null;
+ var property = this.uniqueProperties[i];
+ var disabled = property.disabled;
+ if (!disabled && this.disabledComputedProperties && !(property.name in this.usedProperties) && property.name in this.disabledComputedProperties)
+ disabled = true;
- if (shorthand && shorthand in foundShorthands)
+ var shorthand = !disabled ? property.shorthand : null;
+
+ if (shorthand && shorthand in handledProperties)
continue;
if (shorthand) {
- foundShorthands[shorthand] = true;
- name = shorthand;
+ property = style.getLiveProperty(shorthand);
+ if (!property)
+ property = new WebInspector.CSSProperty(style, style.allProperties.length, shorthand, style.getShorthandValue(shorthand), style.getShorthandPriority(shorthand), "style", true, true, "");
}
- var isShorthand = (shorthand ? true : false);
- var inherited = this.isPropertyInherited(name);
- var overloaded = this.isPropertyOverloaded(name, isShorthand);
+ var isShorthand = !!(property.isLive && (shorthand || shorthandNames[property.name]));
+ var inherited = this.isPropertyInherited(property.name);
+ var overloaded = this.isPropertyOverloaded(property.name, isShorthand);
- var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, name, isShorthand, inherited, overloaded, disabled);
+ var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, isShorthand, inherited, overloaded);
this.propertiesTreeOutline.appendChild(item);
+ handledProperties[property.name] = property;
}
},
@@ -808,7 +785,9 @@ WebInspector.StylePropertiesSection.prototype = {
addNewBlankProperty: function()
{
- var item = new WebInspector.StylePropertyTreeElement(this.styleRule, this.styleRule.style, "", false, false, false, false);
+ var style = this.styleRule.style;
+ var property = new WebInspector.CSSProperty(style, style.allProperties.length, "", "", "", "style", true, false, false, undefined);
+ var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, false, false, false);
this.propertiesTreeOutline.appendChild(item);
item.listItemElement.textContent = "";
item._newProperty = true;
@@ -894,7 +873,7 @@ WebInspector.StylePropertiesSection.prototype = {
}
self.rule = newRule;
- self.styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, parentStyleSheet: newRule.parentStyleSheet, rule: newRule };
+ self.styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };
var oldIdentifier = this.identifier;
self.identifier = newRule.selectorText + ":" + self.subtitleElement.textContent;
@@ -937,9 +916,9 @@ WebInspector.ComputedStylePropertiesSection.prototype = {
// Overriding with empty body.
},
- _isPropertyInherited: function(property)
+ _isPropertyInherited: function(propertyName)
{
- return !(property in this._usedProperties) && !(property in this._alwaysShowComputedProperties) && !(property in this._disabledComputedProperties);
+ return !(propertyName in this._usedProperties) && !(propertyName in this._alwaysShowComputedProperties) && !(propertyName in this._disabledComputedProperties);
},
update: function()
@@ -956,19 +935,25 @@ WebInspector.ComputedStylePropertiesSection.prototype = {
onpopulate: function()
{
+ function sorter(a, b)
+ {
+ return a.name.localeCompare(b.name);
+ }
+
var style = this.styleRule.style;
var uniqueProperties = [];
- for (var i = 0; i < style.length; ++i)
- uniqueProperties.push(style[i]);
- uniqueProperties.sort();
+ var allProperties = style.allProperties;
+ for (var i = 0; i < allProperties.length; ++i)
+ uniqueProperties.push(allProperties[i]);
+ uniqueProperties.sort(sorter);
this._propertyTreeElements = {};
for (var i = 0; i < uniqueProperties.length; ++i) {
- var name = uniqueProperties[i];
- var inherited = this._isPropertyInherited(name);
- var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, name, false, inherited, false, false);
+ var property = uniqueProperties[i];
+ var inherited = this._isPropertyInherited(property.name);
+ var item = new WebInspector.StylePropertyTreeElement(this.styleRule, style, property, false, inherited, false);
this.propertiesTreeOutline.appendChild(item);
- this._propertyTreeElements[name] = item;
+ this._propertyTreeElements[property.name] = item;
}
},
@@ -980,21 +965,21 @@ WebInspector.ComputedStylePropertiesSection.prototype = {
continue;
for (var j = 0; j < section.uniqueProperties.length; ++j) {
- var name = section.uniqueProperties[j];
- if (section.isPropertyDisabled(name))
+ var property = section.uniqueProperties[j];
+ if (property.disabled)
continue;
- if (section.isInherited && !(name in WebInspector.StylesSidebarPane.InheritedProperties))
+ if (section.isInherited && !(property.name in WebInspector.StylesSidebarPane.InheritedProperties))
continue;
- var treeElement = this._propertyTreeElements[name];
+ var treeElement = this._propertyTreeElements[property.name];
if (treeElement) {
var selectorText = section.styleRule.selectorText;
- var value = section.styleRule.style.getPropertyValue(name);
+ var value = property.value;
var title = "<span style='color: gray'>" + selectorText + "</span> - " + value;
var subtitle = " <span style='float:right'>" + section.subtitleElement.innerHTML + "</span>";
var childElement = new TreeElement(title + subtitle, null, false);
treeElement.appendChild(childElement);
- if (section.isPropertyOverloaded(name))
+ if (section.isPropertyOverloaded(property.name))
childElement.listItemElement.addStyleClass("overloaded");
}
}
@@ -1060,15 +1045,14 @@ WebInspector.BlankStylePropertiesSection.prototype = {
WebInspector.BlankStylePropertiesSection.prototype.__proto__ = WebInspector.StylePropertiesSection.prototype;
-WebInspector.StylePropertyTreeElement = function(styleRule, style, name, shorthand, inherited, overloaded, disabled)
+WebInspector.StylePropertyTreeElement = function(styleRule, style, property, shorthand, inherited, overloaded)
{
this._styleRule = styleRule;
this.style = style;
- this.name = name;
+ this.property = property;
this.shorthand = shorthand;
this._inherited = inherited;
this._overloaded = overloaded;
- this._disabled = disabled;
// Pass an empty title, the title gets made later in onattach.
TreeElement.call(this, "", null, shorthand);
@@ -1103,29 +1087,31 @@ WebInspector.StylePropertyTreeElement.prototype = {
get disabled()
{
- return this._disabled;
+ return this.property.disabled;
},
- set disabled(x)
+ get name()
{
- if (x === this._disabled)
- return;
- this._disabled = x;
- this.updateState();
+ return this.property.name;
},
get priority()
{
- if (this.disabled && this.style.__disabledPropertyPriorities && this.name in this.style.__disabledPropertyPriorities)
- return this.style.__disabledPropertyPriorities[this.name];
- return (this.shorthand ? this.style.getShorthandPriority(this.name) : this.style.getPropertyPriority(this.name));
+ if (this.disabled)
+ return this.property.priority;
+ return (this.shorthand ? this.style.getShorthandPriority(this.name) : this.property.priority);
},
get value()
{
- if (this.disabled && this.style.__disabledPropertyValues && this.name in this.style.__disabledPropertyValues)
- return this.style.__disabledPropertyValues[this.name];
- return (this.shorthand ? this.style.getShorthandValue(this.name) : this.style.getPropertyValue(this.name));
+ if (this.disabled)
+ return this.property.value;
+ return (this.shorthand ? this.style.getShorthandValue(this.name) : this.property.value);
+ },
+
+ get parsedOk()
+ {
+ return this.property.parsedOk;
},
onattach: function()
@@ -1145,11 +1131,14 @@ WebInspector.StylePropertyTreeElement.prototype = {
this.updateState();
- var enabledCheckboxElement = document.createElement("input");
- enabledCheckboxElement.className = "enabled-button";
- enabledCheckboxElement.type = "checkbox";
- enabledCheckboxElement.checked = !this.disabled;
- enabledCheckboxElement.addEventListener("change", this.toggleEnabled.bind(this), false);
+ var enabledCheckboxElement;
+ if (this.parsedOk) {
+ enabledCheckboxElement = document.createElement("input");
+ enabledCheckboxElement.className = "enabled-button";
+ enabledCheckboxElement.type = "checkbox";
+ enabledCheckboxElement.checked = !this.disabled;
+ enabledCheckboxElement.addEventListener("change", this.toggleEnabled.bind(this), false);
+ }
var nameElement = document.createElement("span");
nameElement.className = "webkit-css-property";
@@ -1186,7 +1175,8 @@ WebInspector.StylePropertyTreeElement.prototype = {
{
var container = document.createDocumentFragment();
container.appendChild(document.createTextNode("url("));
- container.appendChild(WebInspector.linkifyURLAsNode(url, url, null, (url in WebInspector.resourceURLMap)));
+ var hasResource = !!WebInspector.resourceForURL(url);
+ container.appendChild(WebInspector.linkifyURLAsNode(url, url, null, hasResource));
container.appendChild(document.createTextNode(")"));
return container;
}
@@ -1297,7 +1287,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
return;
// Append the checkbox for root elements of an editable section.
- if (this.treeOutline.section && this.treeOutline.section.editable && this.parent.root)
+ if (enabledCheckboxElement && this.treeOutline.section && this.treeOutline.section.editable && this.parent.root)
this.listItemElement.appendChild(enabledCheckboxElement);
this.listItemElement.appendChild(nameElement);
this.listItemElement.appendChild(document.createTextNode(": "));
@@ -1310,7 +1300,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
this.listItemElement.appendChild(document.createTextNode(";"));
- this.tooltip = this.name + ": " + valueElement.textContent + (priority ? " " + priority : "");
+ this.tooltip = this.property.propertyText;
},
updateAll: function(updateAllRules)
@@ -1322,33 +1312,28 @@ WebInspector.StylePropertyTreeElement.prototype = {
else if (this.treeOutline.section)
this.treeOutline.section.update(true);
else
- this.updateTitle(); // FIXME: this will not show new properties. But we don't hit his case yet.
+ this.updateTitle(); // FIXME: this will not show new properties. But we don't hit this case yet.
},
toggleEnabled: function(event)
{
var disabled = !event.target.checked;
- var self = this;
function callback(newStyle)
{
if (!newStyle)
return;
- self.style = newStyle;
- self._styleRule.style = self.style;
-
- // Set the disabled property here, since the code above replies on it not changing
- // until after the value and priority are retrieved.
- self.disabled = disabled;
+ this.style = newStyle;
+ this._styleRule.style = newStyle;
- if (self.treeOutline.section && self.treeOutline.section.pane)
- self.treeOutline.section.pane.dispatchEventToListeners("style property toggled");
+ if (this.treeOutline.section && this.treeOutline.section.pane)
+ this.treeOutline.section.pane.dispatchEventToListeners("style property toggled");
- self.updateAll(true);
+ this.updateAll(true);
}
- WebInspector.cssModel.toggleStyleEnabled(this.style.id, this.name, disabled, callback);
+ this.property.setDisabled(disabled, callback.bind(this));
},
updateState: function()
@@ -1385,14 +1370,16 @@ WebInspector.StylePropertyTreeElement.prototype = {
var longhandProperties = this.style.getLonghandProperties(this.name);
for (var i = 0; i < longhandProperties.length; ++i) {
- var name = longhandProperties[i];
+ var name = longhandProperties[i].name;
+
if (this.treeOutline.section) {
var inherited = this.treeOutline.section.isPropertyInherited(name);
var overloaded = this.treeOutline.section.isPropertyOverloaded(name);
}
- var item = new WebInspector.StylePropertyTreeElement(this._styleRule, this.style, name, false, inherited, overloaded);
+ var liveProperty = this.style.getLiveProperty(name);
+ var item = new WebInspector.StylePropertyTreeElement(this._styleRule, this.style, liveProperty, false, inherited, overloaded);
this.appendChild(item);
}
},
@@ -1680,39 +1667,37 @@ WebInspector.StylePropertyTreeElement.prototype = {
}
}
- var self = this;
-
- function failureCallback()
+ function callback(newStyle)
{
- // The user typed something, but it didn't parse. Just abort and restore
- // the original title for this property. If this was a new attribute and
- // we couldn't parse, then just remove it.
- if (self._newProperty) {
- self.parent.removeChild(self);
+ if (!newStyle) {
+ // The user typed something, but it didn't parse. Just abort and restore
+ // the original title for this property. If this was a new attribute and
+ // we couldn't parse, then just remove it.
+ if (this._newProperty) {
+ this.parent.removeChild(this);
+ return;
+ }
+ if (updateInterface)
+ this.updateTitle();
return;
}
- if (updateInterface)
- self.updateTitle();
- }
- function successCallback(newStyle)
- {
if (!styleTextLength) {
// Do remove ourselves from UI when the property removal is confirmed.
- self.parent.removeChild(self);
+ this.parent.removeChild(this);
} else {
- self.style = newStyle;
- self._styleRule.style = self.style;
+ this.style = newStyle;
+ this._styleRule.style = this.style;
}
if (section && section.pane)
section.pane.dispatchEventToListeners("style edited");
if (updateInterface)
- self.updateAll(true);
+ this.updateAll(true);
}
- WebInspector.cssModel.applyStyleText(this.style.id, styleText, this.name, successCallback, failureCallback);
+ this.property.setText(styleText, callback.bind(this));
}
}
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index 28dad23..11b0e03 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -31,11 +31,11 @@
WebInspector.WatchExpressionsSidebarPane = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Watch Expressions"));
- WebInspector.applicationSettings.addEventListener("loaded", this._settingsLoaded, this);
+ this.reset();
}
WebInspector.WatchExpressionsSidebarPane.prototype = {
- _settingsLoaded: function()
+ reset: function()
{
this.bodyElement.removeChildren();
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 1e5a508..481f8b3 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -158,6 +158,7 @@
<file>Images/excludeButtonGlyph.png</file>
<file>Images/focusButtonGlyph.png</file>
<file>Images/forward.png</file>
+ <file>Images/frame.png</file>
<file>Images/gearButtonGlyph.png</file>
<file>Images/glossyHeader.png</file>
<file>Images/glossyHeaderPressed.png</file>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 0662954..429e749 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -715,11 +715,6 @@ body.platform-linux .monospace, body.platform-linux .source-code {
content: url(Images/treeDownTriangleBlack.png);
}
-.console-message.repeated-message > ol.stack-trace {
- margin-top: -14px;
- margin-left: 18px;
-}
-
.console-group-messages .section .header .title {
color: black;
font-weight: normal;
@@ -903,6 +898,29 @@ body.platform-linux .monospace, body.platform-linux .source-code {
top: 20px;
}
+.resource-view .resource-view-cookies {
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ bottom: 0;
+ overflow: auto;
+ padding: 12px;
+}
+
+.resource-view.headers-visible .resource-view-cookies {
+ top: 20px;
+}
+
+.resource-view-cookies.table .data-grid {
+ height: 100%;
+}
+
+.resource-view-cookies .data-grid .row-group {
+ font-weight: bold;
+ font-size: 11px;
+}
+
.webkit-line-gutter-backdrop {
/* Keep this in sync with view-source.css (.webkit-line-gutter-backdrop) */
width: 31px;
@@ -1190,7 +1208,6 @@ body.platform-linux .monospace, body.platform-linux .source-code {
margin-left: -12px;
}
-.stack-trace li.parent::before,
.outline-disclosure li.parent::before {
content: url(Images/treeRightTriangleBlack.png);
float: left;
@@ -1200,32 +1217,26 @@ body.platform-linux .monospace, body.platform-linux .source-code {
padding-right: 2px;
}
-.stack-trace li.parent::before,
.outline-disclosure li.parent::before {
content: url(Images/treeRightTriangleBlack.png);
}
-.stack-trace ol:focus li.parent.selected::before,
.outline-disclosure ol:focus li.parent.selected::before {
content: url(Images/treeRightTriangleWhite.png);
}
-.stack-trace li.parent.expanded::before,
.outline-disclosure li.parent.expanded::before {
content: url(Images/treeDownTriangleBlack.png);
}
-.stack-trace ol:focus li.parent.expanded.selected::before,
.outline-disclosure ol:focus li.parent.expanded.selected::before {
content: url(Images/treeDownTriangleWhite.png);
}
-.stack-trace ol.children,
.outline-disclosure ol.children {
display: none;
}
-.stack-trace ol.children.expanded,
.outline-disclosure ol.children.expanded {
display: block;
}
@@ -1430,21 +1441,17 @@ body.inactive .placard.selected {
padding-bottom: 3px;
}
-.properties-tree ol, .stack-trace ol, ol.stack-trace {
+.properties-tree ol {
display: none;
margin: 0;
-webkit-padding-start: 12px;
list-style: none;
}
-.properties-tree ol.expanded, .stack-trace ol, ol.stack-trace {
+.properties-tree ol.expanded {
display: block;
}
-ol.stack-trace {
- -webkit-padding-start: 0px;
-}
-
.event-listener-breakpoints .event-category {
font-size: 12px;
font-weight: bold;
@@ -1897,27 +1904,31 @@ body.inactive .sidebar {
background-color: rgb(232, 232, 232);
}
-.database-sidebar-tree-item .icon {
+.frame-storage-tree-item .icon {
+ content: url(Images/frame.png);
+}
+
+.database-storage-tree-item .icon {
content: url(Images/database.png);
}
-.database-table-sidebar-tree-item .icon {
+.database-table-storage-tree-item .icon {
content: url(Images/databaseTable.png);
}
-.domstorage-sidebar-tree-item.local-storage .icon {
+.domstorage-storage-tree-item.local-storage .icon {
content: url(Images/localStorage.png);
}
-.domstorage-sidebar-tree-item.session-storage .icon {
+.domstorage-storage-tree-item.session-storage .icon {
content: url(Images/sessionStorage.png);
}
-.cookie-sidebar-tree-item .icon {
+.cookie-storage-tree-item .icon {
content: url(Images/cookie.png);
}
-.application-cache-sidebar-tree-item .icon {
+.application-cache-storage-tree-item .icon {
content: url(Images/applicationCache.png);
}
@@ -1929,6 +1940,72 @@ body.inactive .sidebar {
bottom: 0;
}
+.storage.panel .sidebar {
+ padding-left: 0;
+ z-index: 10;
+}
+
+.storage.panel .sidebar li {
+ height: 17px;
+ white-space: nowrap;
+ text-indent: 0;
+ margin-left: -2px;
+}
+
+.storage.panel .sidebar li.parent {
+ text-indent: 0;
+ margin-left: -12px;
+}
+
+.storage.panel .sidebar li.selected {
+ color: white;
+ text-shadow: rgba(0, 0, 0, 0.33) 0 1px 0;
+ font-weight: bold;
+}
+
+.storage.panel .sidebar li .selection {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(162, 177, 207)), to(rgb(120, 138, 177)));
+ border-top: 1px solid #979797;
+ height: 17px;
+}
+
+.storage.panel .sidebar :focus li .selection {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(92, 147, 213)), to(rgb(21, 83, 170)));
+ border-top: 1px solid rgb(68, 128, 200);
+}
+
+body.inactive .storage.panel .sidebar li .selection {
+ background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(180, 180, 180)), to(rgb(138, 138, 138)));
+ border-top: 1px solid rgb(151, 151, 151);
+}
+
+.storage.panel .sidebar .icon {
+ width: 16px;
+ height: 16px;
+ float: left;
+}
+
+.storage.panel .base-storage-tree-element-title {
+ overflow: hidden;
+ position: relative;
+ text-overflow: ellipsis;
+ padding-left: 2px;
+ top: 1px;
+}
+
+.storage.panel .status {
+ float: right;
+ height: 16px;
+ margin-top: 1px;
+ margin-left: 4px;
+ line-height: 1em;
+}
+
+.storage.panel li .status .bubble {
+ height: 13px;
+ padding-top: 0;
+}
+
.storage-view {
display: none;
overflow: hidden;
@@ -1952,7 +2029,7 @@ body.inactive .sidebar {
height: 100%;
}
-.storage-view.table .storage-table-empty, .storage-view.table .storage-table-error {
+.storage-empty-view, .storage-view.table .storage-table-error {
position: absolute;
top: 0;
bottom: 25%;
@@ -3167,7 +3244,7 @@ body.inactive .sidebar-tree-item .disclosure-button:active {
margin-right: 3px;
}
-.sidebar-tree-item .status {
+li .status {
float: right;
height: 16px;
margin-top: 9px;
@@ -3175,11 +3252,11 @@ body.inactive .sidebar-tree-item .disclosure-button:active {
line-height: 1em;
}
-.sidebar-tree-item .status:empty {
+li .status:empty {
display: none;
}
-.sidebar-tree-item .status .bubble {
+li .status .bubble {
display: inline-block;
height: 14px;
min-width: 16px;
@@ -3198,20 +3275,20 @@ body.inactive .sidebar-tree-item .disclosure-button:active {
-webkit-border-radius: 7px;
}
-.sidebar-tree-item .status .bubble:empty {
+li .status .bubble:empty {
display: none;
}
-.sidebar-tree-item.selected .status .bubble {
+li.selected .status .bubble {
background-color: white !important;
color: rgb(132, 154, 190) !important;
}
-:focus .sidebar-tree-item.selected .status .bubble {
+:focus li.selected .status .bubble {
color: rgb(36, 98, 172) !important;
}
-body.inactive .sidebar-tree-item.selected .status .bubble {
+body.inactive li.selected .status .bubble {
color: rgb(159, 159, 159) !important;
}
@@ -3362,7 +3439,7 @@ body.inactive .sidebar-tree-item.selected {
content: "";
}
-.resource-sidebar-tree-item.resources-category-images .image-resource-icon-preview {
+.resources-category-images .image-resource-icon-preview {
position: absolute;
margin: auto;
top: 3px;
@@ -3380,7 +3457,7 @@ body.inactive .sidebar-tree-item.selected {
content: "";
}
-.children.small .resource-sidebar-tree-item.resources-category-images .image-resource-icon-preview {
+.children.small .resources-category-images .image-resource-icon-preview {
top: 2px;
bottom: 1px;
left: 3px;
@@ -3432,15 +3509,15 @@ body.inactive .sidebar-tree-item.selected {
padding-left: 13px !important;
}
-.sidebar-tree-item.selected .bubble.search-matches {
+li.selected .bubble.search-matches {
background-image: url(Images/searchSmallBlue.png);
}
-:focus .sidebar-tree-item.selected .bubble.search-matches {
+:focus li.selected .bubble.search-matches {
background-image: url(Images/searchSmallBrightBlue.png);
}
-body.inactive .sidebar-tree-item.selected .bubble.search-matches {
+body.inactive li.selected .bubble.search-matches {
background-image: url(Images/searchSmallGray.png);
}
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 9bd88d6..f5a70c8 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -50,7 +50,6 @@
var WebInspector = {
resources: {},
- resourceURLMap: {},
cookieDomains: {},
applicationCacheDomains: {},
missingLocalizedStrings: {},
@@ -182,7 +181,7 @@ var WebInspector = {
for (var panelName in WebInspector.panels) {
if (WebInspector.panels[panelName] === x) {
- InspectorBackend.storeLastActivePanel(panelName);
+ WebInspector.applicationSettings.lastActivePanel = panelName;
this._panelHistory.setPanel(panelName);
}
}
@@ -226,10 +225,17 @@ var WebInspector = {
var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
if (hiddenPanels.indexOf("elements") === -1)
this.panels.elements = new WebInspector.ElementsPanel();
+
+ if (Preferences.networkPanelEnabled) {
+ if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
+ this.panels.storage = new WebInspector.StoragePanel();
+ if (hiddenPanels.indexOf("network") === -1)
+ this.panels.network = new WebInspector.NetworkPanel();
+ } else if (hiddenPanels.indexOf("resources") === -1)
+ this.panels.resources = new WebInspector.ResourcesPanel();
+
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)
this.panels.scripts = new WebInspector.ScriptsPanel();
if (hiddenPanels.indexOf("timeline") === -1)
@@ -240,8 +246,12 @@ var WebInspector = {
if (Preferences.heapProfilerPresent)
this.panels.profiles.registerProfileType(new WebInspector.HeapSnapshotProfileType());
}
- if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
- this.panels.storage = new WebInspector.StoragePanel();
+
+ if (!Preferences.networkPanelEnabled) {
+ if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1)
+ this.panels.storage = new WebInspector.StoragePanel();
+ }
+
if (hiddenPanels.indexOf("audits") === -1)
this.panels.audits = new WebInspector.AuditsPanel();
if (hiddenPanels.indexOf("console") === -1)
@@ -441,6 +451,33 @@ var WebInspector = {
{
this.currentPanel = this.panels.elements;
this.panels.elements.updateFocusedNode(nodeId);
+ },
+
+ get networkResources()
+ {
+ if (Preferences.networkPanelEnabled)
+ return this.panels.network.resources;
+ else
+ return this.resources;
+ },
+
+ forAllResources: function(callback)
+ {
+ if (Preferences.networkPanelEnabled)
+ WebInspector.resourceManager.forAllResources(callback);
+ else {
+ for (var id in this.resources) {
+ if (callback(this.resources[id]))
+ return;
+ }
+ }
+ },
+
+ resourceForURL: function(url)
+ {
+ if (Preferences.networkPanelEnabled)
+ return this.resourceManager.resourceForURL(url);
+ return this.panels.resources.resourceURLMap[url];
}
}
@@ -493,8 +530,8 @@ WebInspector.doLoadedDone = function()
document.body.addStyleClass("port-" + port);
InspectorFrontendHost.loaded();
- WebInspector.Settings.initialize();
-
+ WebInspector.applicationSettings = new WebInspector.Settings();
+
this._registerShortcuts();
// set order of some sections explicitly
@@ -507,8 +544,8 @@ WebInspector.doLoadedDone = function()
// this.changes = new WebInspector.ChangesView(this.drawer);
// TODO: Remove class="hidden" from inspector.html on button#changes-status-bar-item
this.drawer.visibleView = this.console;
- // FIXME: uncomment when ready.
- // this.resourceManager = new WebInspector.ResourceManager();
+ if (Preferences.networkPanelEnabled)
+ this.resourceManager = new WebInspector.ResourceManager();
this.domAgent = new WebInspector.DOMAgent();
this.resourceCategories = {
@@ -536,6 +573,11 @@ WebInspector.doLoadedDone = function()
for (var panelName in this.panels)
previousToolbarItem = WebInspector.addPanelToolbarIcon(toolbarElement, this.panels[panelName], previousToolbarItem);
+ if (Preferences.networkPanelEnabled) {
+ this.panels.storage._toolbarItem.removeStyleClass("storage");
+ this.panels.storage._toolbarItem.addStyleClass("resources");
+ }
+
this.Tips = {
ResourceNotCompressed: {id: 0, message: WebInspector.UIString("You could save bandwidth by having your web server compress this transfer with gzip or zlib.")}
};
@@ -588,14 +630,22 @@ WebInspector.doLoadedDone = function()
WebInspector.monitoringXHREnabled = inspectorState.monitoringXHREnabled;
if ("pauseOnExceptionsState" in inspectorState)
WebInspector.panels.scripts.updatePauseOnExceptionsState(inspectorState.pauseOnExceptionsState);
- if (inspectorState.resourceTrackingEnabled)
- WebInspector.panels.resources.resourceTrackingWasEnabled();
- else
- WebInspector.panels.resources.resourceTrackingWasDisabled();
+ if (WebInspector.panels.resources) {
+ if (inspectorState.resourceTrackingEnabled)
+ WebInspector.panels.resources.resourceTrackingWasEnabled();
+ else
+ WebInspector.panels.resources.resourceTrackingWasDisabled();
+ }
}
InspectorBackend.getInspectorState(populateInspectorState);
- InspectorBackend.populateScriptObjects();
+ function onPopulateScriptObjects()
+ {
+ if (!WebInspector.currentPanel)
+ WebInspector.showPanel(WebInspector.applicationSettings.lastActivePanel);
+ }
+ InspectorBackend.populateScriptObjects(onPopulateScriptObjects);
+
InspectorBackend.setConsoleMessagesEnabled(true);
// As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
@@ -768,7 +818,7 @@ WebInspector.documentClick = function(event)
if (parsedURL.host === "show-panel") {
var panel = parsedURL.path.substring(1);
if (WebInspector.panels[panel])
- WebInspector.currentPanel = WebInspector.panels[panel];
+ WebInspector.showPanel(panel);
}
return;
}
@@ -794,8 +844,13 @@ WebInspector.openResource = function(resourceURL, inResourcesPanel)
{
var resource = WebInspector.resourceForURL(resourceURL);
if (inResourcesPanel && resource) {
- WebInspector.panels.resources.showResource(resource);
- WebInspector.showPanel("resources");
+ if (Preferences.networkPanelEnabled) {
+ WebInspector.panels.storage.showResource(resource);
+ WebInspector.showPanel("storage");
+ } else {
+ WebInspector.panels.resources.showResource(resource);
+ WebInspector.showPanel("resources");
+ }
} else
InspectorBackend.openInInspectedWindow(resource ? resource.url : resourceURL);
}
@@ -1214,12 +1269,14 @@ WebInspector.selectDOMStorage = function(o)
WebInspector.updateResource = function(payload)
{
+ if (Preferences.networkPanelEnabled)
+ return;
+
var identifier = payload.id;
var resource = this.resources[identifier];
if (!resource) {
resource = new WebInspector.Resource(identifier, payload.url);
this.resources[identifier] = resource;
- this.resourceURLMap[resource.url] = resource;
this.panels.resources.addResource(resource);
this.panels.audits.resourceStarted(resource);
}
@@ -1267,6 +1324,7 @@ WebInspector.updateResource = function(payload)
if (payload.didCompletionChange) {
resource.failed = payload.failed;
+ resource.localizedFailDescription = payload.localizedFailDescription;
resource.finished = payload.finished;
if (this.panels.audits)
this.panels.audits.resourceFinished(resource);
@@ -1286,28 +1344,33 @@ WebInspector.updateResource = function(payload)
WebInspector.domContentEventFired = function(time)
{
- this.panels.resources.mainResourceDOMContentTime = time;
+ if (this.panels.resources)
+ this.panels.resources.mainResourceDOMContentTime = time;
this.panels.audits.mainResourceDOMContentTime = time;
if (this.panels.network)
this.panels.network.mainResourceDOMContentTime = time;
+ this.mainResourceDOMContentTime = time;
}
WebInspector.loadEventFired = function(time)
{
- this.panels.resources.mainResourceLoadTime = time;
+ if (this.panels.resources)
+ this.panels.resources.mainResourceLoadTime = time;
this.panels.audits.mainResourceLoadTime = time;
if (this.panels.network)
this.panels.network.mainResourceLoadTime = time;
+ this.mainResourceLoadTime = time;
}
WebInspector.removeResource = function(identifier)
{
+ if (Preferences.networkPanelEnabled)
+ return;
+
var resource = this.resources[identifier];
if (!resource)
return;
- resource.category.removeResource(resource);
- delete this.resourceURLMap[resource.url];
delete this.resources[identifier];
if (this.panels.resources)
@@ -1449,18 +1512,13 @@ WebInspector.reset = function()
panel.reset();
}
- this.sessionSettings.reset();
-
- for (var category in this.resourceCategories)
- this.resourceCategories[category].removeAllResources();
-
this.resources = {};
- this.resourceURLMap = {};
this.cookieDomains = {};
this.applicationCacheDomains = {};
this.highlightDOMNode(0);
- delete this.mainResource;
+ if (!Preferences.networkPanelEnabled)
+ delete this.mainResource;
this.console.clearMessages();
this.extensionServer.notifyInspectorReset();
@@ -1669,7 +1727,8 @@ WebInspector.displayNameForURL = function(url)
{
if (!url)
return "";
- var resource = this.resourceURLMap[url];
+
+ var resource = this.resourceForURL(url);
if (resource)
return resource.displayName;
@@ -1687,28 +1746,16 @@ WebInspector.displayNameForURL = function(url)
return url.trimURL(WebInspector.mainResource.domain);
}
-WebInspector.resourceForURL = function(url)
-{
- if (url in this.resourceURLMap)
- return this.resourceURLMap[url];
-
- // No direct match found. Search for resources that contain
- // a substring of the URL.
- for (var resourceURL in this.resourceURLMap) {
- if (resourceURL.hasSubstring(url))
- return this.resourceURLMap[resourceURL];
- }
-
- return null;
-}
-
WebInspector._choosePanelToShowSourceLine = function(url, line, preferredPanel)
{
preferredPanel = preferredPanel || "resources";
+ if (Preferences.networkPanelEnabled && preferredPanel === "resources")
+ preferredPanel = "storage";
+
var panel = this.panels[preferredPanel];
if (panel && panel.canShowSourceLine(url, line))
return panel;
- panel = this.panels.resources;
+ panel = Preferences.networkPanelEnabled ? this.panels.storage : this.panels.resources;
return panel.canShowSourceLine(url, line) ? panel : null;
}
@@ -1747,7 +1794,8 @@ WebInspector.linkifyStringAsFragment = function(string)
title = WebInspector.panels.profiles.displayTitleForProfileLink(profileStringMatches[2], profileStringMatches[1]);
var realURL = (linkString.indexOf("www.") === 0 ? "http://" + linkString : linkString);
- container.appendChild(WebInspector.linkifyURLAsNode(realURL, title, null, (realURL in WebInspector.resourceURLMap)));
+ var hasResourceWithURL = !!WebInspector.resourceForURL(realURL);
+ container.appendChild(WebInspector.linkifyURLAsNode(realURL, title, null, hasResourceWithURL));
string = string.substring(linkIndex + linkString.length, string.length);
}
@@ -1815,13 +1863,17 @@ WebInspector.resourceURLForRelatedNode = function(node, url)
}
// documentURL not found or has bad value
- for (var resourceURL in WebInspector.resourceURLMap) {
- var parsedURL = resourceURL.asParsedURL();
- if (parsedURL && parsedURL.path === url)
- return resourceURL;
+ var resourceURL = url;
+ function callback(resource)
+ {
+ if (resource.path === url) {
+ resourceURL = resource.url;
+ return true;
+ }
}
- return url;
-},
+ WebInspector.forAllResources(callback);
+ return resourceURL;
+}
WebInspector.completeURL = function(baseURL, href)
{
@@ -1918,9 +1970,10 @@ WebInspector.doPerformSearch = function(query, forceSearch, isBackwardSearch, re
for (var panelName in this.panels) {
var panel = this.panels[panelName];
- if (panel.currentQuery && panel.searchCanceled)
- panel.searchCanceled();
+ var hadCurrentQuery = !!panel.currentQuery;
delete panel.currentQuery;
+ if (hadCurrentQuery && panel.searchCanceled)
+ panel.searchCanceled();
}
this.updateSearchMatchesCount();
diff --git a/WebCore/inspector/front-end/networkPanel.css b/WebCore/inspector/front-end/networkPanel.css
index 773fe99..215681f 100644
--- a/WebCore/inspector/front-end/networkPanel.css
+++ b/WebCore/inspector/front-end/networkPanel.css
@@ -24,11 +24,16 @@
.network.panel .data-grid td {
line-height: 17px;
+ height: 37px;
border-right: 1px solid rgb(210, 210, 210);
-webkit-user-select: none;
vertical-align: middle;
}
+.network.panel .data-grid.small td {
+ height: 17px;
+}
+
.network.panel .data-grid th {
border-bottom: 1px solid rgb(64%, 64%, 64%);
height: 30px;
@@ -414,6 +419,10 @@
background-color: rgba(0, 0, 255, 0.5);
}
+.network.panel .resources-dividers {
+ z-index: 0;
+}
+
.network.panel .resources-dividers-label-bar {
background-color: transparent;
border: none;
@@ -535,6 +544,19 @@
left: 0;
}
+.network-close-button {
+ position: absolute;
+ width: 14px;
+ height: 14px;
+ background-image: url(Images/closeButtons.png);
+ background-position: 0 0;
+ background-color: transparent;
+ border: 0 none transparent;
+ top: 4px;
+ right: 5px;
+ z-index: 10;
+}
+
.network.panel .data-grid.full-grid-mode .viewer-column {
display: none;
}
@@ -582,7 +604,19 @@
padding-top: 5px;
}
-.network.panel .resource-view.headers-visible .resource-view-content {
+#network-views .resource-view.headers-visible .resource-view-content {
+ top: 31px;
+}
+
+#network-views.small .resource-view.headers-visible .resource-view-content {
+ top: 23px;
+}
+
+#network-views .resource-view-headers {
+ top: 31px;
+}
+
+#network-views.small .resource-view-headers {
top: 23px;
}
@@ -591,7 +625,12 @@
color: black;
}
-.network.panel .resource-view .tabbed-pane-header {
+#network-views .resource-view .tabbed-pane-header {
+ height: 31px;
+ padding-top: 11px;
+}
+
+#network-views.small .resource-view .tabbed-pane-header {
height: 23px;
padding-top: 3px;
}
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 6ef65c0..7dc8a32 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -754,16 +754,16 @@ void Cache::setDisabled(bool disabled)
void Cache::dumpStats()
{
Statistics s = getStatistics();
- printf("%-11s %-11s %-11s %-11s %-11s %-11s %-11s\n", "", "Count", "Size", "LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize");
- printf("%-11s %-11s %-11s %-11s %-11s %-11s %-11s\n", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------");
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "Images", s.images.count, s.images.size, s.images.liveSize, s.images.decodedSize, s.images.purgeableSize, s.images.purgedSize);
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "CSS", s.cssStyleSheets.count, s.cssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSize, s.cssStyleSheets.purgeableSize, s.cssStyleSheets.purgedSize);
+ printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize");
+ printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------");
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Images", s.images.count, s.images.size, s.images.liveSize, s.images.decodedSize, s.images.purgeableSize, s.images.purgedSize);
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "CSS", s.cssStyleSheets.count, s.cssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSize, s.cssStyleSheets.purgeableSize, s.cssStyleSheets.purgedSize);
#if ENABLE(XSLT)
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "XSL", s.xslStyleSheets.count, s.xslStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSize, s.xslStyleSheets.purgeableSize, s.xslStyleSheets.purgedSize);
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "XSL", s.xslStyleSheets.count, s.xslStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSize, s.xslStyleSheets.purgeableSize, s.xslStyleSheets.purgedSize);
#endif
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "JavaScript", s.scripts.count, s.scripts.size, s.scripts.liveSize, s.scripts.decodedSize, s.scripts.purgeableSize, s.scripts.purgedSize);
- printf("%-11s %11d %11d %11d %11d %11d %11d\n", "Fonts", s.fonts.count, s.fonts.size, s.fonts.liveSize, s.fonts.decodedSize, s.fonts.purgeableSize, s.fonts.purgedSize);
- printf("%-11s %-11s %-11s %-11s %-11s %-11s %-11s\n\n", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------", "-----------");
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "JavaScript", s.scripts.count, s.scripts.size, s.scripts.liveSize, s.scripts.decodedSize, s.scripts.purgeableSize, s.scripts.purgedSize);
+ printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Fonts", s.fonts.count, s.fonts.size, s.fonts.liveSize, s.fonts.decodedSize, s.fonts.purgeableSize, s.fonts.purgedSize);
+ printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n\n", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------", "-------------");
}
void Cache::dumpLRULists(bool includeLive) const
diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp
index ef88af8..e8db6c6 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) || OS(FREEBSD))) || 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) || PLATFORM(BREWMP)
#define STORE_FONT_CUSTOM_PLATFORM_DATA
#endif
@@ -117,7 +117,7 @@ bool CachedFont::ensureCustomFontData()
return m_fontData;
}
-FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontRenderingMode renderingMode)
+FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode renderingMode)
{
#if ENABLE(SVG_FONTS)
if (m_externalSVGDocument)
@@ -125,7 +125,7 @@ FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, b
#endif
#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
ASSERT(m_fontData);
- return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, renderingMode);
+ return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, renderingMode);
#else
return FontPlatformData();
#endif
diff --git a/WebCore/loader/CachedFont.h b/WebCore/loader/CachedFont.h
index 95c2423..8dc8874 100644
--- a/WebCore/loader/CachedFont.h
+++ b/WebCore/loader/CachedFont.h
@@ -27,6 +27,7 @@
#define CachedFont_h
#include "CachedResource.h"
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Vector.h>
@@ -62,7 +63,7 @@ public:
void beginLoadIfNeeded(CachedResourceLoader* dl);
bool ensureCustomFontData();
- FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
#if ENABLE(SVG_FONTS)
bool isSVGFont() const { return m_isSVGFont; }
diff --git a/WebCore/loader/CachedImage.cpp b/WebCore/loader/CachedImage.cpp
index 641ce94..30eaf9d 100644
--- a/WebCore/loader/CachedImage.cpp
+++ b/WebCore/loader/CachedImage.cpp
@@ -241,7 +241,7 @@ inline void CachedImage::createImage()
// Create the image if it doesn't yet exist.
if (m_image)
return;
-#if PLATFORM(CG)
+#if PLATFORM(CG) && !USE(WEBKIT_IMAGE_DECODERS)
if (m_response.mimeType() == "application/pdf") {
m_image = PDFDocumentImage::create();
return;
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index 2c113c3..5707530 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -799,6 +799,27 @@ void DocumentLoader::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* loa
frame->loader()->checkLoadComplete();
}
+void DocumentLoader::transferLoadingResourcesFromPage(Page* oldPage)
+{
+ ASSERT(oldPage != m_frame->page());
+
+ FrameLoaderClient* frameLoaderClient = frameLoader()->client();
+ const ResourceRequest& request = originalRequest();
+ if (isLoadingMainResource()) {
+ frameLoaderClient->transferLoadingResourceFromPage(
+ m_mainResourceLoader->identifier(), this, request, oldPage);
+ }
+
+ if (isLoadingSubresources()) {
+ ResourceLoaderSet::const_iterator it = m_subresourceLoaders.begin();
+ ResourceLoaderSet::const_iterator end = m_subresourceLoaders.end();
+ for (; it != end; ++it) {
+ frameLoaderClient->transferLoadingResourceFromPage(
+ (*it)->identifier(), this, request, oldPage);
+ }
+ }
+}
+
void DocumentLoader::iconLoadDecisionAvailable()
{
if (m_frame)
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index ebb6525..2328160 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -48,6 +48,7 @@ namespace WebCore {
class Frame;
class FrameLoader;
class MainResourceLoader;
+ class Page;
class ResourceLoader;
class SchedulePair;
class SharedBuffer;
@@ -199,7 +200,9 @@ namespace WebCore {
void removePlugInStreamLoader(ResourceLoader*);
void subresourceLoaderFinishedLoadingOnePart(ResourceLoader*);
-
+
+ void transferLoadingResourcesFromPage(Page*);
+
void setDeferMainResourceDataLoad(bool defer) { m_deferMainResourceDataLoad = defer; }
bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; }
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h
index 6fb003e..59be8b1 100644
--- a/WebCore/loader/EmptyClients.h
+++ b/WebCore/loader/EmptyClients.h
@@ -107,7 +107,7 @@ public:
virtual void focusedNodeChanged(Node*) { }
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) { return 0; }
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) { return 0; }
virtual void show() { }
virtual bool canRunModal() { return false; }
@@ -263,7 +263,7 @@ public:
virtual void dispatchDidFirstLayout() { }
virtual void dispatchDidFirstVisuallyNonEmptyLayout() { }
- virtual Frame* dispatchCreatePage() { return 0; }
+ virtual Frame* dispatchCreatePage(const NavigationAction&) { return 0; }
virtual void dispatchShow() { }
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String&, const ResourceRequest&) { }
@@ -329,6 +329,8 @@ public:
virtual void transitionToCommittedFromCachedFrame(CachedFrame*) { }
virtual void transitionToCommittedForNewPage() { }
+ virtual void dispatchDidBecomeFrameset(bool) { }
+
virtual void updateGlobalHistory() { }
virtual void updateGlobalHistoryRedirectLinks() { }
virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; }
@@ -341,6 +343,7 @@ public:
virtual void didRunInsecureContent(SecurityOrigin*) { }
virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) { return 0; }
virtual void didTransferChildFrameToNewDocument(Page*) { }
+ virtual void transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, 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)
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 03b6ab1..8a2adee 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1453,6 +1453,9 @@ void FrameLoader::load(DocumentLoader* newDocumentLoader)
void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> prpFormState)
{
+ // Retain because dispatchBeforeLoadEvent may release the last reference to it.
+ RefPtr<Frame> protect(m_frame);
+
ASSERT(m_client->hasWebView());
// Unfortunately the view must be non-nil, this is ultimately due
@@ -1761,6 +1764,13 @@ bool FrameLoader::frameHasLoaded() const
return m_stateMachine.committedFirstRealDocumentLoad() || (m_provisionalDocumentLoader && !m_stateMachine.creatingInitialEmptyDocument());
}
+void FrameLoader::transferLoadingResourcesFromPage(Page* oldPage)
+{
+ ASSERT(oldPage != m_frame->page());
+ if (isLoading())
+ activeDocumentLoader()->transferLoadingResourcesFromPage(oldPage);
+}
+
void FrameLoader::setDocumentLoader(DocumentLoader* loader)
{
if (!loader && !m_documentLoader)
@@ -2994,20 +3004,20 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
}
void FrameLoader::callContinueLoadAfterNewWindowPolicy(void* argument,
- const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, bool shouldContinue)
+ const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue)
{
FrameLoader* loader = static_cast<FrameLoader*>(argument);
- loader->continueLoadAfterNewWindowPolicy(request, formState, frameName, shouldContinue);
+ loader->continueLoadAfterNewWindowPolicy(request, formState, frameName, action, shouldContinue);
}
void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& request,
- PassRefPtr<FormState> formState, const String& frameName, bool shouldContinue)
+ PassRefPtr<FormState> formState, const String& frameName, const NavigationAction& action, bool shouldContinue)
{
if (!shouldContinue)
return;
RefPtr<Frame> frame = m_frame;
- RefPtr<Frame> mainFrame = m_client->dispatchCreatePage();
+ RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(action);
if (!mainFrame)
return;
@@ -3134,7 +3144,7 @@ void FrameLoader::checkDidPerformFirstNavigation()
if (!page)
return;
- if (!m_didPerformFirstNavigation && page->backForwardList()->entries().size() == 1) {
+ if (!m_didPerformFirstNavigation && page->backForwardList()->currentItem() && !page->backForwardList()->backItem() && !page->backForwardList()->forwardItem()) {
m_didPerformFirstNavigation = true;
m_client->didPerformFirstNavigation();
}
@@ -3506,7 +3516,8 @@ Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadReque
if (!oldPage)
return 0;
- Page* page = oldPage->chrome()->createWindow(openerFrame, requestWithReferrer, features);
+ NavigationAction action;
+ Page* page = oldPage->chrome()->createWindow(openerFrame, requestWithReferrer, features, action);
if (!page)
return 0;
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 63730bf..b07ed27 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -70,6 +70,7 @@ class HTMLFormElement;
class IconLoader;
class NavigationAction;
class NetworkingContext;
+class Page;
class ProtectionSpace;
class ResourceError;
class ResourceLoader;
@@ -136,6 +137,7 @@ public:
bool isLoadingMainResource() const { return m_isLoadingMainResource; }
bool isLoading() const;
bool frameHasLoaded() const;
+ void transferLoadingResourcesFromPage(Page*);
int numPendingOrLoadingRequests(bool recurse) const;
String referrer() const;
@@ -368,11 +370,11 @@ private:
void setLoadType(FrameLoadType);
static void callContinueLoadAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
- static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue);
+ static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
static void callContinueFragmentScrollAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
void continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
- void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue);
+ void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue);
bool shouldScrollToAnchor(bool isFormSubmission, FrameLoadType, const KURL&);
diff --git a/WebCore/loader/FrameLoaderClient.h b/WebCore/loader/FrameLoaderClient.h
index 1855d5a..7348293 100644
--- a/WebCore/loader/FrameLoaderClient.h
+++ b/WebCore/loader/FrameLoaderClient.h
@@ -140,7 +140,7 @@ namespace WebCore {
virtual void dispatchDidFirstLayout() = 0;
virtual void dispatchDidFirstVisuallyNonEmptyLayout() = 0;
- virtual Frame* dispatchCreatePage() = 0;
+ virtual Frame* dispatchCreatePage(const NavigationAction&) = 0;
virtual void dispatchShow() = 0;
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String& MIMEType, const ResourceRequest&) = 0;
@@ -224,12 +224,15 @@ namespace WebCore {
virtual void transitionToCommittedFromCachedFrame(CachedFrame*) = 0;
virtual void transitionToCommittedForNewPage() = 0;
+ virtual void dispatchDidBecomeFrameset(bool) = 0; // Can change due to navigation or DOM modification.
+
virtual bool canCachePage() const = 0;
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) = 0;
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(Page* oldPage) = 0;
+ virtual void transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader*, const ResourceRequest&, 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;
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index af30a11..7e5eb90 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -202,9 +202,8 @@ void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const Reso
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
if (!redirectResponse.isNull()) {
// We checked application cache for initial URL, now we need to check it for redirected one.
- ASSERT(documentLoader()->applicationCacheHost()->status() == ApplicationCacheHost::UNCACHED);
ASSERT(!m_substituteData.isValid());
- documentLoader()->applicationCacheHost()->maybeLoadMainResource(newRequest, m_substituteData);
+ documentLoader()->applicationCacheHost()->maybeLoadMainResourceForRedirect(newRequest, m_substituteData);
}
#endif
diff --git a/WebCore/loader/PolicyCallback.cpp b/WebCore/loader/PolicyCallback.cpp
index 14799cf..4ec2c84 100644
--- a/WebCore/loader/PolicyCallback.cpp
+++ b/WebCore/loader/PolicyCallback.cpp
@@ -71,11 +71,12 @@ void PolicyCallback::set(const ResourceRequest& request, PassRefPtr<FormState> f
}
void PolicyCallback::set(const ResourceRequest& request, PassRefPtr<FormState> formState,
- const String& frameName, NewWindowPolicyDecisionFunction function, void* argument)
+ const String& frameName, const NavigationAction& navigationAction, NewWindowPolicyDecisionFunction function, void* argument)
{
m_request = request;
m_formState = formState;
m_frameName = frameName;
+ m_navigationAction = navigationAction;
m_navigationFunction = 0;
m_newWindowFunction = function;
@@ -100,7 +101,7 @@ void PolicyCallback::call(bool shouldContinue)
if (m_navigationFunction)
m_navigationFunction(m_argument, m_request, m_formState.get(), shouldContinue);
if (m_newWindowFunction)
- m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, shouldContinue);
+ m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, m_navigationAction, shouldContinue);
ASSERT(!m_contentFunction);
}
@@ -125,7 +126,7 @@ void PolicyCallback::cancel()
if (m_navigationFunction)
m_navigationFunction(m_argument, m_request, m_formState.get(), false);
if (m_newWindowFunction)
- m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, false);
+ m_newWindowFunction(m_argument, m_request, m_formState.get(), m_frameName, m_navigationAction, false);
if (m_contentFunction)
m_contentFunction(m_argument, PolicyIgnore);
}
diff --git a/WebCore/loader/PolicyCallback.h b/WebCore/loader/PolicyCallback.h
index 757fff8..415a3e3 100644
--- a/WebCore/loader/PolicyCallback.h
+++ b/WebCore/loader/PolicyCallback.h
@@ -31,9 +31,10 @@
#define PolicyCallback_h
#include "FrameLoaderTypes.h"
-#include "PlatformString.h"
+#include "NavigationAction.h"
#include "ResourceRequest.h"
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -42,7 +43,7 @@ class FormState;
typedef void (*NavigationPolicyDecisionFunction)(void* argument,
const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue);
typedef void (*NewWindowPolicyDecisionFunction)(void* argument,
- const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue);
+ const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&, bool shouldContinue);
typedef void (*ContentPolicyDecisionFunction)(void* argument, PolicyAction);
class PolicyCallback {
@@ -53,7 +54,7 @@ public:
void clear();
void set(const ResourceRequest&, PassRefPtr<FormState>,
NavigationPolicyDecisionFunction, void* argument);
- void set(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName,
+ void set(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, const NavigationAction&,
NewWindowPolicyDecisionFunction, void* argument);
void set(ContentPolicyDecisionFunction, void* argument);
@@ -68,6 +69,7 @@ private:
ResourceRequest m_request;
RefPtr<FormState> m_formState;
String m_frameName;
+ NavigationAction m_navigationAction;
NavigationPolicyDecisionFunction m_navigationFunction;
NewWindowPolicyDecisionFunction m_newWindowFunction;
diff --git a/WebCore/loader/PolicyChecker.cpp b/WebCore/loader/PolicyChecker.cpp
index 196ab4f..2680386 100644
--- a/WebCore/loader/PolicyChecker.cpp
+++ b/WebCore/loader/PolicyChecker.cpp
@@ -92,7 +92,7 @@ void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, Docume
void PolicyChecker::checkNewWindowPolicy(const NavigationAction& action, NewWindowPolicyDecisionFunction function,
const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, void* argument)
{
- m_callback.set(request, formState, frameName, function, argument);
+ m_callback.set(request, formState, frameName, action, function, argument);
m_frame->loader()->client()->dispatchDecidePolicyForNewWindowAction(&PolicyChecker::continueAfterNewWindowPolicy,
action, request, formState, frameName);
}
diff --git a/WebCore/loader/ThreadableLoaderClient.h b/WebCore/loader/ThreadableLoaderClient.h
index b8a6584..bcf68be 100644
--- a/WebCore/loader/ThreadableLoaderClient.h
+++ b/WebCore/loader/ThreadableLoaderClient.h
@@ -31,6 +31,8 @@
#ifndef ThreadableLoaderClient_h
#define ThreadableLoaderClient_h
+#include <wtf/Noncopyable.h>
+
namespace WebCore {
class ResourceError;
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.cpp b/WebCore/loader/appcache/ApplicationCacheHost.cpp
index f613729..d5707cf 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheHost.cpp
@@ -91,6 +91,12 @@ void ApplicationCacheHost::maybeLoadMainResource(ResourceRequest& request, Subst
}
}
+void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest& request, SubstituteData& substituteData)
+{
+ ASSERT(status() == UNCACHED);
+ maybeLoadMainResource(request, substituteData);
+}
+
bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest& request, const ResourceResponse& r)
{
if (r.httpStatusCode() / 100 == 4 || r.httpStatusCode() / 100 == 5) {
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.h b/WebCore/loader/appcache/ApplicationCacheHost.h
index 667205d..8ac5357 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.h
+++ b/WebCore/loader/appcache/ApplicationCacheHost.h
@@ -122,6 +122,7 @@ namespace WebCore {
void selectCacheWithManifest(const KURL& manifestURL);
void maybeLoadMainResource(ResourceRequest&, SubstituteData&);
+ void maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&);
bool maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse&);
bool maybeLoadFallbackForMainError(const ResourceRequest&, const ResourceError&);
void mainResourceDataReceived(const char* data, int length, long long lengthReceived, bool allAtOnce);
diff --git a/WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html b/WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html
new file mode 100644
index 0000000..185e5c6
--- /dev/null
+++ b/WebCore/manual-tests/autocorrection/autocorrection-cancelled-by-ESC.html
@@ -0,0 +1,50 @@
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../../../LayoutTests/editing/editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+function editingTest() {
+ typeCharacterCommand('t');
+ typeCharacterCommand('h');
+ typeCharacterCommand('e');
+ typeCharacterCommand(' ');
+ typeCharacterCommand('c');
+ typeCharacterCommand('o');
+ typeCharacterCommand('l');
+ typeCharacterCommand('l');
+ typeCharacterCommand('a');
+ typeCharacterCommand('p');
+ typeCharacterCommand('s');
+}
+
+</script>
+
+<title>Autocorrection Cancellation By ESC Test</title>
+</head>
+<body>
+<div><p>This test verifies that autocorrection is not applied when user dismisses correction panel by pressing
+ESC key.</p>
+<p>After seeing the correction panel, press ESC key, then press space. You should see the phrase "the collaps"
+where "collaps" has red mispell underline. </p>
+<p style="color:green">Note, this test can fail due to user specific spell checking data. If the user has previously
+dismissed 'collapse' as the correct spelling of 'collaps' several times, the spell checker will not provide
+'collapse' as a suggestion anymore. To fix this, remove all files in ~/Library/Spelling.</p>
+<div contenteditable id="root" class="editing">
+<span id="test"></span>
+</div>
+
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html b/WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html
new file mode 100644
index 0000000..fff8888
--- /dev/null
+++ b/WebCore/manual-tests/compositing/show-composited-iframe-on-back-button.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <!--
+ This content was originally intended as a layout test, but the sequencing performed by
+ queueBackNavigation/queueForwardNavigation differs somehow from what occurs when hitting
+ the back and forward buttons, so the error does not occur. I've left all the LayoutTestController
+ logic in the test in case this is fixed in the future.
+ -->
+
+ <title>Show composited iframe contents when navigating back to page</title>
+ <style type="text/css" media="screen">
+ #box {
+ background-color: red;
+ width: 100px;
+ height: 100px;
+ -webkit-transform: translateZ(0);
+ }
+ iframe {
+ margin: 20px;
+ height: 250px;
+ width: 250px;
+ border: 1px solid black;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ var dumpLayerTree = function()
+ {
+ if (window.layoutTestController) {
+ document.getElementById('layers').innerHTML += "Layer Tree after\n\n"+layoutTestController.layerTreeAsText()+"\n\n";
+ }
+ }
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ }
+
+ function onPageShow(evt)
+ {
+ if (!evt.persisted && window.layoutTestController) {
+ // this is the first time the page has been loaded, then setup the
+ // to-be-tested scenario.
+ document.getElementById('layers').innerHTML = "Layer Tree before\n\n"+layoutTestController.layerTreeAsText()+"\n\n";
+ layoutTestController.queueLoad("resources/subframe.html");
+ layoutTestController.queueBackNavigation(1);
+ layoutTestController.queueForwardNavigation(1);
+ layoutTestController.queueBackNavigation(1);
+ layoutTestController.queueNonLoadingScript("dumpLayerTree()");
+ }
+ }
+
+ window.onpageshow = onPageShow;
+ </script>
+</head>
+<body>
+<p>
+ This page has a composited iframe. When navigating to a new page and then back to this one, the iframe contents should show up.
+</p>
+ Click on the following URL and then click back. When navigating back to this page, the blue box inside the black rectangle
+ should show up.
+</p>
+<pre>
+ <a href="http://apple.com">http://apple.com</a>
+</pre>
+ <div id=box></div>
+ <iframe id="iframe" scrolling="no" src="resources/composited-subframe.html"></iframe>
+<br>
+<pre id="layers"></pre>
+</body>
+</html>
diff --git a/WebCore/manual-tests/cursor-empty-url.html b/WebCore/manual-tests/cursor-empty-url.html
new file mode 100644
index 0000000..a336100
--- /dev/null
+++ b/WebCore/manual-tests/cursor-empty-url.html
@@ -0,0 +1,3 @@
+<div>Mousing over the grey block should not cause a crash.</div>
+<link rel="stylesheet" href="resources/cursor-empty-url.css"></link>
+<div id="target" style="width: 50px; height: 50px; margin: 10px; background: #ddd"></div>
diff --git a/WebCore/manual-tests/indexed-database.html b/WebCore/manual-tests/indexed-database.html
deleted file mode 100644
index da2a1e1..0000000
--- a/WebCore/manual-tests/indexed-database.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<html>
-<body>
-<p>This is a test that only applies to IndexedDB. <span id=enabled>Our test for whether you have it enabled seems to have failed.</span></p>
-
-<p>Please follow these steps in order:</p>
-
-<p>First, click <a href="javascript: doOpen(true)">here</a> to open an indexedDB database. Look in the proper place in your file system (the place being specific to each port) and verify a file was created. You should be able to open the file up with sqlite and examine it that way as well.</p>
-
-<p>Next, close the browser, delete the file, replace it with some garbage, and make it read only to the user the browser is running as. Now click <a href="javascript: doOpen(false)">here</a>. You should get some sort of error.</p>
-
-<p>Close the browser, delete the file you made, and click <a href="javascript: doOpen(true)">here</a>. All should be well again.</p>
-
-<p>Status: <span id=status>...</span></p>
-
-<script>
-
-if (!('indexedDB' in window))
- document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>";
-else
- document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>";
-
-function status(str, color)
-{
- if (color)
- str = "<font color='" + color + "'>" + str + "</font>";
- document.getElementById("status").innerHTML = str;
-}
-
-function doOpen(expectSuccess)
-{
- status("Calling open");
- request = indexedDB.open("xyz");
- request.onsuccess = function() {
- if (expectSuccess)
- status("Open successful", "green");
- else
- status("Open was successful...but shouldn't have been", "red");
- };
- request.onerror = function() {
- if (expectSuccess)
- status("Unexpected error: " + event.message, "red");
- else
- status("Expected error: " + event.message, "green");
- };
-}
-
-</script>
-</body>
-</html>
diff --git a/WebCore/manual-tests/indexeddb-persists.html b/WebCore/manual-tests/indexeddb-persists.html
new file mode 100644
index 0000000..6f5e036
--- /dev/null
+++ b/WebCore/manual-tests/indexeddb-persists.html
@@ -0,0 +1,69 @@
+<html>
+<body>
+<p>This is a test that only applies to IndexedDB. <span id=enabled>Our test for whether you have it enabled seems to have failed.</span></p>
+
+<p>Please follow these steps in order:</p>
+
+<p>First, click <a href="javascript: setData()">here</a> to open a database and set some data within it.</p>
+
+<p>Next, close the browser and then re-open this page.</p>
+
+<p>Lastly, click <a href="javascript: verifyData()">here</a> to verify the data was there</p>
+
+<p>Status: <span id=status>...</span></p>
+
+<script>
+
+if (!('webkitIndexedDB' in window))
+ document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>";
+else
+ document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>";
+
+function status(str, color)
+{
+ if (color)
+ str = "<font color='" + color + "'>" + str + "</font>";
+ document.getElementById("status").innerHTML = str;
+}
+
+function setData()
+{
+ status("Something must have gone wrong (or we're still working)...", "red");
+
+ webkitIndexedDB.open("someDB", "some description").onsuccess = function() {
+ event.result.setVersion("some version").onsuccess = function() {
+ var db = event.source;
+ while (db.objectStores.length)
+ db.removeObjectStore(db.objectStores[0]);
+ db.createObjectStore("test").put("value", "key").onsuccess = function() {
+ status("Value set", "green");
+ }
+ }
+ }
+}
+
+function verifyData()
+{
+ status("Something must have gone wrong (or we're still working)...", "red");
+
+ webkitIndexedDB.open("someDB", "some description").onsuccess = function() {
+ try {
+ var result = event.result.transaction([]).objectStore("test").get("key");
+ result.onsuccess = function() {
+ if (event.result == "value")
+ status("Value verified", "green");
+ else
+ status("Value incorrect!", "red");
+ }
+ result.onerror = function() {
+ status("An error occurred: " + event.code + " " + event.message, "red");
+ }
+ } catch (e) {
+ status("An exception occurred: " + e, "red");
+ }
+ }
+}
+
+</script>
+</body>
+</html>
diff --git a/WebCore/manual-tests/plugins/windowed.html b/WebCore/manual-tests/plugins/windowed.html
index 808a0ad..56a02f4 100644
--- a/WebCore/manual-tests/plugins/windowed.html
+++ b/WebCore/manual-tests/plugins/windowed.html
@@ -62,7 +62,7 @@
<body>
<b> Verify the following tests with and without the page scrolled (including seeming unrelated test cases like printing). <br/>
- For the Qt port, test with both QtLauncher and QGVLauncher </b> <br/><br/>
+ For the Qt port, test with QGraphicsView enabled and disabled</b> <br/><br/>
<!-- <embed id="flashPlugin" src="http://www.youtube.com/v/loXfcsXRB-w&#038;hl=en&#038;fs=1" --!>
<embed id="flashPlugin" src="test.swf"
@@ -91,7 +91,7 @@
<input type="checkbox" name="zoomCheckBox"> Verify if elements in flash are correctly painted and clickable after zooming <br/>
- <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtLauncher display flash <br/>
+ <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtTestBrowser displays flash <br/>
<input type="checkbox" name="paintSystemsCheckBox"> Verify if flash is displayed with graphicssystems - raster, opengl <br/>
diff --git a/WebCore/manual-tests/plugins/windowless.html b/WebCore/manual-tests/plugins/windowless.html
index 1020abb..27e8a82 100644
--- a/WebCore/manual-tests/plugins/windowless.html
+++ b/WebCore/manual-tests/plugins/windowless.html
@@ -62,7 +62,7 @@
<body>
<b> Verify the following tests with and without the page scrolled (including seeming unrelated test cases like printing). <br/>
- For the Qt port, test with both QtLauncher and QGVLauncher </b> <br/><br/>
+ For the Qt port, test with QGraphicsView enabled and disabled</b> <br/><br/>
<!-- <embed id="flashPlugin" src="http://www.youtube.com/v/loXfcsXRB-w&#038;hl=en&#038;fs=1" --!>
<embed id="flashPlugin" src="test.swf"
@@ -92,7 +92,7 @@
<input type="checkbox" name="zoomCheckBox"> Verify if elements in flash are correctly painted and clickable after zooming <br/>
- <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtLauncher display flash <br/>
+ <input type="checkbox" name="screenshotBox"> Verify if taking a screenshot from QtTestBrowser displays flash <br/>
<input type="checkbox" name="paintSystemsCheckBox"> Verify if flash is displayed with graphicssystems - raster, opengl <br/>
diff --git a/WebCore/manual-tests/resources/cursor-empty-url.css b/WebCore/manual-tests/resources/cursor-empty-url.css
new file mode 100644
index 0000000..0479af1
--- /dev/null
+++ b/WebCore/manual-tests/resources/cursor-empty-url.css
@@ -0,0 +1 @@
+#target { cursor: url(''), auto; }
diff --git a/WebCore/mathml/RenderMathMLFenced.cpp b/WebCore/mathml/RenderMathMLFenced.cpp
index a304fa4..f7bbf71 100644
--- a/WebCore/mathml/RenderMathMLFenced.cpp
+++ b/WebCore/mathml/RenderMathMLFenced.cpp
@@ -142,26 +142,6 @@ void RenderMathMLFenced::addChild(RenderObject* child, RenderObject*)
RenderBlock::addChild(child, lastChild());
}
-void RenderMathMLFenced::layout()
-{
- RenderMathMLRow::layout();
-
- int width = 0;
- for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
- if (current->isBoxModelObject()) {
- RenderBoxModelObject* box = toRenderBoxModelObject(current);
- width += box->offsetWidth();
- }
- }
- width++;
- style()->setWidth(Length(width, Fixed));
-
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
- RenderBlock::layout();
-
- setNeedsLayout(false);
-}
}
#endif
diff --git a/WebCore/mathml/RenderMathMLFenced.h b/WebCore/mathml/RenderMathMLFenced.h
index 63cdaa8..64e4d90 100644
--- a/WebCore/mathml/RenderMathMLFenced.h
+++ b/WebCore/mathml/RenderMathMLFenced.h
@@ -38,9 +38,6 @@ public:
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual void updateFromElement();
-protected:
- virtual void layout();
-
private:
void makeFences();
RefPtr<RenderStyle> makeOperatorStyle();
diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp
index 92c8101..1000604 100644
--- a/WebCore/mathml/RenderMathMLFraction.cpp
+++ b/WebCore/mathml/RenderMathMLFraction.cpp
@@ -129,13 +129,6 @@ void RenderMathMLFraction::layout()
RenderBlock::layout();
- // The row layout can affect the numerator/denominator width.
- // FIXME: This is probably only needed if one of the children
- // contains an mrow.
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
-
- RenderBlock::layout();
}
void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
diff --git a/WebCore/mathml/RenderMathMLOperator.cpp b/WebCore/mathml/RenderMathMLOperator.cpp
index 1e3b429..9f35480 100644
--- a/WebCore/mathml/RenderMathMLOperator.cpp
+++ b/WebCore/mathml/RenderMathMLOperator.cpp
@@ -67,8 +67,7 @@ void RenderMathMLOperator::stretchToHeight(int height)
m_stretchHeight = static_cast<int>(height * gOperatorExpansion);
updateBoxModelInfoFromStyle();
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
}
void RenderMathMLOperator::layout()
diff --git a/WebCore/mathml/RenderMathMLRoot.cpp b/WebCore/mathml/RenderMathMLRoot.cpp
index ab15c80..ba60c9f 100644
--- a/WebCore/mathml/RenderMathMLRoot.cpp
+++ b/WebCore/mathml/RenderMathMLRoot.cpp
@@ -246,14 +246,14 @@ void RenderMathMLRoot::layout()
if (rootMarginTop > 0)
style()->setPaddingTop(Length(rootMarginTop + static_cast<int>(gRootPadding * style()->fontSize()), Fixed));
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
+ setPreferredLogicalWidthsDirty(true, false);
RenderBlock::layout();
indexBox->style()->setBottom(Length(radicalHeight + style()->paddingBottom().value(), Fixed));
// Now that we've potentially changed its position, we need layout the index again.
- indexBox->setNeedsLayoutAndPrefWidthsRecalc();
+ indexBox->setNeedsLayout(true);
indexBox->layout();
}
diff --git a/WebCore/mathml/RenderMathMLRow.cpp b/WebCore/mathml/RenderMathMLRow.cpp
index 632b794..ae911fc 100644
--- a/WebCore/mathml/RenderMathMLRow.cpp
+++ b/WebCore/mathml/RenderMathMLRow.cpp
@@ -66,42 +66,27 @@ void RenderMathMLRow::layout()
{
RenderBlock::layout();
- // Calculate the maximum height of the row without the operators.
- int maxHeight = nonOperatorHeight();
-
- // Notify contained operators they may need to re-layout their stretched operators.
- // We need to keep track of the number of children and operators because a row of
- // operators needs some special handling.
+ int maxHeight = 0;
int childCount = 0;
int operatorCount = 0;
- for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
- childCount++;
- if (current->isRenderMathMLBlock()) {
- RenderMathMLBlock* block = toRenderMathMLBlock(current);
- block->stretchToHeight(maxHeight);
- if (block->isRenderMathMLOperator())
- operatorCount++;
- }
- }
-
- // Layout the non-operators which have just been stretched.
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
- RenderBlock::layout();
- // Make a second pass with the real height of the operators.
+ // Calculate the non-operator max height of the row.
int operatorHeight = 0;
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ childCount++;
if (current->isRenderMathMLBlock()) {
RenderMathMLBlock* block = toRenderMathMLBlock(current);
- if (!block->hasBase() && !block->isRenderMathMLOperator()) {
- // Check to see if this box has a larger height.
- if (block->offsetHeight() > maxHeight)
- maxHeight = block->offsetHeight();
- }
- if (block->isRenderMathMLOperator())
+ // Check to see if the non-operator block has a greater height.
+ if (!block->hasBase() && !block->isRenderMathMLOperator() && block->offsetHeight() > maxHeight)
+ maxHeight = block->offsetHeight();
+ if (block->hasBase() && block->nonOperatorHeight() > maxHeight)
+ maxHeight = block->nonOperatorHeight();
+ // If the block is an operator, capture the maximum height and increment the count.
+ if (block->isRenderMathMLOperator()) {
if (block->offsetHeight() > operatorHeight)
operatorHeight = block->offsetHeight();
+ operatorCount++;
+ }
} else if (current->isBoxModelObject()) {
RenderBoxModelObject* box = toRenderBoxModelObject(current);
// Check to see if this box has a larger height.
@@ -115,34 +100,23 @@ void RenderMathMLRow::layout()
maxHeight = operatorHeight;
}
- int stretchHeight = maxHeight;
-
- // Stretch the operators again and re-calculate the row height.
- for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
- if (current->isRenderMathMLBlock()) {
- RenderMathMLBlock* block = toRenderMathMLBlock(current);
- if (block->isRenderMathMLOperator()) {
- RenderMathMLOperator* mathop = toRenderMathMLOperator(block);
- mathop->stretchToHeight(stretchHeight);
- } else {
- block->stretchToHeight(stretchHeight);
- RenderBoxModelObject* box = toRenderBoxModelObject(current);
- // Check to see if this box has a larger height
- if (box->offsetHeight() > maxHeight)
- maxHeight = box->offsetHeight();
+ // Stretch everything to the same height (blocks can ignore the request).
+ if (maxHeight > 0) {
+ bool didStretch = false;
+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->isRenderMathMLBlock()) {
+ RenderMathMLBlock* block = toRenderMathMLBlock(current);
+ block->stretchToHeight(maxHeight);
+ didStretch = true;
}
- } else if (current->isBoxModelObject()) {
- RenderBoxModelObject* box = toRenderBoxModelObject(current);
- // Check to see if this box has a larger height
- if (box->offsetHeight() > maxHeight)
- maxHeight = box->offsetHeight();
+ }
+ if (didStretch) {
+ setNeedsLayout(true);
+ setPreferredLogicalWidthsDirty(true, false);
+ RenderBlock::layout();
}
}
- // Mark outself as needing layout and do the final layout of the row.
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
- RenderBlock::layout();
}
int RenderMathMLRow::baselinePosition(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
diff --git a/WebCore/mathml/RenderMathMLRow.h b/WebCore/mathml/RenderMathMLRow.h
index b363b1b..c877561 100644
--- a/WebCore/mathml/RenderMathMLRow.h
+++ b/WebCore/mathml/RenderMathMLRow.h
@@ -38,6 +38,7 @@ public:
virtual bool isRenderMathMLRow() const { return true; }
virtual int nonOperatorHeight() const;
virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+ virtual void stretchToHeight(int) {}
protected:
virtual void layout();
};
diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp
index 8add254..6c9c6b9 100644
--- a/WebCore/mathml/RenderMathMLSubSup.cpp
+++ b/WebCore/mathml/RenderMathMLSubSup.cpp
@@ -95,10 +95,11 @@ void RenderMathMLSubSup::addChild(RenderObject* child, RenderObject* beforeChild
RefPtr<RenderStyle> wrapperStyle = RenderStyle::create();
wrapperStyle->inheritFrom(style());
wrapperStyle->setDisplay(INLINE_BLOCK);
- wrapperStyle->setVerticalAlign(TOP);
+ wrapperStyle->setVerticalAlign(BASELINE);
wrapper->setStyle(wrapperStyle.release());
RenderMathMLBlock::addChild(wrapper, beforeChild);
wrapper->addChild(child);
+
}
}
@@ -111,6 +112,8 @@ void RenderMathMLSubSup::stretchToHeight(int height)
if (base->firstChild()->isRenderMathMLBlock()) {
RenderMathMLBlock* block = toRenderMathMLBlock(base->firstChild());
block->stretchToHeight(static_cast<int>(gSubSupStretch * height));
+
+ // Adjust the script placement after we stretch
if (height > 0 && m_kind == SubSup && m_scripts) {
RenderObject* script = m_scripts->firstChild();
if (script) {
@@ -124,31 +127,28 @@ void RenderMathMLSubSup::stretchToHeight(int height)
RenderBoxModelObject* topBox = toRenderBoxModelObject(top);
topBox->updateBoxModelInfoFromStyle();
}
- m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
- m_scripts->markContainingBlocksForLayout();
+ m_scripts->setNeedsLayout(true);
+ setNeedsLayout(true);
}
}
+
}
- updateBoxModelInfoFromStyle();
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
}
int RenderMathMLSubSup::nonOperatorHeight() const
{
- return 0;
+ if (m_kind == SubSup)
+ return static_cast<int>(style()->fontSize()*gSubSupStretch);
+ return static_cast<int>(style()->fontSize());
}
void RenderMathMLSubSup::layout()
{
- if (firstChild()) {
- firstChild()->setNeedsLayoutAndPrefWidthsRecalc();
- firstChild()->markContainingBlocksForLayout();
- }
- if (m_scripts) {
- m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
- m_scripts->markContainingBlocksForLayout();
- }
+ if (firstChild())
+ firstChild()->setNeedsLayout(true);
+ if (m_scripts)
+ m_scripts->setNeedsLayout(true);
+
RenderBlock::layout();
if (m_kind == SubSup) {
@@ -165,10 +165,10 @@ void RenderMathMLSubSup::layout()
int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;
if (heightDiff < 0)
heightDiff = 0;
- base->style()->setMarginTop(Length(heightDiff, Fixed));
+ base->style()->setPaddingTop(Length(heightDiff, Fixed));
}
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
+ base->setNeedsLayout(true);
RenderBlock::layout();
}
}
@@ -178,17 +178,17 @@ int RenderMathMLSubSup::baselinePosition(bool firstLine, LineDirectionMode direc
RenderObject* base = firstChild();
if (!base)
return offsetHeight();
- base = base->firstChild();
int baseline = offsetHeight();
if (!base || !base->isBoxModelObject())
return baseline;
- RenderBoxModelObject* box = toRenderBoxModelObject(base);
-
switch (m_kind) {
case SubSup:
- if (m_scripts) {
+ base = base->firstChild();
+ if (m_scripts && base->isBoxModelObject()) {
+ RenderBoxModelObject* box = toRenderBoxModelObject(base);
+
int topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;
// FIXME: The last bit of this calculation should be more exact. Why is the 2-3px scaled for zoom necessary?
@@ -197,22 +197,10 @@ int RenderMathMLSubSup::baselinePosition(bool firstLine, LineDirectionMode direc
return topAdjust + box->baselinePosition(firstLine, direction, linePositionMode) + static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
}
break;
- case Sup: {
- baseline = box->baselinePosition(firstLine, direction, linePositionMode) + 4;
- // FIXME: The extra amount of the superscript ascending above the base's box
- // isn't taken into account. This should be calculated in a more reliable
- // way.
- RenderObject* sup = base->nextSibling();
- if (sup && sup->isBoxModelObject()) {
- RenderBoxModelObject* box = toRenderBoxModelObject(sup);
- // we'll take half of the sup's box height into account in the baseline
- baseline += static_cast<int>(box->offsetHeight() * 0.5);
- }
- baseline++;
- break;
- }
+ case Sup:
case Sub:
- baseline = box->baselinePosition(true, direction) + 4;
+ RenderBoxModelObject* box = toRenderBoxModelObject(base);
+ baseline = box->baselinePosition(firstLine, direction, linePositionMode);
break;
}
diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp
index 69f2c57..a76f6b1 100644
--- a/WebCore/mathml/RenderMathMLUnderOver.cpp
+++ b/WebCore/mathml/RenderMathMLUnderOver.cpp
@@ -118,7 +118,7 @@ inline int getOffsetHeight(RenderObject* obj)
return 0;
}
-void RenderMathMLUnderOver::stretchToHeight(int height)
+void RenderMathMLUnderOver::stretchToHeight(int height)
{
RenderObject* base = firstChild();
@@ -138,9 +138,7 @@ void RenderMathMLUnderOver::stretchToHeight(int height)
if (base && base->isRenderMathMLBlock()) {
RenderMathMLBlock* block = toRenderMathMLBlock(base);
block->stretchToHeight(height);
- updateBoxModelInfoFromStyle();
- setNeedsLayoutAndPrefWidthsRecalc();
- markContainingBlocksForLayout();
+ setNeedsLayout(true);
}
}
@@ -241,7 +239,7 @@ void RenderMathMLUnderOver::layout()
}
break;
}
- setNeedsLayoutAndPrefWidthsRecalc();
+ setNeedsLayout(true);
RenderBlock::layout();
}
@@ -282,7 +280,17 @@ int RenderMathMLUnderOver::baselinePosition(bool firstLine, LineDirectionMode di
int RenderMathMLUnderOver::nonOperatorHeight() const
{
- return 0;
+ int nonOperators = 0;
+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->firstChild()->isRenderMathMLBlock()) {
+ RenderMathMLBlock* block = toRenderMathMLBlock(current->firstChild());
+ if (!block->isRenderMathMLOperator())
+ nonOperators += getOffsetHeight(current);
+ } else {
+ nonOperators += getOffsetHeight(current);
+ }
+ }
+ return nonOperators;
}
}
diff --git a/WebCore/mathml/mathtags.in b/WebCore/mathml/mathtags.in
index 5bb369a..b2dcb93 100644
--- a/WebCore/mathml/mathtags.in
+++ b/WebCore/mathml/mathtags.in
@@ -16,8 +16,8 @@ mi interfaceName=MathMLTextElement
mn interfaceName=MathMLTextElement
mo interfaceName=MathMLTextElement
mtext interfaceName=MathMLTextElement
-msub interfaceName=MathMLElement
-msup interfaceName=MathMLElement
+msub interfaceName=MathMLInlineContainerElement
+msup interfaceName=MathMLInlineContainerElement
#if 0 // Curently only for MathMLNames used by HTMLTreeBuilder.
ms
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp
index 944f32f..762b087 100644
--- a/WebCore/page/Chrome.cpp
+++ b/WebCore/page/Chrome.cpp
@@ -163,9 +163,9 @@ void Chrome::focusedNodeChanged(Node* node) const
m_client->focusedNodeChanged(node);
}
-Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features) const
+Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction& action) const
{
- Page* newPage = m_client->createWindow(frame, request, features);
+ Page* newPage = m_client->createWindow(frame, request, features, action);
#if ENABLE(DOM_STORAGE)
if (newPage) {
diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h
index 1897b79..9f43b11 100644
--- a/WebCore/page/Chrome.h
+++ b/WebCore/page/Chrome.h
@@ -45,6 +45,7 @@ namespace WebCore {
class Geolocation;
class HitTestResult;
class IntRect;
+ class NavigationAction;
class Node;
class Page;
class PopupMenuClient;
@@ -94,7 +95,7 @@ namespace WebCore {
void focusedNodeChanged(Node*) const;
- Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) const;
+ Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const;
void show() const;
bool canRunModal() const;
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
index 29a54c9..3e6f8d9 100644
--- a/WebCore/page/ChromeClient.h
+++ b/WebCore/page/ChromeClient.h
@@ -56,11 +56,12 @@ namespace WebCore {
class HTMLParserQuirks;
class HitTestResult;
class IntRect;
+ class NavigationAction;
class Node;
class Page;
+ class PopupMenuClient;
class SecurityOrigin;
class SharedGraphicsContext3D;
- class PopupMenuClient;
class Widget;
struct FrameLoadRequest;
@@ -98,7 +99,7 @@ namespace WebCore {
// 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 Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) = 0;
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) = 0;
virtual void show() = 0;
virtual bool canRunModal() = 0;
diff --git a/WebCore/page/ContextMenuController.cpp b/WebCore/page/ContextMenuController.cpp
index de64988..08c3d2e 100644
--- a/WebCore/page/ContextMenuController.cpp
+++ b/WebCore/page/ContextMenuController.cpp
@@ -50,6 +50,7 @@
#include "HitTestResult.h"
#include "InspectorController.h"
#include "MouseEvent.h"
+#include "NavigationAction.h"
#include "Node.h"
#include "Page.h"
#include "RenderLayer.h"
@@ -139,7 +140,7 @@ static void openNewWindow(const KURL& urlToLoad, Frame* frame)
{
if (Page* oldPage = frame->page()) {
WindowFeatures features;
- if (Page* newPage = oldPage->chrome()->createWindow(frame, FrameLoadRequest(ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer())), features))
+ if (Page* newPage = oldPage->chrome()->createWindow(frame, FrameLoadRequest(ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer())), features, NavigationAction()))
newPage->chrome()->show();
}
}
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 1c811cc..c7b8911 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -38,6 +38,7 @@
#include "DocumentLoader.h"
#include "DOMApplicationCache.h"
#include "DOMSelection.h"
+#include "DOMSettableTokenList.h"
#include "DOMStringList.h"
#include "DOMTimer.h"
#include "DOMTokenList.h"
@@ -730,13 +731,13 @@ void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSyste
return;
if (!AsyncFileSystem::isAvailable() || !document->securityOrigin()->canAccessFileSystem()) {
- DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(SECURITY_ERR));
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
- DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_MODIFICATION_ERR));
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -1270,8 +1271,8 @@ PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* elt, const String
if (!m_frame)
return 0;
- Document* doc = m_frame->document();
- return doc->styleSelector()->styleRulesForElement(elt, authorOnly);
+ Settings* settings = m_frame->settings();
+ return m_frame->document()->styleSelector()->styleRulesForElement(elt, authorOnly, false, settings && settings->crossOriginCheckInGetMatchedCSSRulesDisabled() ? AllCSSRules : SameOriginCSSRulesOnly);
}
PassRefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index cb504b9..4db0944 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -147,9 +147,11 @@ module window {
in DOMString pseudoElement);
// WebKit extensions
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
CSSRuleList getMatchedCSSRules(in Element element,
- in DOMString pseudoElement,
- in [Optional] boolean authorOnly);
+ in DOMString pseudoElement);
+#endif
+
attribute [Replaceable] double devicePixelRatio;
WebKitPoint webkitConvertPointFromPageToNode(in Node node, in WebKitPoint p);
@@ -379,6 +381,7 @@ module window {
// attribute DOMImplementationListConstructor DOMImplementationList;
// attribute DOMImplementationSourceConstructor DOMImplementationSource;
attribute DOMImplementationConstructor DOMImplementation;
+ attribute DOMSettableTokenListConstructor DOMSettableTokenList;
attribute DOMTokenListConstructor DOMTokenList;
attribute DocumentFragmentConstructor DocumentFragment;
attribute DocumentConstructor Document;
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index b0c3911..4046bd8 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1063,15 +1063,18 @@ static bool nodeIsNotBeingEdited(Node* node, Frame* frame)
Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scrollbar* scrollbar)
{
- // During selection, use an I-beam no matter what we're over.
- // If you're capturing mouse events for a particular node, don't treat this as a selection.
- if (m_mousePressed && m_mouseDownMayStartSelect && m_frame->selection()->isCaretOrRange() && !m_capturingMouseEventsNode)
- return iBeamCursor();
-
Node* node = event.targetNode();
RenderObject* renderer = node ? node->renderer() : 0;
RenderStyle* style = renderer ? renderer->style() : 0;
+ bool horizontalText = !style || style->isHorizontalWritingMode();
+ const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor();
+
+ // During selection, use an I-beam no matter what we're over.
+ // If you're capturing mouse events for a particular node, don't treat this as a selection.
+ if (m_mousePressed && m_mouseDownMayStartSelect && m_frame->selection()->isCaretOrRange() && !m_capturingMouseEventsNode)
+ return iBeam;
+
if (renderer && renderer->isFrameSet()) {
RenderFrameSet* frameSetRenderer = toRenderFrameSet(renderer);
if (frameSetRenderer->canResizeRow(event.localPoint()))
@@ -1085,7 +1088,7 @@ Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scr
for (unsigned i = 0; i < cursors->size(); ++i) {
const CachedImage* cimage = 0;
StyleImage* image = (*cursors)[i].image();
- if (image->isCachedImage())
+ if (image && image->isCachedImage())
cimage = static_cast<StyleCachedImage*>(image)->cachedImage();
if (!cimage)
continue;
@@ -1140,7 +1143,7 @@ Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scr
}
}
if ((editable || (renderer && renderer->isText() && node->canStartSelection())) && !inResizer && !scrollbar)
- return iBeamCursor();
+ return iBeam;
return pointerCursor();
}
case CURSOR_CROSS:
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 1b476a0..a4d33a3 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -163,6 +163,7 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader
, m_lifeSupportTimer(this, &Frame::lifeSupportTimerFired)
, m_pageZoomFactor(parentPageZoomFactor(this))
, m_textZoomFactor(parentTextZoomFactor(this))
+ , m_pageScaleFactor(1)
#if ENABLE(ORIENTATION_EVENTS)
, m_orientation(0)
#endif
@@ -748,6 +749,10 @@ void Frame::transferChildFrameToNewDocument()
// Let external clients update themselves.
loader()->client()->didTransferChildFrameToNewDocument(oldPage);
+ // Update resource tracking now that frame could be in a different page.
+ if (oldPage != newPage)
+ loader()->transferLoadingResourcesFromPage(oldPage);
+
// Do the same for all the children.
for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
child->transferChildFrameToNewDocument();
@@ -883,6 +888,13 @@ IntRect Frame::tiledBackingStoreVisibleRect()
return IntRect();
return m_page->chrome()->client()->visibleRectForTiledBackingStore();
}
+
+Color Frame::tiledBackingStoreBackgroundColor() const
+{
+ if (!m_view)
+ return Color();
+ return m_view->baseBackgroundColor();
+}
#endif
String Frame::layerTreeAsText() const
@@ -956,4 +968,26 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
}
}
+void Frame::scalePage(float scale)
+{
+ if (m_pageScaleFactor == scale)
+ return;
+
+ m_pageScaleFactor = scale;
+
+ Document* document = this->document();
+ if (!document)
+ return;
+
+ if (document->renderer())
+ document->renderer()->setNeedsLayout(true);
+
+ document->recalcStyle(Node::Force);
+
+ if (FrameView* view = this->view()) {
+ if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
+ view->layout();
+ }
+}
+
} // namespace WebCore
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index b48f5c8..59e1556 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -144,6 +144,9 @@ namespace WebCore {
float textZoomFactor() const { return m_textZoomFactor; }
void setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor);
+ void scalePage(float scale);
+ float pageScaleFactor() const { return m_pageScaleFactor; }
+
#if ENABLE(ORIENTATION_EVENTS)
// Orientation is the interface orientation in degrees. Some examples are:
// 0 is straight up; -90 is when the device is rotated 90 clockwise;
@@ -215,6 +218,8 @@ namespace WebCore {
float m_pageZoomFactor;
float m_textZoomFactor;
+ float m_pageScaleFactor;
+
#if ENABLE(ORIENTATION_EVENTS)
int m_orientation;
#endif
@@ -237,6 +242,7 @@ namespace WebCore {
virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea);
virtual IntRect tiledBackingStoreContentsRect();
virtual IntRect tiledBackingStoreVisibleRect();
+ virtual Color tiledBackingStoreBackgroundColor() const;
OwnPtr<TiledBackingStore> m_tiledBackingStore;
#endif
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 6abb07c..7bc29d5 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -509,8 +509,6 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
hMode = ScrollbarAlwaysOff;
#endif
} else if (body->hasTagName(bodyTag)) {
- if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewport())
- body->renderer()->setChildNeedsLayout(true);
// It's sufficient to just check the X overflow,
// since it's illegal to have visible in only one direction.
RenderObject* o = rootRenderer->style()->overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer;
@@ -770,8 +768,17 @@ void FrameView::layout(bool allowSubtree)
m_size = IntSize(layoutWidth(), layoutHeight());
- if (oldSize != m_size)
+ if (oldSize != m_size) {
m_doFullRepaint = true;
+ if (!m_firstLayout) {
+ RenderBox* rootRenderer = document->documentElement() ? document->documentElement()->renderBox() : 0;
+ RenderBox* bodyRenderer = rootRenderer && document->body() ? document->body()->renderBox() : 0;
+ if (bodyRenderer && bodyRenderer->stretchesToViewport())
+ bodyRenderer->setChildNeedsLayout(true);
+ else if (rootRenderer && rootRenderer->stretchesToViewport())
+ rootRenderer->setChildNeedsLayout(true);
+ }
+ }
}
RenderLayer* layer = root->enclosingLayer();
@@ -1020,6 +1027,23 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
return false;
}
+void FrameView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+#if USE(ACCELERATED_COMPOSITING)
+ if (RenderPart* frameRenderer = m_frame->ownerRenderer()) {
+ if (frameRenderer->containerForRepaint()) {
+ IntRect rect(frameRenderer->borderLeft() + frameRenderer->paddingLeft(),
+ frameRenderer->borderTop() + frameRenderer->paddingTop(),
+ visibleWidth(), visibleHeight());
+ frameRenderer->repaintRectangle(rect);
+ return;
+ }
+ }
+#endif
+
+ ScrollView::scrollContentsSlowPath(updateRect);
+}
+
// Note that this gets called at painting time.
void FrameView::setIsOverlapped(bool isOverlapped)
{
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index 1518233..f9212c1 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -242,7 +242,8 @@ public:
protected:
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
-
+ virtual void scrollContentsSlowPath(const IntRect& updateRect);
+
private:
FrameView(Frame*);
diff --git a/WebCore/page/SecurityOriginHash.h b/WebCore/page/SecurityOriginHash.h
index 1915fc7..c2ebdd1 100644
--- a/WebCore/page/SecurityOriginHash.h
+++ b/WebCore/page/SecurityOriginHash.h
@@ -43,7 +43,7 @@ struct SecurityOriginHash {
origin->host().impl() ? origin->host().impl()->hash() : 0,
origin->port()
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static unsigned hash(const RefPtr<SecurityOrigin>& origin)
{
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index aa758c4..66ffcf0 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -28,6 +28,7 @@
#include "BackForwardList.h"
#include "CachedResourceLoader.h"
+#include "CookieStorage.h"
#include "DOMTimer.h"
#include "Database.h"
#include "Frame.h"
@@ -160,12 +161,16 @@ Settings::Settings(Page* page)
, m_interactiveFormValidation(false)
, m_usePreHTML5ParserQuirks(false)
, m_hyperlinkAuditingEnabled(false)
-#ifdef ANDROID_PLUGINS
- , m_pluginsOnDemand(false)
-#endif
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
, m_autoFillEnabled(false)
#endif
+#ifdef ANDROID_PLUGINS
+ , m_pluginsOnDemand(false)
+#endif
+=======
+ , m_crossOriginCheckInGetMatchedCSSRulesDisabled(false)
+>>>>>>> webkit.org at r70949
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -341,6 +346,9 @@ void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
if (m_privateBrowsingEnabled == privateBrowsingEnabled)
return;
+ // FIXME: We can only enable cookie private browsing mode globally, so it's misleading to have it as a per-page setting.
+ setCookieStoragePrivateBrowsingEnabled(privateBrowsingEnabled);
+
m_privateBrowsingEnabled = privateBrowsingEnabled;
m_page->privateBrowsingStateChanged();
}
@@ -448,9 +456,10 @@ void Settings::setUsesPageCache(bool usesPageCache)
m_usesPageCache = usesPageCache;
if (!m_usesPageCache) {
- HistoryItemVector& historyItems = m_page->backForwardList()->entries();
- for (unsigned i = 0; i < historyItems.size(); i++)
- pageCache()->remove(historyItems[i].get());
+ int first = -m_page->backForwardList()->backListCount();
+ int last = m_page->backForwardList()->forwardListCount();
+ for (int i = first; i <= last; i++)
+ pageCache()->remove(m_page->backForwardList()->itemAtIndex(i));
pageCache()->releaseAutoreleasedPagesNow();
}
}
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 3401428..8324e2f 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -175,6 +175,8 @@ namespace WebCore {
// - Application Cache
// - Back/Forward Page History
// - Page Search Results
+ // - HTTP Cookies
+ // - Plug-ins (that support NPNVprivateModeBool)
void setPrivateBrowsingEnabled(bool);
bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
@@ -398,10 +400,15 @@ namespace WebCore {
void setHyperlinkAuditingEnabled(bool flag) { m_hyperlinkAuditingEnabled = flag; }
bool hyperlinkAuditingEnabled() const { return m_hyperlinkAuditingEnabled; }
+<<<<<<< HEAD
#if ENABLE(WEB_AUTOFILL)
void setAutoFillEnabled(bool flag) { m_autoFillEnabled = flag; }
bool autoFillEnabled() { return m_autoFillEnabled; }
#endif
+=======
+ void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
+ bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
+>>>>>>> webkit.org at r70949
private:
Page* m_page;
@@ -528,12 +535,16 @@ namespace WebCore {
bool m_interactiveFormValidation: 1;
bool m_usePreHTML5ParserQuirks: 1;
bool m_hyperlinkAuditingEnabled : 1;
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
#if ENABLE(WEB_AUTOFILL)
bool m_autoFillEnabled: 1;
#endif
+=======
+ bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
+>>>>>>> webkit.org at r70949
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index 234791b..f36ed4d 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -85,7 +85,7 @@ void SpeechInput::didCompleteRecognition(int listenerId)
m_listeners.get(listenerId)->didCompleteRecognition(listenerId);
}
-void SpeechInput::setRecognitionResult(int listenerId, const String& result)
+void SpeechInput::setRecognitionResult(int listenerId, const SpeechInputResultArray& result)
{
// Don't assert if not present as the element might have been removed by the page while
// this event was on the way.
@@ -93,10 +93,10 @@ void SpeechInput::setRecognitionResult(int listenerId, const String& result)
m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
}
-bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect)
+bool SpeechInput::startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar)
{
ASSERT(m_listeners.contains(listenerId));
- return m_client->startRecognition(listenerId, elementRect);
+ return m_client->startRecognition(listenerId, elementRect, language, grammar);
}
void SpeechInput::stopRecording(int listenerId)
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index d10b789..4532d49 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -61,14 +61,14 @@ public:
void unregisterListener(int);
// Methods invoked by the input elements.
- bool startRecognition(int, const IntRect&);
+ bool startRecognition(int listenerId, const IntRect& elementRect, const AtomicString& language, const String& grammar);
void stopRecording(int);
void cancelRecognition(int);
// SpeechInputListener methods.
virtual void didCompleteRecording(int);
virtual void didCompleteRecognition(int);
- virtual void setRecognitionResult(int, const String&);
+ virtual void setRecognitionResult(int, const SpeechInputResultArray&);
private:
SpeechInputClient* m_client;
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index d5fda17..2a2e160 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -31,6 +31,8 @@
#ifndef SpeechInputClient_h
#define SpeechInputClient_h
+#include <wtf/Forward.h>
+
#if ENABLE(INPUT_SPEECH)
namespace WebCore {
@@ -48,7 +50,7 @@ public:
virtual void setListener(SpeechInputListener*) = 0;
// Starts speech recognition and audio recording.
- virtual bool startRecognition(int requestId, const IntRect& elementRect) = 0;
+ virtual bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar) = 0;
// Stops audio recording and performs recognition with the audio recorded until now
// (does not discard audio).
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
index 36060fc..568b1b7 100644
--- a/WebCore/page/SpeechInputListener.h
+++ b/WebCore/page/SpeechInputListener.h
@@ -33,10 +33,13 @@
#if ENABLE(INPUT_SPEECH)
+#include "SpeechInputResult.h"
#include <wtf/Forward.h>
namespace WebCore {
+typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray;
+
// Interface to be implemented by the element which invokes SpeechInput.
class SpeechInputListener {
public:
@@ -53,7 +56,7 @@ public:
// This method can potentially get called multiple times if there are partial results
// available as the user keeps speaking. If the speech could not be recognized properly
// or if there was any other errors in the process, this method may never be called.
- virtual void setRecognitionResult(int requestId, const String& result) = 0;
+ virtual void setRecognitionResult(int requestId, const SpeechInputResultArray&) = 0;
protected:
virtual ~SpeechInputListener() { }
diff --git a/WebCore/page/SpeechInputResult.cpp b/WebCore/page/SpeechInputResult.cpp
new file mode 100644
index 0000000..f5b6972
--- /dev/null
+++ b/WebCore/page/SpeechInputResult.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.
+ *
+ * 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 "SpeechInputResult.h"
+
+#if ENABLE(INPUT_SPEECH)
+
+namespace WebCore {
+
+PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence)
+{
+ return adoptRef(new SpeechInputResult(utterance, confidence));
+}
+
+SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)
+ : m_utterance(utterance)
+ , m_confidence(confidence)
+{
+}
+
+double SpeechInputResult::confidence() const
+{
+ return m_confidence;
+}
+
+const String& SpeechInputResult::utterance() const
+{
+ return m_utterance;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/page/SpeechInputResult.h b/WebCore/page/SpeechInputResult.h
new file mode 100644
index 0000000..ef9fd10
--- /dev/null
+++ b/WebCore/page/SpeechInputResult.h
@@ -0,0 +1,57 @@
+/*
+ * 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 ``AS IS'' AND ANY
+ * EXPRESS OR 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 SpeechInputResult_h
+#define SpeechInputResult_h
+
+#if ENABLE(INPUT_SPEECH)
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+// This class holds one speech recognition result including the text and other related
+// fields, as received from the embedder.
+class SpeechInputResult : public RefCounted<SpeechInputResult> {
+public:
+ static PassRefPtr<SpeechInputResult> create(const String& utterance, double confidence);
+
+ double confidence() const;
+ const String& utterance() const;
+
+private:
+ SpeechInputResult(const String& utterance, double confidence);
+
+ String m_utterance;
+ double m_confidence;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INPUT_SPEECH)
+
+#endif // SpeechInputResult_h
diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp
index df963fb..84d6b97 100644
--- a/WebCore/page/animation/KeyframeAnimation.cpp
+++ b/WebCore/page/animation/KeyframeAnimation.cpp
@@ -47,6 +47,7 @@ KeyframeAnimation::KeyframeAnimation(const Animation* animation, RenderObject* r
: AnimationBase(animation, renderer, compAnim)
, m_keyframes(renderer, animation->name())
, m_index(index)
+ , m_startEventDispatched(false)
, m_unanimatedStyle(unanimatedStyle)
{
// Get the keyframe RenderStyles
@@ -323,6 +324,9 @@ bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double
listenerType = Document::ANIMATIONEND_LISTENER;
else {
ASSERT(eventType == eventNames().webkitAnimationStartEvent);
+ if (m_startEventDispatched)
+ return false;
+ m_startEventDispatched = true;
listenerType = Document::ANIMATIONSTART_LISTENER;
}
diff --git a/WebCore/page/animation/KeyframeAnimation.h b/WebCore/page/animation/KeyframeAnimation.h
index a187f35..5099b50 100644
--- a/WebCore/page/animation/KeyframeAnimation.h
+++ b/WebCore/page/animation/KeyframeAnimation.h
@@ -90,6 +90,7 @@ private:
// The order in which this animation appears in the animation-name style.
int m_index;
+ bool m_startEventDispatched;
// The style just before we started animation
RefPtr<RenderStyle> m_unanimatedStyle;
diff --git a/WebCore/platform/AsyncFileSystemCallbacks.h b/WebCore/platform/AsyncFileSystemCallbacks.h
index 451aead..290a669 100644
--- a/WebCore/platform/AsyncFileSystemCallbacks.h
+++ b/WebCore/platform/AsyncFileSystemCallbacks.h
@@ -39,6 +39,7 @@ namespace WebCore {
class AsyncFileSystem;
class AsyncFileWriter;
+struct FileMetadata;
class AsyncFileSystemCallbacks : public Noncopyable {
public:
@@ -49,7 +50,7 @@ public:
virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>) = 0;
// Called when a file metadata is read successfully.
- virtual void didReadMetadata(double modificationTime) = 0;
+ virtual void didReadMetadata(const FileMetadata&) = 0;
// Called when a directory entry is read.
virtual void didReadDirectoryEntry(const String& name, bool isDirectory) = 0;
diff --git a/WebCore/platform/ContextMenu.cpp b/WebCore/platform/ContextMenu.cpp
index ca1f719..369f9ce 100644
--- a/WebCore/platform/ContextMenu.cpp
+++ b/WebCore/platform/ContextMenu.cpp
@@ -428,7 +428,7 @@ void ContextMenu::populate()
} else { // Make an editing context menu
SelectionController* selection = frame->selection();
bool inPasswordField = selection->isInPasswordField();
- bool spellCheckingEnabled = frame->editor()->spellCheckingEnabledInFocusedNode();
+ bool spellCheckingEnabled = frame->editor()->isSpellCheckingEnabledInFocusedNode();
if (!inPasswordField && spellCheckingEnabled) {
// Consider adding spelling-related or grammar-related context menu items (never both, since a single selected range
diff --git a/WebCore/platform/FileMetadata.h b/WebCore/platform/FileMetadata.h
new file mode 100644
index 0000000..9b7d09b
--- /dev/null
+++ b/WebCore/platform/FileMetadata.h
@@ -0,0 +1,62 @@
+/*
+ * 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 FileMetadata_h
+#define FileMetadata_h
+
+#if ENABLE(FILE_SYSTEM)
+
+namespace WebCore {
+
+struct FileMetadata {
+ // The last modification time of the file, in seconds.
+ // The value 0.0 means that the time is not set.
+ double modificationTime;
+
+ // 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;
+
+ FileMetadata() : modificationTime(0.0), length(-1), type(TypeUnknown) { }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // FileMetadata_h
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 0ae1389..1e986a7 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -337,7 +337,10 @@ static MediaMIMETypeMap& mediaMIMETypeMap()
// CoreAudio File
{ "audio/x-caf", "caf" },
- { "audio/x-gsm", "gsm" }
+ { "audio/x-gsm", "gsm" },
+
+ // ADPCM
+ { "audio/x-wav", "wav" }
};
DEFINE_STATIC_LOCAL(MediaMIMETypeMap, mediaMIMETypeForExtensionMap, ());
@@ -355,7 +358,7 @@ static MediaMIMETypeMap& mediaMIMETypeMap()
// If there is a system specific type for this extension, add it as the first type so
// getMediaMIMETypeForExtension will always return it.
- String systemType = MIMETypeRegistry::getMIMETypeForExtension(pairs[ndx].type);
+ String systemType = MIMETypeRegistry::getMIMETypeForExtension(pairs[ndx].extension);
if (!systemType.isEmpty() && pairs[ndx].type != systemType)
synonyms->append(systemType);
synonyms->append(pairs[ndx].type);
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index fac37d7..5f745b8 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -565,6 +565,8 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
hostWindow()->invalidateWindow(updateRect, false /*immediate*/);
if (m_drawPanScrollIcon) {
+ // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
+ // https://bugs.webkit.org/show_bug.cgi?id=47837
int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation , IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
@@ -575,11 +577,11 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
if (canBlitOnScroll()) { // The main frame can just blit the WebView window
// FIXME: Find a way to scroll subframes with this faster path
if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
- hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+ scrollContentsSlowPath(updateRect);
} else {
// We need to go ahead and repaint the entire backing store. Do it now before moving the
// windowed plugins.
- hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+ scrollContentsSlowPath(updateRect);
}
// This call will move children with native widgets (plugins) and invalidate them as well.
@@ -595,6 +597,11 @@ bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRec
return true;
}
+void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+ hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
+}
+
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
{
IntPoint viewPoint = convertFromContainingWindow(windowPoint);
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 1744963..739e1ac 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -271,8 +271,10 @@ protected:
virtual void updateScrollCorner();
virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
- // Scroll the content by blitting the pixels
+ // Scroll the content by blitting the pixels.
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+ // Scroll the content by invalidating everything.
+ virtual void scrollContentsSlowPath(const IntRect& updateRect);
private:
RefPtr<Scrollbar> m_horizontalScrollbar;
@@ -353,6 +355,8 @@ private:
#if PLATFORM(GTK)
public:
void setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, bool resetValues = true);
+ void setHorizontalAdjustment(GtkAdjustment* hadj, bool resetValues = true);
+ void setVerticalAdjustment(GtkAdjustment* vadj, bool resetValues = true);
void setScrollOffset(const IntSize& offset) { m_scrollOffset = offset; }
private:
diff --git a/WebCore/platform/UUID.cpp b/WebCore/platform/UUID.cpp
index fdbf601..5208bee 100644
--- a/WebCore/platform/UUID.cpp
+++ b/WebCore/platform/UUID.cpp
@@ -44,8 +44,11 @@
#endif
#elif OS(DARWIN)
#include <CoreFoundation/CoreFoundation.h>
-#elif OS(LINUX)
+#elif OS(LINUX) && !PLATFORM(CHROMIUM)
#include <stdio.h>
+#elif OS(LINUX) && PLATFORM(CHROMIUM)
+#include <wtf/RandomNumber.h>
+#include <wtf/text/StringBuilder.h>
#endif
namespace WebCore {
@@ -80,7 +83,8 @@ String createCanonicalUUIDString()
String canonicalUuidStr = uuidStr.lower(); // make it lower.
ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
return canonicalUuidStr;
-#elif OS(LINUX)
+#elif OS(LINUX) && !PLATFORM(CHROMIUM)
+ // This does not work for the linux system that turns on sandbox.
FILE* fptr = fopen("/proc/sys/kernel/random/uuid", "r");
if (!fptr)
return String();
@@ -92,10 +96,29 @@ String createCanonicalUUIDString()
String canonicalUuidStr = String(uuidStr).lower(); // make it lower.
ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
return canonicalUuidStr;
+#elif OS(LINUX) && PLATFORM(CHROMIUM)
+ unsigned randomData[4];
+ for (size_t i = 0; i < sizeof(randomData) / sizeof(randomData[0]); ++i)
+ randomData[i] = static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0));
+
+ // Format as Version 4 UUID.
+ StringBuilder builder;
+ builder.append(String::format("%08x", randomData[0]));
+ builder.append("-");
+ builder.append(String::format("%04x", randomData[1] >> 16));
+ builder.append("-4");
+ builder.append(String::format("%03x", randomData[1] & 0x00000fff));
+ builder.append("-");
+ builder.append(String::format("%x", (randomData[2] >> 30) | 0x8)); // Condense this byte to 8, 9, a, and b.
+ builder.append(String::format("%03x", (randomData[2] >> 16) & 0x00000fff));
+ builder.append("-");
+ builder.append(String::format("%04x", randomData[2] & 0x0000ffff));
+ builder.append(String::format("%08x", randomData[3]));
+ return builder.toString();
#else
notImplemented();
return String();
-#endif
+#endif
}
}
diff --git a/WebCore/platform/android/TemporaryLinkStubs.cpp b/WebCore/platform/android/TemporaryLinkStubs.cpp
index 3997739..53640b6 100644
--- a/WebCore/platform/android/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/android/TemporaryLinkStubs.cpp
@@ -36,6 +36,7 @@
#include "ContextMenu.h"
#include "ContextMenuItem.h"
#include "CookieJar.h"
+#include "CookieStorage.h"
#include "Cursor.h"
#include "Database.h"
#include "DocumentFragment.h"
@@ -487,4 +488,9 @@ OpaqueJSClassContextData::~OpaqueJSClassContextData()
notImplemented();
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
#endif
diff --git a/WebCore/platform/audio/AudioBus.cpp b/WebCore/platform/audio/AudioBus.cpp
index 6b7ec3f..dd4746d 100644
--- a/WebCore/platform/audio/AudioBus.cpp
+++ b/WebCore/platform/audio/AudioBus.cpp
@@ -32,7 +32,7 @@
#include "AudioBus.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include <algorithm>
#include <assert.h>
#include <math.h>
@@ -41,6 +41,8 @@
namespace WebCore {
+using namespace VectorMath;
+
AudioBus::AudioBus(unsigned numberOfChannels, size_t length, bool allocate)
: m_length(length)
, m_busGain(1.0)
diff --git a/WebCore/platform/audio/AudioChannel.cpp b/WebCore/platform/audio/AudioChannel.cpp
index ad38219..a962deb 100644
--- a/WebCore/platform/audio/AudioChannel.cpp
+++ b/WebCore/platform/audio/AudioChannel.cpp
@@ -32,13 +32,15 @@
#include "AudioChannel.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include <algorithm>
#include <math.h>
#include <wtf/OwnPtr.h>
namespace WebCore {
+using namespace VectorMath;
+
void AudioChannel::scale(double scale)
{
float s = static_cast<float>(scale);
diff --git a/WebCore/platform/audio/AudioDSPKernel.h b/WebCore/platform/audio/AudioDSPKernel.h
index d9be6dc..d0719c5 100644
--- a/WebCore/platform/audio/AudioDSPKernel.h
+++ b/WebCore/platform/audio/AudioDSPKernel.h
@@ -41,6 +41,13 @@ class AudioDSPKernel {
public:
AudioDSPKernel(AudioDSPKernelProcessor* kernelProcessor)
: m_kernelProcessor(kernelProcessor)
+ , m_sampleRate(kernelProcessor->sampleRate())
+ {
+ }
+
+ AudioDSPKernel(double sampleRate)
+ : m_kernelProcessor(0)
+ , m_sampleRate(sampleRate)
{
}
@@ -50,7 +57,7 @@ public:
virtual void process(const float* source, float* destination, size_t framesToProcess) = 0;
virtual void reset() = 0;
- double sampleRate() const { return processor()->sampleRate(); }
+ double sampleRate() const { return m_sampleRate; }
double nyquist() const { return 0.5 * sampleRate(); }
AudioDSPKernelProcessor* processor() { return m_kernelProcessor; }
@@ -58,6 +65,7 @@ public:
protected:
AudioDSPKernelProcessor* m_kernelProcessor;
+ double m_sampleRate;
};
} // namespace WebCore
diff --git a/WebCore/platform/audio/AudioResamplerKernel.cpp b/WebCore/platform/audio/AudioResamplerKernel.cpp
new file mode 100644
index 0000000..7b99997
--- /dev/null
+++ b/WebCore/platform/audio/AudioResamplerKernel.cpp
@@ -0,0 +1,143 @@
+/*
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioResamplerKernel.h"
+
+#include "AudioResampler.h"
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+const size_t AudioResamplerKernel::MaxFramesToProcess = 128;
+
+AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler)
+ : m_resampler(resampler)
+ // The buffer size must be large enough to hold up to two extra sample frames for the linear interpolation.
+ , m_sourceBuffer(2 + static_cast<int>(MaxFramesToProcess * AudioResampler::MaxRate))
+ , m_virtualReadIndex(0.0)
+ , m_fillIndex(0)
+{
+ m_lastValues[0] = 0.0f;
+ m_lastValues[1] = 0.0f;
+}
+
+float* AudioResamplerKernel::getSourcePointer(size_t framesToProcess, size_t* numberOfSourceFramesNeededP)
+{
+ ASSERT(framesToProcess <= MaxFramesToProcess);
+
+ // Calculate the next "virtual" index. After process() is called, m_virtualReadIndex will equal this value.
+ double nextFractionalIndex = m_virtualReadIndex + framesToProcess * rate();
+
+ // Because we're linearly interpolating between the previous and next sample we need to round up so we include the next sample.
+ int endIndex = static_cast<int>(nextFractionalIndex + 1.0); // round up to next integer index
+
+ // Determine how many input frames we'll need.
+ // We need to fill the buffer up to and including endIndex (so add 1) but we've already buffered m_fillIndex frames from last time.
+ size_t framesNeeded = 1 + endIndex - m_fillIndex;
+ if (numberOfSourceFramesNeededP)
+ *numberOfSourceFramesNeededP = framesNeeded;
+
+ // Do bounds checking for the source buffer.
+ bool isGood = m_fillIndex < m_sourceBuffer.size() && m_fillIndex + framesNeeded <= m_sourceBuffer.size();
+ ASSERT(isGood);
+ if (!isGood)
+ return 0;
+
+ return m_sourceBuffer.data() + m_fillIndex;
+}
+
+void AudioResamplerKernel::process(float* destination, size_t framesToProcess)
+{
+ ASSERT(framesToProcess <= MaxFramesToProcess);
+
+ float* source = m_sourceBuffer.data();
+
+ double rate = this->rate();
+ rate = max(0.0, rate);
+ rate = min(AudioResampler::MaxRate, rate);
+
+ // Start out with the previous saved values (if any).
+ if (m_fillIndex > 0) {
+ source[0] = m_lastValues[0];
+ source[1] = m_lastValues[1];
+ }
+
+ // Make a local copy.
+ double virtualReadIndex = m_virtualReadIndex;
+
+ // Sanity check source buffer access.
+ ASSERT(framesToProcess > 0);
+ ASSERT(virtualReadIndex >= 0 && 1 + static_cast<unsigned>(virtualReadIndex + (framesToProcess - 1) * rate) < m_sourceBuffer.size());
+
+ // Do the linear interpolation.
+ int n = framesToProcess;
+ while (n--) {
+ unsigned readIndex = static_cast<unsigned>(virtualReadIndex);
+ double interpolationFactor = virtualReadIndex - readIndex;
+
+ double sample1 = source[readIndex];
+ double sample2 = source[readIndex + 1];
+
+ double sample = (1.0 - interpolationFactor) * sample1 + interpolationFactor * sample2;
+
+ *destination++ = static_cast<float>(sample);
+
+ virtualReadIndex += rate;
+ }
+
+ // Save the last two sample-frames which will later be used at the beginning of the source buffer the next time around.
+ int readIndex = static_cast<int>(virtualReadIndex);
+ m_lastValues[0] = source[readIndex];
+ m_lastValues[1] = source[readIndex + 1];
+ m_fillIndex = 2;
+
+ // Wrap the virtual read index back to the start of the buffer.
+ virtualReadIndex -= readIndex;
+
+ // Put local copy back into member variable.
+ m_virtualReadIndex = virtualReadIndex;
+}
+
+void AudioResamplerKernel::reset()
+{
+ m_virtualReadIndex = 0.0;
+ m_fillIndex = 0;
+ m_lastValues[0] = 0.0f;
+ m_lastValues[1] = 0.0f;
+}
+
+double AudioResamplerKernel::rate() const
+{
+ return m_resampler->rate();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/AudioResamplerKernel.h b/WebCore/platform/audio/AudioResamplerKernel.h
new file mode 100644
index 0000000..99d877b
--- /dev/null
+++ b/WebCore/platform/audio/AudioResamplerKernel.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.
+ *
+ * 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 AudioResamplerKernel_h
+#define AudioResamplerKernel_h
+
+#include "AudioArray.h"
+
+namespace WebCore {
+
+class AudioResampler;
+
+// AudioResamplerKernel does resampling on a single mono channel.
+// It uses a simple linear interpolation for good performance.
+
+class AudioResamplerKernel {
+public:
+ AudioResamplerKernel(AudioResampler*);
+
+ // getSourcePointer() should be called each time before process() is called.
+ // Given a number of frames to process (for subsequent call to process()), it returns a pointer and numberOfSourceFramesNeeded
+ // where sample data should be copied. This sample data provides the input to the resampler when process() is called.
+ // framesToProcess must be less than or equal to MaxFramesToProcess.
+ float* getSourcePointer(size_t framesToProcess, size_t* numberOfSourceFramesNeeded);
+
+ // process() resamples framesToProcess frames from the source into destination.
+ // Each call to process() must be preceded by a call to getSourcePointer() so that source input may be supplied.
+ // framesToProcess must be less than or equal to MaxFramesToProcess.
+ void process(float* destination, size_t framesToProcess);
+
+ // Resets the processing state.
+ void reset();
+
+ static const size_t MaxFramesToProcess;
+
+private:
+ double rate() const;
+
+ AudioResampler* m_resampler;
+ AudioFloatArray m_sourceBuffer;
+
+ // This is a (floating point) read index on the input stream.
+ double m_virtualReadIndex;
+
+ // We need to have continuity from one call of process() to the next.
+ // m_lastValues stores the last two sample values from the last call to process().
+ // m_fillIndex represents how many buffered samples we have which can be as many as 2.
+ // For the first call to process() (or after reset()) there will be no buffered samples.
+ float m_lastValues[2];
+ unsigned m_fillIndex;
+};
+
+} // namespace WebCore
+
+#endif // AudioResamplerKernel_h
diff --git a/WebCore/platform/audio/Biquad.cpp b/WebCore/platform/audio/Biquad.cpp
index 6918dd6..49f010b 100644
--- a/WebCore/platform/audio/Biquad.cpp
+++ b/WebCore/platform/audio/Biquad.cpp
@@ -32,12 +32,15 @@
#include "Biquad.h"
-#include "Accelerate.h"
#include <algorithm>
#include <float.h>
#include <math.h>
#include <stdio.h>
+#if OS(DARWIN)
+#include <Accelerate/Accelerate.h>
+#endif
+
namespace WebCore {
const int kBufferSize = 1024;
diff --git a/WebCore/platform/audio/FFTConvolver.cpp b/WebCore/platform/audio/FFTConvolver.cpp
index b0211fd..9093433 100644
--- a/WebCore/platform/audio/FFTConvolver.cpp
+++ b/WebCore/platform/audio/FFTConvolver.cpp
@@ -32,10 +32,12 @@
#include "FFTConvolver.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
namespace WebCore {
+using namespace VectorMath;
+
FFTConvolver::FFTConvolver(size_t fftSize)
: m_frame(fftSize)
, m_readWriteIndex(0)
diff --git a/WebCore/platform/audio/FFTConvolver.h b/WebCore/platform/audio/FFTConvolver.h
index 0eec7c1..c1b5002 100644
--- a/WebCore/platform/audio/FFTConvolver.h
+++ b/WebCore/platform/audio/FFTConvolver.h
@@ -29,7 +29,7 @@
#ifndef FFTConvolver_h
#define FFTConvolver_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
#include "FFTFrame.h"
namespace WebCore {
diff --git a/WebCore/platform/audio/Panner.cpp b/WebCore/platform/audio/Panner.cpp
index 29a1fbe..a300786 100644
--- a/WebCore/platform/audio/Panner.cpp
+++ b/WebCore/platform/audio/Panner.cpp
@@ -45,7 +45,7 @@ PassOwnPtr<Panner> Panner::create(PanningModel model, double sampleRate)
switch (model) {
case PanningModelEqualPower:
- panner = adoptPtr(new EqualPowerPanner());
+ panner = adoptPtr(new EqualPowerPanner(sampleRate));
break;
case PanningModelHRTF:
diff --git a/WebCore/platform/audio/Reverb.cpp b/WebCore/platform/audio/Reverb.cpp
index 886a553..e59ff46 100644
--- a/WebCore/platform/audio/Reverb.cpp
+++ b/WebCore/platform/audio/Reverb.cpp
@@ -56,12 +56,12 @@ static double calculateNormalizationScale(AudioBus* response)
{
// Normalize by RMS power
size_t numberOfChannels = response->numberOfChannels();
- size_t frameSize = response->frameSize();
+ size_t length = response->length();
double power = 0.0;
for (size_t i = 0; i < numberOfChannels; ++i) {
- int n = frameSize;
+ int n = length;
float* p = response->channel(i)->data();
while (n--) {
@@ -70,7 +70,7 @@ static double calculateNormalizationScale(AudioBus* response)
}
}
- power = sqrt(power / (numberOfChannels * frameSize));
+ power = sqrt(power / (numberOfChannels * length));
// Protect against accidental overload
if (isinf(power) || isnan(power) || power < MinPower)
@@ -102,7 +102,7 @@ Reverb::Reverb(AudioBus* impulseResponse, size_t renderSliceSize, size_t maxFFTS
void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads)
{
- m_impulseResponseLength = impulseResponseBuffer->frameSize();
+ m_impulseResponseLength = impulseResponseBuffer->length();
// The reverb can handle a mono impulse response and still do stereo processing
size_t numResponseChannels = impulseResponseBuffer->numberOfChannels();
@@ -112,8 +112,8 @@ void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize,
for (size_t i = 0; i < numResponseChannels; ++i) {
AudioChannel* channel = impulseResponseBuffer->channel(i);
- ReverbConvolver* convolver = new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads);
- m_convolvers.append(convolver);
+ OwnPtr<ReverbConvolver> convolver = adoptPtr(new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads));
+ m_convolvers.append(convolver.release());
convolverRenderPhase += renderSliceSize;
}
@@ -129,7 +129,7 @@ void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t frame
// Do a fairly comprehensive sanity check.
// If these conditions are satisfied, all of the source and destination pointers will be valid for the various matrixing cases.
bool isSafeToProcess = sourceBus && destinationBus && sourceBus->numberOfChannels() > 0 && destinationBus->numberOfChannels() > 0
- && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->frameSize() && framesToProcess <= destinationBus->frameSize();
+ && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->length() && framesToProcess <= destinationBus->length();
ASSERT(isSafeToProcess);
if (!isSafeToProcess)
@@ -167,7 +167,7 @@ void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t frame
// simply copy L -> R
AudioChannel* destinationChannelR = destinationBus->channel(1);
- bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->frameSize() >= framesToProcess && destinationChannelR->frameSize() >= framesToProcess;
+ bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->length() >= framesToProcess && destinationChannelR->length() >= framesToProcess;
ASSERT(isCopySafe);
if (!isCopySafe)
return;
diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
index 7b1c63b..3d694d1 100644
--- a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
+++ b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp
@@ -32,10 +32,12 @@
#include "ReverbAccumulationBuffer.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
namespace WebCore {
+using namespace VectorMath;
+
ReverbAccumulationBuffer::ReverbAccumulationBuffer(size_t length)
: m_buffer(length)
, m_readIndex(0)
diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.h b/WebCore/platform/audio/ReverbAccumulationBuffer.h
index 44a0773..f5ead2a 100644
--- a/WebCore/platform/audio/ReverbAccumulationBuffer.h
+++ b/WebCore/platform/audio/ReverbAccumulationBuffer.h
@@ -29,7 +29,7 @@
#ifndef ReverbAccumulationBuffer_h
#define ReverbAccumulationBuffer_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
namespace WebCore {
diff --git a/WebCore/platform/audio/ReverbConvolver.cpp b/WebCore/platform/audio/ReverbConvolver.cpp
index 719e586..120c9f2 100644
--- a/WebCore/platform/audio/ReverbConvolver.cpp
+++ b/WebCore/platform/audio/ReverbConvolver.cpp
@@ -32,11 +32,13 @@
#include "ReverbConvolver.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include "AudioBus.h"
namespace WebCore {
+using namespace VectorMath;
+
const int InputBufferSize = 8 * 16384;
// We only process the leading portion of the impulse response in the real-time thread. We don't exceed this length.
@@ -59,8 +61,8 @@ static void* backgroundThreadEntry(void* threadData)
}
ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t convolverRenderPhase, bool useBackgroundThreads)
- : m_impulseResponseLength(impulseResponse->frameSize())
- , m_accumulationBuffer(impulseResponse->frameSize() + renderSliceSize)
+ : m_impulseResponseLength(impulseResponse->length())
+ , m_accumulationBuffer(impulseResponse->length() + renderSliceSize)
, m_inputBuffer(InputBufferSize)
, m_renderSliceSize(renderSliceSize)
, m_minFFTSize(MinFFTSize) // First stage will have this size - successive stages will double in size each time
@@ -81,7 +83,7 @@ ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSli
bool hasRealtimeConstraint = useBackgroundThreads;
float* response = impulseResponse->data();
- size_t totalResponseLength = impulseResponse->frameSize();
+ size_t totalResponseLength = impulseResponse->length();
// Because we're not using direct-convolution in the leading portion, the reverb has an overall latency of half the first-stage FFT size
size_t reverbTotalLatency = m_minFFTSize / 2;
@@ -175,7 +177,7 @@ void ReverbConvolver::backgroundThreadEntry()
void ReverbConvolver::process(AudioChannel* sourceChannel, AudioChannel* destinationChannel, size_t framesToProcess)
{
- bool isSafe = sourceChannel && destinationChannel && sourceChannel->frameSize() >= framesToProcess && destinationChannel->frameSize() >= framesToProcess;
+ bool isSafe = sourceChannel && destinationChannel && sourceChannel->length() >= framesToProcess && destinationChannel->length() >= framesToProcess;
ASSERT(isSafe);
if (!isSafe)
return;
diff --git a/WebCore/platform/audio/ReverbConvolver.h b/WebCore/platform/audio/ReverbConvolver.h
index 34f77d3..013b684 100644
--- a/WebCore/platform/audio/ReverbConvolver.h
+++ b/WebCore/platform/audio/ReverbConvolver.h
@@ -29,7 +29,7 @@
#ifndef ReverbConvolver_h
#define ReverbConvolver_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
#include "FFTConvolver.h"
#include "ReverbAccumulationBuffer.h"
#include "ReverbConvolverStage.h"
diff --git a/WebCore/platform/audio/ReverbConvolverStage.cpp b/WebCore/platform/audio/ReverbConvolverStage.cpp
index 8606502..e722813 100644
--- a/WebCore/platform/audio/ReverbConvolverStage.cpp
+++ b/WebCore/platform/audio/ReverbConvolverStage.cpp
@@ -32,7 +32,7 @@
#include "ReverbConvolverStage.h"
-#include "Accelerate.h"
+#include "VectorMath.h"
#include "ReverbAccumulationBuffer.h"
#include "ReverbConvolver.h"
#include "ReverbInputBuffer.h"
@@ -41,6 +41,8 @@
namespace WebCore {
+using namespace VectorMath;
+
ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t responseLength, size_t reverbTotalLatency, size_t stageOffset, size_t stageLength,
size_t fftSize, size_t renderPhase, size_t renderSliceSize, ReverbAccumulationBuffer* accumulationBuffer)
: m_fftKernel(fftSize)
@@ -53,8 +55,8 @@ ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t respon
ASSERT(accumulationBuffer);
m_fftKernel.doPaddedFFT(impulseResponse + stageOffset, stageLength);
- m_convolver = new FFTConvolver(fftSize);
- m_temporaryBuffer.allocate(renderSliceSize);
+ m_convolver = adoptPtr(new FFTConvolver(fftSize));
+ m_temporaryBuffer.resize(renderSliceSize);
// The convolution stage at offset stageOffset needs to have a corresponding delay to cancel out the offset.
size_t totalDelay = stageOffset + reverbTotalLatency;
@@ -76,7 +78,7 @@ ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t respon
m_preReadWriteIndex = 0;
m_framesProcessed = 0; // total frames processed so far
- m_preDelayBuffer.allocate(m_preDelayLength < fftSize ? fftSize : m_preDelayLength);
+ m_preDelayBuffer.resize(m_preDelayLength < fftSize ? fftSize : m_preDelayLength);
}
void ReverbConvolverStage::processInBackground(ReverbConvolver* convolver, size_t framesToProcess)
diff --git a/WebCore/platform/audio/ReverbConvolverStage.h b/WebCore/platform/audio/ReverbConvolverStage.h
index 88351af..fc05a0e 100644
--- a/WebCore/platform/audio/ReverbConvolverStage.h
+++ b/WebCore/platform/audio/ReverbConvolverStage.h
@@ -29,7 +29,7 @@
#ifndef ReverbConvolverStage_h
#define ReverbConvolverStage_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
#include "FFTFrame.h"
#include <wtf/OwnPtr.h>
diff --git a/WebCore/platform/audio/ReverbInputBuffer.h b/WebCore/platform/audio/ReverbInputBuffer.h
index aa9cf41..15a2818 100644
--- a/WebCore/platform/audio/ReverbInputBuffer.h
+++ b/WebCore/platform/audio/ReverbInputBuffer.h
@@ -29,7 +29,7 @@
#ifndef ReverbInputBuffer_h
#define ReverbInputBuffer_h
-#include "AudioFloatArray.h"
+#include "AudioArray.h"
namespace WebCore {
diff --git a/WebCore/platform/audio/VectorMath.cpp b/WebCore/platform/audio/VectorMath.cpp
new file mode 100644
index 0000000..faf5431
--- /dev/null
+++ b/WebCore/platform/audio/VectorMath.cpp
@@ -0,0 +1,84 @@
+/*
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "VectorMath.h"
+
+#if OS(DARWIN)
+#include <Accelerate/Accelerate.h>
+#endif
+
+namespace WebCore {
+
+namespace VectorMath {
+
+#if OS(DARWIN)
+// On the Mac we use the highly optimized versions in Accelerate.framework
+
+void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess)
+{
+ vDSP_vsmul(sourceP, sourceStride, scale, destP, destStride, framesToProcess);
+}
+
+void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess)
+{
+ vDSP_vadd(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess);
+}
+
+#else
+
+void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess)
+{
+ // FIXME: optimize for SSE
+ int n = framesToProcess;
+ float k = *scale;
+ while (n--) {
+ *destP = k * *sourceP;
+ sourceP += sourceStride;
+ destP += destStride;
+ }
+}
+
+void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess)
+{
+ // FIXME: optimize for SSE
+ int n = framesToProcess;
+ while (n--) {
+ *destP = *source1P + *source2P;
+ source1P += sourceStride1;
+ source2P += sourceStride2;
+ destP += destStride;
+ }
+}
+
+#endif // OS(DARWIN)
+
+} // namespace VectorMath
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/platform/audio/VectorMath.h b/WebCore/platform/audio/VectorMath.h
new file mode 100644
index 0000000..0360bdb
--- /dev/null
+++ b/WebCore/platform/audio/VectorMath.h
@@ -0,0 +1,41 @@
+/*
+ * 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 VectorMath_h
+#define VectorMath_h
+
+// Defines the interface for several vector math functions whose implementation will ideally be optimized.
+
+namespace WebCore {
+
+namespace VectorMath {
+
+void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess);
+void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess);
+
+} // namespace VectorMath
+
+} // namespace WebCore
+
+#endif // VectorMath_h
diff --git a/WebCore/platform/brew/LanguageBrew.cpp b/WebCore/platform/brew/LanguageBrew.cpp
new file mode 100644
index 0000000..ce41973
--- /dev/null
+++ b/WebCore/platform/brew/LanguageBrew.cpp
@@ -0,0 +1,40 @@
+/*
+ * 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:
+ * 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 "Language.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+String platformDefaultLanguage()
+{
+ notImplemented();
+ return String();
+}
+
+}
diff --git a/WebCore/platform/brew/LocalizedStringsBrew.cpp b/WebCore/platform/brew/LocalizedStringsBrew.cpp
index 2dfd12b..7c6c564 100644
--- a/WebCore/platform/brew/LocalizedStringsBrew.cpp
+++ b/WebCore/platform/brew/LocalizedStringsBrew.cpp
@@ -46,11 +46,6 @@ String resetButtonDefaultLabel()
return "Reset";
}
-String defaultLanguage()
-{
- return "en";
-}
-
String searchableIndexIntroduction()
{
return "Searchable Index";
diff --git a/WebCore/platform/brew/TemporaryLinkStubs.cpp b/WebCore/platform/brew/TemporaryLinkStubs.cpp
new file mode 100644
index 0000000..d75c224
--- /dev/null
+++ b/WebCore/platform/brew/TemporaryLinkStubs.cpp
@@ -0,0 +1,40 @@
+/*
+ * 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:
+ * 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 "NotImplemented.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
+}
+
diff --git a/WebCore/platform/cf/SchedulePair.h b/WebCore/platform/cf/SchedulePair.h
index ed58406..8361856 100644
--- a/WebCore/platform/cf/SchedulePair.h
+++ b/WebCore/platform/cf/SchedulePair.h
@@ -73,7 +73,7 @@ struct SchedulePairHash {
static unsigned hash(const RefPtr<SchedulePair>& pair)
{
uintptr_t hashCodes[2] = { reinterpret_cast<uintptr_t>(pair->runLoop()), pair->mode() ? CFHash(pair->mode()) : 0 };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static bool equal(const RefPtr<SchedulePair>& a, const RefPtr<SchedulePair>& b) { return a == b; }
diff --git a/WebCore/platform/chromium/TemporaryLinkStubs.cpp b/WebCore/platform/chromium/TemporaryLinkStubs.cpp
index 1f60d95..3c747d0 100644
--- a/WebCore/platform/chromium/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/chromium/TemporaryLinkStubs.cpp
@@ -30,6 +30,7 @@
#include "config.h"
+#include "CookieStorage.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "SharedBuffer.h"
@@ -48,4 +49,9 @@ PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&)
return 0;
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/efl/LanguageEfl.cpp b/WebCore/platform/efl/LanguageEfl.cpp
index 4b765a6..efed862 100644
--- a/WebCore/platform/efl/LanguageEfl.cpp
+++ b/WebCore/platform/efl/LanguageEfl.cpp
@@ -29,15 +29,25 @@
#include "config.h"
#include "Language.h"
-#include "NotImplemented.h"
#include "PlatformString.h"
+#include <locale.h>
+
namespace WebCore {
String platformDefaultLanguage()
{
- notImplemented();
- return String();
+ char* localeDefault = setlocale(LC_CTYPE, 0);
+
+ if (!localeDefault)
+ return String("c");
+
+ char* ptr = strchr(localeDefault, '_');
+
+ if (ptr)
+ *ptr = '-';
+
+ return String(localeDefault);
}
}
diff --git a/WebCore/platform/efl/TemporaryLinkStubs.cpp b/WebCore/platform/efl/TemporaryLinkStubs.cpp
index 24f1111..ef6e6f7 100644
--- a/WebCore/platform/efl/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/efl/TemporaryLinkStubs.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "AXObjectCache.h"
+#include "CookieStorage.h"
#include "Editor.h"
#include "FTPDirectoryDocument.h"
#include "FrameView.h"
@@ -61,5 +62,10 @@ float userIdleTime()
return FLT_MAX;
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
}
diff --git a/WebCore/platform/graphics/FontCache.cpp b/WebCore/platform/graphics/FontCache.cpp
index ff865c2..149ea79 100644
--- a/WebCore/platform/graphics/FontCache.cpp
+++ b/WebCore/platform/graphics/FontCache.cpp
@@ -55,13 +55,14 @@ FontCache::FontCache()
struct FontPlatformDataCacheKey : FastAllocBase {
FontPlatformDataCacheKey(const AtomicString& family = AtomicString(), unsigned size = 0, unsigned weight = 0, bool italic = false,
- bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode)
+ bool isPrinterFont = false, FontRenderingMode renderingMode = NormalRenderingMode, FontOrientation orientation = Horizontal)
: m_size(size)
, m_weight(weight)
, m_family(family)
, m_italic(italic)
, m_printerFont(isPrinterFont)
, m_renderingMode(renderingMode)
+ , m_orientation(orientation)
{
}
@@ -72,7 +73,7 @@ struct FontPlatformDataCacheKey : FastAllocBase {
{
return equalIgnoringCase(m_family, other.m_family) && m_size == other.m_size &&
m_weight == other.m_weight && m_italic == other.m_italic && m_printerFont == other.m_printerFont &&
- m_renderingMode == other.m_renderingMode;
+ m_renderingMode == other.m_renderingMode && m_orientation == other.m_orientation;
}
unsigned m_size;
@@ -81,6 +82,7 @@ struct FontPlatformDataCacheKey : FastAllocBase {
bool m_italic;
bool m_printerFont;
FontRenderingMode m_renderingMode;
+ FontOrientation m_orientation;
private:
static unsigned hashTableDeletedSize() { return 0xFFFFFFFFU; }
@@ -92,9 +94,9 @@ inline unsigned computeHash(const FontPlatformDataCacheKey& fontKey)
CaseFoldingHash::hash(fontKey.m_family),
fontKey.m_size,
fontKey.m_weight,
- static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
+ static_cast<unsigned>(fontKey.m_orientation) << 3 | static_cast<unsigned>(fontKey.m_italic) << 2 | static_cast<unsigned>(fontKey.m_printerFont) << 1 | static_cast<unsigned>(fontKey.m_renderingMode)
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
struct FontPlatformDataCacheKeyHash {
@@ -191,7 +193,7 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
}
FontPlatformDataCacheKey key(familyName, fontDescription.computedPixelSize(), fontDescription.weight(), fontDescription.italic(),
- fontDescription.usePrinterFont(), fontDescription.renderingMode());
+ fontDescription.usePrinterFont(), fontDescription.renderingMode(), fontDescription.orientation());
FontPlatformData* result = 0;
bool foundResult;
FontPlatformDataCache::iterator it = gFontPlatformDataCache->find(key);
diff --git a/WebCore/platform/graphics/FontDescription.h b/WebCore/platform/graphics/FontDescription.h
index 48fcaad..12900bf 100644
--- a/WebCore/platform/graphics/FontDescription.h
+++ b/WebCore/platform/graphics/FontDescription.h
@@ -26,6 +26,7 @@
#define FontDescription_h
#include "FontFamily.h"
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include "FontSmoothingMode.h"
#include "FontTraitsMask.h"
@@ -55,6 +56,7 @@ public:
FontDescription()
: m_specifiedSize(0)
, m_computedSize(0)
+ , m_orientation(Horizontal)
, m_italic(false)
, m_smallCaps(false)
, m_isAbsoluteSize(false)
@@ -94,6 +96,7 @@ public:
FontTraitsMask traitsMask() const;
bool isSpecifiedFont() const { return m_isSpecifiedFont; }
+ FontOrientation orientation() const { return m_orientation; }
void setFamily(const FontFamily& family) { m_familyList = family; }
void setComputedSize(float s) { m_computedSize = s; }
@@ -113,6 +116,7 @@ public:
void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
+ void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
private:
FontFamily m_familyList; // The list of font families to be used.
@@ -121,6 +125,8 @@ private:
// rounding, minimum font sizes, and zooming.
float m_computedSize; // Computed size adjusted for the minimum font size and the zoom factor.
+ FontOrientation m_orientation;
+
bool m_italic : 1;
bool m_smallCaps : 1;
bool m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size
@@ -155,7 +161,8 @@ inline bool FontDescription::operator==(const FontDescription& other) const
&& m_keywordSize == other.m_keywordSize
&& m_fontSmoothing == other.m_fontSmoothing
&& m_textRendering == other.m_textRendering
- && m_isSpecifiedFont == other.m_isSpecifiedFont;
+ && m_isSpecifiedFont == other.m_isSpecifiedFont
+ && m_orientation == other.m_orientation;
}
}
diff --git a/WebCore/platform/graphics/FontOrientation.h b/WebCore/platform/graphics/FontOrientation.h
new file mode 100644
index 0000000..12cf5c1
--- /dev/null
+++ b/WebCore/platform/graphics/FontOrientation.h
@@ -0,0 +1,35 @@
+/*
+ * 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 COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FontOrientation_h
+#define FontOrientation_h
+
+namespace WebCore {
+
+enum FontOrientation { Horizontal, Vertical };
+
+} // namespace WebCore
+
+#endif // FontOrientation_h
diff --git a/WebCore/platform/graphics/Gradient.cpp b/WebCore/platform/graphics/Gradient.cpp
index f9427fb..6cb0ef1 100644
--- a/WebCore/platform/graphics/Gradient.cpp
+++ b/WebCore/platform/graphics/Gradient.cpp
@@ -196,6 +196,16 @@ int Gradient::findStop(float value) const
return m_lastStop;
}
+bool Gradient::hasAlpha() const
+{
+ for (size_t i = 0; i < m_stops.size(); i++) {
+ if (m_stops[i].alpha < 1)
+ return true;
+ }
+
+ return false;
+}
+
void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod)
{
// FIXME: Should it become necessary, allow calls to this method after m_gradient has been set.
diff --git a/WebCore/platform/graphics/Gradient.h b/WebCore/platform/graphics/Gradient.h
index 0a69fa2..153e1e9 100644
--- a/WebCore/platform/graphics/Gradient.h
+++ b/WebCore/platform/graphics/Gradient.h
@@ -92,6 +92,7 @@ namespace WebCore {
void addColorStop(float, const Color&);
void getColor(float value, float* r, float* g, float* b, float* a) const;
+ bool hasAlpha() const;
bool isRadial() const { return m_radial; }
bool isZeroSize() const { return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && (!m_radial || m_r0 == m_r1); }
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index d2e9057..b8c66d5 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -945,6 +945,8 @@ static void doPacking(const void* sourceData,
doUnpackingAndPacking<uint16_t, DestType, unpackA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
+ default:
+ ASSERT(false);
}
}
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index d74c97c..20b4e2d 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -540,7 +540,7 @@ public:
// uploading. This enum must be public because it is accessed
// by non-member functions.
enum SourceDataFormat {
- kSourceFormatRGBA8,
+ kSourceFormatRGBA8 = 0,
kSourceFormatRGBA16Little,
kSourceFormatRGBA16Big,
kSourceFormatRGB8,
@@ -566,7 +566,8 @@ public:
kSourceFormatAR16Big,
kSourceFormatA8,
kSourceFormatA16Little,
- kSourceFormatA16Big
+ kSourceFormatA16Big,
+ kSourceFormatNumFormats
};
//----------------------------------------------------------------------
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index ad4d056..991ca32 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -40,6 +40,10 @@
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
+#if USE(TEXTURE_MAPPER)
+#include "texmap/TextureMapperPlatformLayer.h"
+#endif
+
#if PLATFORM(MAC)
#ifdef __OBJC__
@class WebLayer;
@@ -57,11 +61,21 @@ typedef WKCACFLayer PlatformLayer;
typedef void* NativeLayer;
}
#elif PLATFORM(QT)
+#if USE(TEXTURE_MAPPER)
+namespace WebCore {
+class TextureMapperPlatformLayer;
+typedef TextureMapperPlatformLayer PlatformLayer;
+typedef TextureMapperPlatformLayer* NativeLayer;
+};
+#else
QT_BEGIN_NAMESPACE
-class QGraphicsItem;
+class QGraphicsObject;
QT_END_NAMESPACE
-typedef QGraphicsItem PlatformLayer;
-typedef QGraphicsItem* NativeLayer;
+namespace WebCore {
+typedef QGraphicsObject PlatformLayer;
+typedef QGraphicsObject* NativeLayer;
+}
+#endif
#elif PLATFORM(CHROMIUM)
namespace WebCore {
class LayerChromium;
diff --git a/WebCore/platform/graphics/ImageSource.h b/WebCore/platform/graphics/ImageSource.h
index 189f0f5..4d50253 100644
--- a/WebCore/platform/graphics/ImageSource.h
+++ b/WebCore/platform/graphics/ImageSource.h
@@ -69,7 +69,12 @@ class IntSize;
class SharedBuffer;
#if PLATFORM(CG)
+#if USE(WEBKIT_IMAGE_DECODERS)
+class ImageDecoder;
+typedef ImageDecoder* NativeImageSourcePtr;
+#else
typedef CGImageSourceRef NativeImageSourcePtr;
+#endif
typedef CGImageRef NativeImagePtr;
#elif PLATFORM(OPENVG)
class ImageDecoder;
diff --git a/WebCore/platform/graphics/SimpleFontData.h b/WebCore/platform/graphics/SimpleFontData.h
index 535554f..7bd58ad 100644
--- a/WebCore/platform/graphics/SimpleFontData.h
+++ b/WebCore/platform/graphics/SimpleFontData.h
@@ -37,7 +37,7 @@
typedef struct OpaqueATSUStyle* ATSUStyle;
#endif
-#if USE(CORE_TEXT)
+#if PLATFORM(MAC) || USE(CORE_TEXT)
#include <wtf/RetainPtr.h>
#endif
@@ -130,7 +130,7 @@ public:
NSFont* getNSFont() const { return m_platformData.nsFont(); }
#endif
-#if USE(CORE_TEXT)
+#if PLATFORM(MAC) || USE(CORE_TEXT)
CFDictionaryRef getCFStringAttributes(TypesettingFeatures) const;
#endif
@@ -234,7 +234,7 @@ public:
private:
#endif
-#if USE(CORE_TEXT)
+#if PLATFORM(MAC) || USE(CORE_TEXT)
mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes;
#endif
diff --git a/WebCore/platform/graphics/TiledBackingStoreClient.h b/WebCore/platform/graphics/TiledBackingStoreClient.h
index c5845b9..6087ec3 100644
--- a/WebCore/platform/graphics/TiledBackingStoreClient.h
+++ b/WebCore/platform/graphics/TiledBackingStoreClient.h
@@ -30,6 +30,7 @@ public:
virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) = 0;
virtual IntRect tiledBackingStoreContentsRect() = 0;
virtual IntRect tiledBackingStoreVisibleRect() = 0;
+ virtual Color tiledBackingStoreBackgroundColor() const = 0;
};
#else
diff --git a/WebCore/platform/graphics/WOFFFileFormat.cpp b/WebCore/platform/graphics/WOFFFileFormat.cpp
index 25b3b00..5391f30 100644
--- a/WebCore/platform/graphics/WOFFFileFormat.cpp
+++ b/WebCore/platform/graphics/WOFFFileFormat.cpp
@@ -25,16 +25,16 @@
#include "config.h"
#include "WOFFFileFormat.h"
+#include <zlib.h>
#if !ENABLE(OPENTYPE_SANITIZER)
#include "SharedBuffer.h"
-#if !PLATFORM(WIN)
#if OS(UNIX)
#include <netinet/in.h>
#endif
-#include <zlib.h>
+
#if PLATFORM(BREWMP)
#include <AEEStdLib.h>
#define htonl(x) HTONL(x)
@@ -42,17 +42,8 @@
#define ntohl(x) NTOHL(x)
#define ntohs(x) NTOHS(x)
#endif
-#else
-#include "SoftLinking.h"
-
-typedef unsigned char Bytef;
-typedef unsigned long uLong;
-typedef unsigned long uLongf;
-#define Z_OK 0
-
-SOFT_LINK_LIBRARY(zlib1);
-SOFT_LINK(zlib1, uncompress, int, __cdecl, (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen), (dest, destLen, source, sourceLen));
+#if PLATFORM(WIN)
#if CPU(BIG_ENDIAN)
#define ntohs(x) ((uint16_t)(x))
#define htons(x) ((uint16_t)(x))
@@ -70,7 +61,6 @@ SOFT_LINK(zlib1, uncompress, int, __cdecl, (Bytef *dest, uLongf *destLen, const
(((uint32_t)(x) & 0x0000ff00) << 8) | (((uint32_t)(x) & 0x000000ff) << 24)))
#define htonl(x) ntohl(x)
#endif
-
#endif // PLATFORM(WIN)
namespace WebCore {
@@ -123,10 +113,6 @@ bool isWOFF(SharedBuffer* buffer)
bool convertWOFFToSfnt(SharedBuffer* woff, Vector<char>& sfnt)
{
-#if PLATFORM(WINDOWS)
- if (!zlib1Library())
- return false;
-#endif
ASSERT_ARG(sfnt, sfnt.isEmpty());
size_t offset = 0;
diff --git a/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
index 5dca010..cd9ee46 100644
--- a/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
+++ b/WebCore/platform/graphics/cairo/FontCacheFreeType.cpp
@@ -41,33 +41,63 @@ void FontCache::platformInit()
ASSERT_NOT_REACHED();
}
-const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
+FcPattern* createFontConfigPatternForCharacters(const UChar* characters, int length)
{
- FcResult fresult;
- FontPlatformData* prim = const_cast<FontPlatformData*>(&font.primaryFont()->platformData());
+ FcPattern* pattern = FcPatternCreate();
+
+ FcCharSet* fontConfigCharSet = FcCharSetCreate();
+ for (int i = 0; i < length; ++i) {
+ if (U16_IS_SURROGATE(characters[i]) && U16_IS_SURROGATE_LEAD(characters[i])
+ && i != length - 1 && U16_IS_TRAIL(characters[i + 1])) {
+ FcCharSetAddChar(fontConfigCharSet, U16_GET_SUPPLEMENTARY(characters[i], characters[i+1]));
+ i++;
+ } else
+ FcCharSetAddChar(fontConfigCharSet, characters[i]);
+ }
+ FcPatternAddCharSet(pattern, FC_CHARSET, fontConfigCharSet);
+ FcCharSetDestroy(fontConfigCharSet);
- // FIXME: This should not happen, apparently. We are null-checking
- // for now just to avoid crashing.
- if (!prim || !prim->m_pattern)
+ FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
+ FcConfigSubstitute(0, pattern, FcMatchPattern);
+ FcDefaultSubstitute(pattern);
+ return pattern;
+}
+
+FcPattern* findBestFontGivenFallbacks(const FontPlatformData& fontData, FcPattern* pattern)
+{
+ if (!fontData.m_pattern)
return 0;
- if (!prim->m_fallbacks)
- prim->m_fallbacks = FcFontSort(0, prim->m_pattern.get(), FcTrue, 0, &fresult);
+ if (!fontData.m_fallbacks) {
+ FcResult fontConfigResult;
+ fontData.m_fallbacks = FcFontSort(0, fontData.m_pattern.get(), FcTrue, 0, &fontConfigResult);
+ }
- FcFontSet* fs = prim->m_fallbacks;
+ if (!fontData.m_fallbacks)
+ return 0;
- for (int i = 0; i < fs->nfont; i++) {
- PlatformRefPtr<FcPattern> fin = adoptPlatformRef(FcFontRenderPrepare(0, prim->m_pattern.get(), fs->fonts[i]));
- cairo_font_face_t* fontFace = cairo_ft_font_face_create_for_pattern(fin.get());
- FontPlatformData alternateFont(fontFace, font.fontDescription().computedPixelSize(), false, false);
- cairo_font_face_destroy(fontFace);
- alternateFont.m_pattern = fin;
- SimpleFontData* sfd = getCachedFontData(&alternateFont);
- if (sfd->containsCharacters(characters, length))
- return sfd;
+ FcFontSet* sets[] = { fontData.m_fallbacks };
+ FcResult fontConfigResult;
+ return FcFontSetMatch(0, sets, 1, pattern, &fontConfigResult);
+}
+
+const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
+{
+ PlatformRefPtr<FcPattern> pattern = adoptPlatformRef(createFontConfigPatternForCharacters(characters, length));
+ const FontPlatformData& fontData = font.primaryFont()->platformData();
+
+ PlatformRefPtr<FcPattern> fallbackPattern = adoptPlatformRef(findBestFontGivenFallbacks(fontData, pattern.get()));
+ if (fallbackPattern) {
+ FontPlatformData alternateFontData(fallbackPattern.get(), font.fontDescription());
+ return getCachedFontData(&alternateFontData);
}
- return 0;
+ FcResult fontConfigResult;
+ PlatformRefPtr<FcPattern> resultPattern = adoptPlatformRef(FcFontMatch(0, pattern.get(), &fontConfigResult));
+ if (!resultPattern)
+ return 0;
+ FontPlatformData alternateFontData(resultPattern.get(), font.fontDescription());
+ return getCachedFontData(&alternateFontData);
}
SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
diff --git a/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
index 0d195cb..800907a 100644
--- a/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/cairo/FontCustomPlatformData.cpp
@@ -58,7 +58,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
cairo_font_face_destroy(m_fontFace);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(m_fontFace, size, bold, italic);
}
diff --git a/WebCore/platform/graphics/cairo/FontCustomPlatformData.h b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
index c48d110..dac31f8 100644
--- a/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/cairo/FontCustomPlatformData.h
@@ -22,6 +22,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -38,7 +39,7 @@ struct FontCustomPlatformData : Noncopyable {
public:
FontCustomPlatformData(FT_Face, SharedBuffer*);
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
private:
diff --git a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
index 7d3ff99..d47d556 100644
--- a/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
+++ b/WebCore/platform/graphics/cairo/FontPlatformDataFreeType.h
@@ -86,7 +86,7 @@ public:
#endif
PlatformRefPtr<FcPattern> m_pattern;
- FcFontSet* m_fallbacks;
+ mutable FcFontSet* m_fallbacks; // Initialized lazily.
float m_size;
bool m_syntheticBold;
bool m_syntheticOblique;
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index d5045be..03f1d10 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -274,6 +274,8 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
+ if (!isfinite(point.x()) || !isfinite(point.y()))
+ return false;
cairo_t* cr = platformPath()->context();
cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index fe4fc7f..a1cc805 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -41,6 +41,56 @@
namespace WebCore {
+enum SourceDataFormatBase {
+ SourceFormatBaseR = 0,
+ SourceFormatBaseA,
+ SourceFormatBaseRA,
+ SourceFormatBaseAR,
+ SourceFormatBaseRGB,
+ SourceFormatBaseRGBA,
+ SourceFormatBaseARGB,
+ SourceFormatBaseNumFormats
+};
+
+enum AlphaFormat {
+ AlphaFormatNone = 0,
+ AlphaFormatFirst,
+ AlphaFormatLast,
+ AlphaFormatNumFormats
+};
+
+// This returns kSourceFormatNumFormats if the combination of input parameters is unsupported.
+static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int componentsPerPixel, AlphaFormat alphaFormat, bool is16BitFormat, bool bigEndian)
+{
+ const static SourceDataFormatBase formatTableBase[4][AlphaFormatNumFormats] = { // componentsPerPixel x AlphaFormat
+ // AlphaFormatNone AlphaFormatFirst AlphaFormatLast
+ { SourceFormatBaseR, SourceFormatBaseA, SourceFormatBaseA }, // 1 componentsPerPixel
+ { SourceFormatBaseNumFormats, SourceFormatBaseAR, SourceFormatBaseRA }, // 2 componentsPerPixel
+ { SourceFormatBaseRGB, SourceFormatBaseNumFormats, SourceFormatBaseNumFormats }, // 3 componentsPerPixel
+ { SourceFormatBaseNumFormats, SourceFormatBaseARGB, SourceFormatBaseRGBA } // 4 componentsPerPixel
+ };
+ const static GraphicsContext3D::SourceDataFormat formatTable[SourceFormatBaseNumFormats][3] = { // SourceDataFormatBase x bitsPerComponentAndEndian
+ // 8bits 16bits, little endian 16bits, big endian
+ { GraphicsContext3D::kSourceFormatR8, GraphicsContext3D::kSourceFormatR16Little, GraphicsContext3D::kSourceFormatR16Big },
+ { GraphicsContext3D::kSourceFormatA8, GraphicsContext3D::kSourceFormatA16Little, GraphicsContext3D::kSourceFormatA16Big },
+ { GraphicsContext3D::kSourceFormatRA8, GraphicsContext3D::kSourceFormatRA16Little, GraphicsContext3D::kSourceFormatRA16Big },
+ { GraphicsContext3D::kSourceFormatAR8, GraphicsContext3D::kSourceFormatAR16Little, GraphicsContext3D::kSourceFormatAR16Big },
+ { GraphicsContext3D::kSourceFormatRGB8, GraphicsContext3D::kSourceFormatRGB16Little, GraphicsContext3D::kSourceFormatRGB16Big },
+ { GraphicsContext3D::kSourceFormatRGBA8, GraphicsContext3D::kSourceFormatRGBA16Little, GraphicsContext3D::kSourceFormatRGBA16Big },
+ { GraphicsContext3D::kSourceFormatARGB8, GraphicsContext3D::kSourceFormatARGB16Little, GraphicsContext3D::kSourceFormatARGB16Big }
+ };
+
+ ASSERT(componentsPerPixel <= 4 && componentsPerPixel > 0);
+ SourceDataFormatBase formatBase = formatTableBase[componentsPerPixel - 1][alphaFormat];
+ if (formatBase == SourceFormatBaseNumFormats)
+ return GraphicsContext3D::kSourceFormatNumFormats;
+ if (!is16BitFormat)
+ return formatTable[formatBase][0];
+ if (!bigEndian)
+ return formatTable[formatBase][1];
+ return formatTable[formatBase][2];
+}
+
bool GraphicsContext3D::getImageData(Image* image,
unsigned int format,
unsigned int type,
@@ -62,6 +112,7 @@ bool GraphicsContext3D::getImageData(Image* image,
cgImage = image->nativeImageForCurrentFrame();
if (!cgImage)
return false;
+
size_t width = CGImageGetWidth(cgImage);
size_t height = CGImageGetHeight(cgImage);
if (!width || !height)
@@ -73,6 +124,7 @@ bool GraphicsContext3D::getImageData(Image* image,
if (bitsPerPixel % bitsPerComponent)
return false;
size_t componentsPerPixel = bitsPerPixel / bitsPerComponent;
+
bool srcByteOrder16Big = false;
if (bitsPerComponent == 16) {
CGBitmapInfo bitInfo = CGImageGetBitmapInfo(cgImage);
@@ -93,8 +145,9 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
}
}
- SourceDataFormat srcDataFormat = kSourceFormatRGBA8;
+
AlphaOp neededAlphaOp = kAlphaDoNothing;
+ AlphaFormat alphaFormat = AlphaFormatNone;
switch (CGImageGetAlphaInfo(cgImage)) {
case kCGImageAlphaPremultipliedFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
@@ -103,68 +156,17 @@ bool GraphicsContext3D::getImageData(Image* image,
ASSERT(!image->data());
if (!premultiplyAlpha)
neededAlphaOp = kAlphaDoUnmultiply;
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatAR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatAR16Big : kSourceFormatAR16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatARGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatARGB16Big : kSourceFormatARGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
if (premultiplyAlpha)
neededAlphaOp = kAlphaDoPremultiply;
- switch (componentsPerPixel) {
- case 1:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatA16Big : kSourceFormatA16Little;
- break;
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatAR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatAR16Big : kSourceFormatAR16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatARGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatARGB16Big : kSourceFormatARGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaNoneSkipFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatAR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatAR16Big : kSourceFormatAR16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatARGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatARGB16Big : kSourceFormatARGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaPremultipliedLast:
// This is a special case for texImage2D with HTMLCanvasElement input,
@@ -172,88 +174,26 @@ bool GraphicsContext3D::getImageData(Image* image,
ASSERT(!image->data());
if (!premultiplyAlpha)
neededAlphaOp = kAlphaDoUnmultiply;
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRA16Big : kSourceFormatRA16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGBA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGBA16Big : kSourceFormatRGBA16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaLast:
if (premultiplyAlpha)
neededAlphaOp = kAlphaDoPremultiply;
- switch (componentsPerPixel) {
- case 1:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatA16Big : kSourceFormatA16Little;
- break;
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRA16Big : kSourceFormatRA16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGBA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGBA16Big : kSourceFormatRGBA16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNoneSkipLast:
- switch (componentsPerPixel) {
- case 2:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRA16Big : kSourceFormatRA16Little;
- break;
- case 4:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGBA8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGBA16Big : kSourceFormatRGBA16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNone:
- switch (componentsPerPixel) {
- case 1:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatR8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatR16Big : kSourceFormatR16Little;
- break;
- case 3:
- if (bitsPerComponent == 8)
- srcDataFormat = kSourceFormatRGB8;
- else
- srcDataFormat = srcByteOrder16Big ? kSourceFormatRGB16Big : kSourceFormatRGB16Little;
- break;
- default:
- return false;
- }
+ alphaFormat = AlphaFormatNone;
break;
default:
return false;
}
+ SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, srcByteOrder16Big);
+ if (srcDataFormat == kSourceFormatNumFormats)
+ return false;
+
RetainPtr<CFDataRef> pixelData;
pixelData.adoptCF(CGDataProviderCopyData(CGImageGetDataProvider(cgImage)));
if (!pixelData)
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index f38273c..e73747f 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Google Inc. All rights reserved.
+ * Copyright (c) 2007, 2008, 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
@@ -220,8 +220,6 @@ public:
const FontPlatformData* fontPlatformDataForScriptRun() { return reinterpret_cast<FontPlatformData*>(m_item.font->userData); }
private:
- const TextRun& getTextRun(const TextRun&);
- const TextRun& getNormalizedTextRun(const TextRun&);
void setupFontForScriptRun();
HB_FontRec* allocHarfbuzzFont();
void deleteGlyphArrays();
@@ -229,7 +227,9 @@ private:
void resetGlyphArrays();
void shapeGlyphs();
void setGlyphXPositions(bool);
- void mirrorCharacters(UChar*, const UChar*, int) const;
+
+ static void normalizeSpacesAndMirrorChars(const UChar* source, bool rtl, UChar* destination, int length);
+ static const TextRun& getNormalizedTextRun(const TextRun& originalRun, OwnPtr<TextRun>& normalizedRun, OwnArrayPtr<UChar>& normalizedBuffer);
// This matches the logic in RenderBlock::findNextLineBreak
static bool isCodepointSpace(HB_UChar16 c) { return c == ' ' || c == '\t'; }
@@ -264,11 +264,13 @@ TextRunWalker::TextRunWalker(const TextRun& run, unsigned startingX, const Font*
: m_font(font)
, m_startingX(startingX)
, m_offsetX(m_startingX)
- , m_run(getTextRun(run))
+ , m_run(getNormalizedTextRun(run, m_normalizedRun, m_normalizedBuffer))
, m_iterateBackwards(m_run.rtl())
, m_wordSpacingAdjustment(0)
, m_padding(0)
+ , m_padPerWordBreak(0)
, m_padError(0)
+ , m_letterSpacing(0)
{
// Do not use |run| inside this constructor. Use |m_run| instead.
@@ -286,17 +288,8 @@ TextRunWalker::TextRunWalker(const TextRun& run, unsigned startingX, const Font*
m_item.item.bidiLevel = m_run.rtl();
- int length = m_run.length();
- m_item.stringLength = length;
-
- if (!m_item.item.bidiLevel)
- m_item.string = m_run.characters();
- else {
- // Assume mirrored character is in the same Unicode multilingual plane as the original one.
- UChar* string = new UChar[length];
- mirrorCharacters(string, m_run.characters(), length);
- m_item.string = string;
- }
+ m_item.string = m_run.characters();
+ m_item.stringLength = m_run.length();
reset();
}
@@ -306,8 +299,6 @@ TextRunWalker::~TextRunWalker()
fastFree(m_item.font);
deleteGlyphArrays();
delete[] m_item.log_clusters;
- if (m_item.item.bidiLevel)
- delete[] m_item.string;
}
bool TextRunWalker::isWordBreak(unsigned index, bool isRTL)
@@ -408,51 +399,6 @@ float TextRunWalker::widthOfFullRun()
return widthSum;
}
-const TextRun& TextRunWalker::getTextRun(const TextRun& originalRun)
-{
- // Normalize the text run in two ways:
- // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
- // (U+0300..) are used in the run. This conversion is necessary since most OpenType
- // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
- // their GSUB tables.
- //
- // Note that we don't use the icu::Normalizer::isNormalized(UNORM_NFC) API here since
- // the API returns FALSE (= not normalized) for complex runs that don't require NFC
- // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
- // 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 (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 != ' '))
- return getNormalizedTextRun(originalRun);
- }
- return originalRun;
-}
-
-const TextRun& TextRunWalker::getNormalizedTextRun(const TextRun& originalRun)
-{
- icu::UnicodeString normalizedString;
- UErrorCode error = U_ZERO_ERROR;
- icu::Normalizer::normalize(icu::UnicodeString(originalRun.characters(), originalRun.length()), UNORM_NFC, 0 /* no options */, normalizedString, error);
- if (U_FAILURE(error))
- return originalRun;
-
- m_normalizedBuffer.set(new UChar[normalizedString.length() + 1]);
- normalizedString.extract(m_normalizedBuffer.get(), normalizedString.length() + 1, error);
- ASSERT(U_SUCCESS(error));
-
- for (int i = 0; i < normalizedString.length(); ++i) {
- if (Font::treatAsSpace(m_normalizedBuffer[i]))
- m_normalizedBuffer[i] = ' ';
- }
-
- m_normalizedRun.set(new TextRun(originalRun));
- m_normalizedRun->setText(m_normalizedBuffer.get(), normalizedString.length());
- return *m_normalizedRun;
-}
-
void TextRunWalker::setupFontForScriptRun()
{
const FontData* fontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false, false).fontData;
@@ -595,7 +541,7 @@ void TextRunWalker::setGlyphXPositions(bool isRTL)
m_offsetX += m_pixelWidth;
}
-void TextRunWalker::mirrorCharacters(UChar* destination, const UChar* source, int length) const
+void TextRunWalker::normalizeSpacesAndMirrorChars(const UChar* source, bool rtl, UChar* destination, int length)
{
int position = 0;
bool error = false;
@@ -604,13 +550,68 @@ void TextRunWalker::mirrorCharacters(UChar* destination, const UChar* source, in
UChar32 character;
int nextPosition = position;
U16_NEXT(source, nextPosition, length, character);
- character = u_charMirror(character);
+ if (Font::treatAsSpace(character))
+ character = ' ';
+ else if (rtl)
+ character = u_charMirror(character);
U16_APPEND(destination, position, length, character, error);
ASSERT(!error);
position = nextPosition;
}
}
+const TextRun& TextRunWalker::getNormalizedTextRun(const TextRun& originalRun, OwnPtr<TextRun>& normalizedRun, OwnArrayPtr<UChar>& normalizedBuffer)
+{
+ // Normalize the text run in three ways:
+ // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
+ // (U+0300..) are used in the run. This conversion is necessary since most OpenType
+ // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
+ // their GSUB tables.
+ //
+ // Note that we don't use the icu::Normalizer::isNormalized(UNORM_NFC) API here since
+ // the API returns FALSE (= not normalized) for complex runs that don't require NFC
+ // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
+ // 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.
+ // 3) Convert mirrored characters such as parenthesis for rtl text.
+
+ // Convert to NFC form if the text has diacritical marks.
+ icu::UnicodeString normalizedString;
+ UErrorCode error = U_ZERO_ERROR;
+
+ for (int16_t i = 0; i < originalRun.length(); ++i) {
+ UChar ch = originalRun[i];
+ if (::ublock_getCode(ch) == UBLOCK_COMBINING_DIACRITICAL_MARKS) {
+ icu::Normalizer::normalize(icu::UnicodeString(originalRun.characters(),
+ originalRun.length()), UNORM_NFC, 0 /* no options */,
+ normalizedString, error);
+ if (U_FAILURE(error))
+ return originalRun;
+ break;
+ }
+ }
+
+ // Normalize space and mirror parenthesis for rtl text.
+ int normalizedBufferLength;
+ const UChar* sourceText;
+ if (normalizedString.isEmpty()) {
+ normalizedBufferLength = originalRun.length();
+ sourceText = originalRun.characters();
+ } else {
+ normalizedBufferLength = normalizedString.length();
+ sourceText = normalizedString.getBuffer();
+ }
+
+ normalizedBuffer.set(new UChar[normalizedBufferLength + 1]);
+
+ normalizeSpacesAndMirrorChars(sourceText, originalRun.rtl(), normalizedBuffer.get(), normalizedBufferLength);
+
+ normalizedRun.set(new TextRun(originalRun));
+ normalizedRun->setText(normalizedBuffer.get(), normalizedBufferLength);
+ return *normalizedRun;
+}
+
static void setupForTextPainting(SkPaint* paint, SkColor color)
{
paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
index beac0bf..c59cb56 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
@@ -102,7 +102,7 @@ private:
HFONT hfont() const { return m_hfont; }
unsigned hash() const
{
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(&m_hfont), sizeof(HFONT) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(HFONT)>(&m_hfont);
}
bool operator==(const RefCountedHFONT& other) const
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
index 79f18f0..f668bbf 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -176,8 +176,10 @@ void LayerChromium::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)
+ if (layerRenderer() && layerRenderer() != renderer) {
cleanupResources();
+ setNeedsDisplay();
+ }
m_layerRenderer = renderer;
}
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index 6a06105..b2a32ee 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -82,6 +82,7 @@ public:
void setRootLayer(PassRefPtr<LayerChromium> layer) { m_rootLayer = layer; }
LayerChromium* rootLayer() { return m_rootLayer.get(); }
+ void transferRootLayer(LayerRendererChromium* other) { other->m_rootLayer = m_rootLayer.release(); }
bool hardwareCompositing() const { return m_hardwareCompositing; }
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformData.h b/WebCore/platform/graphics/cocoa/FontPlatformData.h
index 034e23b..17ae4b5 100644
--- a/WebCore/platform/graphics/cocoa/FontPlatformData.h
+++ b/WebCore/platform/graphics/cocoa/FontPlatformData.h
@@ -24,6 +24,7 @@
#ifndef FontPlatformData_h
#define FontPlatformData_h
+#include "FontOrientation.h"
#include <wtf/text/StringImpl.h>
#ifdef __OBJC__
@@ -58,9 +59,10 @@ inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef
class FontPlatformData {
public:
- FontPlatformData(float size, bool syntheticBold, bool syntheticOblique)
+ FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation = Horizontal)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
+ , m_orientation(orientation)
, m_atsuFontID(0)
, m_size(size)
, m_font(0)
@@ -71,11 +73,12 @@ class FontPlatformData {
{
}
- FontPlatformData(NSFont *nsFont, bool syntheticBold = false, bool syntheticOblique = false);
+ FontPlatformData(NSFont *nsFont, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal);
- FontPlatformData(CGFontRef cgFont, ATSUFontID fontID, float size, bool syntheticBold, bool syntheticOblique)
+ FontPlatformData(CGFontRef cgFont, ATSUFontID fontID, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
+ , m_orientation(orientation)
, m_atsuFontID(fontID)
, m_size(size)
, m_font(0)
@@ -94,9 +97,11 @@ class FontPlatformData {
float size() const { return m_size; }
bool syntheticBold() const { return m_syntheticBold; }
bool syntheticOblique() const { return m_syntheticOblique; }
+ FontOrientation orientation() const { return m_orientation; }
bool m_syntheticBold;
bool m_syntheticOblique;
+ FontOrientation m_orientation;
ATSUFontID m_atsuFontID;
float m_size;
@@ -104,8 +109,8 @@ class FontPlatformData {
unsigned hash() const
{
ASSERT(m_font != 0 || m_cgFont == 0);
- uintptr_t hashCodes[2] = { (uintptr_t)m_font, m_syntheticBold << 1 | m_syntheticOblique };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ uintptr_t hashCodes[2] = { (uintptr_t)m_font, m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
const FontPlatformData& operator=(const FontPlatformData& f);
@@ -113,15 +118,13 @@ class FontPlatformData {
bool operator==(const FontPlatformData& other) const
{
return m_font == other.m_font && m_syntheticBold == other.m_syntheticBold && m_syntheticOblique == other.m_syntheticOblique &&
- m_cgFont == other.m_cgFont && m_size == other.m_size && m_atsuFontID == other.m_atsuFontID;
+ m_cgFont == other.m_cgFont && m_size == other.m_size && m_atsuFontID == other.m_atsuFontID && m_orientation == other.m_orientation;
}
NSFont *font() const { return m_font; }
void setFont(NSFont *font);
-#if USE(CORE_TEXT)
CTFontRef ctFont() const;
-#endif
bool roundsGlyphAdvances() const;
bool allowsLigatures() const;
@@ -157,9 +160,7 @@ private:
CGFontRef m_cgFont; // It is not necessary to refcount this, since either an NSFont owns it or some CachedFont has it referenced.
#endif
-#if USE(CORE_TEXT)
mutable RetainPtr<CTFontRef> m_CTFont;
-#endif
bool m_isColorBitmapFont;
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
index bd49dcc..dbfec5f 100644
--- a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
+++ b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
@@ -44,7 +44,7 @@ void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFon
}
#endif // PLATFORM(MAC)
-FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique)
+FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
, m_font(nsFont)
@@ -63,6 +63,26 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt
CGFontRef cgFont = 0;
loadFont(nsFont, m_size, m_font, cgFont, m_atsuFontID);
+ if (orientation == Vertical) {
+ // Ignore vertical orientation when the font doesn't support vertical metrics.
+ // The check doesn't look neat but this is what AppKit does for vertical writing...
+ RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont(), kCTFontTableOptionExcludeSynthetic));
+ CFIndex numTables = CFArrayGetCount(tableTags.get());
+ bool found = false;
+ for (CFIndex index = 0; index < numTables; ++index) {
+ CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
+ if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) {
+ found = true;
+ break;
+ }
+ }
+
+ if (found == false)
+ orientation = Horizontal;
+ }
+
+ m_orientation = orientation;
+
if (m_font)
CFRetain(m_font);
@@ -83,9 +103,8 @@ FontPlatformData::FontPlatformData(const FontPlatformData& f)
m_cgFont = f.m_cgFont;
m_atsuFontID = f.m_atsuFontID;
m_isColorBitmapFont = f.m_isColorBitmapFont;
-#if USE(CORE_TEXT)
+ m_orientation = f.m_orientation;
m_CTFont = f.m_CTFont;
-#endif
#if PLATFORM(CHROMIUM) && OS(DARWIN)
m_inMemoryFont = f.m_inMemoryFont;
#endif
@@ -112,9 +131,8 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& f)
CFRelease(m_font);
m_font = f.m_font;
m_isColorBitmapFont = f.m_isColorBitmapFont;
-#if USE(CORE_TEXT)
+ m_orientation = f.m_orientation;
m_CTFont = f.m_CTFont;
-#endif
#if PLATFORM(CHROMIUM) && OS(DARWIN)
m_inMemoryFont = f.m_inMemoryFont;
#endif
@@ -157,9 +175,7 @@ void FontPlatformData::setFont(NSFont *font)
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait;
#endif
-#if USE(CORE_TEXT)
m_CTFont = 0;
-#endif
}
bool FontPlatformData::roundsGlyphAdvances() const
@@ -169,10 +185,9 @@ bool FontPlatformData::roundsGlyphAdvances() const
bool FontPlatformData::allowsLigatures() const
{
- return ![[m_font coveredCharacterSet] characterIsMember:'a'];
+ return m_orientation == Horizontal && ![[m_font coveredCharacterSet] characterIsMember:'a'];
}
-#if USE(CORE_TEXT)
CTFontRef FontPlatformData::ctFont() const
{
if (m_font)
@@ -181,13 +196,13 @@ CTFontRef FontPlatformData::ctFont() const
m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0));
return m_CTFont.get();
}
-#endif // USE(CORE_TEXT)
#ifndef NDEBUG
String FontPlatformData::description() const
{
RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()));
- return String(cgFontDescription.get()) + " " + String::number(m_size) + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : "");
+ return String(cgFontDescription.get()) + " " + String::number(m_size)
+ + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : "") + (m_orientation ? " vertical orientation" : "");
}
#endif
diff --git a/WebCore/platform/graphics/filters/FEBlend.cpp b/WebCore/platform/graphics/filters/FEBlend.cpp
index 1a40027..03b95c3 100644
--- a/WebCore/platform/graphics/filters/FEBlend.cpp
+++ b/WebCore/platform/graphics/filters/FEBlend.cpp
@@ -95,26 +95,30 @@ void FEBlend::apply(Filter* filter)
if (!in->resultImage() || !in2->resultImage())
return;
- if (m_mode == FEBLEND_MODE_UNKNOWN)
+ if (m_mode <= FEBLEND_MODE_UNKNOWN || m_mode > FEBLEND_MODE_LIGHTEN)
return;
if (!effectContext(filter))
return;
IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ RefPtr<ImageData> srcImageDataA = in->resultImage()->getPremultipliedImageData(effectADrawingRect);
+ ByteArray* srcPixelArrayA = srcImageDataA->data()->data();
IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)->data());
+ RefPtr<ImageData> srcImageDataB = in2->resultImage()->getPremultipliedImageData(effectBDrawingRect);
+ ByteArray* srcPixelArrayB = srcImageDataB->data()->data();
IntRect imageRect(IntPoint(), resultImage()->size());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* dstPixelArray = imageData->data()->data();
// Keep synchronized with BlendModeType
static const BlendType callEffect[] = {unknown, normal, multiply, screen, darken, lighten};
- ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArrayA->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = srcPixelArrayA->length();
+ ASSERT(pixelArrayLength == srcPixelArrayB->length());
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
unsigned char alphaA = srcPixelArrayA->get(pixelOffset + 3);
unsigned char alphaB = srcPixelArrayB->get(pixelOffset + 3);
for (unsigned channel = 0; channel < 3; ++channel) {
@@ -122,10 +126,10 @@ void FEBlend::apply(Filter* filter)
unsigned char colorB = srcPixelArrayB->get(pixelOffset + channel);
unsigned char result = (*callEffect[m_mode])(colorA, colorB, alphaA, alphaB);
- imageData->data()->set(pixelOffset + channel, result);
+ dstPixelArray->set(pixelOffset + channel, result);
}
unsigned char alphaR = 255 - ((255 - alphaA) * (255 - alphaB)) / 255;
- imageData->data()->set(pixelOffset + 3, alphaR);
+ dstPixelArray->set(pixelOffset + 3, alphaR);
}
resultImage()->putPremultipliedImageData(imageData.get(), imageRect, IntPoint());
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index b41d5ad..acf7d4a 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -25,11 +25,10 @@
#if ENABLE(FILTERS)
#include "FEColorMatrix.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include <math.h>
+
#include <wtf/MathExtras.h>
namespace WebCore {
@@ -112,25 +111,21 @@ inline void huerotate(double& red, double& green, double& blue, const float& hue
inline void luminance(double& red, double& green, double& blue, double& alpha)
{
alpha = 0.2125 * red + 0.7154 * green + 0.0721 * blue;
- red = 0.;
- green = 0.;
- blue = 0.;
+ red = 0;
+ green = 0;
+ blue = 0;
}
template<ColorMatrixType filterType>
-void effectType(const PassRefPtr<CanvasPixelArray>& srcPixelArray, PassRefPtr<ImageData>& imageData, const Vector<float>& values)
+void effectType(ByteArray* pixelArray, const Vector<float>& values)
{
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset++) {
- unsigned pixelByteOffset = pixelOffset * 4;
-
- unsigned char r = 0, g = 0, b = 0, a = 0;
- srcPixelArray->get(pixelByteOffset, r);
- srcPixelArray->get(pixelByteOffset + 1, g);
- srcPixelArray->get(pixelByteOffset + 2, b);
- srcPixelArray->get(pixelByteOffset + 3, a);
+ unsigned pixelArrayLength = pixelArray->length();
+ for (unsigned pixelByteOffset = 0; pixelByteOffset < pixelArrayLength; pixelByteOffset += 4) {
+ double red = pixelArray->get(pixelByteOffset);
+ double green = pixelArray->get(pixelByteOffset + 1);
+ double blue = pixelArray->get(pixelByteOffset + 2);
+ double alpha = pixelArray->get(pixelByteOffset + 3);
- double red = r, green = g, blue = b, alpha = a;
-
switch (filterType) {
case FECOLORMATRIX_TYPE_MATRIX:
matrix(red, green, blue, alpha, values);
@@ -146,10 +141,10 @@ void effectType(const PassRefPtr<CanvasPixelArray>& srcPixelArray, PassRefPtr<Im
break;
}
- imageData->data()->set(pixelByteOffset, red);
- imageData->data()->set(pixelByteOffset + 1, green);
- imageData->data()->set(pixelByteOffset + 2, blue);
- imageData->data()->set(pixelByteOffset + 3, alpha);
+ pixelArray->set(pixelByteOffset, red);
+ pixelArray->set(pixelByteOffset + 1, green);
+ pixelArray->set(pixelByteOffset + 2, blue);
+ pixelArray->set(pixelByteOffset + 3, alpha);
}
}
@@ -167,23 +162,23 @@ void FEColorMatrix::apply(Filter* filter)
filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
IntRect imageRect(IntPoint(), resultImage()->size());
- PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
- PassRefPtr<CanvasPixelArray> srcPixelArray(imageData->data());
+ RefPtr<ImageData> imageData = resultImage()->getUnmultipliedImageData(imageRect);
+ ByteArray* pixelArray = imageData->data()->data();
switch (m_type) {
case FECOLORMATRIX_TYPE_UNKNOWN:
break;
case FECOLORMATRIX_TYPE_MATRIX:
- effectType<FECOLORMATRIX_TYPE_MATRIX>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_MATRIX>(pixelArray, m_values);
break;
case FECOLORMATRIX_TYPE_SATURATE:
- effectType<FECOLORMATRIX_TYPE_SATURATE>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_SATURATE>(pixelArray, m_values);
break;
case FECOLORMATRIX_TYPE_HUEROTATE:
- effectType<FECOLORMATRIX_TYPE_HUEROTATE>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_HUEROTATE>(pixelArray, m_values);
break;
case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
- effectType<FECOLORMATRIX_TYPE_LUMINANCETOALPHA>(srcPixelArray, imageData, m_values);
+ effectType<FECOLORMATRIX_TYPE_LUMINANCETOALPHA>(pixelArray, m_values);
setIsAlphaImage(true);
break;
}
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
index 08d0b1f..5cffac7 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
@@ -26,11 +26,11 @@
#if ENABLE(FILTERS)
#include "FEComponentTransfer.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include <math.h>
+
+#include <wtf/MathExtras.h>
namespace WebCore {
@@ -168,13 +168,14 @@ void FEComponentTransfer::apply(Filter* filter)
(*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
IntRect drawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<ImageData> imageData(in->resultImage()->getUnmultipliedImageData(drawingRect));
- CanvasPixelArray* srcPixelArray(imageData->data());
+ RefPtr<ImageData> imageData = in->resultImage()->getUnmultipliedImageData(drawingRect);
+ ByteArray* pixelArray = imageData->data()->data();
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = pixelArray->length();
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
for (unsigned channel = 0; channel < 4; ++channel) {
- unsigned char c = srcPixelArray->get(pixelOffset + channel);
- imageData->data()->set(pixelOffset + channel, tables[channel][c]);
+ unsigned char c = pixelArray->get(pixelOffset + channel);
+ pixelArray->set(pixelOffset + channel, tables[channel][c]);
}
}
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index 2326966..aad71e3 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FEComposite.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
@@ -98,12 +97,13 @@ void FEComposite::setK4(float k4)
m_k4 = k4;
}
-inline void arithmetic(const RefPtr<CanvasPixelArray>& srcPixelArrayA, CanvasPixelArray*& srcPixelArrayB,
+inline void arithmetic(const ByteArray* srcPixelArrayA, ByteArray* srcPixelArrayB,
float k1, float k2, float k3, float k4)
{
float scaledK1 = k1 / 255.f;
float scaledK4 = k4 * 255.f;
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArrayA->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = srcPixelArrayA->length();
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
for (unsigned channel = 0; channel < 4; ++channel) {
unsigned char i1 = srcPixelArrayA->get(pixelOffset + channel);
unsigned char i2 = srcPixelArrayB->get(pixelOffset + channel);
@@ -174,11 +174,12 @@ void FEComposite::apply(Filter* filter)
break;
case FECOMPOSITE_OPERATOR_ARITHMETIC: {
IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ RefPtr<ImageData> srcImageData = in->resultImage()->getPremultipliedImageData(effectADrawingRect);
+ ByteArray* srcPixelArrayA = srcImageData->data()->data();
IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
- RefPtr<ImageData> imageData(in2->resultImage()->getPremultipliedImageData(effectBDrawingRect));
- CanvasPixelArray* srcPixelArrayB(imageData->data());
+ RefPtr<ImageData> imageData = in2->resultImage()->getPremultipliedImageData(effectBDrawingRect);
+ ByteArray* srcPixelArrayB = imageData->data()->data();
arithmetic(srcPixelArrayA, srcPixelArrayB, m_k1, m_k2, m_k3, m_k4);
resultImage()->putPremultipliedImageData(imageData.get(), IntRect(IntPoint(), resultImage()->size()), IntPoint());
diff --git a/WebCore/platform/graphics/filters/FEDisplacementMap.cpp b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
index 0c53241..4c62ca7 100644
--- a/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
+++ b/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FEDisplacementMap.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
@@ -93,13 +92,16 @@ void FEDisplacementMap::apply(Filter* filter)
return;
IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayA(in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data());
+ RefPtr<ImageData> srcImageDataA = in->resultImage()->getPremultipliedImageData(effectADrawingRect);
+ ByteArray* srcPixelArrayA = srcImageDataA->data()->data() ;
IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArrayB(in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect)->data());
+ RefPtr<ImageData> srcImageDataB = in2->resultImage()->getUnmultipliedImageData(effectBDrawingRect);
+ ByteArray* srcPixelArrayB = srcImageDataB->data()->data();
IntRect imageRect(IntPoint(), resultImage()->size());
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* dstPixelArray = imageData->data()->data();
ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
@@ -116,10 +118,10 @@ void FEDisplacementMap::apply(Filter* filter)
int srcY = y + static_cast<int>(scaleY * srcPixelArrayB->get(dstIndex + m_yChannelSelector - 1) + scaleAdjustmentY);
for (unsigned channel = 0; channel < 4; ++channel) {
if (srcX < 0 || srcX >= imageRect.width() || srcY < 0 || srcY >= imageRect.height())
- imageData->data()->set(dstIndex + channel, static_cast<unsigned char>(0));
+ dstPixelArray->set(dstIndex + channel, static_cast<unsigned char>(0));
else {
unsigned char pixelValue = srcPixelArrayA->get(srcY * stride + srcX * 4 + channel);
- imageData->data()->set(dstIndex + channel, pixelValue);
+ dstPixelArray->set(dstIndex + channel, pixelValue);
}
}
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index 1f36ba7..bb70537 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -27,10 +27,10 @@
#if ENABLE(FILTERS)
#include "FEGaussianBlur.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
+
#include <wtf/MathExtras.h>
using std::max;
@@ -72,7 +72,7 @@ void FEGaussianBlur::setStdDeviationY(float y)
m_stdY = y;
}
-static void boxBlur(CanvasPixelArray*& srcPixelArray, CanvasPixelArray*& dstPixelArray,
+inline void boxBlur(ByteArray* srcPixelArray, ByteArray* dstPixelArray,
unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
{
for (int y = 0; y < effectHeight; ++y) {
@@ -175,7 +175,7 @@ void FEGaussianBlur::apply(Filter* filter)
setIsAlphaImage(in->isAlphaImage());
IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<ImageData> srcImageData(in->resultImage()->getPremultipliedImageData(effectDrawingRect));
+ RefPtr<ImageData> srcImageData = in->resultImage()->getPremultipliedImageData(effectDrawingRect);
IntRect imageRect(IntPoint(), resultImage()->size());
if (!m_stdX && !m_stdY) {
@@ -187,9 +187,9 @@ void FEGaussianBlur::apply(Filter* filter)
unsigned kernelSizeY = 0;
calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
- CanvasPixelArray* srcPixelArray(srcImageData->data());
+ ByteArray* srcPixelArray = srcImageData->data()->data();
RefPtr<ImageData> tmpImageData = ImageData::create(imageRect.width(), imageRect.height());
- CanvasPixelArray* tmpPixelArray(tmpImageData->data());
+ ByteArray* tmpPixelArray = tmpImageData->data()->data();
int stride = 4 * imageRect.width();
int dxLeft = 0;
@@ -201,7 +201,7 @@ void FEGaussianBlur::apply(Filter* filter)
kernelPosition(i, kernelSizeX, dxLeft, dxRight);
boxBlur(srcPixelArray, tmpPixelArray, kernelSizeX, dxLeft, dxRight, 4, stride, imageRect.width(), imageRect.height(), isAlphaImage());
} else {
- CanvasPixelArray* auxPixelArray = tmpPixelArray;
+ ByteArray* auxPixelArray = tmpPixelArray;
tmpPixelArray = srcPixelArray;
srcPixelArray = auxPixelArray;
}
@@ -210,7 +210,7 @@ void FEGaussianBlur::apply(Filter* filter)
kernelPosition(i, kernelSizeY, dyLeft, dyRight);
boxBlur(tmpPixelArray, srcPixelArray, kernelSizeY, dyLeft, dyRight, stride, 4, imageRect.height(), imageRect.width(), isAlphaImage());
} else {
- CanvasPixelArray* auxPixelArray = tmpPixelArray;
+ ByteArray* auxPixelArray = tmpPixelArray;
tmpPixelArray = srcPixelArray;
srcPixelArray = auxPixelArray;
}
diff --git a/WebCore/platform/graphics/filters/FEMorphology.cpp b/WebCore/platform/graphics/filters/FEMorphology.cpp
index ac26441..0b67f9a 100644
--- a/WebCore/platform/graphics/filters/FEMorphology.cpp
+++ b/WebCore/platform/graphics/filters/FEMorphology.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FEMorphology.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
@@ -108,8 +107,10 @@ void FEMorphology::apply(Filter* filter)
IntRect imageRect(IntPoint(), resultImage()->size());
IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
- RefPtr<CanvasPixelArray> srcPixelArray(in->resultImage()->getPremultipliedImageData(effectDrawingRect)->data());
+ RefPtr<ImageData> srcImageData = in->resultImage()->getPremultipliedImageData(effectDrawingRect);
+ ByteArray* srcPixelArray = srcImageData->data()->data();
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* dstPixelArray = imageData->data()->data();
int effectWidth = effectDrawingRect.width() * 4;
@@ -155,7 +156,7 @@ void FEMorphology::apply(Filter* filter)
(m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema))
entireExtrema = extrema[kernelIndex];
}
- imageData->data()->set(y * effectWidth + 4 * x + channel, entireExtrema);
+ dstPixelArray->set(y * effectWidth + 4 * x + channel, entireExtrema);
}
}
}
diff --git a/WebCore/platform/graphics/filters/FETile.cpp b/WebCore/platform/graphics/filters/FETile.cpp
index a695d3b..57160ed 100644
--- a/WebCore/platform/graphics/filters/FETile.cpp
+++ b/WebCore/platform/graphics/filters/FETile.cpp
@@ -41,14 +41,6 @@ PassRefPtr<FETile> FETile::create()
return adoptRef(new FETile);
}
-FloatRect FETile::determineFilterPrimitiveSubregion(Filter* filter)
-{
- inputEffect(0)->determineFilterPrimitiveSubregion(filter);
-
- filter->determineFilterPrimitiveSubregion(this, filter->filterRegionInUserSpace());
- return filterPrimitiveSubregion();
-}
-
void FETile::apply(Filter* filter)
{
// FIXME: See bug 47315. This is a hack to work around a compile failure, but is incorrect behavior otherwise.
diff --git a/WebCore/platform/graphics/filters/FETile.h b/WebCore/platform/graphics/filters/FETile.h
index 8562c90..5f21433 100644
--- a/WebCore/platform/graphics/filters/FETile.h
+++ b/WebCore/platform/graphics/filters/FETile.h
@@ -37,10 +37,10 @@ public:
virtual void determineAbsolutePaintRect(Filter*) { setAbsolutePaintRect(maxEffectRect()); }
+ virtual FilterEffectType filterEffectType() const { return FilterEffectTypeTile; }
+
virtual TextStream& externalRepresentation(TextStream&, int indention) const;
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
private:
FETile();
};
diff --git a/WebCore/platform/graphics/filters/FETurbulence.cpp b/WebCore/platform/graphics/filters/FETurbulence.cpp
index b1494a5..9ad27cf 100644
--- a/WebCore/platform/graphics/filters/FETurbulence.cpp
+++ b/WebCore/platform/graphics/filters/FETurbulence.cpp
@@ -26,7 +26,6 @@
#if ENABLE(FILTERS)
#include "FETurbulence.h"
-#include "CanvasPixelArray.h"
#include "Filter.h"
#include "ImageData.h"
@@ -329,6 +328,7 @@ void FETurbulence::apply(Filter* filter)
return;
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
+ ByteArray* pixelArray = imageData->data()->data();
PaintingData paintingData(m_seed, roundedIntSize(filterPrimitiveSubregion().size()));
initPaint(paintingData);
@@ -342,7 +342,7 @@ void FETurbulence::apply(Filter* filter)
for (int x = 0; x < imageRect.width(); ++x) {
point.setX(point.x() + 1);
for (paintingData.channel = 0; paintingData.channel < 4; ++paintingData.channel, ++indexOfPixelChannel)
- imageData->data()->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, filter->mapAbsolutePointToLocalPoint(point)));
+ pixelArray->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(paintingData, filter->mapAbsolutePointToLocalPoint(point)));
}
}
resultImage()->putUnmultipliedImageData(imageData.get(), imageRect, IntPoint());
diff --git a/WebCore/platform/graphics/filters/Filter.h b/WebCore/platform/graphics/filters/Filter.h
index 121e389..33cf724 100644
--- a/WebCore/platform/graphics/filters/Filter.h
+++ b/WebCore/platform/graphics/filters/Filter.h
@@ -52,12 +52,8 @@ namespace WebCore {
virtual FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint&) const { return FloatPoint(); }
- // SVG specific
- virtual void determineFilterPrimitiveSubregion(FilterEffect*, const FloatRect&) { }
-
virtual FloatRect filterRegionInUserSpace() const { return FloatRect(); }
- virtual FloatSize maxImageSize() const = 0;
virtual bool effectBoundingBoxMode() const = 0;
private:
diff --git a/WebCore/platform/graphics/filters/FilterEffect.cpp b/WebCore/platform/graphics/filters/FilterEffect.cpp
index 121b921..ad351a5 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -39,23 +39,6 @@ FilterEffect::~FilterEffect()
{
}
-FloatRect FilterEffect::determineFilterPrimitiveSubregion(Filter* filter)
-{
- FloatRect uniteRect;
- unsigned size = m_inputEffects.size();
-
- // FETurbulence, FEImage and FEFlood don't have input effects, take the filter region as unite rect.
- if (!size)
- uniteRect = filter->filterRegionInUserSpace();
- else {
- for (unsigned i = 0; i < size; ++i)
- uniteRect.unite(m_inputEffects.at(i)->determineFilterPrimitiveSubregion(filter));
- }
-
- filter->determineFilterPrimitiveSubregion(this, uniteRect);
- return m_filterPrimitiveSubregion;
-}
-
void FilterEffect::determineAbsolutePaintRect(Filter*)
{
m_absolutePaintRect = IntRect();
diff --git a/WebCore/platform/graphics/filters/FilterEffect.h b/WebCore/platform/graphics/filters/FilterEffect.h
index a614b59..25db57b 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/WebCore/platform/graphics/filters/FilterEffect.h
@@ -99,9 +99,6 @@ public:
bool hasHeight() const { return m_hasHeight; }
void setHasHeight(bool value) { m_hasHeight = value; }
- // FIXME: FETile still needs special handling.
- virtual FloatRect determineFilterPrimitiveSubregion(Filter*);
-
FloatRect filterPrimitiveSubregion() const { return m_filterPrimitiveSubregion; }
void setFilterPrimitiveSubregion(const FloatRect& filterPrimitiveSubregion) { m_filterPrimitiveSubregion = filterPrimitiveSubregion; }
diff --git a/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp b/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
index d5f3173..a158689 100644
--- a/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
+++ b/WebCore/platform/graphics/gtk/FontCustomPlatformDataPango.cpp
@@ -30,7 +30,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
{
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(m_fontFace, size, bold, italic);
}
diff --git a/WebCore/platform/graphics/gtk/FontPlatformDataPango.h b/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
index 7b1e51f..c42af7f 100644
--- a/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
+++ b/WebCore/platform/graphics/gtk/FontPlatformDataPango.h
@@ -71,7 +71,7 @@ public:
unsigned hash() const
{
uintptr_t hashCodes[1] = { reinterpret_cast<uintptr_t>(m_scaledFont) };
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
bool operator==(const FontPlatformData&) const;
diff --git a/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp b/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
index 4b39fdd..ce7ec46 100644
--- a/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/haiku/FontCustomPlatformData.cpp
@@ -31,7 +31,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
{
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(size, bold, italic);
}
diff --git a/WebCore/platform/graphics/haiku/FontCustomPlatformData.h b/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
index a7dfe37..cc348e3 100644
--- a/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/haiku/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -37,7 +38,7 @@ namespace WebCore {
static bool supportsFormat(const String&);
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
};
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
diff --git a/WebCore/platform/graphics/mac/FontCacheMac.mm b/WebCore/platform/graphics/mac/FontCacheMac.mm
index 0747dd7..313db1c 100644
--- a/WebCore/platform/graphics/mac/FontCacheMac.mm
+++ b/WebCore/platform/graphics/mac/FontCacheMac.mm
@@ -142,7 +142,8 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
FontPlatformData alternateFont(substituteFont,
!font.isPlatformFont() && isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(substituteFontWeight),
- !font.isPlatformFont() && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait));
+ !font.isPlatformFont() && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait),
+ platformData.m_orientation);
return getCachedFontData(&alternateFont);
}
@@ -210,7 +211,7 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
- return new FontPlatformData(platformFont, syntheticBold, syntheticOblique);
+ return new FontPlatformData(platformFont, syntheticBold, syntheticOblique, fontDescription.orientation());
}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp b/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
index a600d73..cead71b 100644
--- a/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
@@ -38,9 +38,9 @@ FontCustomPlatformData::~FontCustomPlatformData()
CGFontRelease(m_cgFont);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation orientation, FontRenderingMode)
{
- return FontPlatformData(m_cgFont, (ATSUFontID)m_atsFont, size, bold, italic);
+ return FontPlatformData(m_cgFont, (ATSUFontID)m_atsFont, size, bold, italic, orientation);
}
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
diff --git a/WebCore/platform/graphics/mac/FontCustomPlatformData.h b/WebCore/platform/graphics/mac/FontCustomPlatformData.h
index 90440d5..7702457 100644
--- a/WebCore/platform/graphics/mac/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/mac/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <CoreFoundation/CFBase.h>
#include <wtf/Forward.h>
@@ -41,7 +42,7 @@ struct FontCustomPlatformData : Noncopyable {
{}
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index 33a930b..d760f5a 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -47,10 +47,29 @@ bool Font::canReturnFallbackFontsForComplexText()
return true;
}
-static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
+static void showGlyphsWithAdvances(const SimpleFontData* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
{
- if (!font.isColorBitmapFont())
+ const FontPlatformData& platformData = font->platformData();
+ if (!platformData.isColorBitmapFont()) {
+ CGAffineTransform savedMatrix;
+ bool isVertical = platformData.orientation() == Vertical;
+
+ if (isVertical) {
+ CGAffineTransform rotateLeftTransform = CGAffineTransformMake(0, -1, 1, 0, 0, 0);
+
+ savedMatrix = CGContextGetTextMatrix(context);
+ CGAffineTransform runMatrix = CGAffineTransformConcat(savedMatrix, rotateLeftTransform);
+ // Move start point to put glyphs into original region.
+ runMatrix.tx = savedMatrix.tx + font->ascent();
+ runMatrix.ty = savedMatrix.ty + font->descent();
+ CGContextSetTextMatrix(context, runMatrix);
+ }
+
CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
+
+ if (isVertical)
+ CGContextSetTextMatrix(context, savedMatrix);
+ }
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
else {
if (!count)
@@ -64,7 +83,7 @@ static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef co
positions[i].x = positions[i - 1].x + advance.width;
positions[i].y = positions[i - 1].y + advance.height;
}
- CTFontDrawGlyphs(font.ctFont(), glyphs, positions.data(), count, context);
+ CTFontDrawGlyphs(platformData.ctFont(), glyphs, positions.data(), count, context);
}
#endif
}
@@ -149,19 +168,19 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
context->setFillColor(shadowFillColor, fillColorSpace);
CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset()) {
CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + shadowOffset.height());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
}
context->setFillColor(fillColor, fillColorSpace);
}
CGContextSetTextPosition(cgContext, point.x(), point.y());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset()) {
CGContextSetTextPosition(cgContext, point.x() + font->syntheticBoldOffset(), point.y());
- showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+ showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
}
if (hasSimpleShadow)
diff --git a/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp b/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
index 143e665..48ad1c0 100644
--- a/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
+++ b/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
@@ -40,15 +40,70 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
bool haveGlyphs = false;
#ifndef BUILDING_ON_TIGER
- Vector<CGGlyph, 512> glyphs(bufferLength);
- wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+ if (fontData->platformData().orientation() == Horizontal) {
+ Vector<CGGlyph, 512> glyphs(bufferLength);
+ wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+ for (unsigned i = 0; i < length; ++i) {
+ if (!glyphs[i])
+ setGlyphDataForIndex(offset + i, 0, 0);
+ else {
+ setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+ haveGlyphs = true;
+ }
+ }
+ } else {
+ // We ask CoreText for possible vertical variant glyphs
+ RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
+ RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0)));
+ RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithAttributedString(attributedString.get()));
- for (unsigned i = 0; i < length; ++i) {
- if (!glyphs[i])
- setGlyphDataForIndex(offset + i, 0, 0);
- else {
- setGlyphDataForIndex(offset + i, glyphs[i], fontData);
- haveGlyphs = true;
+ CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
+ CFIndex runCount = CFArrayGetCount(runArray);
+
+ // Initialize glyph entries
+ for (unsigned index = 0; index < length; ++index)
+ setGlyphDataForIndex(offset + index, 0, 0);
+
+ Vector<CGGlyph, 512> glyphVector;
+ Vector<CFIndex, 512> indexVector;
+ bool done = false;
+ for (CFIndex r = 0; r < runCount && !done ; ++r) {
+ // CTLine could map characters over multiple fonts using its own font fallback list.
+ // We need to pick runs that use the exact font we need, i.e., fontData->platformData().ctFont().
+ CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
+ ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
+
+ CFDictionaryRef attributes = CTRunGetAttributes(ctRun);
+ CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(attributes, kCTFontAttributeName));
+ RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
+ // Use CGFont here as CFEqual for CTFont counts all attributes for font.
+ if (CFEqual(fontData->platformData().cgFont(), runCGFont.get())) {
+ // This run uses the font we want. Extract glyphs.
+ CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
+ const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
+ if (!glyphs) {
+ glyphVector.resize(glyphCount);
+ CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), glyphVector.data());
+ glyphs = glyphVector.data();
+ }
+ const CFIndex* stringIndices = CTRunGetStringIndicesPtr(ctRun);
+ if (!stringIndices) {
+ indexVector.resize(glyphCount);
+ CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), indexVector.data());
+ stringIndices = indexVector.data();
+ }
+
+ for (CFIndex i = 0; i < glyphCount; ++i) {
+ if (stringIndices[i] >= static_cast<CFIndex>(length)) {
+ done = true;
+ break;
+ }
+ if (glyphs[i]) {
+ setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], fontData);
+ haveGlyphs = true;
+ }
+ }
+ }
}
}
#else
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index e079b44..78d004a 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -210,6 +210,8 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi
m_compiler.setResources(ANGLEResources);
::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+ ::glEnable(GL_POINT_SPRITE);
+
::glClearColor(0, 0, 0, 0);
}
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
index 4fb525f..01d75ee 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
+++ b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
@@ -30,8 +30,6 @@
#import "config.h"
#import "SimpleFontData.h"
-#if USE(CORE_TEXT)
-
#import "Font.h"
#import "FontCache.h"
#import "FontDescription.h"
@@ -60,16 +58,16 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese
if (!(typesettingFeatures & Kerning)) {
static const float kerningAdjustmentValue = 0;
static CFNumberRef kerningAdjustment = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &kerningAdjustmentValue);
- static const void* keysWithKerningDisabled[] = { kCTFontAttributeName, kCTKernAttributeName, kCTLigatureAttributeName };
+ static const void* keysWithKerningDisabled[] = { kCTFontAttributeName, kCTKernAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
const void* valuesWithKerningDisabled[] = { platformData().ctFont(), kerningAdjustment, allowLigatures
- ? ligaturesAllowed : ligaturesNotAllowed };
+ ? ligaturesAllowed : ligaturesNotAllowed, platformData().orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningDisabled, valuesWithKerningDisabled,
sizeof(keysWithKerningDisabled) / sizeof(*keysWithKerningDisabled),
&kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
} else {
// By omitting the kCTKernAttributeName attribute, we get Core Text's standard kerning.
- static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName };
- const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed };
+ static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
+ const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed, platformData().orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningEnabled, valuesWithKerningEnabled,
sizeof(keysWithKerningEnabled) / sizeof(*keysWithKerningEnabled),
&kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
@@ -79,5 +77,3 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese
}
} // namespace WebCore
-
-#endif
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index 94fcc5e..fd57630 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -277,6 +277,11 @@ void SimpleFontData::platformInit()
#else
m_xHeight = m_platformData.font() ? [m_platformData.font() xHeight] : 0;
#endif
+ // CGFontGetXHeight() returns a wrong value for "Apple Symbols" font (a float close to 0, but not strictly 0).
+ // The following code makes a guess for m_xHeight in that case.
+ // The int cast is a workaround for the "almost" zero value returned by CGFontGetXHeight().
+ if (!static_cast<int>(m_xHeight) && fAscent)
+ m_xHeight = 2 * fAscent / 3;
}
}
@@ -417,11 +422,9 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
{
FloatRect boundingBox;
#ifndef BUILDING_ON_TIGER
- CGRect box;
- CGFontGetGlyphBBoxes(platformData().cgFont(), &glyph, 1, &box);
- float pointSize = platformData().m_size;
- CGFloat scale = pointSize / unitsPerEm();
- boundingBox = CGRectApplyAffineTransform(box, CGAffineTransformMakeScale(scale, -scale));
+ boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(),
+ m_platformData.orientation() == Vertical ? kCTFontVerticalOrientation : kCTFontHorizontalOrientation, &glyph, 0, 1);
+ boundingBox.setY(-boundingBox.bottom());
#else
// FIXME: Custom fonts don't have NSFonts, so this function doesn't compute correct bounds for these on Tiger.
if (!m_platformData.font())
@@ -437,14 +440,18 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
{
- NSFont* font = platformData().font();
- float pointSize = platformData().m_size;
- CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
CGSize advance;
- if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
- LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
- advance.width = 0;
- }
+ if (m_platformData.orientation() == Horizontal) {
+ NSFont* font = platformData().font();
+ float pointSize = platformData().m_size;
+ CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
+ if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
+ LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
+ advance.width = 0;
+ }
+ } else
+ CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &glyph, &advance, 1);
+
return advance.width + m_syntheticBoldOffset;
}
diff --git a/WebCore/platform/graphics/opengl/TextureMapperGL.cpp b/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
new file mode 100644
index 0000000..6527ce4
--- /dev/null
+++ b/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
@@ -0,0 +1,591 @@
+/*
+ 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 "TextureMapperGL.h"
+
+#include "GraphicsContext.h"
+#include "HashMap.h"
+#include "Image.h"
+#include "PassRefPtr.h"
+#include "RefCounted.h"
+#include "Timer.h"
+
+#if defined(TEXMAP_OPENGL_ES_2)
+#include <GLES2/gl2.h>
+#elif OS(MAC_OS_X)
+#include <gl.h>
+#else
+#include <GL/gl.h>
+#endif
+
+#ifndef TEXMAP_OPENGL_ES2
+extern "C" {
+ void glUniform1f(GLint, GLfloat);
+ void glUniform1i(GLint, GLint);
+ void glVertexAttribPointer(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
+ void glUniform4f(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+ void glShaderSource(GLuint, GLsizei, const char**, const GLint*);
+ GLuint glCreateShader(GLenum);
+ void glShaderSource(GLuint, GLsizei, const char**, const GLint*);
+ void glCompileShader(GLuint);
+ void glDeleteShader(GLuint);
+ void glUniformMatrix4fv(GLint, GLsizei, GLboolean, const GLfloat*);
+ GLuint glCreateProgram();
+ void glAttachShader(GLuint, GLuint);
+ void glLinkProgram(GLuint);
+ void glUseProgram(GLuint);
+ void glDisableVertexAttribArray(GLuint);
+ void glEnableVertexAttribArray(GLuint);
+ void glBindFramebuffer(GLenum target, GLuint framebuffer);
+ void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
+ void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
+ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+ void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+ void glBindBuffer(GLenum, GLuint);
+ void glDeleteBuffers(GLsizei, const GLuint*);
+ void glGenBuffers(GLsizei, GLuint*);
+ void glBufferData(GLenum, GLsizeiptr, const GLvoid*, GLenum);
+ void glBufferSubData(GLenum, GLsizeiptr, GLsizeiptr, const GLvoid*);
+ void glGetProgramInfoLog(GLuint program, GLsizei, GLsizei*, GLchar*);
+
+#if !OS(MAC_OS_X)
+ GLint glGetUniformLocation(GLuint, const GLchar*);
+ GLint glBindAttribLocation(GLuint, GLuint, const GLchar*);
+#endif
+}
+#endif
+
+namespace WebCore {
+
+inline static void debugGLCommand(const char* command, int line)
+{
+ const GLenum err = glGetError();
+ if (!err)
+ return;
+ WTFReportError(__FILE__, line, WTF_PRETTY_FUNCTION, "[TextureMapper GL] Command failed: %s (%x)\n", command, err);
+}
+
+#define DEBUG_GL_COMMANDS
+
+#ifdef DEBUG_GL_COMMANDS
+#define GL_CMD(x) {x, debugGLCommand(#x, __LINE__); }
+#else
+#define GL_CMD(x) x
+#endif
+
+class BitmapTextureGL : public BitmapTexture {
+public:
+ virtual void destroy();
+ virtual IntSize size() const;
+ virtual bool isValid() const;
+ virtual void reset(const IntSize&, bool opaque);
+ virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect);
+ virtual void endPaint();
+ virtual void setContentsToImage(Image*);
+
+private:
+ GLuint m_id;
+ NativeImagePtr m_image;
+ FloatSize m_relativeSize;
+ bool m_opaque;
+ IntSize m_textureSize;
+ RefPtr<RGBA32PremultimpliedBuffer> m_buffer;
+ IntRect m_dirtyRect;
+ GLuint m_fbo;
+ IntSize m_actualSize;
+ bool m_surfaceNeedsReset;
+ BitmapTextureGL()
+ : m_id(0)
+ , m_image(0)
+ , m_opaque(false)
+ , m_fbo(0)
+ , m_surfaceNeedsReset(true)
+ {
+ }
+
+ friend class TextureMapperGL;
+};
+
+static struct TexmapShaderInfo {
+ enum ShaderProgramIndex {
+ SimpleProgram,
+ OpacityAndMaskProgram,
+ TargetProgram,
+ NumPrograms
+ };
+
+ enum ShaderVariableIndex {
+ InMatrixVariable,
+ InSourceMatrixVariable,
+ InMaskMatrixVariable,
+ InVertexVariable,
+
+ OpacityVariable,
+ SourceTextureVariable,
+ MaskTextureVariable,
+ NumVariables
+ };
+
+ struct ProgramInfo {
+ GLuint id;
+ GLint vars[NumVariables];
+ };
+
+ GLint getUniformLocation(ShaderProgramIndex prog, ShaderVariableIndex var, const char* name)
+ {
+ return programs[prog].vars[var] = glGetUniformLocation(programs[prog].id, name);
+ }
+
+ void createShaderProgram(const char* vertexShaderSource, const char* fragmentShaderSource, ShaderProgramIndex index)
+ {
+ GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
+ GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
+ GL_CMD(glShaderSource(vertexShader, 1, &vertexShaderSource, 0))
+ GL_CMD(glShaderSource(fragmentShader, 1, &fragmentShaderSource, 0))
+ GLuint programID = glCreateProgram();
+ GL_CMD(glCompileShader(vertexShader))
+ GL_CMD(glCompileShader(fragmentShader))
+ GL_CMD(glAttachShader(programID, vertexShader))
+ GL_CMD(glAttachShader(programID, fragmentShader))
+ GL_CMD(glBindAttribLocation(programID, 0, "InVertex"))
+ GL_CMD(glLinkProgram(programID))
+ programs[index].id = programID;
+ }
+
+ ProgramInfo programs[NumPrograms];
+
+} gShaderInfo;
+
+#define TEXMAP_GET_SHADER_VAR_LOCATION(prog, var) \
+ if (gShaderInfo.getUniformLocation(TexmapShaderInfo::prog##Program, TexmapShaderInfo::var##Variable, #var) < 0) \
+ LOG_ERROR("Couldn't find variable "#var" in program "#prog"\n");
+#define TEXMAP_BUILD_SHADER(program) gShaderInfo.createShaderProgram(vertexShaderSource##program, fragmentShaderSource##program, TexmapShaderInfo::program##Program);
+
+TextureMapperGL::TextureMapperGL(GraphicsContext* context)
+ : TextureMapper(context)
+ , m_currentProgram(TexmapShaderInfo::TargetProgram)
+{
+ static bool shadersCompiled = false;
+ if (shadersCompiled)
+ return;
+ shadersCompiled = true;
+#ifndef TEXMAP_OPENGL_ES2
+#define OES2_PRECISION_DEFINITIONS \
+ "#define lowp\n#define highp\n"
+#else
+#define OES2_PRECISION_DEFINITIONS
+#endif
+
+ const char* fragmentShaderSourceOpacityAndMask =
+ OES2_PRECISION_DEFINITIONS
+" uniform sampler2D SourceTexture, MaskTexture; \n"
+" uniform lowp float Opacity; \n"
+" varying highp vec2 OutTexCoordSource, OutTexCoordMask; \n"
+" void main(void) \n"
+" { \n"
+" lowp vec4 color = texture2D(SourceTexture, OutTexCoordSource); \n"
+" lowp vec4 maskColor = texture2D(MaskTexture, OutTexCoordMask); \n"
+" lowp float o = Opacity * maskColor.a; \n"
+" gl_FragColor = vec4(color.rgb * o, color.a * o); \n"
+" } \n";
+
+ const char* vertexShaderSourceOpacityAndMask =
+ OES2_PRECISION_DEFINITIONS
+" uniform mat4 InMatrix, InSourceMatrix, InMaskMatrix; \n"
+" attribute vec4 InVertex; \n"
+" varying highp vec2 OutTexCoordSource, OutTexCoordMask; \n"
+" void main(void) \n"
+" { \n"
+" OutTexCoordSource = vec2(InSourceMatrix * InVertex); \n"
+" OutTexCoordMask = vec2(InMaskMatrix * InVertex); \n"
+" gl_Position = InMatrix * InVertex; \n"
+" } \n";
+
+ const char* fragmentShaderSourceSimple =
+ OES2_PRECISION_DEFINITIONS
+" uniform sampler2D SourceTexture; \n"
+" uniform lowp float Opacity; \n"
+" varying highp vec2 OutTexCoordSource; \n"
+" void main(void) \n"
+" { \n"
+" lowp vec4 color = texture2D(SourceTexture, OutTexCoordSource); \n"
+" gl_FragColor = vec4(color.rgb * Opacity, color.a * Opacity); \n"
+" } \n";
+
+ const char* vertexShaderSourceSimple =
+ OES2_PRECISION_DEFINITIONS
+" uniform mat4 InMatrix, InSourceMatrix; \n"
+" attribute vec4 InVertex; \n"
+" varying highp vec2 OutTexCoordSource; \n"
+" void main(void) \n"
+" { \n"
+" OutTexCoordSource = vec2(InSourceMatrix * InVertex); \n"
+" gl_Position = InMatrix * InVertex; \n"
+" } \n";
+
+ const char* fragmentShaderSourceTarget =
+ OES2_PRECISION_DEFINITIONS
+" uniform sampler2D SourceTexture; \n"
+" uniform lowp float Opacity; \n"
+" varying highp vec2 OutTexCoordSource; \n"
+" void main(void) \n"
+" { \n"
+" lowp vec4 color = texture2D(SourceTexture, OutTexCoordSource); \n"
+" gl_FragColor = vec4(color.bgr * Opacity, color.a * Opacity); \n"
+" } \n";
+
+ const char* vertexShaderSourceTarget = vertexShaderSourceSimple;
+
+ TEXMAP_BUILD_SHADER(Simple)
+ TEXMAP_BUILD_SHADER(OpacityAndMask)
+ TEXMAP_BUILD_SHADER(Target)
+
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, InMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, InSourceMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, InMaskMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, SourceTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, MaskTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(OpacityAndMask, Opacity)
+
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, InSourceMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, InMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, SourceTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Simple, Opacity)
+
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, InSourceMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, InMatrix)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, SourceTexture)
+ TEXMAP_GET_SHADER_VAR_LOCATION(Target, Opacity)
+}
+
+void TextureMapperGL::drawTexture(const BitmapTexture& texture, const IntRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture)
+{
+ if (!texture.isValid())
+ return;
+
+ const BitmapTextureGL& textureGL = static_cast<const BitmapTextureGL&>(texture);
+
+ TexmapShaderInfo::ShaderProgramIndex program;
+ if (maskTexture)
+ program = TexmapShaderInfo::OpacityAndMaskProgram;
+ else
+ program = TexmapShaderInfo::SimpleProgram;
+
+ const TexmapShaderInfo::ProgramInfo& programInfo = gShaderInfo.programs[program];
+ if (m_currentProgram != program) {
+ GL_CMD(glUseProgram(programInfo.id))
+ GL_CMD(glDisableVertexAttribArray(gShaderInfo.programs[m_currentProgram].vars[TexmapShaderInfo::InVertexVariable]))
+ m_currentProgram = program;
+ GL_CMD(glEnableVertexAttribArray(programInfo.vars[TexmapShaderInfo::InVertexVariable]))
+ }
+
+ GL_CMD(glDisable(GL_DEPTH_TEST))
+ GL_CMD(glDisable(GL_STENCIL_TEST))
+
+ GL_CMD(glActiveTexture(GL_TEXTURE0))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, textureGL.m_id))
+ GL_CMD(glBindBuffer(GL_ARRAY_BUFFER, 0))
+ const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
+ GL_CMD(glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, unitRect))
+
+ TransformationMatrix matrix = TransformationMatrix(m_projectionMatrix).multLeft(modelViewMatrix).multLeft(TransformationMatrix(
+ targetRect.width(), 0, 0, 0,
+ 0, targetRect.height(), 0, 0,
+ 0, 0, 1, 0,
+ targetRect.x(), targetRect.y(), 0, 1));
+
+ const GLfloat m4[] = {
+ matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
+ matrix.m21(), matrix.m22(), matrix.m23(), matrix.m24(),
+ matrix.m31(), matrix.m32(), matrix.m33(), matrix.m34(),
+ matrix.m41(), matrix.m42(), matrix.m43(), matrix.m44()
+ };
+ const GLfloat m4src[] = {textureGL.m_relativeSize.width(), 0, 0, 0,
+ 0, textureGL.m_relativeSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1};
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InMatrixVariable], 1, GL_FALSE, m4))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InSourceMatrixVariable], 1, GL_FALSE, m4src))
+ GL_CMD(glUniform1i(programInfo.vars[TexmapShaderInfo::SourceTextureVariable], 0))
+ GL_CMD(glUniform1f(programInfo.vars[TexmapShaderInfo::OpacityVariable], opacity))
+
+ if (maskTexture && maskTexture->isValid()) {
+ const BitmapTextureGL* maskTextureGL = static_cast<const BitmapTextureGL*>(maskTexture);
+ GL_CMD(glActiveTexture(GL_TEXTURE1))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, maskTextureGL->m_id))
+ const GLfloat m4mask[] = {maskTextureGL->m_relativeSize.width(), 0, 0, 0,
+ 0, maskTextureGL->m_relativeSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1};
+ glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InMaskMatrixVariable], 1, GL_FALSE, m4mask);
+ GL_CMD(glUniform1i(programInfo.vars[TexmapShaderInfo::MaskTextureVariable], 1))
+ GL_CMD(glActiveTexture(GL_TEXTURE0))
+ }
+
+
+ if (textureGL.m_opaque && opacity > 0.99 && !maskTexture)
+ GL_CMD(glDisable(GL_BLEND))
+ else {
+ GL_CMD(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA))
+ GL_CMD(glEnable(GL_BLEND))
+ }
+
+ GL_CMD(glDrawArrays(GL_TRIANGLE_FAN, 0, 4))
+}
+
+
+const char* TextureMapperGL::type() const
+{
+ return "OpenGL";
+}
+
+void BitmapTextureGL::reset(const IntSize& newSize, bool opaque)
+{
+ BitmapTexture::reset(newSize, opaque);
+ m_image = 0;
+ IntSize newTextureSize = nextPowerOfTwo(newSize);
+ bool justCreated = false;
+ if (!m_id) {
+ GL_CMD(glGenTextures(1, &m_id))
+ justCreated = true;
+ }
+
+ if (justCreated || newTextureSize.width() > m_textureSize.width() || newTextureSize.height() > m_textureSize.height()) {
+ m_textureSize = newTextureSize;
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE))
+ GL_CMD(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE))
+ GL_CMD(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_textureSize.width(), m_textureSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0))
+ }
+ m_actualSize = newSize;
+ m_relativeSize = FloatSize(float(newSize.width()) / m_textureSize.width(), float(newSize.height()) / m_textureSize.height());
+ m_opaque = opaque;
+ m_surfaceNeedsReset = true;
+}
+
+PlatformGraphicsContext* BitmapTextureGL::beginPaint(const IntRect& dirtyRect)
+{
+ m_buffer = RGBA32PremultimpliedBuffer::create();
+ m_dirtyRect = dirtyRect;
+ return m_buffer->beginPaint(dirtyRect, m_opaque);
+}
+
+void BitmapTextureGL::endPaint()
+{
+ if (!m_buffer)
+ return;
+ m_buffer->endPaint();
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
+ GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirtyRect.x(), m_dirtyRect.y(), m_dirtyRect.width(), m_dirtyRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, m_buffer->data()))
+ m_buffer.clear();
+}
+
+struct TexmapGLShaderTextures {
+ struct Entry {
+ GLuint texture;
+ int refCount;
+ };
+ HashMap<NativeImagePtr, Entry> imageToTexture;
+ GLuint findOrCreate(NativeImagePtr image, bool& found)
+ {
+ HashMap<NativeImagePtr, Entry>::iterator it = imageToTexture.find(image);
+ found = false;
+ if (it != imageToTexture.end()) {
+ it->second.refCount++;
+ found = true;
+ return it->second.texture;
+ }
+ Entry entry;
+ GL_CMD(glGenTextures(1, &entry.texture));
+ entry.refCount = 1;
+ imageToTexture.add(image, entry);
+ return entry.texture;
+ }
+
+ bool deref(NativeImagePtr image)
+ {
+ HashMap<NativeImagePtr, Entry>::iterator it = imageToTexture.find(image);
+ if (it != imageToTexture.end()) {
+ if (it->second.refCount < 2) {
+ imageToTexture.remove(it);
+ return false;
+ }
+ }
+ return true;
+ }
+};
+
+static TexmapGLShaderTextures gTextureRepository;
+
+void BitmapTextureGL::setContentsToImage(Image* image)
+{
+ NativeImagePtr nativeImage = image ? image->nativeImageForCurrentFrame() : 0;
+ if (!image || !nativeImage) {
+ if (m_image)
+ destroy();
+ return;
+ }
+
+ if (nativeImage == m_image)
+ return;
+ bool found = false;
+ GLuint newTextureID = gTextureRepository.findOrCreate(nativeImage, found);
+ if (newTextureID != m_id) {
+ destroy();
+ m_id = newTextureID;
+ reset(image->size(), false);
+ m_image = nativeImage;
+ if (!found) {
+ GraphicsContext context(beginPaint(IntRect(0, 0, m_textureSize.width(), m_textureSize.height())));
+ context.drawImage(image, ColorSpaceDeviceRGB, IntPoint(0, 0), CompositeCopy);
+ endPaint();
+ }
+ }
+}
+
+void BitmapTextureGL::destroy()
+{
+ if (m_id && (!m_image || !gTextureRepository.deref(m_image)))
+ GL_CMD(glDeleteTextures(1, &m_id))
+ if (m_fbo)
+ GL_CMD(glDeleteFramebuffers(1, &m_fbo))
+
+ m_fbo = 0;
+ m_id = 0;
+ m_textureSize = IntSize();
+ m_relativeSize = FloatSize(1, 1);
+}
+
+bool BitmapTextureGL::isValid() const
+{
+ return m_id;
+}
+
+IntSize BitmapTextureGL::size() const
+{
+ return m_textureSize;
+}
+
+static inline TransformationMatrix createProjectionMatrix(const IntSize& size, bool flip)
+{
+ return TransformationMatrix(2.0 / float(size.width()), 0, 0, 0,
+ 0, (flip ? -2.0 : 2.0) / float(size.height()), 0, 0,
+ 0, 0, -0.000001, 0,
+ -1, flip ? 1 : -1, 0, 1);
+}
+
+void TextureMapperGL::cleanup()
+{
+}
+
+void TextureMapperGL::bindSurface(BitmapTexture *surfacePointer)
+{
+ BitmapTextureGL* surface = static_cast<BitmapTextureGL*>(surfacePointer);
+
+ if (!surface)
+ return;
+ TransformationMatrix matrix = createProjectionMatrix(surface->size(), false);
+ matrix.translate(-surface->offset().x(), -surface->offset().y());
+
+ if (surface->m_surfaceNeedsReset || !surface->m_fbo) {
+ if (!surface->m_fbo)
+ GL_CMD(glGenFramebuffers(1, &surface->m_fbo))
+ GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, surface->m_fbo))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, 0))
+ GL_CMD(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, surface->m_id, 0))
+ GL_CMD(glClearColor(0, 0, 0, 0))
+ GL_CMD(glClear(GL_COLOR_BUFFER_BIT))
+ surface->m_surfaceNeedsReset = false;
+ } else {
+ GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, surface->m_fbo))
+ }
+
+ GL_CMD(glViewport(0, 0, surface->size().width(), surface->size().height()))
+ m_projectionMatrix = matrix;
+}
+
+void TextureMapperGL::setClip(const IntRect& rect)
+{
+ GL_CMD(glScissor(rect.x(), rect.y(), rect.width(), rect.height()))
+ GL_CMD(glEnable(GL_SCISSOR_TEST))
+}
+
+
+void TextureMapperGL::paintToTarget(const BitmapTexture& aSurface, const IntSize& surfaceSize, const TransformationMatrix& transform, float opacity, const IntRect& visibleRect)
+{
+ const BitmapTextureGL& surface = static_cast<const BitmapTextureGL&>(aSurface);
+
+ // Create the model-view-projection matrix to display on screen.
+ TransformationMatrix matrix = createProjectionMatrix(surfaceSize, true).multLeft(transform).multLeft(
+ TransformationMatrix(
+ surface.m_actualSize.width(), 0, 0, 0,
+ 0, surface.m_actualSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ surface.offset().x(), surface.offset().y(), 0, 1
+ )
+ );
+
+ const GLfloat m4[] = {
+ matrix.m11(), matrix.m12(), matrix.m13(), matrix.m14(),
+ matrix.m21(), matrix.m22(), matrix.m23(), matrix.m24(),
+ matrix.m31(), matrix.m32(), matrix.m33(), matrix.m34(),
+ matrix.m41(), matrix.m42(), matrix.m43(), matrix.m44()
+ };
+
+ const GLfloat m4src[] = {surface.m_relativeSize.width(), 0, 0, 0,
+ 0, surface.m_relativeSize.height(), 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1};
+
+ // We already blended the alpha in; the result is premultiplied.
+ GL_CMD(glUseProgram(gShaderInfo.programs[TexmapShaderInfo::TargetProgram].id))
+ GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, 0))
+ GL_CMD(glViewport(0, 0, surfaceSize.width(), surfaceSize.height()))
+ GL_CMD(glDisable(GL_STENCIL_TEST))
+ const TexmapShaderInfo::ProgramInfo& programInfo = gShaderInfo.programs[TexmapShaderInfo::TargetProgram];
+ GL_CMD(glUniform1f(programInfo.vars[TexmapShaderInfo::OpacityVariable], opacity))
+ GL_CMD(glActiveTexture(GL_TEXTURE0))
+ GL_CMD(glBindTexture(GL_TEXTURE_2D, surface.m_id))
+ GL_CMD(glUniform1i(programInfo.vars[TexmapShaderInfo::SourceTextureVariable], 0))
+ GL_CMD(glEnableVertexAttribArray(programInfo.vars[TexmapShaderInfo::InVertexVariable]))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InMatrixVariable], 1, GL_FALSE, m4))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TexmapShaderInfo::InSourceMatrixVariable], 1, GL_FALSE, m4src))
+ GL_CMD(glBindBuffer(GL_ARRAY_BUFFER, 0))
+ const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
+ GL_CMD(glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, unitRect))
+ GL_CMD(glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA))
+ GL_CMD(glEnable(GL_BLEND))
+ setClip(visibleRect);
+
+ GL_CMD(glDrawArrays(GL_TRIANGLE_FAN, 0, 4))
+ GL_CMD(glDisableVertexAttribArray(programInfo.vars[TexmapShaderInfo::InVertexVariable]))
+ GL_CMD(glUseProgram(0))
+ GL_CMD(glBindBuffer(GL_ARRAY_BUFFER, 0))
+ m_currentProgram = TexmapShaderInfo::TargetProgram;
+}
+
+PassRefPtr<BitmapTexture> TextureMapperGL::createTexture()
+{
+ return adoptRef(new BitmapTextureGL());
+}
+
+};
diff --git a/WebCore/platform/graphics/opengl/TextureMapperGL.h b/WebCore/platform/graphics/opengl/TextureMapperGL.h
new file mode 100644
index 0000000..7a12c72
--- /dev/null
+++ b/WebCore/platform/graphics/opengl/TextureMapperGL.h
@@ -0,0 +1,83 @@
+/*
+ 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 TextureMapperGL_h
+#define TextureMapperGL_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "FloatQuad.h"
+#include "IntSize.h"
+#include "TransformationMatrix.h"
+#include "texmap/TextureMapper.h"
+
+namespace WebCore {
+
+// An OpenGL-ES2 implementation of TextureMapper.
+class TextureMapperGL : public TextureMapper {
+public:
+ TextureMapperGL(GraphicsContext* gc);
+ virtual ~TextureMapperGL() {}
+
+ // reimps from TextureMapper
+ virtual void drawTexture(const BitmapTexture& texture, const IntRect&, const TransformationMatrix& transform, float opacity, const BitmapTexture* maskTexture);
+ virtual void bindSurface(BitmapTexture* surface);
+ virtual void setClip(const IntRect&);
+ virtual void paintToTarget(const BitmapTexture&, const IntSize&, const TransformationMatrix&, float opacity, const IntRect& visibleRect);
+ virtual bool allowSurfaceForRoot() const { return true; }
+ virtual PassRefPtr<BitmapTexture> createTexture();
+ virtual const char* type() const;
+ virtual void cleanup();
+
+private:
+ TransformationMatrix m_projectionMatrix;
+ int m_currentProgram;
+};
+
+// An offscreen buffer to be rendered by software.
+class RGBA32PremultimpliedBuffer : public RefCounted<RGBA32PremultimpliedBuffer> {
+public:
+ virtual ~RGBA32PremultimpliedBuffer() {}
+ virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect, bool opaque) = 0;
+ virtual void endPaint() = 0;
+ virtual const void* data() const = 0;
+ static PassRefPtr<RGBA32PremultimpliedBuffer> create();
+};
+
+static inline int nextPowerOfTwo(int num)
+{
+ for (int i = 0x10000000; i > 0; i >>= 1) {
+ if (num == i)
+ return num;
+ if (num & i)
+ return (i << 1);
+ }
+ return 1;
+}
+
+static inline IntSize nextPowerOfTwo(const IntSize& size)
+{
+ return IntSize(nextPowerOfTwo(size.width()), nextPowerOfTwo(size.height()));
+}
+
+};
+
+#endif
+
+#endif
diff --git a/WebCore/platform/graphics/qt/FontCustomPlatformData.h b/WebCore/platform/graphics/qt/FontCustomPlatformData.h
index 019a6bc..6c41d47 100644
--- a/WebCore/platform/graphics/qt/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/qt/FontCustomPlatformData.h
@@ -22,6 +22,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -37,7 +38,7 @@ struct FontCustomPlatformData : Noncopyable {
// for use with QFontDatabase::addApplicationFont/removeApplicationFont
int m_handle;
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
};
diff --git a/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp b/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
index dbf0b16..e2f009b 100644
--- a/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
+++ b/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
@@ -34,7 +34,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
QFontDatabase::removeApplicationFont(m_handle);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
QFont font;
font.setFamily(QFontDatabase::applicationFontFamilies(m_handle)[0]);
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 8b34f51..50971b5 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -171,7 +171,7 @@ static inline Qt::FillRule toQtFillRule(WindRule rule)
class GraphicsContextPlatformPrivate : public Noncopyable {
public:
- GraphicsContextPlatformPrivate(QPainter* painter);
+ GraphicsContextPlatformPrivate(QPainter*, const QColor& initialSolidColor);
~GraphicsContextPlatformPrivate();
inline QPainter* p() const
@@ -225,42 +225,42 @@ private:
};
-GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p)
+GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p, const QColor& initialSolidColor)
+ : antiAliasingForRectsAndLines(false)
+ , layerCount(0)
+ , solidColor(initialSolidColor)
+ , imageInterpolationQuality(InterpolationDefault)
+ , painter(p)
{
- painter = p;
- layerCount = 0;
-
- solidColor = QBrush(Qt::black);
+ if (!painter)
+ return;
- imageInterpolationQuality = InterpolationDefault;
+ // Use the default the QPainter was constructed with.
+ antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
- if (painter) {
- // use the default the QPainter was constructed with
- antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
- // FIXME: Maybe only enable in SVG mode?
- painter->setRenderHint(QPainter::Antialiasing, true);
- painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
- } else
- antiAliasingForRectsAndLines = false;
+ painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, true);
}
GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
{
}
-GraphicsContext::GraphicsContext(PlatformGraphicsContext* context)
+GraphicsContext::GraphicsContext(PlatformGraphicsContext* painter)
: m_common(createGraphicsContextPrivate())
- , m_data(new GraphicsContextPlatformPrivate(context))
+ , m_data(new GraphicsContextPlatformPrivate(painter, fillColor()))
{
- setPaintingDisabled(!context);
- if (context) {
- // Make sure the context starts in sync with our state.
- setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB);
- setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB);
+ setPaintingDisabled(!painter);
- // Make sure we start with the correct join mode.
- setLineJoin(MiterJoin);
- }
+ if (!painter)
+ return;
+
+ // solidColor is initialized with the fillColor().
+ painter->setBrush(m_data->solidColor);
+
+ QPen pen(painter->pen());
+ pen.setColor(strokeColor());
+ pen.setJoinStyle(toQtLineJoin(MiterJoin));
+ painter->setPen(pen);
}
GraphicsContext::~GraphicsContext()
diff --git a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index e0941f5..aa7ed2f 100644
--- a/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -200,6 +200,7 @@ public:
TransformationMatrix m_transformRelativeToRootLayer;
bool m_transformAnimationRunning;
bool m_opacityAnimationRunning;
+ bool m_blockNotifySyncRequired;
#ifndef QT_NO_GRAPHICSEFFECT
QWeakPointer<MaskEffectQt> m_maskEffect;
#endif
@@ -300,6 +301,7 @@ GraphicsLayerQtImpl::GraphicsLayerQtImpl(GraphicsLayerQt* newLayer)
, m_layer(newLayer)
, m_transformAnimationRunning(false)
, m_opacityAnimationRunning(false)
+ , m_blockNotifySyncRequired(false)
, m_changeMask(NoChanges)
#if ENABLE(3D_CANVAS)
, m_gc3D(0)
@@ -593,6 +595,8 @@ void GraphicsLayerQtImpl::paint(QPainter* painter, const QStyleOptionGraphicsIte
void GraphicsLayerQtImpl::notifySyncRequired()
{
+ m_blockNotifySyncRequired = false;
+
if (m_layer->client())
m_layer->client()->notifySyncRequired(m_layer);
}
@@ -600,8 +604,14 @@ void GraphicsLayerQtImpl::notifySyncRequired()
void GraphicsLayerQtImpl::notifyChange(ChangeMask changeMask)
{
m_changeMask |= changeMask;
+
+ if (m_blockNotifySyncRequired)
+ return;
+
static QMetaMethod syncMethod = staticMetaObject.method(staticMetaObject.indexOfMethod("notifySyncRequired()"));
syncMethod.invoke(this, Qt::QueuedConnection);
+
+ m_blockNotifySyncRequired = true;
}
void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform)
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 0cdc894..de23297 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -157,14 +157,17 @@ void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
QImage image = m_data.m_pixmap.toImage().convertToFormat(QImage::Format_ARGB32);
ASSERT(!image.isNull());
+ uchar* bits = image.bits();
+ const int bytesPerLine = image.bytesPerLine();
+
for (int y = 0; y < m_size.height(); ++y) {
- for (int x = 0; x < m_size.width(); x++) {
- QRgb value = image.pixel(x, y);
- value = qRgba(lookUpTable[qRed(value)],
- lookUpTable[qGreen(value)],
- lookUpTable[qBlue(value)],
- qAlpha(value));
- image.setPixel(x, y, value);
+ quint32* scanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
+ for (int x = 0; x < m_size.width(); ++x) {
+ QRgb& pixel = scanLine[x];
+ pixel = qRgba(lookUpTable[qRed(pixel)],
+ lookUpTable[qGreen(pixel)],
+ lookUpTable[qBlue(pixel)],
+ qAlpha(pixel));
}
}
diff --git a/WebCore/platform/graphics/qt/TileQt.cpp b/WebCore/platform/graphics/qt/TileQt.cpp
index 9628448..096ce14 100644
--- a/WebCore/platform/graphics/qt/TileQt.cpp
+++ b/WebCore/platform/graphics/qt/TileQt.cpp
@@ -97,9 +97,10 @@ void Tile::updateBackBuffer()
return;
if (!m_backBuffer) {
- if (!m_buffer)
+ if (!m_buffer) {
m_backBuffer = new QPixmap(m_backingStore->m_tileSize.width(), m_backingStore->m_tileSize.height());
- else {
+ m_backBuffer->fill(m_backingStore->m_client->tiledBackingStoreBackgroundColor());
+ } else {
// Currently all buffers are updated synchronously at the same time so there is no real need
// to have separate back and front buffers. Just use the existing buffer.
m_backBuffer = m_buffer;
diff --git a/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp b/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
index 8301871..2ea568b 100644
--- a/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Apple Computer, Inc.
* Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
+ * Copyright (C) 2010 Company 100, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -36,7 +37,7 @@
#include "Base64.h"
#include "ChromiumBridge.h"
#include "OpenTypeUtilities.h"
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include "SkStream.h"
#endif
@@ -47,7 +48,7 @@
#if OS(WINDOWS)
#include <objbase.h>
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include <cstring>
#endif
@@ -58,13 +59,13 @@ FontCustomPlatformData::~FontCustomPlatformData()
#if OS(WINDOWS)
if (m_fontReference)
RemoveFontMemResourceEx(m_fontReference);
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
if (m_fontReference)
m_fontReference->unref();
#endif
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode mode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode mode)
{
#if OS(WINDOWS)
ASSERT(m_fontReference);
@@ -99,7 +100,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b
HFONT hfont = CreateFontIndirect(&logFont);
return FontPlatformData(hfont, size);
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
ASSERT(m_fontReference);
return FontPlatformData(m_fontReference, "", size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic());
#else
@@ -123,7 +124,7 @@ static String createUniqueFontName()
}
#endif
-#if OS(LINUX) || OS(FREEBSD)
+#if OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
class RemoteFontStream : public SkStream {
public:
explicit RemoteFontStream(PassRefPtr<SharedBuffer> buffer)
@@ -189,7 +190,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
if (!fontReference)
return 0;
return new FontCustomPlatformData(fontReference, fontName);
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
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 94d7ec3..e51b6b6 100644
--- a/WebCore/platform/graphics/skia/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/skia/FontCustomPlatformData.h
@@ -32,6 +32,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -39,7 +40,7 @@
#if OS(WINDOWS)
#include "PlatformString.h"
#include <windows.h>
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
#include "SkTypeface.h"
#endif
@@ -54,7 +55,7 @@ struct FontCustomPlatformData : Noncopyable {
: m_fontReference(fontReference)
, m_name(name)
{}
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
explicit FontCustomPlatformData(SkTypeface* typeface)
: m_fontReference(typeface)
{}
@@ -62,7 +63,7 @@ struct FontCustomPlatformData : Noncopyable {
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic,
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal,
FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
@@ -70,7 +71,7 @@ struct FontCustomPlatformData : Noncopyable {
#if OS(WINDOWS)
HANDLE m_fontReference;
String m_name;
-#elif OS(LINUX) || OS(FREEBSD)
+#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
SkTypeface* m_fontReference;
#endif
};
diff --git a/WebCore/platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp b/WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
index 6024d43..6024d43 100644
--- a/WebCore/platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp
+++ b/WebCore/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index 23e7be6..ae2653a 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -236,12 +236,7 @@ static void paintSkBitmap(PlatformContextSkia* platformContext, const NativeImag
SkPaint paint;
paint.setXfermodeMode(compOp);
paint.setFilterBitmap(true);
- int alpha = roundf(platformContext->getAlpha() * 256);
- if (alpha > 255)
- alpha = 255;
- else if (alpha < 0)
- alpha = 0;
- paint.setAlpha(alpha);
+ paint.setAlpha(platformContext->getNormalizedAlpha());
skia::PlatformCanvas* canvas = platformContext->canvas();
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 3f9e4c1..6204597 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -510,6 +510,16 @@ float PlatformContextSkia::getAlpha() const
return m_state->m_alpha;
}
+int PlatformContextSkia::getNormalizedAlpha() const
+{
+ int alpha = roundf(m_state->m_alpha * 256);
+ if (alpha > 255)
+ alpha = 255;
+ else if (alpha < 0)
+ alpha = 0;
+ return alpha;
+}
+
void PlatformContextSkia::setTextDrawingMode(int mode)
{
// cTextClip is never used, so we assert that it isn't set:
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 84e5d78..110085d 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -134,6 +134,7 @@ public:
float getStrokeThickness() const;
int getTextDrawingMode() const;
float getAlpha() const;
+ int getNormalizedAlpha() const;
void beginPath();
void addPath(const SkPath&);
diff --git a/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
index cf90cb1..057bcfc 100644
--- a/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+++ b/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
@@ -683,7 +683,6 @@ void TextureMapperNode::uploadTextureFromContent(TextureMapper* textureMapper, c
|| (!m_currentContent.needsDisplay && m_currentContent.needsDisplayRect.isEmpty() && !needsReset))
return;
- WTF::StopWatch stopWatch;
IntRect dirtyRect = IntRect(0, 0, m_size.width(), m_size.height());
if (!needsReset && !m_currentContent.needsDisplay)
dirtyRect.intersect(m_currentContent.needsDisplayRect);
@@ -701,15 +700,6 @@ void TextureMapperNode::uploadTextureFromContent(TextureMapper* textureMapper, c
m_layer->paintGraphicsLayerContents(context, dirtyRect);
}
m_texture->endPaint();
- {
-#if 0
- LOG("[TextureMapper] Re-render(%d) layer(%p) %d::%d::%d (%dx%d) [%dms]\n", ++renderCount, this,
- needsReset, m_currentContent.needsDisplay, !m_currentContent.needsDisplayRect.isEmpty(),
- dirtyRect.width(), dirtyRect.height(), int(stopWatch.elapsed() * 1000));
- static int renderCount = 0;
- m_texture->save(String().format("/tmp/layer_%d.png", renderCount));
-#endif
- }
m_currentContent.needsDisplay = false;
}
@@ -739,8 +729,6 @@ void TextureMapperNode::paintSelf(const TexmapPaintOptions& options)
void TextureMapperNode::paintRecursive(TexmapPaintOptions options)
{
- WTF::StopWatch stopWatch;
-
bool isDirty = m_state.dirty;
m_state.dirty = false;
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
index 6e59ad7..9cae99b 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
@@ -59,7 +59,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
}
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode renderingMode)
{
ASSERT(m_fontReference);
ASSERT(T2embedLibrary());
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.h b/WebCore/platform/graphics/win/FontCustomPlatformData.h
index d19a8a5..1bdf270 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include "PlatformString.h"
#include <wtf/Forward.h>
@@ -42,7 +43,7 @@ struct FontCustomPlatformData : Noncopyable {
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
index 02c5b99..c3decbf 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
+++ b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp
@@ -32,7 +32,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
cairo_font_face_destroy(m_fontFace);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation)
{
return FontPlatformData(m_fontFace, size, bold, italic);
}
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
index 525957f..3ab52b8 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
+++ b/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.h
@@ -22,6 +22,7 @@
#ifndef FontCustomPlatformDataCairo_h
#define FontCustomPlatformDataCairo_h
+#include "FontDescription.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -39,7 +40,7 @@ struct FontCustomPlatformData : Noncopyable {
}
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index 1b4f1d9..5544229 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -36,6 +36,7 @@
#include "KURL.h"
#include "MediaPlayerPrivateTaskTimer.h"
#include "QTCFDictionary.h"
+#include "QTDecompressionSession.h"
#include "QTMovie.h"
#include "QTMovieTask.h"
#include "QTMovieVisualContext.h"
@@ -728,12 +729,24 @@ void MediaPlayerPrivateQuickTimeVisualContext::paint(GraphicsContext* p, const I
if (currentMode == MediaRenderingSoftwareRenderer && !m_visualContext)
return;
-#if USE(ACCELERATED_COMPOSITING)
- if (m_qtVideoLayer)
- return;
-#endif
QTPixelBuffer buffer = m_visualContext->imageForTime(0);
if (buffer.pixelBufferRef()) {
+#if USE(ACCELERATED_COMPOSITING)
+ if (m_qtVideoLayer) {
+ // We are probably being asked to render the video into a canvas, but
+ // there's a good chance the QTPixelBuffer is not ARGB and thus can't be
+ // drawn using CG. If so, fire up an ICMDecompressionSession and convert
+ // the current frame into something which can be rendered by CG.
+ if (!buffer.pixelFormatIs32ARGB() && !buffer.pixelFormatIs32BGRA()) {
+ // The decompression session will only decompress a specific pixelFormat
+ // at a specific width and height; if these differ, the session must be
+ // recreated with the new parameters.
+ if (!m_decompressionSession || !m_decompressionSession->canDecompress(buffer))
+ m_decompressionSession = QTDecompressionSession::create(buffer.pixelFormatType(), buffer.width(), buffer.height());
+ buffer = m_decompressionSession->decompress(buffer);
+ }
+ }
+#endif
CGImageRef image = CreateCGImageFromPixelBuffer(buffer);
CGContextRef context = p->platformContext();
@@ -1089,7 +1102,7 @@ void MediaPlayerPrivateQuickTimeVisualContext::setUpVideoRendering()
m_player->mediaPlayerClient()->mediaPlayerRenderingModeChanged(m_player);
#endif
- QTMovieVisualContext::Type contextType = requiredDllsAvailable() && preferredMode == MediaRenderingMovieLayer ? QTMovieVisualContext::ConfigureForCAImageQueue : QTMovieVisualContext::ConfigureForCGImage;
+ QTPixelBuffer::Type contextType = requiredDllsAvailable() && preferredMode == MediaRenderingMovieLayer ? QTPixelBuffer::ConfigureForCAImageQueue : QTPixelBuffer::ConfigureForCGImage;
m_visualContext = QTMovieVisualContext::create(m_visualContextClient.get(), contextType);
m_visualContext->setMovie(m_movie.get());
}
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
index 4c62558..109fd0b 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
@@ -42,6 +42,7 @@
typedef struct CGImage *CGImageRef;
class QTMovie;
class QTMovieVisualContext;
+class QTDecompressionSession;
namespace WebCore {
@@ -178,6 +179,7 @@ private:
RefPtr<WKCACFLayer> m_qtVideoLayer;
OwnPtr<GraphicsLayer> m_transformLayer;
OwnPtr<WKCAImageQueue> m_imageQueue;
+ OwnPtr<QTDecompressionSession> m_decompressionSession;
CGAffineTransform m_movieTransform;
#endif
RefPtr<QTMovieVisualContext> m_visualContext;
diff --git a/WebCore/platform/graphics/win/QTDecompressionSession.cpp b/WebCore/platform/graphics/win/QTDecompressionSession.cpp
new file mode 100644
index 0000000..eeb3ca7
--- /dev/null
+++ b/WebCore/platform/graphics/win/QTDecompressionSession.cpp
@@ -0,0 +1,170 @@
+/*
+ * 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 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 "QTDecompressionSession.h"
+
+#include <ImageCompression.h>
+#include <algorithm>
+
+class QTDecompressionSessionClient {
+public:
+ static void trackingCallback(void *decompressionTrackingRefCon, OSStatus,
+ ICMDecompressionTrackingFlags decompressionTrackingFlags, CVPixelBufferRef pixelBuffer,
+ TimeValue64, TimeValue64, ICMValidTimeFlags, void *, void *)
+ {
+ QTDecompressionSession* session = static_cast<QTDecompressionSession*>(decompressionTrackingRefCon);
+ ASSERT(session);
+
+ if (decompressionTrackingFlags & kICMDecompressionTracking_FrameDecoded)
+ session->m_latestFrame = QTPixelBuffer(pixelBuffer);
+ }
+};
+
+PassOwnPtr<QTDecompressionSession> QTDecompressionSession::create(unsigned long pixelFormat, size_t width, size_t height)
+{
+ return adoptPtr(new QTDecompressionSession(pixelFormat, width, height));
+}
+
+QTDecompressionSession::QTDecompressionSession(unsigned long pixelFormat, size_t width, size_t height)
+ : m_session(0)
+ , m_pixelFormat(pixelFormat)
+ , m_width(width)
+ , m_height(height)
+{
+ initializeSession();
+}
+
+QTDecompressionSession::~QTDecompressionSession()
+{
+ if (m_session)
+ ICMDecompressionSessionRelease(m_session);
+}
+
+void QTDecompressionSession::initializeSession()
+{
+ if (m_session)
+ return;
+
+ ICMPixelFormatInfo pixelFormatInfo = {sizeof(ICMPixelFormatInfo), 0};
+ if (ICMGetPixelFormatInfo(m_pixelFormat, &pixelFormatInfo) != noErr) {
+ // The ICM does not know anything about the pixelFormat contained in
+ // the pixel buffer, so it won't be able to convert it to RGBA.
+ return;
+ }
+
+ // The depth and cType fields of the ImageDescriptionHandle are filled
+ // out according to the instructions in Technical Q&A QA1183:
+ // http://developer.apple.com/library/mac/#qa/qa2001/qa1183.html
+ bool isIndexed = pixelFormatInfo.formatFlags & kICMPixelFormatIsIndexed;
+ bool isQD = pixelFormatInfo.formatFlags & kICMPixelFormatIsSupportedByQD;
+ bool isMonochrome = pixelFormatInfo.formatFlags & kICMPixelFormatIsMonochrome;
+ bool hasAlpha = pixelFormatInfo.formatFlags & kICMPixelFormatHasAlphaChannel;
+
+ unsigned int depth = 24; // The default depth is 24.
+ if (hasAlpha)
+ depth = 32; // Any pixel format with alpha gets a depth of 32.
+ else if (isMonochrome) {
+ // Grayscale pixel formats get depths 33 through 40, depending
+ // on their bits per pixel. Yes, this means that 16-bit grayscale
+ // and 8-bit grayscale have the same pixel depth.
+ depth = 32 + std::min<unsigned int>(8, pixelFormatInfo.bitsPerPixel[0]);
+ } else if (isIndexed) {
+ // Indexed pixel formats get a depth of 1 through 8, depending on
+ // the their bits per pixel.
+ depth = pixelFormatInfo.bitsPerPixel[0];
+ }
+
+ // If QuickDraw supports the given pixel format, the cType should be kRawCodecType.
+ // Otherwise, use the pixel format code for the cType. We are assuming the pixel
+ // buffer is uncompressed.
+ unsigned long cType = isQD ? kRawCodecType : m_pixelFormat;
+
+ ImageDescriptionHandle description = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription));
+ (**description).idSize = sizeof(ImageDescription);
+ (**description).cType = cType;
+ (**description).version = 2;
+ (**description).spatialQuality = codecLosslessQuality;
+ (**description).width = m_width;
+ (**description).height = m_height;
+ (**description).hRes = 72 << 16; // 72 DPI as a fixed-point number
+ (**description).vRes = 72 << 16; // 72 DPI as a fixed-point number
+ (**description).frameCount = 1;
+ (**description).depth = depth;
+ (**description).clutID = -1;
+
+ // Create the mandatory ICMDecompressionSessionOptions, but leave
+ // all the default values.
+ ICMDecompressionSessionOptionsRef options = 0;
+ ICMDecompressionSessionOptionsCreate(kCFAllocatorDefault, &options);
+
+ CFDictionaryRef pixelBufferAttributes = QTPixelBuffer::createPixelBufferAttributesDictionary(QTPixelBuffer::ConfigureForCGImage);
+
+ ICMDecompressionTrackingCallbackRecord callback = {
+ QTDecompressionSessionClient::trackingCallback,
+ this,
+ };
+
+ ICMDecompressionSessionCreate(kCFAllocatorDefault,
+ description,
+ options,
+ pixelBufferAttributes,
+ &callback,
+ &m_session);
+
+ if (pixelBufferAttributes)
+ CFRelease(pixelBufferAttributes);
+
+ ICMDecompressionSessionOptionsRelease(options);
+ DisposeHandle((Handle)description);
+}
+
+bool QTDecompressionSession::canDecompress(QTPixelBuffer inBuffer)
+{
+ return m_session
+ && inBuffer.pixelFormatType() == m_pixelFormat
+ && inBuffer.width() == m_width
+ && inBuffer.height() == m_height;
+}
+
+QTPixelBuffer QTDecompressionSession::decompress(QTPixelBuffer inBuffer)
+{
+ if (!canDecompress(inBuffer))
+ return QTPixelBuffer();
+
+ inBuffer.lockBaseAddress();
+ ICMDecompressionSessionDecodeFrame(m_session,
+ static_cast<UInt8*>(inBuffer.baseAddress()),
+ inBuffer.dataSize(),
+ 0, // frameOptions
+ 0, // frameTime
+ 0); // sourceFrameRefCon
+
+ // Because we passed in 0 for frameTime, the above function
+ // is synchronous, and the client callback will have been
+ // called before the function returns, and m_latestFrame
+ // will contain the newly decompressed frame.
+ return m_latestFrame;
+}
diff --git a/WebCore/platform/graphics/win/QTDecompressionSession.h b/WebCore/platform/graphics/win/QTDecompressionSession.h
new file mode 100644
index 0000000..67b6635
--- /dev/null
+++ b/WebCore/platform/graphics/win/QTDecompressionSession.h
@@ -0,0 +1,64 @@
+/*
+ * 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 COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef QTDecompressionSession_h
+#define QTDecompressionSession_h
+
+#ifdef QTMOVIEWIN_EXPORTS
+#define QTMOVIEWIN_API __declspec(dllexport)
+#else
+#define QTMOVIEWIN_API __declspec(dllimport)
+#endif
+
+#include "QTPixelBuffer.h"
+
+#include <WTF/PassOwnPtr.h>
+
+class QTDecompressionSessionClient;
+typedef struct OpaqueICMDecompressionSession* ICMDecompressionSessionRef;
+
+class QTMOVIEWIN_API QTDecompressionSession {
+public:
+ static PassOwnPtr<QTDecompressionSession> create(unsigned long pixelFormat, size_t width, size_t height);
+ ~QTDecompressionSession();
+
+ bool canDecompress(QTPixelBuffer);
+
+ // The resulting QTPixelBuffer will be a CG compatable ARGB pixel buffer.
+ QTPixelBuffer decompress(QTPixelBuffer);
+
+private:
+ friend class QTDecompressionSessionClient;
+ QTDecompressionSession(unsigned long pixelFormat, size_t width, size_t height);
+ void initializeSession();
+
+ unsigned long m_pixelFormat;
+ size_t m_width;
+ size_t m_height;
+ QTPixelBuffer m_latestFrame;
+ ICMDecompressionSessionRef m_session;
+};
+
+#endif
diff --git a/WebCore/platform/graphics/win/QTMovieVisualContext.cpp b/WebCore/platform/graphics/win/QTMovieVisualContext.cpp
index 0232d3b..0fcc7e2 100644
--- a/WebCore/platform/graphics/win/QTMovieVisualContext.cpp
+++ b/WebCore/platform/graphics/win/QTMovieVisualContext.cpp
@@ -39,7 +39,7 @@ struct QTCVTimeStamp {
class QTMovieVisualContextPriv {
public:
- QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTMovieVisualContext::Type contextType);
+ QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType);
~QTMovieVisualContextPriv();
bool isImageAvailableForTime(const QTCVTimeStamp*) const;
@@ -61,61 +61,28 @@ private:
};
-static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, CFStringRef inKey, SInt32 inValue)
+static CFDictionaryRef createPixelBufferOptionsDictionary(QTPixelBuffer::Type contextType)
{
- CFNumberRef number;
-
- number = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &inValue);
- if (!number)
- return coreFoundationUnknownErr;
-
- CFDictionarySetValue(inDict, inKey, number);
- CFRelease(number);
-
- return noErr;
-}
-
-static CFDictionaryRef createPixelBufferOptionsDictionary(QTMovieVisualContext::Type contextType)
-{
- static const CFStringRef kDirect3DCompatibilityKey = CFSTR("Direct3DCompatibility");
-
- CFMutableDictionaryRef pixelBufferOptions = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-
- CFMutableDictionaryRef pixelBufferAttributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- if (contextType == QTMovieVisualContext::ConfigureForCAImageQueue) {
- // Ask for D3D compatible pixel buffers so no further work is needed.
- CFDictionarySetValue(pixelBufferAttributes, kDirect3DCompatibilityKey, kCFBooleanTrue);
- } else {
- // Use the k32BGRAPixelFormat, as QuartzCore will be able to use the pixels directly,
- // without needing an additional copy or rendering pass.
- SetNumberValue(pixelBufferAttributes, kCVPixelBufferPixelFormatTypeKey, k32BGRAPixelFormat);
-
- // Set kCVPixelBufferBytesPerRowAlignmentKey to 16 to ensure that each row of pixels
- // starts at a 16 byte aligned address for most efficient data reading.
- SetNumberValue(pixelBufferAttributes, kCVPixelBufferBytesPerRowAlignmentKey, 16);
- CFDictionarySetValue(pixelBufferAttributes, kCVPixelBufferCGImageCompatibilityKey, kCFBooleanTrue);
- }
-
- CFDictionarySetValue(pixelBufferOptions, kQTVisualContextPixelBufferAttributesKey, pixelBufferAttributes);
-
- CFRelease(pixelBufferAttributes);
-
+ const void* key = kQTVisualContextPixelBufferAttributesKey;
+ const void* value = QTPixelBuffer::createPixelBufferAttributesDictionary(contextType);
+ CFDictionaryRef pixelBufferOptions = CFDictionaryCreate(kCFAllocatorDefault, &key, &value, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFRelease(value);
return pixelBufferOptions;
}
-static CFDictionaryRef pixelBufferCreationOptions(QTMovieVisualContext::Type contextType)
+static CFDictionaryRef pixelBufferCreationOptions(QTPixelBuffer::Type contextType)
{
- if (contextType == QTMovieVisualContext::ConfigureForCAImageQueue) {
+ if (contextType == QTPixelBuffer::ConfigureForCAImageQueue) {
static CFDictionaryRef imageQueueOptions = createPixelBufferOptionsDictionary(contextType);
return imageQueueOptions;
}
- ASSERT(contextType == QTMovieVisualContext::ConfigureForCGImage);
+ ASSERT(contextType == QTPixelBuffer::ConfigureForCGImage);
static CFDictionaryRef cgImageOptions = createPixelBufferOptionsDictionary(contextType);
return cgImageOptions;
}
-QTMovieVisualContextPriv::QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTMovieVisualContext::Type contextType)
+QTMovieVisualContextPriv::QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
: m_parent(parent)
, m_client(client)
, m_visualContext(0)
@@ -206,12 +173,12 @@ void QTMovieVisualContextPriv::imageAvailableCallback(QTVisualContextRef visualC
vc->m_client->imageAvailableForTime(reinterpret_cast<const QTCVTimeStamp*>(timeStamp));
}
-PassRefPtr<QTMovieVisualContext> QTMovieVisualContext::create(QTMovieVisualContextClient* client, Type contextType)
+PassRefPtr<QTMovieVisualContext> QTMovieVisualContext::create(QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
{
return adoptRef(new QTMovieVisualContext(client, contextType));
}
-QTMovieVisualContext::QTMovieVisualContext(QTMovieVisualContextClient* client, Type contextType)
+QTMovieVisualContext::QTMovieVisualContext(QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
: m_private(new QTMovieVisualContextPriv(this, client, contextType))
{
}
diff --git a/WebCore/platform/graphics/win/QTMovieVisualContext.h b/WebCore/platform/graphics/win/QTMovieVisualContext.h
index 057031e..8410208 100644
--- a/WebCore/platform/graphics/win/QTMovieVisualContext.h
+++ b/WebCore/platform/graphics/win/QTMovieVisualContext.h
@@ -54,9 +54,7 @@ public:
class QTMOVIEWIN_API QTMovieVisualContext : public RefCounted<QTMovieVisualContext> {
public:
- enum Type { ConfigureForCGImage, ConfigureForCAImageQueue };
-
- static PassRefPtr<QTMovieVisualContext> create(QTMovieVisualContextClient*, Type);
+ static PassRefPtr<QTMovieVisualContext> create(QTMovieVisualContextClient*, QTPixelBuffer::Type);
~QTMovieVisualContext();
bool isImageAvailableForTime(const QTCVTimeStamp*) const;
@@ -71,7 +69,7 @@ public:
static double currentHostTime();
protected:
- QTMovieVisualContext(QTMovieVisualContextClient*, Type);
+ QTMovieVisualContext(QTMovieVisualContextClient*, QTPixelBuffer::Type);
void setupVisualContext();
friend class QTMovieVisualContextPriv;
diff --git a/WebCore/platform/graphics/win/QTPixelBuffer.cpp b/WebCore/platform/graphics/win/QTPixelBuffer.cpp
index 657b68e..44a1b0e 100644
--- a/WebCore/platform/graphics/win/QTPixelBuffer.cpp
+++ b/WebCore/platform/graphics/win/QTPixelBuffer.cpp
@@ -26,6 +26,7 @@
#include "QTPixelBuffer.h"
+#include <CFNumber.h>
#include <CFString.h>
#include <CGColorSpace.h>
#include <CGImage.h>
@@ -33,6 +34,41 @@
#include <QuickDraw.h>
#include <memory.h>
+static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, CFStringRef inKey, SInt32 inValue)
+{
+ CFNumberRef number;
+
+ number = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &inValue);
+ if (!number)
+ return coreFoundationUnknownErr;
+
+ CFDictionarySetValue(inDict, inKey, number);
+ CFRelease(number);
+
+ return noErr;
+}
+
+CFDictionaryRef QTPixelBuffer::createPixelBufferAttributesDictionary(QTPixelBuffer::Type contextType)
+{
+ static const CFStringRef kDirect3DCompatibilityKey = CFSTR("Direct3DCompatibility");
+
+ CFMutableDictionaryRef pixelBufferAttributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ if (contextType == QTPixelBuffer::ConfigureForCAImageQueue) {
+ // Ask for D3D compatible pixel buffers so no further work is needed.
+ CFDictionarySetValue(pixelBufferAttributes, kDirect3DCompatibilityKey, kCFBooleanTrue);
+ } else {
+ // Use the k32BGRAPixelFormat, as QuartzCore will be able to use the pixels directly,
+ // without needing an additional copy or rendering pass.
+ SetNumberValue(pixelBufferAttributes, kCVPixelBufferPixelFormatTypeKey, k32BGRAPixelFormat);
+
+ // Set kCVPixelBufferBytesPerRowAlignmentKey to 16 to ensure that each row of pixels
+ // starts at a 16 byte aligned address for most efficient data reading.
+ SetNumberValue(pixelBufferAttributes, kCVPixelBufferBytesPerRowAlignmentKey, 16);
+ CFDictionarySetValue(pixelBufferAttributes, kCVPixelBufferCGImageCompatibilityKey, kCFBooleanTrue);
+ }
+ return pixelBufferAttributes;
+}
+
QTPixelBuffer::QTPixelBuffer()
: m_pixelBuffer(0)
{
diff --git a/WebCore/platform/graphics/win/QTPixelBuffer.h b/WebCore/platform/graphics/win/QTPixelBuffer.h
index 22f8ba4..13630da 100644
--- a/WebCore/platform/graphics/win/QTPixelBuffer.h
+++ b/WebCore/platform/graphics/win/QTPixelBuffer.h
@@ -44,6 +44,9 @@ typedef const struct __CFDictionary * CFDictionaryRef;
// safe to call within WebKit.
class QTMOVIEWIN_API QTPixelBuffer {
public:
+ enum Type { ConfigureForCGImage, ConfigureForCAImageQueue };
+ static CFDictionaryRef createPixelBufferAttributesDictionary(Type);
+
QTPixelBuffer();
QTPixelBuffer(const QTPixelBuffer&);
QTPixelBuffer(CVPixelBufferRef);
diff --git a/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp b/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
index 3605c72..f61ae8e 100644
--- a/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp
@@ -45,7 +45,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
g_customFontCache->unregisterFont(m_name);
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode renderingMode)
{
FontDescription fontDesc;
fontDesc.setComputedSize(size);
diff --git a/WebCore/platform/graphics/wince/FontCustomPlatformData.h b/WebCore/platform/graphics/wince/FontCustomPlatformData.h
index 5ce0ea6..abdc0f2 100644
--- a/WebCore/platform/graphics/wince/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/wince/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontDescription.h"
#include "FontRenderingMode.h"
#include "PlatformString.h"
#include <wtf/Noncopyable.h>
@@ -44,7 +45,7 @@ namespace WebCore {
~FontCustomPlatformData();
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation fontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
static bool supportsFormat(const String&);
diff --git a/WebCore/platform/graphics/wince/FontPlatformData.cpp b/WebCore/platform/graphics/wince/FontPlatformData.cpp
index d84a7cc..d9d8a72 100644
--- a/WebCore/platform/graphics/wince/FontPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontPlatformData.cpp
@@ -148,7 +148,7 @@ struct FixedSizeFontDataKeyHash {
font.m_weight,
// static_cast<unsigned>(font.m_italic);
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static bool equal(const FixedSizeFontDataKey& a, const FixedSizeFontDataKey& b)
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index a0c10fc..a11b8d8 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -283,7 +283,7 @@ public:
return 0;
}
- RefPtr<SharedBitmap> bmp = SharedBitmap::createInstance(alphaPaint == AlphaPaintNone, origRect.width(), origRect.height(), false);
+ RefPtr<SharedBitmap> bmp = SharedBitmap::create(origRect.size(), alphaPaint == AlphaPaintNone ? BitmapInfo::BitCount16 : BitmapInfo::BitCount32, false);
SetRect(&bmpRect, 0, 0, origRect.width(), origRect.height());
if (bmp) {
switch (alphaPaint) {
@@ -523,7 +523,7 @@ TransparentLayerDC::TransparentLayerDC(GraphicsContextPlatformPrivate* data, Int
origRect.inflateX(stableRound((width - origRect.width()) * 0.5));
origRect.inflateY(stableRound((height - origRect.height()) * 0.5));
- m_bitmap = SharedBitmap::createInstance(m_rotatedBitmap->is16bit(), m_origRect.width(), m_origRect.height(), true);
+ m_bitmap = SharedBitmap::create(m_origRect.size(), m_rotatedBitmap->is16bit() ? BitmapInfo::BitCount16 : BitmapInfo::BitCount32, true);
if (m_bitmap)
rotateBitmap(m_bitmap.get(), m_rotatedBitmap.get(), -m_rotation);
else
@@ -608,15 +608,13 @@ void GraphicsContext::setBitmap(PassRefPtr<SharedBitmap> bmp)
HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
- notImplemented();
- ASSERT_NOT_REACHED();
- return 0;
+ // FIXME: Add support for AlphaBlend.
+ ASSERT(!supportAlphaBlend);
+ return m_data->m_dc;
}
void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
{
- notImplemented();
- ASSERT_NOT_REACHED();
}
void GraphicsContext::savePlatformState()
@@ -1779,7 +1777,7 @@ void GraphicsContext::drawFrameControl(const IntRect& rect, unsigned type, unsig
RECT rectWin = trRect;
if ((rectWin.right - rectWin.left) < boxWidthBest) {
- RefPtr<SharedBitmap> bmp = SharedBitmap::createInstance(true, boxWidthBest, boxHeightBest, true);
+ RefPtr<SharedBitmap> bmp = SharedBitmap::create(IntSize(boxWidthBest, boxHeightBest), BitmapInfo::BitCount16, true);
SharedBitmap::DCHolder memDC(bmp.get());
if (memDC.get()) {
RECT tempRect = {0, 0, boxWidthBest, boxHeightBest};
diff --git a/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp b/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
index 15720f3..ec8517b 100644
--- a/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
+++ b/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp
@@ -64,7 +64,7 @@ void BufferedImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect
}
ImageBufferData::ImageBufferData(const IntSize& size)
-: m_bitmap(SharedBitmap::createInstance(false, size.width(), size.height(), false))
+ : m_bitmap(SharedBitmap::create(size, BitmapInfo::BitCount32, false))
{
// http://www.w3.org/TR/2009/WD-html5-20090212/the-canvas-element.html#canvaspixelarray
// "When the canvas is initialized it must be set to fully transparent black."
@@ -72,7 +72,7 @@ ImageBufferData::ImageBufferData(const IntSize& size)
m_bitmap->setHasAlpha(true);
}
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace colorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace colorSpace, bool& success)
: m_data(size)
, m_size(size)
{
diff --git a/WebCore/platform/graphics/wince/ImageWinCE.cpp b/WebCore/platform/graphics/wince/ImageWinCE.cpp
index 53b9b68..ec7403e 100644
--- a/WebCore/platform/graphics/wince/ImageWinCE.cpp
+++ b/WebCore/platform/graphics/wince/ImageWinCE.cpp
@@ -43,11 +43,7 @@ namespace WebCore {
NativeImagePtr RGBA32Buffer::asNewNativeImage() const
{
- NativeImagePtr image = SharedBitmap::createInstance(false, width(), height(), false);
-
- memcpy(image->bytes(), m_bytes.data(), m_bytes.size() * sizeof(PixelData));
-
- return image;
+ return SharedBitmap::create(m_bytes, m_size, hasAlpha());
}
bool FrameData::clear(bool clearMetaData)
diff --git a/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp b/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
index 4cebe43..6133372 100644
--- a/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/wx/FontCustomPlatformData.cpp
@@ -31,7 +31,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
{
}
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode)
+FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontRenderingMode)
{
return FontPlatformData(size, bold, italic);
}
diff --git a/WebCore/platform/graphics/wx/FontCustomPlatformData.h b/WebCore/platform/graphics/wx/FontCustomPlatformData.h
index a7dfe37..cc348e3 100644
--- a/WebCore/platform/graphics/wx/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/wx/FontCustomPlatformData.h
@@ -21,6 +21,7 @@
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
+#include "FontOrientation.h"
#include "FontRenderingMode.h"
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -37,7 +38,7 @@ namespace WebCore {
static bool supportsFormat(const String&);
- FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
+ FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, FontRenderingMode = NormalRenderingMode);
};
FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer*);
diff --git a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
index b77a03b..66c69ee 100644
--- a/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
+++ b/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
@@ -111,20 +111,25 @@ FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicStri
m_size = desc.computedPixelSize();
m_fontState = VALID;
m_size = desc.computedPixelSize();
-
}
-unsigned FontPlatformData::computeHash() const {
- wxFont* thisFont = m_font->font();
- ASSERT(thisFont && thisFont->IsOk());
-
- // make a hash that is unique for this font, but not globally unique - that is,
- // a font whose properties are equal should generate the same hash
- uintptr_t hashCodes[6] = { thisFont->GetPointSize(), thisFont->GetFamily(), thisFont->GetStyle(),
- thisFont->GetWeight(), thisFont->GetUnderlined(),
- StringImpl::computeHash(thisFont->GetFaceName().utf8_str()) };
-
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+unsigned FontPlatformData::computeHash() const
+{
+ wxFont* thisFont = m_font->font();
+ ASSERT(thisFont && thisFont->IsOk());
+
+ // make a hash that is unique for this font, but not globally unique - that is,
+ // a font whose properties are equal should generate the same hash
+ uintptr_t hashCodes[6] = {
+ thisFont->GetPointSize(),
+ thisFont->GetFamily(),
+ thisFont->GetStyle(),
+ thisFont->GetWeight(),
+ thisFont->GetUnderlined(),
+ StringImpl::computeHash(thisFont->GetFaceName().utf8_str())
+ };
+
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
FontPlatformData::~FontPlatformData()
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index b2e3fd2..8df5cda 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -450,13 +450,56 @@ bool RenderThemeGtk::paintButton(RenderObject* o, const PaintInfo& i, const IntR
return paintRenderObject(MOZ_GTK_BUTTON, o, i.context, rect, GTK_RELIEF_NORMAL);
}
-void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const
+static void getComboBoxPadding(RenderStyle* style, int& left, int& top, int& right, int& bottom)
{
- style->resetBorder();
- style->resetPadding();
- style->setHeight(Length(Auto));
- style->setWhiteSpace(PRE);
- adjustMozillaStyle(this, style, MOZ_GTK_DROPDOWN);
+ // If this menu list button isn't drawn using the native theme, we
+ // don't add any extra padding beyond what WebCore already uses.
+ if (style->appearance() == NoControlPart)
+ return;
+ moz_gtk_get_widget_border(MOZ_GTK_DROPDOWN, &left, &top, &right, &bottom,
+ gtkTextDirection(style->direction()), TRUE);
+}
+
+int RenderThemeGtk::popupInternalPaddingLeft(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return left;
+}
+
+int RenderThemeGtk::popupInternalPaddingRight(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return right;
+}
+
+int RenderThemeGtk::popupInternalPaddingTop(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return top;
+}
+
+int RenderThemeGtk::popupInternalPaddingBottom(RenderStyle* style) const
+{
+ int left = 0, top = 0, right = 0, bottom = 0;
+ getComboBoxPadding(style, left, top, right, bottom);
+ return bottom;
+}
+
+void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+ // The tests check explicitly that select menu buttons ignore line height.
+ style->setLineHeight(RenderStyle::initialLineHeight());
+
+ // We cannot give a proper rendering when border radius is active, unfortunately.
+ style->resetBorderRadius();
+}
+
+void RenderThemeGtk::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+{
+ adjustMenuListStyle(selector, style, e);
}
bool RenderThemeGtk::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& rect)
@@ -464,6 +507,11 @@ bool RenderThemeGtk::paintMenuList(RenderObject* o, const PaintInfo& i, const In
return paintRenderObject(MOZ_GTK_DROPDOWN, o, i.context, rect);
}
+bool RenderThemeGtk::paintMenuListButton(RenderObject* object, const PaintInfo& info, const IntRect& rect)
+{
+ return paintMenuList(object, info, rect);
+}
+
void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
{
style->resetBorder();
diff --git a/WebCore/platform/gtk/RenderThemeGtk.h b/WebCore/platform/gtk/RenderThemeGtk.h
index 4e24c97..6d324b6 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.h
+++ b/WebCore/platform/gtk/RenderThemeGtk.h
@@ -5,7 +5,7 @@
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2009 Kenneth Rohde Christiansen
+ * Copyright (C) 2010 Igalia S.L.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -102,8 +102,19 @@ protected:
virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&);
+ int popupInternalPaddingLeft(RenderStyle*) const;
+ int popupInternalPaddingRight(RenderStyle*) const;
+ int popupInternalPaddingTop(RenderStyle*) const;
+ int popupInternalPaddingBottom(RenderStyle*) const;
+
+ // The Mac port differentiates between the "menu list" and the "menu list button."
+ // The former is used when a menu list button has been styled. This is used to ensure
+ // Aqua themed controls whenever possible. We always want to use GTK+ theming, so
+ // we don't maintain this differentiation.
virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
+ virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element* e) const;
virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&);
virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInfo&, const IntRect&);
diff --git a/WebCore/platform/gtk/ScrollViewGtk.cpp b/WebCore/platform/gtk/ScrollViewGtk.cpp
index ebcdaa1..a8c7562 100644
--- a/WebCore/platform/gtk/ScrollViewGtk.cpp
+++ b/WebCore/platform/gtk/ScrollViewGtk.cpp
@@ -78,48 +78,29 @@ PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientati
return MainFrameScrollbarGtk::create(this, orientation, m_verticalAdjustment.get());
}
-/*
- * The following is assumed:
- * (hadj && vadj) || (!hadj && !vadj)
- */
-void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, bool resetValues)
+void ScrollView::setHorizontalAdjustment(GtkAdjustment* hadj, bool resetValues)
{
- ASSERT(!hadj == !vadj);
-
- // If this is a non-main frame ScrollView, we do not want to set the
- // m_horizontalAdjustments & m_verticalAdjustments members. At the same
- // time we want to to allow FrameLoaderClientGtk.cpp to call
- // ScrollView::setGtkAdjustments(0, 0) unconditionally.
ASSERT(!parent() || !hadj);
if (parent())
return;
m_horizontalAdjustment = hadj;
- m_verticalAdjustment = vadj;
if (!m_horizontalAdjustment) {
MainFrameScrollbarGtk* hScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(horizontalScrollbar());
if (hScrollbar)
hScrollbar->detachAdjustment();
- MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
- if (vScrollbar)
- vScrollbar->detachAdjustment();
-
return;
}
// We may be lacking scrollbars when returning to a cached
// page, this kicks the page to recreate the scrollbars.
- setHasVerticalScrollbar(true);
setHasHorizontalScrollbar(true);
MainFrameScrollbarGtk* hScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(horizontalScrollbar());
hScrollbar->attachAdjustment(m_horizontalAdjustment.get());
- MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
- vScrollbar->attachAdjustment(m_verticalAdjustment.get());
-
// We used to reset everything to 0 here, but when page cache
// is enabled we reuse FrameViews that are cached. Since their
// size is not going to change when being restored, (which is
@@ -127,7 +108,6 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
// set in the normal case), we make sure they are up-to-date
// here. This is needed for the parent scrolling widget to be
// able to report correct values.
-
int horizontalPageStep = max(max<int>(frameRect().width() * Scrollbar::minFractionToStepWhenPaging(), frameRect().width() - Scrollbar::maxOverlapBetweenPages()), 1);
gtk_adjustment_configure(m_horizontalAdjustment.get(),
resetValues ? 0 : scrollOffset().width(), 0,
@@ -135,8 +115,39 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
resetValues ? 0 : Scrollbar::pixelsPerLineStep(),
resetValues ? 0 : horizontalPageStep,
resetValues ? 0 : frameRect().width());
+}
+
+void ScrollView::setVerticalAdjustment(GtkAdjustment* vadj, bool resetValues)
+{
+ ASSERT(!parent() || !vadj);
+ if (parent())
+ return;
+
+ m_verticalAdjustment = vadj;
+
+ if (!m_verticalAdjustment) {
+ MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
+ if (vScrollbar)
+ vScrollbar->detachAdjustment();
+
+ return;
+ }
+
+ // We may be lacking scrollbars when returning to a cached
+ // page, this kicks the page to recreate the scrollbars.
+ setHasVerticalScrollbar(true);
+
+ MainFrameScrollbarGtk* vScrollbar = reinterpret_cast<MainFrameScrollbarGtk*>(verticalScrollbar());
+ vScrollbar->attachAdjustment(m_verticalAdjustment.get());
- int verticalPageStep = max(max<int>(frameRect().height() * Scrollbar::minFractionToStepWhenPaging(), frameRect().height() - Scrollbar::maxOverlapBetweenPages()), 1);
+ // We used to reset everything to 0 here, but when page cache
+ // is enabled we reuse FrameViews that are cached. Since their
+ // size is not going to change when being restored, (which is
+ // what would cause the upper limit in the adjusments to be
+ // set in the normal case), we make sure they are up-to-date
+ // here. This is needed for the parent scrolling widget to be
+ // able to report correct values.
+ int verticalPageStep = max(max<int>(frameRect().width() * Scrollbar::minFractionToStepWhenPaging(), frameRect().width() - Scrollbar::maxOverlapBetweenPages()), 1);
gtk_adjustment_configure(m_verticalAdjustment.get(),
resetValues ? 0 : scrollOffset().height(), 0,
resetValues ? 0 : contentsSize().height(),
@@ -145,6 +156,12 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
resetValues ? 0 : frameRect().height());
}
+void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, bool resetValues)
+{
+ setHorizontalAdjustment(hadj, resetValues);
+ setVerticalAdjustment(vadj, resetValues);
+}
+
void ScrollView::platformAddChild(Widget* child)
{
}
diff --git a/WebCore/platform/gtk/TemporaryLinkStubs.cpp b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
index 8c12fcb..5c27080 100644
--- a/WebCore/platform/gtk/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
@@ -28,6 +28,7 @@
#include "config.h"
#include "AXObjectCache.h"
+#include "CookieStorage.h"
#include "DNS.h"
#include "Editor.h"
#include "FrameView.h"
@@ -46,5 +47,6 @@ namespace WebCore {
void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) { return String(); }
float userIdleTime() { notImplemented(); return FLT_MAX; } // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed
+void setCookieStoragePrivateBrowsingEnabled(bool) { notImplemented(); }
}
diff --git a/WebCore/platform/haiku/TemporaryLinkStubs.cpp b/WebCore/platform/haiku/TemporaryLinkStubs.cpp
index aa3d538..58ab873 100644
--- a/WebCore/platform/haiku/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/haiku/TemporaryLinkStubs.cpp
@@ -33,6 +33,7 @@
#include "config.h"
+#include "CookieStorage.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "PlatformString.h"
@@ -76,5 +77,10 @@ String KURL::fileSystemPath() const
return String();
}
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/image-decoders/ImageDecoder.cpp b/WebCore/platform/image-decoders/ImageDecoder.cpp
index 10c0b3b..fa61871 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/ImageDecoder.cpp
@@ -122,7 +122,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
if (this == &other)
return *this;
- copyBitmapData(other);
+ copyReferenceToBitmapData(other);
setRect(other.rect());
setStatus(other.status());
setDuration(other.duration());
@@ -133,7 +133,8 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
void RGBA32Buffer::clear()
{
- m_bytes.clear();
+ m_backingStore.clear();
+ m_bytes = 0;
m_status = FrameEmpty;
// NOTE: Do not reset other members here; clearFrameBufferCache() calls this
// to free the bitmap data, but other functions like initFrameBuffer() and
@@ -143,16 +144,25 @@ void RGBA32Buffer::clear()
void RGBA32Buffer::zeroFill()
{
- m_bytes.fill(0);
+ memset(m_bytes, 0, m_size.width() * m_size.height() * sizeof(PixelData));
m_hasAlpha = true;
}
+#if !PLATFORM(CF)
+
+void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
+{
+ ASSERT(this != &other);
+ copyBitmapData(other);
+}
+
bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
{
if (this == &other)
return true;
- m_bytes = other.m_bytes;
+ m_backingStore = other.m_backingStore;
+ m_bytes = m_backingStore.data();
m_size = other.m_size;
setHasAlpha(other.m_hasAlpha);
return true;
@@ -162,7 +172,8 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
{
// NOTE: This has no way to check for allocation failure if the requested
// size was too big...
- m_bytes.resize(newWidth * newHeight);
+ m_backingStore.resize(newWidth * newHeight);
+ m_bytes = m_backingStore.data();
m_size = IntSize(newWidth, newHeight);
// Zero the image.
@@ -171,6 +182,8 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
return true;
}
+#endif
+
bool RGBA32Buffer::hasAlpha() const
{
return m_hasAlpha;
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index 90e8ae2..9fe0e6b 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -86,7 +86,11 @@ namespace WebCore {
// Creates a new copy of the image data in |other|, so the two images
// can be modified independently. Returns whether the copy succeeded.
- bool copyBitmapData(const RGBA32Buffer& other);
+ bool copyBitmapData(const RGBA32Buffer&);
+
+ // Creates a new reference to the image data in |other|. The two images
+ // share a common backing store.
+ void copyReferenceToBitmapData(const RGBA32Buffer&);
// Copies the pixel data at [(startX, startY), (endX, startY)) to the
// same X-coordinates on each subsequent row up to but not including
@@ -143,6 +147,12 @@ namespace WebCore {
#endif
private:
+#if PLATFORM(CF)
+ typedef RetainPtr<CFMutableDataRef> NativeBackingStore;
+#else
+ typedef Vector<PixelData> NativeBackingStore;
+#endif
+
int width() const;
int height() const;
@@ -155,7 +165,7 @@ namespace WebCore {
m_pixmap = QPixmap();
return reinterpret_cast_ptr<QRgb*>(m_image.scanLine(y)) + x;
#else
- return m_bytes.data() + (y * width()) + x;
+ return m_bytes + (y * width()) + x;
#endif
}
@@ -186,26 +196,25 @@ namespace WebCore {
bool m_hasAlpha;
IntSize m_size;
#else
- Vector<PixelData> m_bytes;
- IntSize m_size; // The size of the buffer. This should be the
- // same as ImageDecoder::m_size.
- bool m_hasAlpha; // Whether or not any of the pixels in the buffer
- // have transparency.
+ NativeBackingStore m_backingStore;
+ PixelData* m_bytes; // The memory is backed by m_backingStore.
+ IntSize m_size; // The size of the buffer. This should be the
+ // same as ImageDecoder::m_size.
+ bool m_hasAlpha; // Whether or not any of the pixels in the buffer
+ // have transparency.
#endif
- IntRect m_rect; // The rect of the original specified frame within
- // the overall buffer. This will always just be
- // the entire buffer except for GIF frames whose
- // original rect was smaller than the overall
- // image size.
+ IntRect m_rect; // The rect of the original specified frame within
+ // the overall buffer. This will always just be
+ // the entire buffer except for GIF frames whose
+ // original rect was smaller than the overall
+ // image size.
FrameStatus m_status; // Whether or not this frame is completely
// finished decoding.
- unsigned m_duration; // The animation delay.
- FrameDisposalMethod m_disposalMethod;
- // What to do with this frame's data when
- // initializing the next frame.
- bool m_premultiplyAlpha;
- // Whether to premultiply alpha into R, G, B
- // channels; by default it's true.
+ unsigned m_duration; // The animation delay.
+ FrameDisposalMethod m_disposalMethod; // What to do with this frame's data when
+ // initializing the next frame.
+ bool m_premultiplyAlpha; // Whether to premultiply alpha into R, G, B
+ // channels; by default it's true.
};
// The ImageDecoder class represents a base class for specific image format
diff --git a/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp b/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
index 203205d..d741882 100644
--- a/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
+++ b/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
@@ -34,7 +34,7 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
{
return cairo_image_surface_create_for_data(
reinterpret_cast<unsigned char*>(const_cast<PixelData*>(
- m_bytes.data())), CAIRO_FORMAT_ARGB32, width(), height(),
+ m_bytes)), CAIRO_FORMAT_ARGB32, width(), height(),
width() * sizeof(PixelData));
}
diff --git a/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp b/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
new file mode 100644
index 0000000..2fac7da
--- /dev/null
+++ b/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Google, 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 "ImageDecoder.h"
+
+#include <CoreGraphics/CGColorSpace.h>
+#include <CoreGraphics/CGImage.h>
+
+namespace WebCore {
+
+void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
+{
+ ASSERT(this != &other);
+ m_backingStore = other.m_backingStore;
+ m_bytes = reinterpret_cast<PixelData*>(CFDataGetMutableBytePtr(m_backingStore.get()));
+ // FIXME: The rest of this function seems redundant with RGBA32Buffer::copyBitmapData.
+ m_size = other.m_size;
+ setHasAlpha(other.m_hasAlpha);
+}
+
+bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+{
+ if (this == &other)
+ return true;
+
+ m_backingStore.adoptCF(CFDataCreateMutableCopy(kCFAllocatorDefault, 0, other.m_backingStore.get()));
+ m_bytes = reinterpret_cast<PixelData*>(CFDataGetMutableBytePtr(m_backingStore.get()));
+ m_size = other.m_size;
+ setHasAlpha(other.m_hasAlpha);
+ return true;
+}
+
+bool RGBA32Buffer::setSize(int newWidth, int newHeight)
+{
+ m_backingStore.adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
+ CFDataSetLength(m_backingStore.get(), newWidth * newHeight * sizeof(PixelData));
+ m_bytes = reinterpret_cast<PixelData*>(CFDataGetMutableBytePtr(m_backingStore.get()));
+ m_size = IntSize(newWidth, newHeight);
+
+ zeroFill();
+ return true;
+}
+
+NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+{
+ // FIXME: Figure out the right color space.
+ DEFINE_STATIC_LOCAL(RetainPtr<CGColorSpaceRef>, deviceColorSpace, (AdoptCF, CGColorSpaceCreateDeviceRGB()));
+ RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(m_backingStore.get()));
+
+ CGImageAlphaInfo alphaInfo = m_premultiplyAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaFirst;
+
+ return CGImageCreate(width(), height(), 8, 32, width() * sizeof(PixelData), deviceColorSpace.get(),
+ alphaInfo | kCGBitmapByteOrder32Host, dataProvider.get(), 0, false, kCGRenderingIntentDefault);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
index 0a88ffd..b011e1e 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
@@ -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.
*/
#ifndef GIFImageDecoder_h
@@ -29,7 +29,7 @@
#include "ImageDecoder.h"
#include <wtf/OwnPtr.h>
-class GIFImageReader;
+struct GIFImageReader;
namespace WebCore {
diff --git a/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp b/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
index 7f00db2..47302f7 100644
--- a/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
+++ b/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
@@ -36,7 +36,7 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
int bytesPerRow = width() * sizeof(PixelData);
OwnPtr<BBitmap> bitmap(new BBitmap(BRect(0, 0, width() - 1, height() - 1), 0, B_RGBA32, bytesPerRow));
- const uint8* source = reinterpret_cast<const uint8*>(m_bytes.data());
+ const uint8* source = reinterpret_cast<const uint8*>(m_bytes);
uint8* destination = reinterpret_cast<uint8*>(bitmap->Bits());
int h = height();
int w = width();
diff --git a/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp b/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
index 3d8f749..061c5ab 100644
--- a/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
+++ b/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
@@ -59,7 +59,7 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
tileRect.width(), tileRect.height(), VG_IMAGE_QUALITY_FASTER);
ASSERT_VG_NO_ERROR();
- PixelData* pixelData = const_cast<PixelData*>(m_bytes.data());
+ PixelData* pixelData = const_cast<PixelData*>(m_bytes);
pixelData += (tileRect.y() * width()) + tileRect.x();
vgImageSubData(image, reinterpret_cast<unsigned char*>(pixelData),
diff --git a/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp b/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 5794fd6..2275fc7 100644
--- a/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -86,14 +86,15 @@ bool WEBPImageDecoder::decode(bool onlySize)
return true;
if (!WebPGetInfo(dataBytes, dataSize, &width, &height))
return setFailed();
+ if (!ImageDecoder::isSizeAvailable() && !setSize(width, height))
+ return setFailed();
if (onlySize)
- return setSize(width, height) || setFailed();
+ return true;
// FIXME: Add support for progressive decoding.
if (!isAllDataReceived())
return true;
- if (m_frameBufferCache.isEmpty())
- return true;
+ ASSERT(!m_frameBufferCache.isEmpty());
RGBA32Buffer& buffer = m_frameBufferCache[0];
if (buffer.status() == RGBA32Buffer::FrameEmpty) {
ASSERT(width == size().width());
@@ -103,8 +104,8 @@ bool WEBPImageDecoder::decode(bool onlySize)
}
const int stride = width * bytesPerPixel;
Vector<uint8_t> rgb;
- rgb.reserveCapacity(height * stride);
- if (!WebPDecodeBGRInto(dataBytes, dataSize, &rgb[0], height * stride, stride))
+ rgb.resize(height * stride);
+ if (!WebPDecodeBGRInto(dataBytes, dataSize, rgb.data(), rgb.size(), stride))
return setFailed();
// FIXME: remove this data copy.
for (int y = 0; y < height; ++y) {
diff --git a/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp b/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
index e6e45b7..966eb90 100644
--- a/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
+++ b/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
@@ -48,12 +48,12 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
// NB: It appears that the data is in BGRA format instead of RGBA format.
// This code works properly on both ppc and intel, meaning the issue is
// likely not an issue of byte order getting mixed up on different archs.
- const unsigned char* bytes = (const unsigned char*)m_bytes.data();
+ const unsigned char* bytes = (const unsigned char*)m_bytes;
int rowCounter = 0;
long pixelCounter = 0;
WxPixelData::Iterator p(data);
WxPixelData::Iterator rowStart = p;
- for (size_t i = 0; i < m_bytes.size() * sizeof(PixelData); i += sizeof(PixelData)) {
+ for (size_t i = 0; i < m_size.width() * m_size.height() * sizeof(PixelData); i += sizeof(PixelData)) {
p.Red() = bytes[i + 2];
p.Green() = bytes[i + 1];
p.Blue() = bytes[i + 0];
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h
index 7cac443..758639d 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -48,7 +48,6 @@ typedef struct _NSRect NSRect;
@class NSFont;
@class NSImage;
@class NSMenu;
-@class NSMutableArray;
@class NSMutableURLRequest;
@class NSString;
@class NSTextFieldCell;
@@ -132,6 +131,7 @@ extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
extern void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
+extern void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
@@ -171,10 +171,8 @@ extern BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
extern BOOL (*wkUseSharedMediaUI)();
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-extern NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
extern void* wkGetHyphenationLocationBeforeIndex;
#else
-extern void* wkNoteOpenPanelFiles;
extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm
index 52e0064..1882674 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -67,6 +67,7 @@ void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
+void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
void (*wkSetPatternBaseCTM)(CGContextRef, CGAffineTransform);
void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
@@ -113,9 +114,7 @@ BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
#endif
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
void* wkGetHyphenationLocationBeforeIndex;
#else
-void* wkNoteOpenPanelFiles;
CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index 6b64942..331209c 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -50,12 +50,13 @@ void SpeechInputClientMock::setListener(SpeechInputListener* listener)
m_listener = listener;
}
-bool SpeechInputClientMock::startRecognition(int requestId, const IntRect&)
+bool SpeechInputClientMock::startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar)
{
if (m_timer.isActive())
return false;
m_requestId = requestId;
m_recording = true;
+ m_language = language;
m_timer.startOneShot(0);
return true;
}
@@ -80,9 +81,12 @@ void SpeechInputClientMock::cancelRecognition(int requestId)
}
}
-void SpeechInputClientMock::setRecognitionResult(const String& result)
+void SpeechInputClientMock::setRecognitionResult(const String& result, const AtomicString& language)
{
- m_recognitionResult = result;
+ if (language.isEmpty())
+ m_resultForEmptyLanguage = result;
+ else
+ m_recognitionResult.set(language, result);
}
void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
@@ -92,7 +96,32 @@ void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
m_listener->didCompleteRecording(m_requestId);
m_timer.startOneShot(0);
} else {
- m_listener->setRecognitionResult(m_requestId, m_recognitionResult);
+ SpeechInputResultArray results;
+ bool noResultsFound = false;
+
+ // Empty language case must be handled separately to avoid problems with HashMap and empty keys.
+ if (m_language.isEmpty()) {
+ if (!m_resultForEmptyLanguage.isNull())
+ results.append(SpeechInputResult::create(m_resultForEmptyLanguage, 1.0));
+ else
+ noResultsFound = true;
+ } else {
+ if (m_recognitionResult.contains(m_language))
+ results.append(SpeechInputResult::create(m_recognitionResult.get(m_language), 1.0));
+ else
+ noResultsFound = true;
+ }
+
+ if (noResultsFound) {
+ // Can't avoid setting a result even if no result was set for the given language.
+ // This would avoid generating the events used to check the results and the test would timeout.
+ String error("error: no result found for language '");
+ error.append(m_language);
+ error.append("'");
+ results.append(SpeechInputResult::create(error, 1.0));
+ }
+
+ m_listener->setRecognitionResult(m_requestId, results);
m_listener->didCompleteRecognition(m_requestId);
m_requestId = 0;
}
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index ce83d3b..0e3c456 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -34,6 +34,8 @@
#include "PlatformString.h"
#include "SpeechInputClient.h"
#include "Timer.h"
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(INPUT_SPEECH)
@@ -46,11 +48,11 @@ class SpeechInputClientMock : public SpeechInputClient {
public:
SpeechInputClientMock();
- void setRecognitionResult(const String& result);
+ void setRecognitionResult(const String& result, const AtomicString& language);
// SpeechInputClient methods.
void setListener(SpeechInputListener*);
- bool startRecognition(int, const IntRect&);
+ bool startRecognition(int requestId, const IntRect& elementRect, const AtomicString& language, const String& grammar);
void stopRecording(int);
void cancelRecognition(int);
@@ -61,7 +63,10 @@ private:
Timer<SpeechInputClientMock> m_timer;
SpeechInputListener* m_listener;
int m_requestId;
- String m_recognitionResult;
+
+ HashMap<String, String> m_recognitionResult;
+ AtomicString m_language;
+ String m_resultForEmptyLanguage;
};
} // namespace WebCore
diff --git a/WebCore/platform/network/CookieStorage.h b/WebCore/platform/network/CookieStorage.h
new file mode 100644
index 0000000..56ca5dc
--- /dev/null
+++ b/WebCore/platform/network/CookieStorage.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CookieStorage_h
+#define CookieStorage_h
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool);
+
+}
+
+#endif
diff --git a/WebCore/platform/network/cf/AuthenticationChallenge.h b/WebCore/platform/network/cf/AuthenticationChallenge.h
index 58fb836..e7d66de 100644
--- a/WebCore/platform/network/cf/AuthenticationChallenge.h
+++ b/WebCore/platform/network/cf/AuthenticationChallenge.h
@@ -22,6 +22,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.
*/
+
#ifndef AuthenticationChallenge_h
#define AuthenticationChallenge_h
diff --git a/WebCore/platform/network/win/CookieJarCFNetWin.cpp b/WebCore/platform/network/cf/CookieJarCFNet.cpp
index d431289..d3fc06d 100644
--- a/WebCore/platform/network/win/CookieJarCFNetWin.cpp
+++ b/WebCore/platform/network/cf/CookieJarCFNet.cpp
@@ -27,7 +27,7 @@
#include "CookieJar.h"
#include "Cookie.h"
-#include "CookieStorageWin.h"
+#include "CookieStorageCFNet.h"
#include "Document.h"
#include "KURL.h"
#include "PlatformString.h"
diff --git a/WebCore/platform/network/win/CookieStorageWin.cpp b/WebCore/platform/network/cf/CookieStorageCFNet.cpp
index 5e74c17..93819e1 100644
--- a/WebCore/platform/network/win/CookieStorageWin.cpp
+++ b/WebCore/platform/network/cf/CookieStorageCFNet.cpp
@@ -24,11 +24,11 @@
*/
#include "config.h"
-
-#include "CookieStorageWin.h"
+#include "CookieStorageCFNet.h"
#include <CFNetwork/CFHTTPCookiesPriv.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#include <wtf/MainThread.h>
#include <wtf/RetainPtr.h>
namespace WebCore {
@@ -37,6 +37,8 @@ static RetainPtr<CFHTTPCookieStorageRef> s_cookieStorage;
CFHTTPCookieStorageRef currentCookieStorage()
{
+ ASSERT(isMainThread());
+
if (s_cookieStorage)
return s_cookieStorage.get();
return wkGetDefaultHTTPCookieStorage();
@@ -44,7 +46,19 @@ CFHTTPCookieStorageRef currentCookieStorage()
void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage)
{
+ ASSERT(isMainThread());
+
s_cookieStorage = cookieStorage;
}
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ ASSERT(isMainThread());
+
+ if (enabled)
+ s_cookieStorage.adoptCF(wkCreatePrivateHTTPCookieStorage());
+ else
+ s_cookieStorage = 0;
+}
+
}
diff --git a/WebCore/platform/network/win/CookieStorageWin.h b/WebCore/platform/network/cf/CookieStorageCFNet.h
index 4350b72..fc980c5 100644
--- a/WebCore/platform/network/win/CookieStorageWin.h
+++ b/WebCore/platform/network/cf/CookieStorageCFNet.h
@@ -23,17 +23,18 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CookieStorageWin_h
-#define CookieStorageWin_h
+#ifndef CookieStorageCFNet_h
+#define CookieStorageCFNet_h
typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
namespace WebCore {
CFHTTPCookieStorageRef currentCookieStorage();
-
+
+ // Needed for WebKit1 API only.
void setCurrentCookieStorage(CFHTTPCookieStorageRef cookieStorage);
}
-#endif // CookieStorageWin_h
+#endif // CookieStorageCFNet_h
diff --git a/WebCore/platform/network/cf/ResourceError.h b/WebCore/platform/network/cf/ResourceError.h
index 10f1208..83f298c 100644
--- a/WebCore/platform/network/cf/ResourceError.h
+++ b/WebCore/platform/network/cf/ResourceError.h
@@ -70,4 +70,4 @@ private:
} // namespace WebCore
-#endif // ResourceError_h_
+#endif // ResourceError_h
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 13412c1..e48bd2d 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -32,7 +32,7 @@
#include "AuthenticationCF.h"
#include "AuthenticationChallenge.h"
#include "Base64.h"
-#include "CookieStorageWin.h"
+#include "CookieStorageCFNet.h"
#include "CredentialStorage.h"
#include "CachedResourceLoader.h"
#include "FormDataStreamCFNet.h"
diff --git a/WebCore/platform/network/cf/ResourceRequest.h b/WebCore/platform/network/cf/ResourceRequest.h
index 9ed79f2..0f330d1 100644
--- a/WebCore/platform/network/cf/ResourceRequest.h
+++ b/WebCore/platform/network/cf/ResourceRequest.h
@@ -21,7 +21,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ResourceRequest_h
diff --git a/WebCore/platform/network/cf/ResourceResponse.h b/WebCore/platform/network/cf/ResourceResponse.h
index 5e27670..a586a16 100644
--- a/WebCore/platform/network/cf/ResourceResponse.h
+++ b/WebCore/platform/network/cf/ResourceResponse.h
@@ -22,6 +22,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.
*/
+
#ifndef ResourceResponse_h
#define ResourceResponse_h
diff --git a/WebCore/platform/network/cf/SocketStreamError.h b/WebCore/platform/network/cf/SocketStreamError.h
index f9641ad..6a0b441 100644
--- a/WebCore/platform/network/cf/SocketStreamError.h
+++ b/WebCore/platform/network/cf/SocketStreamError.h
@@ -35,15 +35,15 @@
namespace WebCore {
- class SocketStreamError : public SocketStreamErrorBase {
- public:
- SocketStreamError() { }
- explicit SocketStreamError(int errorCode)
- : SocketStreamErrorBase(errorCode)
- {
- }
+class SocketStreamError : public SocketStreamErrorBase {
+public:
+ SocketStreamError() { }
+ explicit SocketStreamError(int errorCode)
+ : SocketStreamErrorBase(errorCode)
+ {
+ }
- };
+};
} // namespace WebCore
diff --git a/WebCore/platform/network/cf/SocketStreamHandle.h b/WebCore/platform/network/cf/SocketStreamHandle.h
index 8643db7..41d543a 100644
--- a/WebCore/platform/network/cf/SocketStreamHandle.h
+++ b/WebCore/platform/network/cf/SocketStreamHandle.h
@@ -39,74 +39,74 @@
namespace WebCore {
- class AuthenticationChallenge;
- class Credential;
- class SocketStreamHandleClient;
+class AuthenticationChallenge;
+class Credential;
+class SocketStreamHandleClient;
- class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase, public AuthenticationClient {
- public:
- static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
+class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase, public AuthenticationClient {
+public:
+ static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
- virtual ~SocketStreamHandle();
+ virtual ~SocketStreamHandle();
- using RefCounted<SocketStreamHandle>::ref;
- using RefCounted<SocketStreamHandle>::deref;
+ using RefCounted<SocketStreamHandle>::ref;
+ using RefCounted<SocketStreamHandle>::deref;
- private:
- virtual int platformSend(const char* data, int length);
- virtual void platformClose();
+private:
+ virtual int platformSend(const char* data, int length);
+ virtual void platformClose();
- SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
- void createStreams();
- void scheduleStreams();
- void chooseProxy();
+ SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
+ void createStreams();
+ void scheduleStreams();
+ void chooseProxy();
#ifndef BUILDING_ON_TIGER
- void chooseProxyFromArray(CFArrayRef);
- void executePACFileURL(CFURLRef);
- void removePACRunLoopSource();
- RetainPtr<CFRunLoopSourceRef> m_pacRunLoopSource;
- static void pacExecutionCallback(void* client, CFArrayRef proxyList, CFErrorRef error);
- static void pacExecutionCallbackMainThread(void*);
- static CFStringRef copyPACExecutionDescription(void*);
+ void chooseProxyFromArray(CFArrayRef);
+ void executePACFileURL(CFURLRef);
+ void removePACRunLoopSource();
+ RetainPtr<CFRunLoopSourceRef> m_pacRunLoopSource;
+ static void pacExecutionCallback(void* client, CFArrayRef proxyList, CFErrorRef error);
+ static void pacExecutionCallbackMainThread(void*);
+ static CFStringRef copyPACExecutionDescription(void*);
#endif
- bool shouldUseSSL() const { return m_url.protocolIs("wss"); }
+ bool shouldUseSSL() const { return m_url.protocolIs("wss"); }
- void addCONNECTCredentials(CFHTTPMessageRef response);
+ void addCONNECTCredentials(CFHTTPMessageRef response);
- static CFStringRef copyCFStreamDescription(void* );
- static void readStreamCallback(CFReadStreamRef, CFStreamEventType, void*);
- static void writeStreamCallback(CFWriteStreamRef, CFStreamEventType, void*);
+ static CFStringRef copyCFStreamDescription(void* );
+ static void readStreamCallback(CFReadStreamRef, CFStreamEventType, void*);
+ static void writeStreamCallback(CFWriteStreamRef, CFStreamEventType, void*);
#if PLATFORM(WIN)
- static void readStreamCallbackMainThread(void*);
- static void writeStreamCallbackMainThread(void*);
+ static void readStreamCallbackMainThread(void*);
+ static void writeStreamCallbackMainThread(void*);
#endif
- void readStreamCallback(CFStreamEventType);
- void writeStreamCallback(CFStreamEventType);
+ void readStreamCallback(CFStreamEventType);
+ void writeStreamCallback(CFStreamEventType);
- // No authentication for streams per se, but proxy may ask for credentials.
- virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
- virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
- virtual void receivedCancellation(const AuthenticationChallenge&);
+ // No authentication for streams per se, but proxy may ask for credentials.
+ virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
+ virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
+ virtual void receivedCancellation(const AuthenticationChallenge&);
- virtual void refAuthenticationClient() { ref(); }
- virtual void derefAuthenticationClient() { deref(); }
+ virtual void refAuthenticationClient() { ref(); }
+ virtual void derefAuthenticationClient() { deref(); }
- enum ConnectingSubstate { New, ExecutingPACFile, WaitingForCredentials, WaitingForConnect, Connected };
- ConnectingSubstate m_connectingSubstate;
+ enum ConnectingSubstate { New, ExecutingPACFile, WaitingForCredentials, WaitingForConnect, Connected };
+ ConnectingSubstate m_connectingSubstate;
- enum ConnectionType { Unknown, Direct, SOCKSProxy, CONNECTProxy };
- ConnectionType m_connectionType;
- RetainPtr<CFStringRef> m_proxyHost;
- RetainPtr<CFNumberRef> m_proxyPort;
+ enum ConnectionType { Unknown, Direct, SOCKSProxy, CONNECTProxy };
+ ConnectionType m_connectionType;
+ RetainPtr<CFStringRef> m_proxyHost;
+ RetainPtr<CFNumberRef> m_proxyPort;
- RetainPtr<CFHTTPMessageRef> m_proxyResponseMessage;
- bool m_sentStoredCredentials;
- RetainPtr<CFReadStreamRef> m_readStream;
- RetainPtr<CFWriteStreamRef> m_writeStream;
+ RetainPtr<CFHTTPMessageRef> m_proxyResponseMessage;
+ bool m_sentStoredCredentials;
+ RetainPtr<CFReadStreamRef> m_readStream;
+ RetainPtr<CFWriteStreamRef> m_writeStream;
- RetainPtr<CFURLRef> m_httpsURL; // ws(s): replaced with https:
- };
+ RetainPtr<CFURLRef> m_httpsURL; // ws(s): replaced with https:
+};
} // namespace WebCore
diff --git a/WebCore/platform/network/curl/CookieJarCurl.cpp b/WebCore/platform/network/curl/CookieJarCurl.cpp
index e05947c..6f8a6b7 100644
--- a/WebCore/platform/network/curl/CookieJarCurl.cpp
+++ b/WebCore/platform/network/curl/CookieJarCurl.cpp
@@ -61,4 +61,9 @@ void deleteCookie(const Document*, const KURL&, const String&)
// FIXME: Not yet implemented
}
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ // FIXME: Not yet implemented
+}
+
}
diff --git a/WebCore/platform/network/mac/CookieStorageMac.mm b/WebCore/platform/network/mac/CookieStorageMac.mm
new file mode 100644
index 0000000..ab26f7b
--- /dev/null
+++ b/WebCore/platform/network/mac/CookieStorageMac.mm
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2008 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 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 "CookieStorage.h"
+
+#import "WebCoreSystemInterface.h"
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool enabled)
+{
+ wkSetCookieStoragePrivateBrowsingEnabled(enabled);
+}
+
+}
diff --git a/WebCore/platform/network/mac/FormDataStreamMac.mm b/WebCore/platform/network/mac/FormDataStreamMac.mm
index 9b5884f..69af91a 100644
--- a/WebCore/platform/network/mac/FormDataStreamMac.mm
+++ b/WebCore/platform/network/mac/FormDataStreamMac.mm
@@ -46,6 +46,12 @@
#import <wtf/StdLibExtras.h>
#import <wtf/Threading.h>
+#if PLATFORM(IOS)
+#import <MacErrors.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
namespace WebCore {
typedef HashMap<CFReadStreamRef, RefPtr<FormData> > StreamFormDataMap;
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index 05c659f..0f97867 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -672,6 +672,15 @@ bool ResourceHandle::start(NetworkingContext* context)
if (context && !context->isValid())
return false;
+ if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
+ // If credentials were specified for this request, add them to the url,
+ // so that they will be passed to NetworkRequest.
+ KURL urlWithCredentials(firstRequest().url());
+ urlWithCredentials.setUser(d->m_user);
+ urlWithCredentials.setPass(d->m_pass);
+ d->m_firstRequest.setURL(urlWithCredentials);
+ }
+
KURL url = firstRequest().url();
String urlString = url.string();
String protocol = url.protocol();
diff --git a/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
index 380fc84..d46e47b 100644
--- a/WebCore/platform/network/soup/ResourceRequestSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceRequestSoup.cpp
@@ -25,6 +25,7 @@
#include "HTTPParsers.h"
#include "MIMETypeRegistry.h"
#include "PlatformString.h"
+#include "SoupURIUtils.h"
#include <wtf/text/CString.h>
#include <libsoup/soup.h>
@@ -88,9 +89,7 @@ SoupMessage* ResourceRequest::toSoupMessage() const
void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
{
- SoupURI* soupURI = soup_message_get_uri(soupMessage);
- GOwnPtr<gchar> uri(soup_uri_to_string(soupURI, FALSE));
- m_url = KURL(KURL(), String::fromUTF8(uri.get()));
+ m_url = soupURIToKURL(soup_message_get_uri(soupMessage));
m_httpMethod = String::fromUTF8(soupMessage->method);
@@ -107,10 +106,8 @@ void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
#ifdef HAVE_LIBSOUP_2_29_90
SoupURI* firstParty = soup_message_get_first_party(soupMessage);
- if (firstParty) {
- GOwnPtr<gchar> firstPartyURI(soup_uri_to_string(firstParty, FALSE));
- m_firstPartyForCookies = KURL(KURL(), String::fromUTF8(firstPartyURI.get()));
- }
+ if (firstParty)
+ m_firstPartyForCookies = soupURIToKURL(firstParty);
#endif
m_soupFlags = soup_message_get_flags(soupMessage);
diff --git a/WebCore/platform/network/soup/ResourceResponseSoup.cpp b/WebCore/platform/network/soup/ResourceResponseSoup.cpp
index cdbdc67..3bcdcc4 100644
--- a/WebCore/platform/network/soup/ResourceResponseSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceResponseSoup.cpp
@@ -25,6 +25,7 @@
#include "HTTPParsers.h"
#include "MIMETypeRegistry.h"
#include "PlatformString.h"
+#include "SoupURIUtils.h"
#include <wtf/text/CString.h>
using namespace std;
@@ -56,9 +57,7 @@ SoupMessage* ResourceResponse::toSoupMessage() const
void ResourceResponse::updateFromSoupMessage(SoupMessage* soupMessage)
{
- SoupURI* soupURI = soup_message_get_uri(soupMessage);
- GOwnPtr<gchar> uri(soup_uri_to_string(soupURI, FALSE));
- m_url = KURL(KURL(), String::fromUTF8(uri.get()));
+ m_url = soupURIToKURL(soup_message_get_uri(soupMessage));
m_httpStatusCode = soupMessage->status_code;
diff --git a/WebCore/platform/network/soup/SoupURIUtils.cpp b/WebCore/platform/network/soup/SoupURIUtils.cpp
new file mode 100644
index 0000000..1f65615
--- /dev/null
+++ b/WebCore/platform/network/soup/SoupURIUtils.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 20010 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
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "SoupURIUtils.h"
+
+#include "GOwnPtr.h"
+#include <libsoup/soup.h>
+
+namespace WebCore {
+
+// Motivated by https://bugs.webkit.org/show_bug.cgi?id=38956. libsoup
+// does not add the password to the URL when calling
+// soup_uri_to_string, and thus the requests are not properly
+// built. Fixing soup_uri_to_string is a no-no as the maintainer does
+// not want to break compatibility with previous implementations
+KURL soupURIToKURL(SoupURI* soupURI)
+{
+ GOwnPtr<gchar> urlString(soup_uri_to_string(soupURI, FALSE));
+ KURL url(KURL(), String::fromUTF8(urlString.get()));
+
+ if (!soupURI->password)
+ return url;
+
+ url.setPass(String::fromUTF8(soupURI->password));
+ return url;
+}
+
+}
diff --git a/WebCore/platform/network/soup/SoupURIUtils.h b/WebCore/platform/network/soup/SoupURIUtils.h
new file mode 100644
index 0000000..69772e7
--- /dev/null
+++ b/WebCore/platform/network/soup/SoupURIUtils.h
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+#ifndef SoupURIUtils_h
+#define SoupURIUtils_h
+
+#include "KURL.h"
+
+typedef struct _SoupURI SoupURI;
+
+namespace WebCore {
+KURL soupURIToKURL(SoupURI* soupURI);
+}
+
+#endif
diff --git a/WebCore/platform/network/win/AuthenticationChallenge.h b/WebCore/platform/network/win/AuthenticationChallenge.h
new file mode 100644
index 0000000..7463539
--- /dev/null
+++ b/WebCore/platform/network/win/AuthenticationChallenge.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * 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 AuthenticationChallenge_h
+#define AuthenticationChallenge_h
+
+#include "AuthenticationChallengeBase.h"
+
+namespace WebCore {
+
+class AuthenticationChallenge : public AuthenticationChallengeBase {
+public:
+ AuthenticationChallenge()
+ {
+ }
+
+ AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
+ : AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // AuthenticationChallenge_h
diff --git a/WebCore/platform/network/win/NetworkStateNotifierWin.cpp b/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
index 1620669..e600e41 100644
--- a/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
+++ b/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
@@ -109,11 +109,14 @@ NetworkStateNotifier::NetworkStateNotifier()
memset(&m_overlapped, 0, sizeof(m_overlapped));
+// FIXME: Check m_overlapped on WinCE.
+#if !OS(WINCE)
m_overlapped.hEvent = ::CreateEvent(0, false, false, 0);
::RegisterWaitForSingleObject(&m_waitHandle, m_overlapped.hEvent, addrChangeCallback, this, INFINITE, 0);
registerForAddressChange();
+#endif
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/network/win/ResourceError.h b/WebCore/platform/network/win/ResourceError.h
new file mode 100644
index 0000000..a09c227
--- /dev/null
+++ b/WebCore/platform/network/win/ResourceError.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. 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 ResourceError_h
+#define ResourceError_h
+
+#include "ResourceErrorBase.h"
+
+namespace WebCore {
+
+class ResourceError : public ResourceErrorBase {
+public:
+ ResourceError()
+ {
+ }
+
+ ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+ : ResourceErrorBase(domain, errorCode, failingURL, localizedDescription)
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // ResourceError_h
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index 28035b9..38d9cd1 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -277,7 +277,9 @@ bool ResourceHandle::start(NetworkingContext* context)
DWORD flags = INTERNET_FLAG_KEEP_CONNECTION
| INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
- | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
+ | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
+ | INTERNET_FLAG_DONT_CACHE
+ | INTERNET_FLAG_RELOAD;
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));
diff --git a/WebCore/platform/network/win/ResourceRequest.h b/WebCore/platform/network/win/ResourceRequest.h
new file mode 100644
index 0000000..cd50311
--- /dev/null
+++ b/WebCore/platform/network/win/ResourceRequest.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the 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 ResourceRequest_h
+#define ResourceRequest_h
+
+#include "ResourceRequestBase.h"
+
+namespace WebCore {
+
+class ResourceRequest : public ResourceRequestBase {
+public:
+ ResourceRequest(const String& url)
+ : ResourceRequestBase(KURL(ParsedURLString, url), UseProtocolCachePolicy)
+ {
+ }
+
+ ResourceRequest(const KURL& url)
+ : ResourceRequestBase(url, UseProtocolCachePolicy)
+ {
+ }
+
+ ResourceRequest(const KURL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy)
+ : ResourceRequestBase(url, policy)
+ {
+ setHTTPReferrer(referrer);
+ }
+
+ ResourceRequest()
+ : ResourceRequestBase(KURL(), UseProtocolCachePolicy)
+ {
+ }
+
+private:
+ friend struct ResourceRequestBase;
+
+ void doUpdatePlatformRequest() { }
+ void doUpdateResourceRequest() { }
+
+ PassOwnPtr<CrossThreadResourceRequestData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData> data) const { return data; }
+ void doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData>) { }
+};
+
+struct CrossThreadResourceRequestData : public CrossThreadResourceRequestDataBase {
+};
+
+} // namespace WebCore
+
+#endif // ResourceRequest_h
diff --git a/WebCore/platform/network/win/ResourceResponse.h b/WebCore/platform/network/win/ResourceResponse.h
new file mode 100644
index 0000000..b74a1e8
--- /dev/null
+++ b/WebCore/platform/network/win/ResourceResponse.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. 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 ResourceResponse_h
+#define ResourceResponse_h
+
+#include "ResourceResponseBase.h"
+
+namespace WebCore {
+
+class ResourceResponse : public ResourceResponseBase {
+public:
+ ResourceResponse()
+ {
+ }
+
+ ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
+ : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
+ {
+ }
+
+private:
+ friend class ResourceResponseBase;
+
+ PassOwnPtr<CrossThreadResourceResponseData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceResponseData> data) const { return data; }
+ void doPlatformAdopt(PassOwnPtr<CrossThreadResourceResponseData>) { }
+};
+
+struct CrossThreadResourceResponseData : public CrossThreadResourceResponseDataBase {
+};
+
+} // namespace WebCore
+
+#endif // ResourceResponse_h
diff --git a/WebCore/platform/network/win/SocketStreamError.h b/WebCore/platform/network/win/SocketStreamError.h
new file mode 100644
index 0000000..80dfa39
--- /dev/null
+++ b/WebCore/platform/network/win/SocketStreamError.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SocketStreamError_h
+#define SocketStreamError_h
+
+#include "SocketStreamErrorBase.h"
+
+namespace WebCore {
+
+class SocketStreamError : public SocketStreamErrorBase {
+public:
+ SocketStreamError() { }
+ explicit SocketStreamError(int errorCode)
+ : SocketStreamErrorBase(errorCode)
+ {
+ }
+
+};
+
+} // namespace WebCore
+
+#endif // SocketStreamError_h
diff --git a/WebCore/platform/network/win/SocketStreamHandle.h b/WebCore/platform/network/win/SocketStreamHandle.h
new file mode 100644
index 0000000..62808ec
--- /dev/null
+++ b/WebCore/platform/network/win/SocketStreamHandle.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 SocketStreamHandle_h
+#define SocketStreamHandle_h
+
+#include "SocketStreamHandleBase.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class AuthenticationChallenge;
+class Credential;
+class SocketStreamHandleClient;
+
+class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
+public:
+ static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
+
+ virtual ~SocketStreamHandle();
+
+protected:
+ virtual int platformSend(const char* data, int length);
+ virtual void platformClose();
+
+private:
+ SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
+
+ // No authentication for streams per se, but proxy may ask for credentials.
+ void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
+ void receivedCredential(const AuthenticationChallenge&, const Credential&);
+ void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
+ void receivedCancellation(const AuthenticationChallenge&);
+};
+
+} // namespace WebCore
+
+#endif // SocketStreamHandle_h
diff --git a/WebCore/platform/network/win/SocketStreamHandleWin.cpp b/WebCore/platform/network/win/SocketStreamHandleWin.cpp
new file mode 100644
index 0000000..b2b540f
--- /dev/null
+++ b/WebCore/platform/network/win/SocketStreamHandleWin.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2009 Brent Fulgham. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 "SocketStreamHandle.h"
+
+#include "KURL.h"
+#include "Logging.h"
+#include "NotImplemented.h"
+#include "SocketStreamHandleClient.h"
+
+namespace WebCore {
+
+SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient* client)
+ : SocketStreamHandleBase(url, client)
+{
+ LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
+ notImplemented();
+}
+
+SocketStreamHandle::~SocketStreamHandle()
+{
+ LOG(Network, "SocketStreamHandle %p delete", this);
+ setClient(0);
+ notImplemented();
+}
+
+int SocketStreamHandle::platformSend(const char*, int)
+{
+ LOG(Network, "SocketStreamHandle %p platformSend", this);
+ notImplemented();
+ return 0;
+}
+
+void SocketStreamHandle::platformClose()
+{
+ LOG(Network, "SocketStreamHandle %p platformClose", this);
+ notImplemented();
+}
+
+void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index f5d8c1b..d8f4171 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -30,11 +30,14 @@
#include <QCursor>
#endif
+#if USE(ACCELERATED_COMPOSITING)
+#include <GraphicsLayer.h>
+#endif
+
#include <QPalette>
#include <QRect>
QT_BEGIN_NAMESPACE
-class QGraphicsItem;
class QStyle;
QT_END_NAMESPACE
@@ -49,8 +52,7 @@ public:
virtual void setInputMethodEnabled(bool enable) = 0;
virtual bool inputMethodEnabled() const = 0;
#if USE(ACCELERATED_COMPOSITING)
- // this gets called when we start/stop compositing.
- virtual void setRootGraphicsLayer(QGraphicsItem* layer) {}
+ virtual void setRootGraphicsLayer(WebCore::PlatformLayer* layer) { }
// this gets called when the compositor wants us to sync the layers
// if scheduleSync is true, we schedule a sync ourselves. otherwise,
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index 50b5de6..7ef4ab7 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -80,6 +80,19 @@ namespace WebCore {
using namespace HTMLNames;
+inline static void initStyleOption(QWidget *widget, QStyleOption& option)
+{
+ if (widget)
+ option.initFrom(widget);
+ else {
+ /*
+ If a widget is not directly available for rendering, we fallback to default
+ value for an active widget.
+ */
+ option.state = QStyle::State_Active | QStyle::State_Enabled;
+ }
+}
+
StylePainter::StylePainter(RenderThemeQt* theme, const PaintInfo& paintInfo)
{
@@ -538,9 +551,7 @@ bool RenderThemeQt::paintButton(RenderObject* o, const PaintInfo& i, const IntRe
return true;
QStyleOptionButton option;
- if (p.widget)
- option.initFrom(p.widget);
-
+ initStyleOption(p.widget, option);
option.rect = r;
option.state |= QStyle::State_Small;
@@ -571,9 +582,7 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const PaintInfo& i, const In
return true;
QStyleOptionFrameV2 panel;
- if (p.widget)
- panel.initFrom(p.widget);
-
+ initStyleOption(p.widget, panel);
panel.rect = r;
panel.lineWidth = findFrameLineWidth(qStyle());
panel.state |= QStyle::State_Sunken;
@@ -640,8 +649,7 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const PaintInfo& i, const Int
return true;
QtStyleOptionWebComboBox opt(o);
- if (p.widget)
- opt.initFrom(p.widget);
+ initStyleOption(p.widget, opt);
initializeCommonQStyleOptions(opt, o);
const QPoint topLeft = r.topLeft();
@@ -684,8 +692,7 @@ bool RenderThemeQt::paintMenuListButton(RenderObject* o, const PaintInfo& i,
return true;
QtStyleOptionWebComboBox option(o);
- if (p.widget)
- option.initFrom(p.widget);
+ initStyleOption(p.widget, option);
initializeCommonQStyleOptions(option, o);
option.rect = r;
@@ -735,8 +742,7 @@ bool RenderThemeQt::paintProgressBar(RenderObject* o, const PaintInfo& pi, const
return true;
QStyleOptionProgressBarV2 option;
- if (p.widget)
- option.initFrom(p.widget);
+ initStyleOption(p.widget, option);
initializeCommonQStyleOptions(option, o);
RenderProgress* renderProgress = toRenderProgress(o);
@@ -777,8 +783,7 @@ bool RenderThemeQt::paintSliderTrack(RenderObject* o, const PaintInfo& pi,
return true;
QStyleOptionSlider option;
- if (p.widget)
- option.initFrom(p.widget);
+ initStyleOption(p.widget, option);
option.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
ControlPart appearance = initializeCommonQStyleOptions(option, o);
diff --git a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
index 15933e8..d7b5104 100644
--- a/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
+++ b/WebCore/platform/qt/TemporaryLinkStubsQt.cpp
@@ -35,6 +35,7 @@
#include "AXObjectCache.h"
#include "CachedResource.h"
#include "CookieJar.h"
+#include "CookieStorage.h"
#include "Cursor.h"
#include "DNS.h"
#include "FTPDirectoryDocument.h"
@@ -123,6 +124,11 @@ float userIdleTime()
}
#endif
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
}
// vim: ts=4 sw=4 et
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index b9e7639..fb25889 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -72,6 +72,12 @@ bool SQLiteDatabase::open(const String& filename, bool forWebSQLDatabase)
m_db = 0;
return false;
}
+ if (sqlite3_extended_result_codes(m_db, 1) != SQLITE_OK) {
+ LOG_ERROR("SQLite database error when enabling extended errors - %s", sqlite3_errmsg(m_db));
+ sqlite3_close(m_db);
+ m_db = 0;
+ return false;
+ }
if (isOpen())
m_openingThread = currentThread();
diff --git a/WebCore/platform/text/TextEncoding.cpp b/WebCore/platform/text/TextEncoding.cpp
index 921ceeb..58e691f 100644
--- a/WebCore/platform/text/TextEncoding.cpp
+++ b/WebCore/platform/text/TextEncoding.cpp
@@ -120,6 +120,10 @@ CString TextEncoding::encode(const UChar* characters, size_t length, Unencodable
#elif USE(GLIB_UNICODE)
GOwnPtr<char> UTF8Source;
UTF8Source.set(g_utf16_to_utf8(characters, length, 0, 0, 0));
+ if (!UTF8Source) {
+ // If conversion to UTF-8 failed, try with the string without normalization
+ return newTextCodec(*this)->encode(characters, length, handling);
+ }
GOwnPtr<char> UTF8Normalized;
UTF8Normalized.set(g_utf8_normalize(UTF8Source.get(), -1, G_NORMALIZE_NFC));
diff --git a/WebCore/platform/text/brew/StringBrew.cpp b/WebCore/platform/text/brew/StringBrew.cpp
new file mode 100644
index 0000000..7869e0f
--- /dev/null
+++ b/WebCore/platform/text/brew/StringBrew.cpp
@@ -0,0 +1,44 @@
+/*
+ * 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:
+ * 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 "PlatformString.h"
+
+#include <AEEStdLib.h>
+
+namespace WTF {
+
+// String conversions
+String::String(const AECHAR* string)
+{
+ // It is safe to cast AECHAR to UChar as both of them use 16 bits representation.
+ const UChar* str = reinterpret_cast<const UChar*>(string);
+ const size_t len = WSTRLEN(string);
+
+ m_impl = StringImpl::create(str, len);
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp b/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
index 3be0c70..be3f302 100644
--- a/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
+++ b/WebCore/platform/text/gtk/TextBreakIteratorGtk.cpp
@@ -3,6 +3,7 @@
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2008 Jürg Billeter <j@bitron.ch>
* Copyright (C) 2008 Dominik Röttsches <dominik.roettsches@access-company.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
@@ -22,13 +23,160 @@
*/
#include "config.h"
-#include "GOwnPtr.h"
+
#include "TextBreakIterator.h"
+#include "GOwnPtr.h"
#include <pango/pango.h>
+using namespace std;
+
+#define UTF8_IS_SURROGATE(character) (character >= 0x10000 && character <= 0x10FFFF)
namespace WebCore {
+class CharacterIterator {
+public:
+ bool setText(const UChar* string, int length);
+ const gchar* getText() { return m_utf8.get(); }
+ int getLength() { return m_length; }
+ glong getSize() { return m_size; }
+ void setIndex(int index);
+ int getIndex() { return m_index; }
+ void setUTF16Index(int index);
+ int getUTF16Index() { return m_utf16Index; }
+ int getUTF16Length() { return m_utf16Length; }
+ int first();
+ int last();
+ int next();
+ int previous();
+private:
+ int characterSize(int index);
+
+ GOwnPtr<char> m_utf8;
+ int m_length;
+ long m_size;
+ int m_index;
+ int m_utf16Index;
+ int m_utf16Length;
+};
+
+int CharacterIterator::characterSize(int index)
+{
+ if (index == m_length || index < 0)
+ return 0;
+ if (m_length == m_utf16Length)
+ return 1;
+
+ gchar* indexPtr = g_utf8_offset_to_pointer(m_utf8.get(), index);
+ gunichar character = g_utf8_get_char(indexPtr);
+ return UTF8_IS_SURROGATE(character) ? 2 : 1;
+}
+
+bool CharacterIterator::setText(const UChar* string, int length)
+{
+ long utf8Size = 0;
+ m_utf8.set(g_utf16_to_utf8(string, length, 0, &utf8Size, 0));
+ if (!utf8Size)
+ return false;
+
+ m_utf16Length = length;
+ m_length = g_utf8_strlen(m_utf8.get(), utf8Size);
+ m_size = utf8Size;
+ m_index = 0;
+ m_utf16Index = 0;
+
+ return true;
+}
+
+void CharacterIterator::setIndex(int index)
+{
+ if (index == m_index)
+ return;
+ if (index <= 0)
+ m_index = m_utf16Index = 0;
+ else if (index >= m_length) {
+ m_index = m_length;
+ m_utf16Index = m_utf16Length;
+ } else if (m_length == m_utf16Length)
+ m_index = m_utf16Index = index;
+ else {
+ m_index = index;
+ int utf16Index = 0;
+ int utf8Index = 0;
+ while (utf8Index < index) {
+ utf16Index += characterSize(utf8Index);
+ utf8Index++;
+ }
+ m_utf16Index = utf16Index;
+ }
+}
+
+void CharacterIterator::setUTF16Index(int index)
+{
+ if (index == m_utf16Index)
+ return;
+ if (index <= 0)
+ m_utf16Index = m_index = 0;
+ else if (index >= m_utf16Length) {
+ m_utf16Index = m_utf16Length;
+ m_index = m_length;
+ } else if (m_length == m_utf16Length)
+ m_utf16Index = m_index = index;
+ else {
+ m_utf16Index = index;
+ int utf16Index = 0;
+ int utf8Index = 0;
+ while (utf16Index < index) {
+ utf16Index += characterSize(utf8Index);
+ utf8Index++;
+ }
+ m_index = utf8Index;
+ }
+}
+
+int CharacterIterator::first()
+{
+ m_index = m_utf16Index = 0;
+ return m_index;
+}
+
+int CharacterIterator::last()
+{
+ m_index = m_length;
+ m_utf16Index = m_utf16Length;
+ return m_index;
+}
+
+int CharacterIterator::next()
+{
+ int next = m_index + 1;
+
+ if (next <= m_length) {
+ m_utf16Index = min(m_utf16Index + characterSize(m_index), m_utf16Length);
+ m_index = next;
+ } else {
+ m_index = TextBreakDone;
+ m_utf16Index = TextBreakDone;
+ }
+
+ return m_index;
+}
+
+int CharacterIterator::previous()
+{
+ int previous = m_index - 1;
+
+ if (previous >= 0) {
+ m_utf16Index = max(m_utf16Index - characterSize(previous), 0);
+ m_index = previous;
+ } else {
+ m_index = TextBreakDone;
+ m_utf16Index = TextBreakDone;
+ }
+
+ return m_index;
+}
+
enum UBreakIteratorType {
UBRK_CHARACTER,
UBRK_WORD,
@@ -39,9 +187,8 @@ enum UBreakIteratorType {
class TextBreakIterator {
public:
UBreakIteratorType m_type;
- int m_length;
PangoLogAttr* m_logAttrs;
- int m_index;
+ CharacterIterator m_charIterator;
};
static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator*& iterator,
@@ -57,19 +204,17 @@ static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator
if (!iterator)
return 0;
- long utf8len;
- GOwnPtr<char> utf8;
- utf8.set(g_utf16_to_utf8(string, length, 0, &utf8len, 0));
+ if (!iterator->m_charIterator.setText(string, length))
+ return 0;
- // FIXME: assumes no surrogate pairs
+ int charLength = iterator->m_charIterator.getLength();
iterator->m_type = type;
- iterator->m_length = length;
if (createdIterator)
g_free(iterator->m_logAttrs);
- iterator->m_logAttrs = g_new0(PangoLogAttr, length + 1);
- iterator->m_index = -1;
- pango_get_log_attrs(utf8.get(), utf8len, -1, 0, iterator->m_logAttrs, length + 1);
+ iterator->m_logAttrs = g_new0(PangoLogAttr, charLength + 1);
+ pango_get_log_attrs(iterator->m_charIterator.getText(), iterator->m_charIterator.getSize(),
+ -1, 0, iterator->m_logAttrs, charLength + 1);
return iterator;
}
@@ -108,21 +253,13 @@ TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
return setUpIterator(createdSentenceBreakIterator, staticSentenceBreakIterator, UBRK_SENTENCE, string, length);
}
-int textBreakFirst(TextBreakIterator* bi)
+int textBreakFirst(TextBreakIterator* iterator)
{
- // see textBreakLast
-
- int firstCursorPosition = -1;
- int pos = 0;
- while (pos <= bi->m_length && (firstCursorPosition < 0)) {
- if (bi->m_logAttrs[pos].is_cursor_position)
- firstCursorPosition = pos;
- }
- bi->m_index = firstCursorPosition;
- return firstCursorPosition;
+ iterator->m_charIterator.first();
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakLast(TextBreakIterator* bi)
+int textBreakLast(TextBreakIterator* iterator)
{
// TextBreakLast is not meant to find just any break according to bi->m_type
// but really the one near the last character.
@@ -137,81 +274,92 @@ int textBreakLast(TextBreakIterator* bi)
// Otherwise return m_length, as "the first character beyond the last" is outside our string.
bool whiteSpaceAtTheEnd = true;
- int nextWhiteSpacePos = bi->m_length;
-
- int pos = bi->m_length;
+ int nextWhiteSpacePos = iterator->m_charIterator.getLength();
+
+ int pos = iterator->m_charIterator.last();
while (pos >= 0 && whiteSpaceAtTheEnd) {
- if (bi->m_logAttrs[pos].is_cursor_position) {
- if (whiteSpaceAtTheEnd = bi->m_logAttrs[pos].is_white)
+ if (iterator->m_logAttrs[pos].is_cursor_position) {
+ if (whiteSpaceAtTheEnd = iterator->m_logAttrs[pos].is_white)
nextWhiteSpacePos = pos;
}
- pos--;
+ pos = iterator->m_charIterator.previous();
}
- bi->m_index = nextWhiteSpacePos;
- return nextWhiteSpacePos;
+ iterator->m_charIterator.setIndex(nextWhiteSpacePos);
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakNext(TextBreakIterator* bi)
+int textBreakNext(TextBreakIterator* iterator)
{
- for (int i = bi->m_index + 1; i <= bi->m_length; i++) {
+ while (iterator->m_charIterator.next() != TextBreakDone) {
+ int index = iterator->m_charIterator.getIndex();
// FIXME: UBRK_WORD case: Single multibyte characters (i.e. white space around them), such as the euro symbol €,
// are not marked as word_start & word_end as opposed to the way ICU does it.
// This leads to - for example - different word selection behaviour when right clicking.
- if ((bi->m_type == UBRK_LINE && bi->m_logAttrs[i].is_line_break)
- || (bi->m_type == UBRK_WORD && (bi->m_logAttrs[i].is_word_start || bi->m_logAttrs[i].is_word_end))
- || (bi->m_type == UBRK_CHARACTER && bi->m_logAttrs[i].is_cursor_position)
- || (bi->m_type == UBRK_SENTENCE && (bi->m_logAttrs[i].is_sentence_start || bi->m_logAttrs[i].is_sentence_end)) ) {
- bi->m_index = i;
- return i;
+ if ((iterator->m_type == UBRK_LINE && iterator->m_logAttrs[index].is_line_break)
+ || (iterator->m_type == UBRK_WORD && (iterator->m_logAttrs[index].is_word_start || iterator->m_logAttrs[index].is_word_end))
+ || (iterator->m_type == UBRK_CHARACTER && iterator->m_logAttrs[index].is_cursor_position)
+ || (iterator->m_type == UBRK_SENTENCE && (iterator->m_logAttrs[index].is_sentence_start || iterator->m_logAttrs[index].is_sentence_end)) ) {
+ break;
}
}
- return TextBreakDone;
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakPrevious(TextBreakIterator* bi)
+int textBreakPrevious(TextBreakIterator* iterator)
{
- for (int i = bi->m_index - 1; i >= 0; i--) {
- if ((bi->m_type == UBRK_LINE && bi->m_logAttrs[i].is_line_break)
- || (bi->m_type == UBRK_WORD && (bi->m_logAttrs[i].is_word_start || bi->m_logAttrs[i].is_word_end))
- || (bi->m_type == UBRK_CHARACTER && bi->m_logAttrs[i].is_cursor_position)
- || (bi->m_type == UBRK_SENTENCE && (bi->m_logAttrs[i].is_sentence_start || bi->m_logAttrs[i].is_sentence_end)) ) {
- bi->m_index = i;
- return i;
+ while (iterator->m_charIterator.previous() != TextBreakDone) {
+ int index = iterator->m_charIterator.getIndex();
+
+ if ((iterator->m_type == UBRK_LINE && iterator->m_logAttrs[index].is_line_break)
+ || (iterator->m_type == UBRK_WORD && (iterator->m_logAttrs[index].is_word_start || iterator->m_logAttrs[index].is_word_end))
+ || (iterator->m_type == UBRK_CHARACTER && iterator->m_logAttrs[index].is_cursor_position)
+ || (iterator->m_type == UBRK_SENTENCE && (iterator->m_logAttrs[index].is_sentence_start || iterator->m_logAttrs[index].is_sentence_end)) ) {
+ break;
}
}
- return textBreakFirst(bi);
+ return iterator->m_charIterator.getUTF16Index();
}
-int textBreakPreceding(TextBreakIterator* bi, int pos)
+int textBreakPreceding(TextBreakIterator* iterator, int offset)
{
- bi->m_index = pos;
- return textBreakPrevious(bi);
+ if (offset > iterator->m_charIterator.getUTF16Length())
+ return TextBreakDone;
+ if (offset < 0)
+ return 0;
+ iterator->m_charIterator.setUTF16Index(offset);
+ return textBreakPrevious(iterator);
}
-int textBreakFollowing(TextBreakIterator* bi, int pos)
+int textBreakFollowing(TextBreakIterator* iterator, int offset)
{
- if (pos < 0)
- pos = -1;
- bi->m_index = pos;
- return textBreakNext(bi);
+ if (offset > iterator->m_charIterator.getUTF16Length())
+ return TextBreakDone;
+ if (offset < 0)
+ return 0;
+ iterator->m_charIterator.setUTF16Index(offset);
+ return textBreakNext(iterator);
}
-int textBreakCurrent(TextBreakIterator* bi)
+int textBreakCurrent(TextBreakIterator* iterator)
{
- return bi->m_index;
+ return iterator->m_charIterator.getUTF16Index();
}
-bool isTextBreak(TextBreakIterator* bi, int pos)
+bool isTextBreak(TextBreakIterator* iterator, int offset)
{
- if (bi->m_index < 0)
+ if (!offset)
+ return true;
+ if (offset > iterator->m_charIterator.getUTF16Length())
return false;
- return ((bi->m_type == UBRK_LINE && bi->m_logAttrs[bi->m_index].is_line_break)
- || (bi->m_type == UBRK_WORD && bi->m_logAttrs[bi->m_index].is_word_end)
- || (bi->m_type == UBRK_CHARACTER && bi->m_logAttrs[bi->m_index].is_char_break)
- || (bi->m_type == UBRK_SENTENCE && bi->m_logAttrs[bi->m_index].is_sentence_end) );
+ iterator->m_charIterator.setUTF16Index(offset);
+
+ int index = iterator->m_charIterator.getIndex();
+ iterator->m_charIterator.previous();
+ textBreakNext(iterator);
+ return iterator->m_charIterator.getIndex() == index;
}
}
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.cpp b/WebCore/platform/text/gtk/TextCodecGtk.cpp
index 4224c0c..bf6afcd 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.cpp
+++ b/WebCore/platform/text/gtk/TextCodecGtk.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "TextCodecGtk.h"
+#include <gio/gio.h>
#include "GOwnPtr.h"
#include "Logging.h"
#include "PlatformString.h"
@@ -45,164 +46,12 @@ namespace WebCore {
// This can be achieved by specifying the UTF-16 codecs' endianness explicitly when initializing GLib.
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
- const gchar* WebCore::TextCodecGtk::m_internalEncodingName = "UTF-16BE";
-#else
- const gchar* WebCore::TextCodecGtk::m_internalEncodingName = "UTF-16LE";
+static const gchar* internalEncodingName = "UTF-16BE";
+#else
+static const gchar* internalEncodingName = "UTF-16LE";
#endif
-// We're specifying the list of text codecs and their aliases here.
-// For each codec the first entry is the canonical name, remaining ones are used as aliases.
-// Each alias list must be terminated by a 0.
-
-// Unicode
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_UTF_8 = { "UTF-8", 0 };
-
-// Western
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_1 = { "ISO-8859-1", "CP819", "IBM819", "ISO-IR-100", "ISO8859-1", "ISO_8859-1", "ISO_8859-1:1987", "L1", "LATIN1", "CSISOLATIN1", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACROMAN = { "MACROMAN", "MAC", "MACINTOSH", "CSMACINTOSH", 0 };
-
-// Japanese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_SHIFT_JIS = { "Shift_JIS", "MS_KANJI", "SHIFT-JIS", "SJIS", "CSSHIFTJIS", 0 };
- TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_JP = { "EUC-JP", "EUC_JP", "EUCJP", "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE", "CSEUCPKDFMTJAPANESE", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_2022_JP = { "ISO-2022-JP", 0 };
-
-// Traditional Chinese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_BIG5 = { "BIG5", "BIG-5", "BIG-FIVE", "BIG5", "BIGFIVE", "CN-BIG5", "CSBIG5", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_BIG5_HKSCS = { "BIG5-HKSCS", "BIG5-HKSCS:2004", "BIG5HKSCS", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP950 = { "CP950", 0 };
-
-// Korean
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_2022_KR = { "ISO-2022-KR", "CSISO2022KR", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP949 = { "CP949", "UHC", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_KR = { "EUC-KR", "CSEUCKR", 0 };
-
-// Arabic
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_6 = { "ISO-8859-6", "ARABIC", "ASMO-708", "ECMA-114", "ISO-IR-127", "ISO8859-6", "ISO_8859-6", "ISO_8859-6:1987", "CSISOLATINARABIC", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1256 = { "windows-1256", "CP1256", "MS-ARAB", 0 }; // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
-
-// Hebrew
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_8 = { "ISO-8859-8", "HEBREW", "ISO-8859-8", "ISO-IR-138", "ISO8859-8", "ISO_8859-8", "ISO_8859-8:1988", "CSISOLATINHEBREW", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1255 = { "windows-1255", "CP1255", "MS-HEBR", 0 }; // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
-
-// Greek
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_7 = { "ISO-8859-7", "ECMA-118", "ELOT_928", "GREEK", "GREEK8", "ISO-IR-126", "ISO8859-7", "ISO_8859-7", "ISO_8859-7:1987", "ISO_8859-7:2003", "CSI", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP869 = { "CP869", "869", "CP-GR", "IBM869", "CSIBM869", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_WINDOWS_1253 = { "WINDOWS-1253", 0 };
-
-// Cyrillic
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_5 = { "ISO-8859-5", "CYRILLIC", "ISO-IR-144", "ISO8859-5", "ISO_8859-5", "ISO_8859-5:1988", "CSISOLATINCYRILLIC", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_KOI8_R = { "KOI8-R", "CSKOI8R", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP866 = { "CP866", "866", "IBM866", "CSIBM866", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_KOI8_U = { "KOI8-U", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_WINDOWS_1251 = { "windows-1251", "CP1251", 0 }; // CP1251 added to pass /fast/encoding/charset-cp1251.html
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACCYRILLIC = { "mac-cyrillic", "MACCYRILLIC", "x-mac-cyrillic", 0 };
-
-// Thai
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP874 = { "CP874", "WINDOWS-874", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_TIS_620 = { "TIS-620", 0 };
-
-// Simplified Chinese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_GBK = { "GBK", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_HZ = { "HZ", "HZ-GB-2312", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_GB18030 = { "GB18030", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_EUC_CN = { "EUC-CN", "EUCCN", "GB2312", "CN-GB", "CSGB2312", "EUC_CN", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_2312_80 = { "GB_2312-80", "CHINESE", "csISO58GB231280", "GB2312.1980-0", "ISO-IR-58" };
-
-// Central European
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_2 = { "ISO-8859-2", "ISO-IR-101", "ISO8859-2", "ISO_8859-2", "ISO_8859-2:1987", "L2", "LATIN2", "CSISOLATIN2", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1250 = { "CP1250", "MS-EE", "WINDOWS-1250", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_MACCENTRALEUROPE = { "MAC-CENTRALEUROPE", 0 };
-
-// Vietnamese
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1258 = { "CP1258", "WINDOWS-1258", 0 };
-
-// Turkish
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1254 = { "CP1254", "MS-TURK", "WINDOWS-1254", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_9 = { "ISO-8859-9", "ISO-IR-148", "ISO8859-9", "ISO_8859-9", "ISO_8859-9:1989", "L5", "LATIN5", "CSISOLATIN5", 0 };
-
-// Baltic
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_CP1257 = { "CP1257", "WINBALTRIM", "WINDOWS-1257", 0 };
-TextCodecGtk::codecAliasList TextCodecGtk::m_codecAliases_ISO_8859_4 = { "ISO-8859-4", "ISO-IR-110", "ISO8859-4", "ISO_8859-4", "ISO_8859-4:1988", "L4", "LATIN4", "CSISOLATIN4", 0 };
-
-gconstpointer const TextCodecGtk::m_iconvBaseCodecList[] = {
- // Unicode
- &m_codecAliases_UTF_8,
-
- // Western
- &m_codecAliases_ISO_8859_1
-};
-
-gconstpointer const TextCodecGtk::m_iconvExtendedCodecList[] =
-{
- // Western
- &m_codecAliases_MACROMAN,
-
- // Japanese
- &m_codecAliases_SHIFT_JIS,
- &m_codecAliases_EUC_JP,
- &m_codecAliases_ISO_2022_JP,
-
- // Simplified Chinese
- &m_codecAliases_BIG5,
- &m_codecAliases_BIG5_HKSCS,
- &m_codecAliases_CP950,
-
- // Korean
- &m_codecAliases_ISO_2022_KR,
- &m_codecAliases_CP949,
- &m_codecAliases_EUC_KR,
-
- // Arabic
- &m_codecAliases_ISO_8859_6,
- &m_codecAliases_CP1256,
-
- // Hebrew
- &m_codecAliases_ISO_8859_8,
- &m_codecAliases_CP1255,
-
- // Greek
- &m_codecAliases_ISO_8859_7,
- &m_codecAliases_CP869,
- &m_codecAliases_WINDOWS_1253,
-
- // Cyrillic
- &m_codecAliases_ISO_8859_5,
- &m_codecAliases_KOI8_R,
- &m_codecAliases_CP866,
- &m_codecAliases_KOI8_U,
- &m_codecAliases_WINDOWS_1251,
- &m_codecAliases_MACCYRILLIC,
-
- // Thai
- &m_codecAliases_CP874,
- &m_codecAliases_TIS_620,
-
- // Traditional Chinese
- &m_codecAliases_GBK,
- &m_codecAliases_HZ,
- &m_codecAliases_GB18030,
- &m_codecAliases_EUC_CN,
- &m_codecAliases_2312_80,
-
- // Central European
- &m_codecAliases_ISO_8859_2,
- &m_codecAliases_CP1250,
- &m_codecAliases_MACCENTRALEUROPE,
-
- // Vietnamese
- &m_codecAliases_CP1258,
-
- // Turkish
- &m_codecAliases_CP1254,
- &m_codecAliases_ISO_8859_9,
-
- // Baltic
- &m_codecAliases_CP1257,
- &m_codecAliases_ISO_8859_4
-};
-
-
const size_t ConversionBufferSize = 16384;
@@ -211,17 +60,17 @@ static PassOwnPtr<TextCodec> newTextCodecGtk(const TextEncoding& encoding, const
return new TextCodecGtk(encoding);
}
-gboolean TextCodecGtk::isEncodingAvailable(const gchar* encName)
+static bool isEncodingAvailable(const gchar* encodingName)
{
GIConv tester;
// test decoding
- tester = g_iconv_open(m_internalEncodingName, encName);
+ tester = g_iconv_open(internalEncodingName, encodingName);
if (tester == reinterpret_cast<GIConv>(-1)) {
return false;
} else {
g_iconv_close(tester);
// test encoding
- tester = g_iconv_open(encName, m_internalEncodingName);
+ tester = g_iconv_open(encodingName, internalEncodingName);
if (tester == reinterpret_cast<GIConv>(-1)) {
return false;
} else {
@@ -231,186 +80,435 @@ gboolean TextCodecGtk::isEncodingAvailable(const gchar* encName)
}
}
-void TextCodecGtk::registerEncodingNames(EncodingNameRegistrar registrar, bool extended)
+static bool registerEncodingNameIfAvailable(EncodingNameRegistrar registrar, const char* canonicalName)
{
- const void* const* encodingList;
- unsigned int listLength = 0;
- if (extended) {
- encodingList = m_iconvExtendedCodecList;
- listLength = sizeof(m_iconvExtendedCodecList)/sizeof(gpointer);
- } else {
- encodingList = m_iconvBaseCodecList;
- listLength = sizeof(m_iconvBaseCodecList)/sizeof(gpointer);
- }
-
- for (unsigned int i = 0; i < listLength; ++i) {
- codecAliasList *codecAliases = static_cast<codecAliasList*>(encodingList[i]);
-
- // Our convention is, the first entry in codecAliases is the canonical name,
- // see above in the list of declarations.
- // Probe GLib for this one first. If it's not available, we skip the whole group of aliases.
-
- int codecCount = 0;
- const char *canonicalName;
- canonicalName = (*codecAliases)[codecCount];
-
- if (!isEncodingAvailable(canonicalName))
- continue;
+ if (isEncodingAvailable(canonicalName)) {
registrar(canonicalName, canonicalName);
-
- const char *currentAlias;
- while ((currentAlias = (*codecAliases)[++codecCount])) {
- if (isEncodingAvailable(currentAlias))
- registrar(currentAlias, canonicalName);
- }
-
+ return true;
}
+
+ return false;
}
-void TextCodecGtk::registerCodecs(TextCodecRegistrar registrar, bool extended)
+static void registerEncodingAliasIfAvailable(EncodingNameRegistrar registrar, const char* canonicalName, const char* aliasName)
{
- const void* const* encodingList;
- unsigned int listLength = 0;
- if (extended) {
- encodingList = m_iconvExtendedCodecList;
- listLength = sizeof(m_iconvExtendedCodecList)/sizeof(gpointer);
- } else {
- encodingList = m_iconvBaseCodecList;
- listLength = sizeof(m_iconvBaseCodecList)/sizeof(gpointer);
- }
+ if (isEncodingAvailable(aliasName))
+ registrar(aliasName, canonicalName);
+}
- for (unsigned int i = 0; i < listLength; ++i) {
- codecAliasList *codecAliases = static_cast<codecAliasList*>(encodingList[i]);
- // by convention, the first "alias" should be the canonical name, see the definition of the alias lists
- const gchar *codecName = (*codecAliases)[0];
- if (isEncodingAvailable(codecName))
- registrar(codecName, newTextCodecGtk, 0);
- }
+static void registerCodecIfAvailable(TextCodecRegistrar registrar, const char* codecName)
+{
+ if (isEncodingAvailable(codecName))
+ registrar(codecName, newTextCodecGtk, 0);
}
void TextCodecGtk::registerBaseEncodingNames(EncodingNameRegistrar registrar)
{
- registerEncodingNames(registrar, false);
+ // Unicode
+ registerEncodingNameIfAvailable(registrar, "UTF-8");
+ registerEncodingNameIfAvailable(registrar, "UTF-32");
+ registerEncodingNameIfAvailable(registrar, "UTF-32BE");
+ registerEncodingNameIfAvailable(registrar, "UTF-32LE");
+
+ // Western
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-1")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "CP819");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "IBM819");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO-IR-100");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO8859-1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO_8859-1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "ISO_8859-1:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "L1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "LATIN1");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-1", "CSISOLATIN1");
+ }
}
void TextCodecGtk::registerBaseCodecs(TextCodecRegistrar registrar)
{
- registerCodecs(registrar, false);
+ // Unicode
+ registerCodecIfAvailable(registrar, "UTF-8");
+ registerCodecIfAvailable(registrar, "UTF-32");
+ registerCodecIfAvailable(registrar, "UTF-32BE");
+ registerCodecIfAvailable(registrar, "UTF-32LE");
+
+ // Western
+ registerCodecIfAvailable(registrar, "ISO-8859-1");
}
void TextCodecGtk::registerExtendedEncodingNames(EncodingNameRegistrar registrar)
{
- registerEncodingNames(registrar, true);
+ // Western
+ if (registerEncodingNameIfAvailable(registrar, "MACROMAN")) {
+ registerEncodingAliasIfAvailable(registrar, "MACROMAN", "MAC");
+ registerEncodingAliasIfAvailable(registrar, "MACROMAN", "MACINTOSH");
+ registerEncodingAliasIfAvailable(registrar, "MACROMAN", "CSMACINTOSH");
+ }
+
+ // Japanese
+ if (registerEncodingNameIfAvailable(registrar, "Shift_JIS")) {
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "MS_KANJI");
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "SHIFT-JIS");
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "SJIS");
+ registerEncodingAliasIfAvailable(registrar, "Shift_JIS", "CSSHIFTJIS");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "EUC-JP")) {
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EUC_JP");
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EUCJP");
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE");
+ registerEncodingAliasIfAvailable(registrar, "EUC-JP", "CSEUCPKDFMTJAPANESE");
+ }
+ registerEncodingNameIfAvailable(registrar, "ISO-2022-JP");
+
+ // Traditional Chinese
+ if (registerEncodingNameIfAvailable(registrar, "BIG5")) {
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "BIG-5");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "BIG-FIVE");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "BIGFIVE");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "CN-BIG5");
+ registerEncodingAliasIfAvailable(registrar, "BIG5", "CSBIG5");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "BIG5-HKSCS")) {
+ registerEncodingAliasIfAvailable(registrar, "BIG5-HKSCS", "BIG5-HKSCS:2004");
+ registerEncodingAliasIfAvailable(registrar, "BIG5-HKSCS", "BIG5HKSCS");
+ }
+ registerEncodingNameIfAvailable(registrar, "CP950");
+
+ // Korean
+ if (registerEncodingNameIfAvailable(registrar, "ISO-2022-KR"))
+ registerEncodingAliasIfAvailable(registrar, "ISO-2022-KR", "CSISO2022KR");
+ if (registerEncodingNameIfAvailable(registrar, "CP949"))
+ registerEncodingAliasIfAvailable(registrar, "CP949", "UHC");
+ if (registerEncodingNameIfAvailable(registrar, "EUC-KR"))
+ registerEncodingAliasIfAvailable(registrar, "EUC-KR", "CSEUCKR");
+
+ // Arabic
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-6")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ARABIC");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ASMO-708");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ECMA-114");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO-IR-127");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO8859-6");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO_8859-6");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "ISO_8859-6:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-6", "CSISOLATINARABIC");
+ }
+ // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
+ if (registerEncodingNameIfAvailable(registrar, "windows-1256")) {
+ registerEncodingAliasIfAvailable(registrar, "windows-1256", "CP1256");
+ registerEncodingAliasIfAvailable(registrar, "windows-1256", "MS-ARAB");
+ }
+
+ // Hebrew
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-8")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "HEBREW");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO-8859-8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO-IR-138");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO8859-8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO_8859-8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "ISO_8859-8:1988");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-8", "CSISOLATINHEBREW");
+ }
+ // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
+ if (registerEncodingNameIfAvailable(registrar, "windows-1255")) {
+ registerEncodingAliasIfAvailable(registrar, "windows-1255", "CP1255");
+ registerEncodingAliasIfAvailable(registrar, "windows-1255", "MS-HEBR");
+ }
+
+ // Greek
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-7")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ECMA-118");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ELOT_928");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "GREEK");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "GREEK8");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO-IR-126");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO8859-7");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "ISO_8859-7:2003");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-7", "CSI");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "CP869")) {
+ registerEncodingAliasIfAvailable(registrar, "CP869", "869");
+ registerEncodingAliasIfAvailable(registrar, "CP869", "CP-GR");
+ registerEncodingAliasIfAvailable(registrar, "CP869", "IBM869");
+ registerEncodingAliasIfAvailable(registrar, "CP869", "CSIBM869");
+ }
+ registerEncodingNameIfAvailable(registrar, "WINDOWS-1253");
+
+ // Cyrillic
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-5")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "CYRILLIC");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO-IR-144");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO8859-5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO_8859-5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "ISO_8859-5:1988");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-5", "CSISOLATINCYRILLIC");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "KOI8-R"))
+ registerEncodingAliasIfAvailable(registrar, "KOI8-R", "CSKOI8R");
+ if (registerEncodingNameIfAvailable(registrar, "CP866")) {
+ registerEncodingAliasIfAvailable(registrar, "CP866", "866");
+ registerEncodingAliasIfAvailable(registrar, "CP866", "IBM866");
+ registerEncodingAliasIfAvailable(registrar, "CP866", "CSIBM866");
+ }
+ registerEncodingNameIfAvailable(registrar, "KOI8-U");
+ // CP1251 added to pass /fast/encoding/charset-cp1251.html
+ if (registerEncodingNameIfAvailable(registrar, "windows-1251"))
+ registerEncodingAliasIfAvailable(registrar, "windows-1251", "CP1251");
+ if (registerEncodingNameIfAvailable(registrar, "mac-cyrillic")) {
+ registerEncodingAliasIfAvailable(registrar, "mac-cyrillic", "MACCYRILLIC");
+ registerEncodingAliasIfAvailable(registrar, "mac-cyrillic", "x-mac-cyrillic");
+ }
+
+ // Thai
+ if (registerEncodingNameIfAvailable(registrar, "CP874"))
+ registerEncodingAliasIfAvailable(registrar, "CP874", "WINDOWS-874");
+ registerEncodingNameIfAvailable(registrar, "TIS-620");
+
+ // Simplified Chinese
+ registerEncodingNameIfAvailable(registrar, "GBK");
+ if (registerEncodingNameIfAvailable(registrar, "HZ"))
+ registerEncodingAliasIfAvailable(registrar, "HZ", "HZ-GB-2312");
+ registerEncodingNameIfAvailable(registrar, "GB18030");
+ if (registerEncodingNameIfAvailable(registrar, "EUC-CN")) {
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "EUCCN");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "GB2312");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "CN-GB");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "CSGB2312");
+ registerEncodingAliasIfAvailable(registrar, "EUC-CN", "EUC_CN");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "GB_2312-80")) {
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "CHINESE");
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "csISO58GB231280");
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "GB2312.1980-0");
+ registerEncodingAliasIfAvailable(registrar, "GB_2312-80", "ISO-IR-58");
+ }
+
+ // Central European
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-2")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO-IR-101");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO8859-2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO_8859-2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "ISO_8859-2:1987");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "L2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "LATIN2");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-2", "CSISOLATIN2");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "CP1250")) {
+ registerEncodingAliasIfAvailable(registrar, "CP1250", "MS-EE");
+ registerEncodingAliasIfAvailable(registrar, "CP1250", "WINDOWS-1250");
+ }
+ registerEncodingNameIfAvailable(registrar, "MAC-CENTRALEUROPE");
+
+ // Vietnamese
+ if (registerEncodingNameIfAvailable(registrar, "CP1258"))
+ registerEncodingAliasIfAvailable(registrar, "CP1258", "WINDOWS-1258");
+
+ // Turkish
+ if (registerEncodingNameIfAvailable(registrar, "CP1254")) {
+ registerEncodingAliasIfAvailable(registrar, "CP1254", "MS-TURK");
+ registerEncodingAliasIfAvailable(registrar, "CP1254", "WINDOWS-1254");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-9")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO-IR-148");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO8859-9");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO_8859-9");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "ISO_8859-9:1989");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "L5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "LATIN5");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-9", "CSISOLATIN5");
+ }
+
+ // Baltic
+ if (registerEncodingNameIfAvailable(registrar, "CP1257")) {
+ registerEncodingAliasIfAvailable(registrar, "CP1257", "WINBALTRIM");
+ registerEncodingAliasIfAvailable(registrar, "CP1257", "WINDOWS-1257");
+ }
+ if (registerEncodingNameIfAvailable(registrar, "ISO-8859-4")) {
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO-IR-110");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO8859-4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO_8859-4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "ISO_8859-4:1988");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "L4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "LATIN4");
+ registerEncodingAliasIfAvailable(registrar, "ISO-8859-4", "CSISOLATIN4");
+ }
}
void TextCodecGtk::registerExtendedCodecs(TextCodecRegistrar registrar)
{
- registerCodecs(registrar, true);
+ // Western
+ registerCodecIfAvailable(registrar, "MACROMAN");
+
+ // Japanese
+ registerCodecIfAvailable(registrar, "Shift_JIS");
+ registerCodecIfAvailable(registrar, "EUC-JP");
+ registerCodecIfAvailable(registrar, "ISO-2022-JP");
+
+ // Traditional Chinese
+ registerCodecIfAvailable(registrar, "BIG5");
+ registerCodecIfAvailable(registrar, "BIG5-HKSCS");
+ registerCodecIfAvailable(registrar, "CP950");
+
+ // Korean
+ registerCodecIfAvailable(registrar, "ISO-2022-KR");
+ registerCodecIfAvailable(registrar, "CP949");
+ registerCodecIfAvailable(registrar, "EUC-KR");
+
+ // Arabic
+ registerCodecIfAvailable(registrar, "ISO-8859-6");
+ // rearranged, windows-1256 now declared the canonical name and put to lowercase to fix /fast/encoding/ahram-org-eg.html test case
+ registerCodecIfAvailable(registrar, "windows-1256");
+
+ // Hebrew
+ registerCodecIfAvailable(registrar, "ISO-8859-8");
+ // rearranged, moved windows-1255 as canonical and lowercased, fixing /fast/encoding/meta-charset.html
+ registerCodecIfAvailable(registrar, "windows-1255");
+
+ // Greek
+ registerCodecIfAvailable(registrar, "ISO-8859-7");
+ registerCodecIfAvailable(registrar, "CP869");
+ registerCodecIfAvailable(registrar, "WINDOWS-1253");
+
+ // Cyrillic
+ registerCodecIfAvailable(registrar, "ISO-8859-5");
+ registerCodecIfAvailable(registrar, "KOI8-R");
+ registerCodecIfAvailable(registrar, "CP866");
+ registerCodecIfAvailable(registrar, "KOI8-U");
+ // CP1251 added to pass /fast/encoding/charset-cp1251.html
+ registerCodecIfAvailable(registrar, "windows-1251");
+ registerCodecIfAvailable(registrar, "mac-cyrillic");
+
+ // Thai
+ registerCodecIfAvailable(registrar, "CP874");
+ registerCodecIfAvailable(registrar, "TIS-620");
+
+ // Simplified Chinese
+ registerCodecIfAvailable(registrar, "GBK");
+ registerCodecIfAvailable(registrar, "HZ");
+ registerCodecIfAvailable(registrar, "GB18030");
+ registerCodecIfAvailable(registrar, "EUC-CN");
+ registerCodecIfAvailable(registrar, "GB_2312-80");
+
+ // Central European
+ registerCodecIfAvailable(registrar, "ISO-8859-2");
+ registerCodecIfAvailable(registrar, "CP1250");
+ registerCodecIfAvailable(registrar, "MAC-CENTRALEUROPE");
+
+ // Vietnamese
+ registerCodecIfAvailable(registrar, "CP1258");
+
+ // Turkish
+ registerCodecIfAvailable(registrar, "CP1254");
+ registerCodecIfAvailable(registrar, "ISO-8859-9");
+
+ // Baltic
+ registerCodecIfAvailable(registrar, "CP1257");
+ registerCodecIfAvailable(registrar, "ISO-8859-4");
}
TextCodecGtk::TextCodecGtk(const TextEncoding& encoding)
: m_encoding(encoding)
, m_numBufferedBytes(0)
- , m_iconvDecoder(reinterpret_cast<GIConv>(-1))
- , m_iconvEncoder(reinterpret_cast<GIConv>(-1))
{
}
TextCodecGtk::~TextCodecGtk()
{
- if (m_iconvDecoder != reinterpret_cast<GIConv>(-1)) {
- g_iconv_close(m_iconvDecoder);
- m_iconvDecoder = reinterpret_cast<GIConv>(-1);
- }
- if (m_iconvEncoder != reinterpret_cast<GIConv>(-1)) {
- g_iconv_close(m_iconvEncoder);
- m_iconvEncoder = reinterpret_cast<GIConv>(-1);
- }
}
void TextCodecGtk::createIConvDecoder() const
{
- ASSERT(m_iconvDecoder == reinterpret_cast<GIConv>(-1));
+ ASSERT(!m_iconvDecoder);
- m_iconvDecoder = g_iconv_open(m_internalEncodingName, m_encoding.name());
+ m_iconvDecoder = adoptPlatformRef(g_charset_converter_new(internalEncodingName, m_encoding.name(), 0));
}
void TextCodecGtk::createIConvEncoder() const
{
- ASSERT(m_iconvDecoder == reinterpret_cast<GIConv>(-1));
+ ASSERT(!m_iconvEncoder);
- m_iconvEncoder = g_iconv_open(m_encoding.name(), m_internalEncodingName);
+ m_iconvEncoder = adoptPlatformRef(g_charset_converter_new(m_encoding.name(), internalEncodingName, 0));
}
String TextCodecGtk::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
{
// Get a converter for the passed-in encoding.
- if (m_iconvDecoder == reinterpret_cast<GIConv>(-1)) {
+ if (!m_iconvDecoder)
createIConvDecoder();
- ASSERT(m_iconvDecoder != reinterpret_cast<GIConv>(-1));
- if (m_iconvDecoder == reinterpret_cast<GIConv>(-1)) {
- LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
- return String();
- }
+ if (!m_iconvDecoder) {
+ LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
+ return String();
}
- size_t countWritten, countRead, conversionLength;
- const char* conversionBytes;
+ Vector<UChar> result;
+
+ gsize bytesRead = 0;
+ gsize bytesWritten = 0;
+ const gchar* input = bytes;
+ gsize inputLength = length;
+ gchar buffer[ConversionBufferSize];
+ int flags = !length ? G_CONVERTER_INPUT_AT_END : G_CONVERTER_NO_FLAGS;
+ if (flush)
+ flags |= G_CONVERTER_FLUSH;
+
+ bool bufferWasFull = false;
char* prefixedBytes = 0;
if (m_numBufferedBytes) {
- conversionLength = length + m_numBufferedBytes;
- prefixedBytes = static_cast<char*>(fastMalloc(conversionLength));
+ inputLength = length + m_numBufferedBytes;
+ prefixedBytes = static_cast<char*>(fastMalloc(inputLength));
memcpy(prefixedBytes, m_bufferedBytes, m_numBufferedBytes);
memcpy(prefixedBytes + m_numBufferedBytes, bytes, length);
-
- conversionBytes = prefixedBytes;
-
+
+ input = prefixedBytes;
+
// all buffered bytes are consumed now
m_numBufferedBytes = 0;
- } else {
- // no previously buffered partial data,
- // just convert the data that was passed in
- conversionBytes = bytes;
- conversionLength = length;
}
- GOwnPtr<GError> err;
- GOwnPtr<UChar> buffer;
-
- buffer.outPtr() = reinterpret_cast<UChar*>(g_convert_with_iconv(conversionBytes, conversionLength, m_iconvDecoder, &countRead, &countWritten, &err.outPtr()));
-
-
- if (err) {
- LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", err->code, err->message);
- m_numBufferedBytes = 0; // reset state for subsequent calls to decode
- fastFree(prefixedBytes);
- sawError = true;
- return String();
- }
-
- // Partial input at the end of the string may not result in an error being raised.
- // From the gnome library documentation on g_convert_with_iconv:
- // "Even if the conversion was successful, this may be less than len if there were partial characters at the end of the input."
- // That's why we need to compare conversionLength against countRead
-
- m_numBufferedBytes = conversionLength - countRead;
- if (m_numBufferedBytes > 0) {
- if (flush) {
- LOG_ERROR("Partial bytes at end of input while flush requested.");
- m_numBufferedBytes = 0; // reset state for subsequent calls to decode
- fastFree(prefixedBytes);
- sawError = true;
- return String();
+ do {
+ GOwnPtr<GError> error;
+ GConverterResult res = g_converter_convert(G_CONVERTER(m_iconvDecoder.get()),
+ input, inputLength,
+ buffer, sizeof(buffer),
+ static_cast<GConverterFlags>(flags),
+ &bytesRead, &bytesWritten,
+ &error.outPtr());
+ input += bytesRead;
+ inputLength -= bytesRead;
+
+ if (res == G_CONVERTER_ERROR) {
+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_PARTIAL_INPUT)) {
+ // There is not enough input to fully determine what the conversion should produce,
+ // save it to a buffer to prepend it to the next input.
+ memcpy(m_bufferedBytes, input, inputLength);
+ m_numBufferedBytes = inputLength;
+ inputLength = 0;
+ } else if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_NO_SPACE))
+ bufferWasFull = true;
+ else if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
+ if (stopOnError)
+ sawError = true;
+ if (inputLength) {
+ // Ignore invalid character.
+ input += 1;
+ inputLength -= 1;
+ }
+ } else {
+ sawError = true;
+ LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", error->code, error->message);
+ m_numBufferedBytes = 0; // Reset state for subsequent calls to decode.
+ fastFree(prefixedBytes);
+ return String();
+ }
}
- memcpy(m_bufferedBytes, conversionBytes + countRead, m_numBufferedBytes);
- }
- fastFree(prefixedBytes);
-
- Vector<UChar> result;
+ result.append(reinterpret_cast<UChar*>(buffer), bytesWritten / sizeof(UChar));
+ } while ((inputLength || bufferWasFull) && !sawError);
- result.append(buffer.get(), countWritten / sizeof(UChar));
+ fastFree(prefixedBytes);
return String::adopt(result);
}
@@ -420,23 +518,42 @@ CString TextCodecGtk::encode(const UChar* characters, size_t length, Unencodable
if (!length)
return "";
- if (m_iconvEncoder == reinterpret_cast<GIConv>(-1))
+ if (!m_iconvEncoder)
createIConvEncoder();
- if (m_iconvEncoder == reinterpret_cast<GIConv>(-1))
+ if (!m_iconvEncoder) {
+ LOG_ERROR("Error creating IConv encoder even though encoding was in table.");
return CString();
+ }
- size_t count;
-
- GOwnPtr<GError> err;
- GOwnPtr<char> buffer;
-
- buffer.outPtr() = g_convert_with_iconv(reinterpret_cast<const char*>(characters), length * sizeof(UChar), m_iconvEncoder, 0, &count, &err.outPtr());
- if (err) {
- LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", err->code, err->message);
+ gsize bytesRead = 0;
+ gsize bytesWritten = 0;
+ const gchar* input = reinterpret_cast<const char*>(characters);
+ gsize inputLength = length * sizeof(UChar);
+ gchar buffer[ConversionBufferSize];
+ Vector<char> result;
+ GOwnPtr<GError> error;
+
+ size_t size = 0;
+ do {
+ g_converter_convert(G_CONVERTER(m_iconvEncoder.get()),
+ input, inputLength,
+ buffer, sizeof(buffer),
+ G_CONVERTER_INPUT_AT_END,
+ &bytesRead, &bytesWritten,
+ &error.outPtr());
+ input += bytesRead;
+ inputLength -= bytesRead;
+ result.grow(size + bytesWritten);
+ memcpy(result.data() + size, buffer, bytesWritten);
+ size += bytesWritten;
+ } while (inputLength && !error.get());
+
+ if (error) {
+ LOG_ERROR("GIConv conversion error, Code %d: \"%s\"", error->code, error->message);
return CString();
}
- return CString(buffer.get(), count);
+ return CString(result.data(), size);
}
} // namespace WebCore
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.h b/WebCore/platform/text/gtk/TextCodecGtk.h
index a8af752..1fb8df9 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.h
+++ b/WebCore/platform/text/gtk/TextCodecGtk.h
@@ -29,6 +29,7 @@
#ifndef TextCodecGTK_h
#define TextCodecGTK_h
+#include "GRefPtr.h"
#include <glib.h>
#include "TextCodec.h"
#include "TextEncoding.h"
@@ -53,93 +54,11 @@ namespace WebCore {
void createIConvDecoder() const;
void createIConvEncoder() const;
- static void registerEncodingNames(EncodingNameRegistrar registrar, bool extended);
- static void registerCodecs(TextCodecRegistrar registrar, bool extended);
- static gboolean isEncodingAvailable(const gchar*);
-
TextEncoding m_encoding;
size_t m_numBufferedBytes;
unsigned char m_bufferedBytes[16]; // bigger than any single multi-byte character
- mutable GIConv m_iconvDecoder;
- mutable GIConv m_iconvEncoder;
-
- static const gchar* m_internalEncodingName;
-
- typedef const gchar* const codecAliasList[];
-
- // Unicode
- static codecAliasList m_codecAliases_UTF_8;
-
- // Western
- static codecAliasList m_codecAliases_ISO_8859_1;
- static codecAliasList m_codecAliases_MACROMAN;
-
- // Japanese
- static codecAliasList m_codecAliases_SHIFT_JIS;
- static codecAliasList m_codecAliases_EUC_JP;
- static codecAliasList m_codecAliases_ISO_2022_JP;
-
- // Traditional Chinese
- static codecAliasList m_codecAliases_BIG5;
- static codecAliasList m_codecAliases_BIG5_HKSCS;
- static codecAliasList m_codecAliases_CP950;
-
- // Korean
- static codecAliasList m_codecAliases_ISO_2022_KR;
- static codecAliasList m_codecAliases_CP949;
- static codecAliasList m_codecAliases_EUC_KR;
-
- // Arabic
- static codecAliasList m_codecAliases_ISO_8859_6;
- static codecAliasList m_codecAliases_CP1256;
-
- // Hebrew
- static codecAliasList m_codecAliases_ISO_8859_8;
- static codecAliasList m_codecAliases_CP1255;
-
- // Greek
- static codecAliasList m_codecAliases_ISO_8859_7;
- static codecAliasList m_codecAliases_CP869;
- static codecAliasList m_codecAliases_WINDOWS_1253;
-
- // Cyrillic
- static codecAliasList m_codecAliases_ISO_8859_5;
- static codecAliasList m_codecAliases_KOI8_R;
- static codecAliasList m_codecAliases_CP866;
- static codecAliasList m_codecAliases_KOI8_U;
- static codecAliasList m_codecAliases_WINDOWS_1251;
- static codecAliasList m_codecAliases_MACCYRILLIC;
-
- // Thai
- static codecAliasList m_codecAliases_CP874;
- static codecAliasList m_codecAliases_TIS_620;
-
- // Simplified Chinese
- static codecAliasList m_codecAliases_GBK;
- static codecAliasList m_codecAliases_HZ;
- static codecAliasList m_codecAliases_GB18030;
- static codecAliasList m_codecAliases_EUC_CN;
- static codecAliasList m_codecAliases_2312_80;
-
- // Central European
- static codecAliasList m_codecAliases_ISO_8859_2;
- static codecAliasList m_codecAliases_CP1250;
- static codecAliasList m_codecAliases_MACCENTRALEUROPE;
-
- // Vietnamese
- static codecAliasList m_codecAliases_CP1258;
-
- // Turkish
- static codecAliasList m_codecAliases_CP1254;
- static codecAliasList m_codecAliases_ISO_8859_9;
-
- // Baltic
- static codecAliasList m_codecAliases_CP1257;
- static codecAliasList m_codecAliases_ISO_8859_4;
-
- static gconstpointer const m_iconvBaseCodecList[];
- static gconstpointer const m_iconvExtendedCodecList[];
-
+ mutable PlatformRefPtr<GCharsetConverter> m_iconvDecoder;
+ mutable PlatformRefPtr<GCharsetConverter> m_iconvEncoder;
};
} // namespace WebCore
diff --git a/WebCore/platform/win/COMPtr.h b/WebCore/platform/win/COMPtr.h
index 6b84256..95b53af 100644
--- a/WebCore/platform/win/COMPtr.h
+++ b/WebCore/platform/win/COMPtr.h
@@ -30,10 +30,13 @@
#define NOMINMAX
#endif
-#include <guiddef.h>
#include <unknwn.h>
-#include <WTF/Assertions.h>
-#include <WTF/HashTraits.h>
+#include <wtf/Assertions.h>
+#include <wtf/HashTraits.h>
+
+#if !OS(WINCE)
+#include <guiddef.h>
+#endif
typedef long HRESULT;
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 7a54737..f467d65 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -56,6 +56,7 @@
#include <wininet.h>
#include <wtf/RefPtr.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringConcatenate.h>
#include <wtf/text/StringHash.h>
using namespace std;
@@ -64,9 +65,6 @@ namespace WebCore {
using namespace HTMLNames;
-// format string for
-static const char szShellDotUrlTemplate[] = "[InternetShortcut]\r\nURL=%s\r\n";
-
// We provide the IE clipboard types (URL and Text), and the clipboard types specified in the WHATWG Web Applications 1.0 draft
// see http://www.whatwg.org/specs/web-apps/current-work/ Section 6.3.5.3
@@ -163,36 +161,19 @@ static String filesystemPathFromUrlOrTitle(const String& url, const String& titl
return result;
}
-static HGLOBAL createGlobalURLContent(const String& url, int estimatedFileSize)
+static HGLOBAL createGlobalURLContent(const CString& content)
{
HRESULT hr = S_OK;
HGLOBAL memObj = 0;
char* fileContents;
- char ansiUrl[INTERNET_MAX_URL_LENGTH + 1];
- // Used to generate the buffer. This is null terminated whereas the fileContents won't be.
- char contentGenerationBuffer[INTERNET_MAX_URL_LENGTH + ARRAYSIZE(szShellDotUrlTemplate) + 1];
-
- if (estimatedFileSize > 0 && estimatedFileSize > ARRAYSIZE(contentGenerationBuffer))
- return 0;
-
- int ansiUrlSize = ::WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)url.characters(), url.length(), ansiUrl, ARRAYSIZE(ansiUrl) - 1, 0, 0);
- if (!ansiUrlSize)
- return 0;
- ansiUrl[ansiUrlSize] = 0;
-
- int fileSize = (int) (ansiUrlSize+strlen(szShellDotUrlTemplate)-2); // -2 to remove the %s
- ASSERT(estimatedFileSize < 0 || fileSize == estimatedFileSize);
-
- memObj = GlobalAlloc(GPTR, fileSize);
+ memObj = GlobalAlloc(GPTR, content.length());
if (!memObj)
return 0;
fileContents = (PSTR)GlobalLock(memObj);
-
- sprintf_s(contentGenerationBuffer, ARRAYSIZE(contentGenerationBuffer), szShellDotUrlTemplate, ansiUrl);
- CopyMemory(fileContents, contentGenerationBuffer, fileSize);
+ CopyMemory(fileContents, content.data(), content.length());
GlobalUnlock(memObj);
@@ -277,7 +258,7 @@ static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, Share
return memObj;
}
-static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& title, int& /*out*/ estimatedSize)
+static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& title, const CString& content)
{
HRESULT hr = S_OK;
HGLOBAL memObj = 0;
@@ -290,10 +271,7 @@ static HGLOBAL createGlobalUrlFileDescriptor(const String& url, const String& ti
memset(fgd, 0, sizeof(FILEGROUPDESCRIPTOR));
fgd->cItems = 1;
fgd->fgd[0].dwFlags = FD_FILESIZE;
- int fileSize = ::WideCharToMultiByte(CP_ACP, 0, url.characters(), url.length(), 0, 0, 0, 0);
- fileSize += strlen(szShellDotUrlTemplate) - 2; // -2 is for getting rid of %s in the template string
- fgd->fgd[0].nFileSizeLow = fileSize;
- estimatedSize = fileSize;
+ fgd->fgd[0].nFileSizeLow = content.length();
fsPath = filesystemPathFromUrlOrTitle(url, title, L".URL", true);
if (fsPath.length() <= 0) {
@@ -744,13 +722,15 @@ void ClipboardWin::writeURL(const KURL& kurl, const String& titleStr, Frame*)
return;
WebCore::writeURL(m_writableDataObject.get(), kurl, titleStr, true, true);
- int estimatedSize = 0;
String url = kurl.string();
+ ASSERT(url.containsOnlyASCII()); // KURL::string() is URL encoded.
+
+ CString content = makeString("[InternetShortcut]\r\nURL=", url, "\r\n").ascii();
- HGLOBAL urlFileDescriptor = createGlobalUrlFileDescriptor(url, titleStr, estimatedSize);
+ HGLOBAL urlFileDescriptor = createGlobalUrlFileDescriptor(url, titleStr, content);
if (!urlFileDescriptor)
return;
- HGLOBAL urlFileContent = createGlobalURLContent(url, estimatedSize);
+ HGLOBAL urlFileContent = createGlobalURLContent(content);
if (!urlFileContent) {
GlobalFree(urlFileDescriptor);
return;
diff --git a/WebCore/platform/win/ContextMenuItemWin.cpp b/WebCore/platform/win/ContextMenuItemWin.cpp
index e265c96..ade0db0 100644
--- a/WebCore/platform/win/ContextMenuItemWin.cpp
+++ b/WebCore/platform/win/ContextMenuItemWin.cpp
@@ -31,6 +31,18 @@
#include <wtf/text/CString.h>
#include <windows.h>
+#if OS(WINCE)
+#ifndef MFS_DISABLED
+#define MFS_DISABLED MF_GRAYED
+#endif
+#ifndef MIIM_FTYPE
+#define MIIM_FTYPE MIIM_TYPE
+#endif
+#ifndef MIIM_STRING
+#define MIIM_STRING 0
+#endif
+#endif
+
namespace WebCore {
ContextMenuItem::ContextMenuItem(LPMENUITEMINFO item)
diff --git a/WebCore/platform/win/FileSystemWin.cpp b/WebCore/platform/win/FileSystemWin.cpp
index 4b7a692..2cca08c 100644
--- a/WebCore/platform/win/FileSystemWin.cpp
+++ b/WebCore/platform/win/FileSystemWin.cpp
@@ -192,8 +192,8 @@ CString openTemporaryFile(const char*, PlatformFileHandle& handle)
handle = INVALID_HANDLE_VALUE;
char tempPath[MAX_PATH];
- int tempPathLength = ::GetTempPathA(_countof(tempPath), tempPath);
- if (tempPathLength <= 0 || tempPathLength > _countof(tempPath))
+ int tempPathLength = ::GetTempPathA(WTF_ARRAY_LENGTH(tempPath), tempPath);
+ if (tempPathLength <= 0 || tempPathLength > WTF_ARRAY_LENGTH(tempPath))
return CString();
HCRYPTPROV hCryptProv = 0;
diff --git a/WebCore/platform/wince/FileSystemWinCE.cpp b/WebCore/platform/wince/FileSystemWinCE.cpp
index 2a27089..90b278e 100644
--- a/WebCore/platform/wince/FileSystemWinCE.cpp
+++ b/WebCore/platform/wince/FileSystemWinCE.cpp
@@ -174,8 +174,8 @@ CString openTemporaryFile(const char*, PlatformFileHandle& handle)
handle = INVALID_HANDLE_VALUE;
wchar_t tempPath[MAX_PATH];
- int tempPathLength = ::GetTempPath(_countof(tempPath), tempPath);
- if (tempPathLength <= 0 || tempPathLength > _countof(tempPath))
+ int tempPathLength = ::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath);
+ if (tempPathLength <= 0 || tempPathLength > WTF_ARRAY_LENGTH(tempPath))
return CString();
HCRYPTPROV hCryptProv = 0;
diff --git a/WebCore/platform/wince/TemporaryLinkStubs.cpp b/WebCore/platform/wince/TemporaryLinkStubs.cpp
new file mode 100644
index 0000000..dbd62dc
--- /dev/null
+++ b/WebCore/platform/wince/TemporaryLinkStubs.cpp
@@ -0,0 +1,37 @@
+/*
+ * 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 "CookieStorage.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+void setCookieStoragePrivateBrowsingEnabled(bool)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp
index 368c83e..b9e154a 100644
--- a/WebCore/plugins/PluginDatabase.cpp
+++ b/WebCore/plugins/PluginDatabase.cpp
@@ -284,26 +284,26 @@ String PluginDatabase::MIMETypeForExtension(const String& extension) const
PluginPackage* PluginDatabase::findPlugin(const KURL& url, String& mimeType)
{
- PluginPackage* plugin = pluginForMIMEType(mimeType);
- String filename = url.string();
-
+ if (!mimeType.isEmpty())
+ return pluginForMIMEType(mimeType);
+
+ String filename = url.lastPathComponent();
+ if (filename.endsWith("/"))
+ return 0;
+
+ int extensionPos = filename.reverseFind('.');
+ if (extensionPos == -1)
+ return 0;
+
+ String mimeTypeForExtension = MIMETypeForExtension(filename.substring(extensionPos + 1));
+ PluginPackage* plugin = pluginForMIMEType(mimeTypeForExtension);
if (!plugin) {
- String filename = url.lastPathComponent();
- if (!filename.endsWith("/")) {
- int extensionPos = filename.reverseFind('.');
- if (extensionPos != -1) {
- String extension = filename.substring(extensionPos + 1);
-
- String mimeTypeForExtension = MIMETypeForExtension(extension);
- if ((plugin = pluginForMIMEType(mimeTypeForExtension)))
- mimeType = mimeTypeForExtension;
- }
- }
+ // FIXME: if no plugin could be found, query Windows for the mime type
+ // corresponding to the extension.
+ return 0;
}
-
- // FIXME: if no plugin could be found, query Windows for the mime type
- // corresponding to the extension.
-
+
+ mimeType = mimeTypeForExtension;
return plugin;
}
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp
index 2e0308b..10149bf 100644
--- a/WebCore/plugins/PluginPackage.cpp
+++ b/WebCore/plugins/PluginPackage.cpp
@@ -348,7 +348,7 @@ unsigned PluginPackage::hash() const
m_lastModified
};
- return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b)
diff --git a/WebCore/plugins/PluginStream.cpp b/WebCore/plugins/PluginStream.cpp
index a6486c9..4d73789 100644
--- a/WebCore/plugins/PluginStream.cpp
+++ b/WebCore/plugins/PluginStream.cpp
@@ -428,7 +428,6 @@ void PluginStream::didReceiveResponse(NetscapePlugInStreamLoader* loader, const
void PluginStream::didReceiveData(NetscapePlugInStreamLoader* loader, const char* data, int length)
{
ASSERT(loader == m_loader);
- ASSERT(length > 0);
ASSERT(m_streamState == StreamStarted);
// If the plug-in cancels the stream in deliverData it could be deleted,
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index 6954af3..80641a1 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -790,7 +790,7 @@ bool PluginView::platformStart()
g_signal_connect(platformPluginWidget(), "plug-added", G_CALLBACK(plugAddedCallback), this);
g_signal_connect(platformPluginWidget(), "plug-removed", G_CALLBACK(plugRemovedCallback), NULL);
} else
- setPlatformWidget(gtk_xtbin_new(gtk_widget_get_window(pageClient), 0));
+ setPlatformWidget(gtk_xtbin_new(pageClient, 0));
#else
setPlatformWidget(gtk_socket_new());
gtk_container_add(GTK_CONTAINER(pageClient), platformPluginWidget());
diff --git a/WebCore/plugins/gtk/gtk2xtbin.c b/WebCore/plugins/gtk/gtk2xtbin.c
index 31c564f..f668bff 100644
--- a/WebCore/plugins/gtk/gtk2xtbin.c
+++ b/WebCore/plugins/gtk/gtk2xtbin.c
@@ -322,13 +322,14 @@ gtk_xtbin_realize (GtkWidget *widget)
GtkWidget*
-gtk_xtbin_new (GdkWindow *parent_window, String * f)
+gtk_xtbin_new (GtkWidget *parent_widget, String *f)
{
GtkXtBin *xtbin;
gpointer user_data;
GdkScreen *screen;
GdkVisual* visual;
Colormap colormap;
+ GdkWindow* parent_window = gtk_widget_get_window(parent_widget);
assert(parent_window != NULL);
xtbin = g_object_new (GTK_TYPE_XTBIN, NULL);
@@ -342,7 +343,7 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
/* Initialize the Xt toolkit */
xtbin->parent_window = parent_window;
- screen = gtk_widget_get_screen(GTK_WIDGET(parent_window));
+ screen = gtk_widget_get_screen(parent_widget);
visual = gdk_screen_get_system_visual(screen);
colormap = XCreateColormap(GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(screen)),
GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen)),
diff --git a/WebCore/plugins/gtk/gtk2xtbin.h b/WebCore/plugins/gtk/gtk2xtbin.h
index 7bcfab6..11f6e06 100644
--- a/WebCore/plugins/gtk/gtk2xtbin.h
+++ b/WebCore/plugins/gtk/gtk2xtbin.h
@@ -101,7 +101,7 @@ struct _GtkXtBinClass
};
GTKXTBIN_API(GType) gtk_xtbin_get_type (void);
-GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
+GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GtkWidget *parent_widget, String *f);
GTKXTBIN_API(void) gtk_xtbin_set_position (GtkXtBin *xtbin,
gint x,
gint y);
diff --git a/WebCore/plugins/win/PluginDatabaseWin.cpp b/WebCore/plugins/win/PluginDatabaseWin.cpp
index 6cbcdc8..27121c6 100644
--- a/WebCore/plugins/win/PluginDatabaseWin.cpp
+++ b/WebCore/plugins/win/PluginDatabaseWin.cpp
@@ -34,10 +34,6 @@
#include <windows.h>
#include <shlwapi.h>
-#if COMPILER(MINGW)
-#define _countof(x) (sizeof(x)/sizeof(x[0]))
-#endif
-
#if OS(WINCE)
// WINCE doesn't support Registry Key Access Rights. The parameter should always be 0
#ifndef KEY_ENUMERATE_SUB_KEYS
@@ -96,7 +92,7 @@ static inline void addPluginPathsFromRegistry(HKEY rootKey, HashSet<String>& pat
// Enumerate subkeys
for (int i = 0;; i++) {
- DWORD nameLen = _countof(name);
+ DWORD nameLen = WTF_ARRAY_LENGTH(name);
result = RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified);
if (result != ERROR_SUCCESS)
@@ -257,9 +253,9 @@ static inline void addWindowsMediaPlayerPluginDirectory(Vector<String>& director
#if !OS(WINCE)
// The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs
WCHAR pluginDirectoryStr[_MAX_PATH + 1];
- DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, _countof(pluginDirectoryStr));
+ DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
- if (pluginDirectorySize > 0 && pluginDirectorySize <= _countof(pluginDirectoryStr))
+ if (pluginDirectorySize > 0 && pluginDirectorySize <= WTF_ARRAY_LENGTH(pluginDirectoryStr))
directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1));
#endif
@@ -410,7 +406,7 @@ static inline void addMacromediaPluginDirectories(Vector<String>& directories)
#if !OS(WINCE)
WCHAR systemDirectoryStr[MAX_PATH];
- if (GetSystemDirectory(systemDirectoryStr, _countof(systemDirectoryStr)) == 0)
+ if (!GetSystemDirectory(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
return;
WCHAR macromediaDirectoryStr[MAX_PATH];
diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp
index f3dd781..74bd2a9 100644
--- a/WebCore/plugins/win/PluginPackageWin.cpp
+++ b/WebCore/plugins/win/PluginPackageWin.cpp
@@ -312,7 +312,7 @@ unsigned PluginPackage::hash() const
m_mimeToExtensions.size()
};
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b)
diff --git a/WebCore/rendering/InlineBox.cpp b/WebCore/rendering/InlineBox.cpp
index 2028d4e..1ce68f9 100644
--- a/WebCore/rendering/InlineBox.cpp
+++ b/WebCore/rendering/InlineBox.cpp
@@ -23,7 +23,7 @@
#include "HitTestResult.h"
#include "InlineFlowBox.h"
#include "RenderArena.h"
-#include "RenderBox.h"
+#include "RenderBlock.h"
#include "RootInlineBox.h"
using namespace std;
@@ -279,6 +279,30 @@ int InlineBox::placeEllipsisBox(bool, int, int, int, bool&)
return -1;
}
+void InlineBox::adjustForFlippedBlocksWritingMode(IntPoint& point)
+{
+ if (!renderer()->style()->isFlippedBlocksWritingMode())
+ return;
+
+ RenderBlock* block = root()->block();
+ if (block->style()->isHorizontalWritingMode())
+ point.setY(block->height() - height() - point.y());
+ else
+ point.setX(block->width() - width() - point.x());
+}
+
+void InlineBox::adjustForFlippedBlocksWritingMode(IntRect& rect)
+{
+ if (!renderer()->style()->isFlippedBlocksWritingMode())
+ return;
+
+ RenderBlock* block = root()->block();
+ if (block->style()->isHorizontalWritingMode())
+ rect.setY(block->height() - rect.bottom());
+ else
+ rect.setX(block->width() - rect.right());
+}
+
} // namespace WebCore
#ifndef NDEBUG
diff --git a/WebCore/rendering/InlineBox.h b/WebCore/rendering/InlineBox.h
index 38a7805..1e4b8bf 100644
--- a/WebCore/rendering/InlineBox.h
+++ b/WebCore/rendering/InlineBox.h
@@ -216,6 +216,9 @@ public:
void setY(int y) { m_y = y; }
int y() const { return m_y; }
+ int width() const { return m_isVertical ? logicalHeight() : logicalWidth(); }
+ int height() const { return m_isVertical ? logicalWidth() : logicalHeight(); }
+
// 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; }
int logicalRight() const { return logicalLeft() + logicalWidth(); }
@@ -229,6 +232,7 @@ public:
// 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; }
+ int logicalBottom() const { return logicalTop() + logicalHeight(); }
void setLogicalTop(int top)
{
if (!m_isVertical)
@@ -286,6 +290,9 @@ public:
return 0;
}
+ void adjustForFlippedBlocksWritingMode(IntPoint&);
+ void adjustForFlippedBlocksWritingMode(IntRect&);
+
private:
InlineBox* m_next; // The next element on the same line as us.
InlineBox* m_prev; // The previous element on the same line as us.
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index 79c571d..d165231 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -299,8 +299,8 @@ int InlineFlowBox::placeBoxesInInlineDirection(int logicalLeft, bool& needsWordS
int textShadowLogicalLeft;
int textShadowLogicalRight;
rt->style(m_firstLine)->getTextShadowInlineDirectionExtent(textShadowLogicalLeft, textShadowLogicalRight);
- childOverflowLogicalLeft = min(childOverflowLogicalLeft, textShadowLogicalLeft);
- childOverflowLogicalRight = max(childOverflowLogicalRight, textShadowLogicalRight);
+ childOverflowLogicalLeft = min(childOverflowLogicalLeft, textShadowLogicalLeft + logicalLeftGlyphOverflow);
+ childOverflowLogicalRight = max(childOverflowLogicalRight, textShadowLogicalRight + logicalRightGlyphOverflow);
logicalLeftVisualOverflow = min(logicalLeft + childOverflowLogicalLeft, logicalLeftVisualOverflow);
logicalRightVisualOverflow = max(logicalLeft + text->logicalWidth() + childOverflowLogicalRight, logicalRightVisualOverflow);
@@ -562,12 +562,14 @@ void InlineFlowBox::flipLinesInBlockDirection(int lineTop, int lineBottom)
void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, bool strictMode, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
+ bool isFlippedLine = renderer()->style(m_firstLine)->isFlippedLinesWritingMode();
+
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.
- int topOverflow = max(y(), lineTop);
- int bottomOverflow = min(y() + boxHeight, lineBottom);
+ int topOverflow = max(logicalTop(), lineTop);
+ int bottomOverflow = min(logicalTop() + boxHeight, lineBottom);
int topLayoutOverflow = topOverflow;
int bottomLayoutOverflow = bottomOverflow;
@@ -579,10 +581,10 @@ void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, b
if (parent()) {
int boxShadowTop;
int boxShadowBottom;
- renderer()->style(m_firstLine)->getBoxShadowVerticalExtent(boxShadowTop, boxShadowBottom);
+ renderer()->style(m_firstLine)->getBoxShadowBlockDirectionExtent(boxShadowTop, boxShadowBottom);
- topVisualOverflow = min(y() + boxShadowTop, topVisualOverflow);
- bottomVisualOverflow = max(y() + boxHeight + boxShadowBottom, bottomVisualOverflow);
+ topVisualOverflow = min(logicalTop() + boxShadowTop, topVisualOverflow);
+ bottomVisualOverflow = max(logicalTop() + boxHeight + boxShadowBottom, bottomVisualOverflow);
}
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
@@ -600,39 +602,53 @@ void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, b
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(static_cast<InlineTextBox*>(curr));
GlyphOverflow* glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->second.second;
- int topGlyphOverflow = -strokeOverflow - (glyphOverflow ? glyphOverflow->top : 0);
- int bottomGlyphOverflow = strokeOverflow + (glyphOverflow ? glyphOverflow->bottom : 0);
+ int topGlyphEdge = glyphOverflow ? (isFlippedLine ? glyphOverflow->bottom : glyphOverflow->top) : 0;
+ int bottomGlyphEdge = glyphOverflow ? (isFlippedLine ? glyphOverflow->top : glyphOverflow->bottom) : 0;
- int childOverflowTop = topGlyphOverflow;
- int childOverflowBottom = bottomGlyphOverflow;
- for (const ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next()) {
- childOverflowTop = min(childOverflowTop, shadow->y() - shadow->blur() + topGlyphOverflow);
- childOverflowBottom = max(childOverflowBottom, shadow->y() + shadow->blur() + bottomGlyphOverflow);
- }
-
- topVisualOverflow = min(curr->y() + childOverflowTop, topVisualOverflow);
- bottomVisualOverflow = max(curr->y() + text->logicalHeight() + childOverflowBottom, bottomVisualOverflow);
+ int topGlyphOverflow = -strokeOverflow - topGlyphEdge;
+ int bottomGlyphOverflow = strokeOverflow + bottomGlyphEdge;
+
+ int textShadowTop;
+ int textShadowBottom;
+ curr->renderer()->style(m_firstLine)->getTextShadowBlockDirectionExtent(textShadowTop, textShadowBottom);
+
+ int childOverflowTop = min(textShadowTop + topGlyphOverflow, topGlyphOverflow);
+ int childOverflowBottom = max(textShadowBottom + bottomGlyphOverflow, bottomGlyphOverflow);
+
+ topVisualOverflow = min(curr->logicalTop() + childOverflowTop, topVisualOverflow);
+ bottomVisualOverflow = max(curr->logicalTop() + text->logicalHeight() + childOverflowBottom, bottomVisualOverflow);
} else if (curr->renderer()->isRenderInline()) {
InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
flow->computeBlockDirectionOverflow(lineTop, lineBottom, strictMode, textBoxDataMap);
- topLayoutOverflow = min(topLayoutOverflow, flow->topLayoutOverflow());
- bottomLayoutOverflow = max(bottomLayoutOverflow, flow->bottomLayoutOverflow());
- topVisualOverflow = min(topVisualOverflow, flow->topVisualOverflow());
- bottomVisualOverflow = max(bottomVisualOverflow, flow->bottomVisualOverflow());
+ topLayoutOverflow = min(topLayoutOverflow, flow->logicalTopLayoutOverflow());
+ bottomLayoutOverflow = max(bottomLayoutOverflow, flow->logicalBottomLayoutOverflow());
+ topVisualOverflow = min(topVisualOverflow, flow->logicalTopVisualOverflow());
+ bottomVisualOverflow = max(bottomVisualOverflow, flow->logicalBottomVisualOverflow());
} else if (!curr->boxModelObject()->hasSelfPaintingLayer()){
// Only include overflow from replaced inlines if they do not paint themselves.
+ int boxLogicalTop = curr->logicalTop();
+ int childTopLayoutOverflow;
+ int childBottomLayoutOverflow;
+ int childTopVisualOverflow;
+ int childBottomVisualOverflow;
+
RenderBox* box = toRenderBox(curr->renderer());
- int boxY = curr->y();
- int childTopOverflow = box->hasOverflowClip() ? 0 : box->topLayoutOverflow();
- int childBottomOverflow = box->hasOverflowClip() ? curr->logicalHeight() : box->bottomLayoutOverflow();
- topLayoutOverflow = min(boxY + childTopOverflow, topLayoutOverflow);
- bottomLayoutOverflow = max(boxY + childBottomOverflow, bottomLayoutOverflow);
- topVisualOverflow = min(boxY + box->topVisualOverflow(), topVisualOverflow);
- bottomVisualOverflow = max(boxY + box->bottomVisualOverflow(), bottomVisualOverflow);
+ box->blockDirectionOverflow(isVertical(), childTopLayoutOverflow, childBottomLayoutOverflow,
+ childTopVisualOverflow, childBottomVisualOverflow);
+
+ if (box->hasOverflowClip()) {
+ childTopLayoutOverflow = 0;
+ childBottomLayoutOverflow = curr->logicalHeight();
+ }
+
+ topLayoutOverflow = min(boxLogicalTop + childTopLayoutOverflow, topLayoutOverflow);
+ bottomLayoutOverflow = max(boxLogicalTop + childBottomLayoutOverflow, bottomLayoutOverflow);
+ topVisualOverflow = min(boxLogicalTop + childTopVisualOverflow, topVisualOverflow);
+ bottomVisualOverflow = max(boxLogicalTop + childBottomVisualOverflow, bottomVisualOverflow);
}
}
- setBlockDirectionOverflowPositions(topLayoutOverflow, bottomLayoutOverflow, topVisualOverflow, bottomVisualOverflow, boxHeight);
+ setBlockDirectionOverflowPositions(topLayoutOverflow, bottomLayoutOverflow, topVisualOverflow, bottomVisualOverflow);
}
bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
@@ -651,7 +667,7 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
}
// Now check ourselves.
- IntRect rect(tx + m_x, ty + m_y, m_logicalWidth, logicalHeight());
+ IntRect rect(tx + m_x, ty + m_y, width(), height());
if (visibleToHitTesting() && rect.intersects(result.rectForPoint(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))
@@ -665,6 +681,7 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty)
{
IntRect overflowRect(visibleOverflowRect());
overflowRect.inflate(renderer()->maximalOutlineSize(paintInfo.phase));
+ adjustForFlippedBlocksWritingMode(overflowRect);
overflowRect.move(tx, ty);
if (!paintInfo.rect.intersects(overflowRect))
@@ -701,11 +718,8 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty)
paintMask(paintInfo, tx, ty);
return;
} else {
- // 1. Paint our background, border and box-shadow.
+ // Paint our background, border and box-shadow.
paintBoxDecorations(paintInfo, tx, ty);
-
- // 2. Paint our underline and overline.
- paintTextDecorations(paintInfo, tx, ty, false);
}
}
@@ -717,17 +731,13 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty)
childInfo.phase = paintPhase;
childInfo.updatePaintingRootForChildren(renderer());
- // 3. Paint our children.
+ // Paint our children.
if (paintPhase != PaintPhaseSelfOutline) {
for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
if (curr->renderer()->isText() || !curr->boxModelObject()->hasSelfPaintingLayer())
curr->paint(childInfo, tx, ty);
}
}
-
- // 4. Paint our strike-through
- if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)
- paintTextDecorations(paintInfo, tx, ty, true);
}
void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, int _tx, int _ty, int w, int h, CompositeOperator op)
@@ -746,23 +756,26 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, c
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, tx, ty, w, h, this, op);
else {
// We have a fill image that spans multiple lines.
- // We need to adjust _tx and _ty by the width of all previous lines.
+ // We need to adjust tx and ty by the width of all previous lines.
// Think of background painting on inlines as though you had one long line, a single continuous
// strip. Even though that strip has been broken up across multiple lines, you still paint it
// as though you had one single line. This means each line has to pick up the background where
// the previous line left off.
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
- int xOffsetOnLine = 0;
+ int logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->logicalWidth();
- int startX = tx - xOffsetOnLine;
- int totalWidth = xOffsetOnLine;
+ logicalOffsetOnLine += curr->logicalWidth();
+ int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->logicalWidth();
+ totalLogicalWidth += curr->logicalWidth();
+ int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
+ int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
+ int stripWidth = isVertical() ? width() : totalLogicalWidth;
+ int stripHeight = isVertical() ? totalLogicalWidth : height();
paintInfo.context->save();
- paintInfo.context->clip(IntRect(tx, ty, logicalWidth(), logicalHeight()));
- boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, startX, ty, totalWidth, h, this, op);
+ paintInfo.context->clip(IntRect(tx, ty, width(), height()));
+ boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, stripX, stripY, stripWidth, stripHeight, this, op);
paintInfo.context->restore();
}
}
@@ -800,8 +813,10 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
}
// Move x/y to our coordinates.
- tx += x;
- ty += y;
+ IntPoint localPoint(x, y);
+ adjustForFlippedBlocksWritingMode(localPoint);
+ tx += localPoint.x();
+ ty += localPoint.y();
GraphicsContext* context = paintInfo.context;
@@ -833,23 +848,26 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
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.
+ // We need to adjust tx and ty by the width of all previous lines.
// Think of border image painting on inlines as though you had one long line, a single continuous
// strip. Even though that strip has been broken up across multiple lines, you still paint it
// as though you had one single line. This means each line has to pick up the image where
// the previous line left off.
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
- int xOffsetOnLine = 0;
+ int logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->logicalWidth();
- int startX = tx - xOffsetOnLine;
- int totalWidth = xOffsetOnLine;
+ logicalOffsetOnLine += curr->logicalWidth();
+ int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->logicalWidth();
+ totalLogicalWidth += curr->logicalWidth();
+ int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
+ int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
+ int stripWidth = isVertical() ? w : totalLogicalWidth;
+ int stripHeight = isVertical() ? totalLogicalWidth : h;
context->save();
context->clip(IntRect(tx, ty, w, h));
- boxModelObject()->paintBorder(context, startX, ty, totalWidth, h, renderer()->style());
+ boxModelObject()->paintBorder(context, stripX, stripY, stripWidth, stripHeight, renderer()->style());
context->restore();
}
}
@@ -878,8 +896,10 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
}
// Move x/y to our coordinates.
- tx += x;
- ty += y;
+ IntPoint localPoint(x, y);
+ adjustForFlippedBlocksWritingMode(localPoint);
+ tx += localPoint.x();
+ ty += localPoint.y();
const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage();
StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image();
@@ -913,16 +933,19 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
} else {
// We have a mask image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
- int xOffsetOnLine = 0;
+ int logicalOffsetOnLine = 0;
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
- xOffsetOnLine += curr->logicalWidth();
- int startX = tx - xOffsetOnLine;
- int totalWidth = xOffsetOnLine;
+ logicalOffsetOnLine += curr->logicalWidth();
+ int totalLogicalWidth = logicalOffsetOnLine;
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
- totalWidth += curr->logicalWidth();
+ totalLogicalWidth += curr->logicalWidth();
+ int stripX = tx - (isVertical() ? 0 : logicalOffsetOnLine);
+ int stripY = ty - (isVertical() ? logicalOffsetOnLine : 0);
+ int stripWidth = isVertical() ? w : totalLogicalWidth;
+ int stripHeight = isVertical() ? totalLogicalWidth : h;
paintInfo.context->save();
paintInfo.context->clip(IntRect(tx, ty, w, h));
- boxModelObject()->paintNinePieceImage(paintInfo.context, startX, ty, totalWidth, h, renderer()->style(), maskNinePieceImage, compositeOp);
+ boxModelObject()->paintNinePieceImage(paintInfo.context, stripX, stripY, stripWidth, stripHeight, renderer()->style(), maskNinePieceImage, compositeOp);
paintInfo.context->restore();
}
@@ -930,163 +953,6 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
paintInfo.context->endTransparencyLayer();
}
-static bool shouldDrawTextDecoration(RenderObject* obj)
-{
- for (RenderObject* curr = obj->firstChild(); curr; curr = curr->nextSibling()) {
- if (curr->isRenderInline())
- return true;
- if (curr->isText() && !curr->isBR()) {
- if (!curr->style()->collapseWhiteSpace())
- return true;
- Node* currElement = curr->node();
- if (!currElement)
- return true;
- if (!currElement->isTextNode())
- return true;
- if (!static_cast<Text*>(currElement)->containsOnlyWhitespace())
- return true;
- }
- }
- return false;
-}
-
-void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, bool paintedChildren)
-{
- // Paint text decorations like underlines/overlines. We only do this if we aren't in quirks mode (i.e., in
- // almost-strict mode or strict mode).
- if (renderer()->document()->inQuirksMode() || !paintInfo.shouldPaintWithinRoot(renderer()) ||
- renderer()->style()->visibility() != VISIBLE)
- return;
-
- // We don't want underlines or other decorations when we're trying to draw nothing but the selection as white text.
- if (paintInfo.phase == PaintPhaseSelection && paintInfo.forceBlackText)
- return;
-
- GraphicsContext* context = paintInfo.context;
- tx += m_x;
- ty += m_y;
- RenderStyle* styleToUse = renderer()->style(m_firstLine);
- int deco = parent() ? styleToUse->textDecoration() : styleToUse->textDecorationsInEffect();
- if (deco != TDNONE &&
- ((!paintedChildren && ((deco & UNDERLINE) || (deco & OVERLINE))) || (paintedChildren && (deco & LINE_THROUGH))) &&
- shouldDrawTextDecoration(renderer())) {
- 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()->logicalWidth();
- bool ltr = renderer()->style()->isLeftToRightDirection();
- if (rootLine == this) {
- // Trim w and x so that the underline isn't drawn underneath the ellipsis.
- // ltr: is our right edge farther right than the right edge of the ellipsis.
- // rtl: is the left edge of our box farther left than the left edge of the ellipsis.
- bool ltrTruncation = ltr && (x + w >= ellipsisX + ellipsisWidth);
- bool rtlTruncation = !ltr && (x <= ellipsisX + ellipsisWidth);
- if (ltrTruncation)
- w -= (x + w) - (ellipsisX + ellipsisWidth);
- else if (rtlTruncation) {
- int dx = m_x - ((ellipsisX - m_x) + ellipsisWidth);
- tx -= dx;
- w += dx;
- }
- } else {
- bool ltrPastEllipsis = ltr && x >= ellipsisX;
- bool rtlPastEllipsis = !ltr && (x + w) <= (ellipsisX + ellipsisWidth);
- if (ltrPastEllipsis || rtlPastEllipsis)
- return;
-
- bool ltrTruncation = ltr && x + w >= ellipsisX;
- bool rtlTruncation = !ltr && x <= ellipsisX;
- if (ltrTruncation)
- w -= (x + w - ellipsisX);
- else if (rtlTruncation) {
- int dx = m_x - ((ellipsisX - m_x) + ellipsisWidth);
- tx -= dx;
- w += dx;
- }
- }
- }
-
- // We must have child boxes and have decorations defined.
- tx += borderLogicalLeft() + paddingLogicalLeft();
-
- Color underline, overline, linethrough;
- underline = overline = linethrough = styleToUse->visitedDependentColor(CSSPropertyColor);
- if (!parent())
- renderer()->getTextDecorationColors(deco, underline, overline, linethrough);
-
- bool isPrinting = renderer()->document()->printing();
- context->setStrokeThickness(1.0f); // FIXME: We should improve this rule and not always just assume 1.
-
- bool paintUnderline = deco & UNDERLINE && !paintedChildren;
- bool paintOverline = deco & OVERLINE && !paintedChildren;
- bool paintLineThrough = deco & LINE_THROUGH && paintedChildren;
-
- bool linesAreOpaque = !isPrinting && (!paintUnderline || underline.alpha() == 255) && (!paintOverline || overline.alpha() == 255) && (!paintLineThrough || linethrough.alpha() == 255);
-
- int baselinePos = renderer()->style(m_firstLine)->font().ascent();
- if (!isRootInlineBox())
- baselinePos += boxModelObject()->borderTop() + boxModelObject()->paddingTop();
-
- bool setClip = false;
- int extraOffset = 0;
- const ShadowData* shadow = styleToUse->textShadow();
- if (!linesAreOpaque && shadow && shadow->next()) {
- IntRect clipRect(tx, ty, w, baselinePos + 2);
- for (const ShadowData* s = shadow; s; s = s->next()) {
- IntRect shadowRect(tx, ty, w, baselinePos + 2);
- shadowRect.inflate(s->blur());
- shadowRect.move(s->x(), s->y());
- clipRect.unite(shadowRect);
- extraOffset = max(extraOffset, max(0, s->y()) + s->blur());
- }
- context->save();
- context->clip(clipRect);
- extraOffset += baselinePos + 2;
- ty += extraOffset;
- setClip = true;
- }
-
- ColorSpace colorSpace = renderer()->style()->colorSpace();
- bool setShadow = false;
- do {
- if (shadow) {
- if (!shadow->next()) {
- // The last set of lines paints normally inside the clip.
- ty -= extraOffset;
- extraOffset = 0;
- }
- context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace);
- setShadow = true;
- shadow = shadow->next();
- }
-
- if (paintUnderline) {
- context->setStrokeColor(underline, colorSpace);
- context->setStrokeStyle(SolidStroke);
- // Leave one pixel of white between the baseline and the underline.
- context->drawLineForText(IntPoint(tx, ty + baselinePos + 1), w, isPrinting);
- }
- if (paintOverline) {
- context->setStrokeColor(overline, colorSpace);
- context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty), w, isPrinting);
- }
- if (paintLineThrough) {
- context->setStrokeColor(linethrough, colorSpace);
- context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty + 2 * baselinePos / 3), w, isPrinting);
- }
- } while (shadow);
-
- if (setClip)
- context->restore();
- else if (setShadow)
- context->clearShadow();
- }
-}
-
InlineBox* InlineFlowBox::firstLeafChild() const
{
InlineBox* leaf = 0;
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index ee16a0f..a168f98 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -96,7 +96,6 @@ public:
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int w, int h, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int w, int h, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, int tx, int ty, int w, int h);
- virtual void paintTextDecorations(PaintInfo&, int tx, int ty, bool paintedChildren = false);
virtual void paint(PaintInfo&, int tx, int ty);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
@@ -175,32 +174,43 @@ public:
void checkConsistency() const;
void setHasBadChildList();
+ // Line visual and layout overflow are in the coordinate space of the block. This means that - unlike other unprefixed uses of the words
+ // top/right/bottom/left in the code - these aren't purely physical directions. For horizontal-tb and vertical-lr they will match physical
+ // directions, but for horizontal-bt and vertical-rl, the top/bottom and left/right respectively are inverted when compared to
+ // their physical counterparts.
int topVisibleOverflow() const { return std::min(topLayoutOverflow(), topVisualOverflow()); }
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_logicalWidth, logicalHeight()); }
+ int logicalTopVisibleOverflow() const { return std::min(logicalTopLayoutOverflow(), logicalTopVisualOverflow()); }
+ int logicalBottomVisibleOverflow() const { return std::max(logicalBottomLayoutOverflow(), logicalBottomVisualOverflow()); }
+
+ IntRect visibleOverflowRect() const { return m_overflow ? m_overflow->visibleOverflowRect() : IntRect(m_x, m_y, width(), height()); }
int topLayoutOverflow() const { return m_overflow ? m_overflow->topLayoutOverflow() : m_y; }
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_logicalWidth; }
- IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
+ IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, width(), height()); }
int logicalLeftLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? leftLayoutOverflow() : topLayoutOverflow(); }
int logicalRightLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? rightLayoutOverflow() : bottomLayoutOverflow(); }
-
+ int logicalTopLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? topVisualOverflow() : leftVisualOverflow(); }
+ int logicalBottomLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? bottomLayoutOverflow() : rightLayoutOverflow(); }
+
int topVisualOverflow() const { return m_overflow ? m_overflow->topVisualOverflow() : m_y; }
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_logicalWidth; }
- IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, m_logicalWidth, logicalHeight()); }
+ IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, width(), height()); }
int logicalLeftVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? leftVisualOverflow() : topVisualOverflow(); }
int logicalRightVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? rightVisualOverflow() : bottomVisualOverflow(); }
-
+ int logicalTopVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? topVisualOverflow() : leftVisualOverflow(); }
+ int logicalBottomVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? bottomVisualOverflow() : rightVisualOverflow(); }
+
void setInlineDirectionOverflowPositions(int logicalLeftLayoutOverflow, int logicalRightLayoutOverflow,
int logicalLeftVisualOverflow, int logicalRightVisualOverflow);
void setBlockDirectionOverflowPositions(int logicalTopLayoutOverflow, int logicalBottomLayoutOverflow,
- int logicalTopVisualOverflow, int logicalBottomVisualOverflow, int boxLogicalHeight);
+ int logicalTopVisualOverflow, int logicalBottomVisualOverflow);
protected:
OwnPtr<RenderOverflow> m_overflow;
@@ -230,8 +240,8 @@ inline void InlineFlowBox::setInlineDirectionOverflowPositions(int logicalLeftLa
&& logicalLeftVisualOverflow == logicalLeft() && logicalRightVisualOverflow == logicalRight())
return;
- int width = isVertical() ? m_renderer->style(m_firstLine)->font().height() : logicalWidth();
- int height = isVertical() ? logicalWidth() : m_renderer->style(m_firstLine)->font().height();
+ int width = isVertical() ? logicalHeight() : logicalWidth();
+ int height = isVertical() ? logicalWidth() : logicalHeight();
m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width, height)));
}
@@ -249,18 +259,31 @@ inline void InlineFlowBox::setInlineDirectionOverflowPositions(int logicalLeftLa
}
}
-inline void InlineFlowBox::setBlockDirectionOverflowPositions(int topLayoutOverflow, int bottomLayoutOverflow, int topVisualOverflow, int bottomVisualOverflow, int boxHeight)
+inline void InlineFlowBox::setBlockDirectionOverflowPositions(int logicalTopLayoutOverflow, int logicalBottomLayoutOverflow,
+ int logicalTopVisualOverflow, int logicalBottomVisualOverflow)
{
if (!m_overflow) {
- if (topLayoutOverflow == m_y && bottomLayoutOverflow == m_y + boxHeight && topVisualOverflow == m_y && bottomVisualOverflow == m_y + boxHeight)
+ if (logicalTopLayoutOverflow == logicalTop() && logicalBottomLayoutOverflow == logicalBottom()
+ && logicalTopVisualOverflow == logicalTop() && logicalBottomVisualOverflow == logicalBottom())
return;
- m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, m_logicalWidth, boxHeight)));
+
+ int width = isVertical() ? logicalHeight() : logicalWidth();
+ int height = isVertical() ? logicalWidth() : logicalHeight();
+
+ m_overflow = adoptPtr(new RenderOverflow(IntRect(m_x, m_y, width, height)));
}
- m_overflow->setTopLayoutOverflow(topLayoutOverflow);
- m_overflow->setBottomLayoutOverflow(bottomLayoutOverflow);
- m_overflow->setTopVisualOverflow(topVisualOverflow);
- m_overflow->setBottomVisualOverflow(bottomVisualOverflow);
+ if (!isVertical()) {
+ m_overflow->setTopLayoutOverflow(logicalTopLayoutOverflow);
+ m_overflow->setBottomLayoutOverflow(logicalBottomLayoutOverflow);
+ m_overflow->setTopVisualOverflow(logicalTopVisualOverflow);
+ m_overflow->setBottomVisualOverflow(logicalBottomVisualOverflow);
+ } else {
+ m_overflow->setLeftLayoutOverflow(logicalTopLayoutOverflow);
+ m_overflow->setRightLayoutOverflow(logicalBottomLayoutOverflow);
+ m_overflow->setLeftVisualOverflow(logicalTopVisualOverflow);
+ m_overflow->setRightVisualOverflow(logicalBottomVisualOverflow);
+ }
}
#ifdef NDEBUG
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index cf100e0..43b025a 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -154,12 +154,19 @@ IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
}
IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride),
- IntPoint(tx + m_x, ty + selTop), selHeight, sPos, ePos));
- if (r.x() > tx + m_x + m_logicalWidth)
- r.setWidth(0);
- else if (r.right() - 1 > tx + m_x + m_logicalWidth)
- r.setWidth(tx + m_x + m_logicalWidth - r.x());
- return r;
+ IntPoint(), selHeight, sPos, ePos));
+
+ int logicalWidth = r.width();
+ if (r.x() > m_logicalWidth)
+ logicalWidth = 0;
+ else if (r.right() > m_logicalWidth)
+ logicalWidth = m_logicalWidth - r.x();
+
+ IntPoint topPoint = m_isVertical ? IntPoint(tx + selTop, ty + m_y + r.x()) : IntPoint(tx + m_x + r.x(), ty + selTop);
+ int width = m_isVertical ? selHeight : logicalWidth;
+ int height = m_isVertical ? logicalWidth : selHeight;
+
+ return IntRect(topPoint, IntSize(width, height));
}
void InlineTextBox::deleteLine(RenderArena* arena)
@@ -302,7 +309,7 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, in
if (isLineBreak())
return false;
- IntRect rect(tx + m_x, ty + m_y, m_logicalWidth, logicalHeight());
+ IntRect rect(tx + m_x, ty + m_y, width(), height());
if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
@@ -311,13 +318,15 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, in
return false;
}
-FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context, const ShadowData* shadow, const FloatRect& textRect, bool stroked, bool opaque)
+FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context, const ShadowData* shadow, const FloatRect& textRect, bool stroked, bool opaque, bool vertical)
{
if (!shadow)
return FloatSize();
FloatSize extraOffset;
- FloatSize shadowOffset(shadow->x(), shadow->y());
+ int shadowX = vertical ? shadow->y() : shadow->x();
+ int shadowY = vertical ? -shadow->x() : shadow->y();
+ FloatSize shadowOffset(shadowX, shadowY);
int shadowBlur = shadow->blur();
const Color& shadowColor = shadow->color();
@@ -336,7 +345,8 @@ FloatSize InlineTextBox::applyShadowToGraphicsContext(GraphicsContext* context,
return extraOffset;
}
-static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, int x, int y, int w, int h, const ShadowData* shadow, bool stroked)
+static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin,
+ const IntRect& boxRect, const ShadowData* shadow, bool stroked, bool vertical)
{
Color fillColor = context->fillColor();
ColorSpace fillColorSpace = context->fillColorSpace();
@@ -347,7 +357,7 @@ static void paintTextWithShadows(GraphicsContext* context, const Font& font, con
do {
IntSize extraOffset;
if (shadow)
- extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsContext(context, shadow, FloatRect(x, y, w, h), stroked, opaque));
+ extraOffset = roundedIntSize(InlineTextBox::applyShadowToGraphicsContext(context, shadow, boxRect, stroked, opaque, vertical));
else if (!opaque)
context->setFillColor(fillColor, fillColorSpace);
@@ -375,18 +385,22 @@ static void paintTextWithShadows(GraphicsContext* context, const Font& font, con
void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
{
if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE ||
- m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline)
+ m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline || !m_len)
return;
ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines);
// 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()->logicalWidth());
- int xPos = tx + m_x - leftOverflow;
- int w = logicalWidth() + leftOverflow + rightOverflow;
- if (xPos >= paintInfo.rect.right() || xPos + w <= paintInfo.rect.x())
+ int logicalLeftOverflow = parent()->logicalLeft() - parent()->logicalLeftVisualOverflow();
+ int logicalRightOverflow = parent()->logicalRightVisualOverflow() - (parent()->logicalLeft() + parent()->logicalWidth());
+ int logicalStart = logicalLeft() - logicalLeftOverflow + (isVertical() ? ty : tx);
+ int logicalExtent = logicalWidth() + logicalLeftOverflow + logicalRightOverflow;
+
+ int paintEnd = isVertical() ? paintInfo.rect.bottom() : paintInfo.rect.right();
+ int paintStart = isVertical() ? paintInfo.rect.y() : paintInfo.rect.x();
+
+ if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart)
return;
bool isPrinting = textRenderer()->document()->printing();
@@ -410,18 +424,39 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
int widthOfVisibleText = toRenderText(renderer())->width(m_start, m_truncation, textPos(), m_firstLine);
int widthOfHiddenText = m_logicalWidth - widthOfVisibleText;
// FIXME: The hit testing logic also needs to take this translation int account.
- tx += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText;
+ if (!m_isVertical)
+ tx += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText;
+ else
+ ty += isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText;
}
}
GraphicsContext* context = paintInfo.context;
+ RenderStyle* styleToUse = renderer()->style(m_firstLine);
+
+ ty -= styleToUse->isHorizontalWritingMode() ? 0 : logicalHeight();
+
+ IntPoint boxOrigin(m_x, m_y);
+ adjustForFlippedBlocksWritingMode(boxOrigin);
+ boxOrigin.move(tx, ty);
+
+ IntPoint textOrigin = IntPoint(boxOrigin.x(), boxOrigin.y() + styleToUse->font().ascent());
+ IntRect boxRect(boxOrigin, IntSize(logicalWidth(), logicalHeight()));
+
+ if (m_isVertical) {
+ context->save();
+ context->translate(boxRect.x(), boxRect.bottom());
+ context->rotate(static_cast<float>(deg2rad(90.)));
+ context->translate(-boxRect.x(), -boxRect.bottom());
+ }
+
+
// Determine whether or not we have composition underlines to draw.
bool containsComposition = renderer()->node() && renderer()->frame()->editor()->compositionNode() == renderer()->node();
bool useCustomUnderlines = containsComposition && renderer()->frame()->editor()->compositionUsesCustomUnderlines();
// Set our font.
- RenderStyle* styleToUse = renderer()->style(m_firstLine);
int d = styleToUse->textDecorationsInEffect();
const Font& font = styleToUse->font();
@@ -435,20 +470,17 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
#endif
if (containsComposition && !useCustomUnderlines)
- paintCompositionBackground(context, tx, ty, styleToUse, font,
+ paintCompositionBackground(context, boxOrigin, styleToUse, font,
renderer()->frame()->editor()->compositionStart(),
renderer()->frame()->editor()->compositionEnd());
- paintDocumentMarkers(context, tx, ty, styleToUse, font, true);
+ paintDocumentMarkers(context, boxOrigin, styleToUse, font, true);
if (haveSelection && !useCustomUnderlines)
- paintSelection(context, tx, ty, styleToUse, font);
+ paintSelection(context, boxOrigin, styleToUse, font);
}
// 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
- if (m_len <= 0)
- return;
-
Color textFillColor;
Color textStrokeColor;
float textStrokeWidth = styleToUse->textStrokeWidth();
@@ -517,8 +549,6 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
if (hasHyphen())
adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length);
- int baseline = renderer()->style(m_firstLine)->font().ascent();
- IntPoint textOrigin(m_x + tx, m_y + ty + baseline);
TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || styleToUse->visuallyOrdered());
int sPos = 0;
@@ -541,9 +571,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, logicalWidth(), logicalHeight(), textShadow, textStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, 0, length, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, m_isVertical);
} else
- paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, m_x + tx, m_y + ty, logicalWidth(), logicalHeight(), textShadow, textStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, ePos, sPos, length, textOrigin, boxRect, textShadow, textStrokeWidth > 0, m_isVertical);
if (textStrokeWidth > 0)
context->restore();
@@ -555,20 +585,20 @@ 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, logicalWidth(), logicalHeight(), selectionShadow, selectionStrokeWidth > 0);
+ paintTextWithShadows(context, font, textRun, sPos, ePos, length, textOrigin, boxRect, selectionShadow, selectionStrokeWidth > 0, m_isVertical);
if (selectionStrokeWidth > 0)
context->restore();
}
// Paint decorations
- if (d != TDNONE && paintInfo.phase != PaintPhaseSelection && renderer()->document()->inQuirksMode()) {
- context->setStrokeColor(styleToUse->visitedDependentColor(CSSPropertyColor), styleToUse->colorSpace());
- paintDecoration(context, tx, ty, d, textShadow);
+ if (d != TDNONE && paintInfo.phase != PaintPhaseSelection) {
+ updateGraphicsContext(context, textFillColor, textStrokeColor, textStrokeWidth, styleToUse->colorSpace());
+ paintDecoration(context, boxOrigin, d, textShadow);
}
if (paintInfo.phase == PaintPhaseForeground) {
- paintDocumentMarkers(context, tx, ty, styleToUse, font, false);
+ paintDocumentMarkers(context, boxOrigin, styleToUse, font, false);
if (useCustomUnderlines) {
const Vector<CompositionUnderline>& underlines = renderer()->frame()->editor()->customCompositionUnderlines();
@@ -585,7 +615,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
if (underline.startOffset <= end()) {
// underline intersects this run. Paint it.
- paintCompositionUnderline(context, tx, ty, underline);
+ paintCompositionUnderline(context, boxOrigin, underline);
if (underline.endOffset > end() + 1)
// underline also runs into the next run. Bail now, no more marker advancement.
break;
@@ -595,6 +625,9 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty)
}
}
}
+
+ if (m_isVertical)
+ context->restore();
}
void InlineTextBox::selectionStartEnd(int& sPos, int& ePos)
@@ -615,7 +648,7 @@ void InlineTextBox::selectionStartEnd(int& sPos, int& ePos)
ePos = min(endPos - m_start, (int)m_len);
}
-void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, RenderStyle* style, const Font& font)
+void InlineTextBox::paintSelection(GraphicsContext* context, const IntPoint& boxOrigin, RenderStyle* style, const Font& font)
{
// See if we have a selection to paint at all.
int sPos, ePos;
@@ -635,8 +668,7 @@ void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, Ren
context->save();
updateGraphicsContext(context, c, c, 0, style->colorSpace()); // Don't draw text at all!
- int y = selectionTop();
- int h = selectionHeight();
+
// If the text is truncated, let the thing being painted in the truncation
// draw its own highlight.
int length = m_truncation != cNoTruncation ? m_truncation : m_len;
@@ -648,14 +680,17 @@ void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, Ren
ePos = length;
}
- context->clip(IntRect(m_x + tx, y + ty, m_logicalWidth, h));
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+ IntPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
+ context->clip(IntRect(localOrigin, IntSize(m_logicalWidth, selHeight)));
context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
- IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos);
+ localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
context->restore();
}
-void InlineTextBox::paintCompositionBackground(GraphicsContext* context, int tx, int ty, RenderStyle* style, const Font& font, int startPos, int endPos)
+void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const IntPoint& boxOrigin, RenderStyle* style, const Font& font, int startPos, int endPos)
{
int offset = m_start;
int sPos = max(startPos - offset, 0);
@@ -670,11 +705,12 @@ void InlineTextBox::paintCompositionBackground(GraphicsContext* context, int tx,
updateGraphicsContext(context, c, c, 0, style->colorSpace()); // Don't draw text at all!
- int y = selectionTop();
- int h = selectionHeight();
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+ IntPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
context->drawHighlightForText(font, TextRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd,
!isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered()),
- IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos);
+ localOrigin, selHeight, c, style->colorSpace(), sPos, ePos);
context->restore();
}
@@ -698,19 +734,18 @@ void InlineTextBox::paintCustomHighlight(int tx, int ty, const AtomicString& typ
#endif
-void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, int deco, const ShadowData* shadow)
+void InlineTextBox::paintDecoration(GraphicsContext* context, const IntPoint& boxOrigin, int deco, const ShadowData* shadow)
{
- tx += m_x;
- ty += m_y;
-
if (m_truncation == cFullTruncation)
return;
+ IntPoint localOrigin = boxOrigin;
+
int width = m_logicalWidth;
if (m_truncation != cNoTruncation) {
width = toRenderText(renderer())->width(m_start, m_truncation, textPos(), m_firstLine);
if (!isLeftToRightDirection())
- tx += (m_logicalWidth - width);
+ localOrigin.move(m_logicalWidth - width, 0);
}
// Get the text decoration colors.
@@ -723,24 +758,27 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
bool linesAreOpaque = !isPrinting && (!(deco & UNDERLINE) || underline.alpha() == 255) && (!(deco & OVERLINE) || overline.alpha() == 255) && (!(deco & LINE_THROUGH) || linethrough.alpha() == 255);
- int baseline = renderer()->style(m_firstLine)->font().ascent();
+ RenderStyle* styleToUse = renderer()->style(m_firstLine);
+ int baseline = styleToUse->font().ascent();
bool setClip = false;
int extraOffset = 0;
if (!linesAreOpaque && shadow && shadow->next()) {
context->save();
- IntRect clipRect(tx, ty, width, baseline + 2);
+ IntRect clipRect(localOrigin, IntSize(width, baseline + 2));
for (const ShadowData* s = shadow; s; s = s->next()) {
- IntRect shadowRect(tx, ty, width, baseline + 2);
+ IntRect shadowRect(localOrigin, IntSize(width, baseline + 2));
shadowRect.inflate(s->blur());
- shadowRect.move(s->x(), s->y());
+ int shadowX = m_isVertical ? s->y() : s->x();
+ int shadowY = m_isVertical ? -s->x() : s->y();
+ shadowRect.move(shadowX, shadowY);
clipRect.unite(shadowRect);
- extraOffset = max(extraOffset, max(0, s->y()) + s->blur());
+ extraOffset = max(extraOffset, max(0, shadowY) + s->blur());
}
context->save();
context->clip(clipRect);
extraOffset += baseline + 2;
- ty += extraOffset;
+ localOrigin.move(0, extraOffset);
setClip = true;
}
@@ -751,10 +789,12 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
if (shadow) {
if (!shadow->next()) {
// The last set of lines paints normally inside the clip.
- ty -= extraOffset;
+ localOrigin.move(0, -extraOffset);
extraOffset = 0;
}
- context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace);
+ int shadowX = m_isVertical ? shadow->y() : shadow->x();
+ int shadowY = m_isVertical ? -shadow->x() : shadow->y();
+ context->setShadow(IntSize(shadowX, shadowY - extraOffset), shadow->blur(), shadow->color(), colorSpace);
setShadow = true;
shadow = shadow->next();
}
@@ -763,17 +803,17 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
context->setStrokeColor(underline, colorSpace);
context->setStrokeStyle(SolidStroke);
// Leave one pixel of white between the baseline and the underline.
- context->drawLineForText(IntPoint(tx, ty + baseline + 1), width, isPrinting);
+ context->drawLineForText(IntPoint(localOrigin.x(), localOrigin.y() + baseline + 1), width, isPrinting);
}
if (deco & OVERLINE) {
context->setStrokeColor(overline, colorSpace);
context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty), width, isPrinting);
+ context->drawLineForText(localOrigin, width, isPrinting);
}
if (deco & LINE_THROUGH) {
context->setStrokeColor(linethrough, colorSpace);
context->setStrokeStyle(SolidStroke);
- context->drawLineForText(IntPoint(tx, ty + 2 * baseline / 3), width, isPrinting);
+ context->drawLineForText(IntPoint(localOrigin.x(), localOrigin.y() + 2 * baseline / 3), width, isPrinting);
}
} while (shadow);
@@ -798,7 +838,7 @@ static GraphicsContext::TextCheckingLineStyle textCheckingLineStyleForMarkerType
}
}
-void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, int ty, const DocumentMarker& marker, RenderStyle* style, const Font& font, bool grammar)
+void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, const IntPoint& boxOrigin, const DocumentMarker& marker, RenderStyle* style, const Font& font, bool grammar)
{
// Never print spelling/grammar markers (5327887)
if (textRenderer()->document()->printing())
@@ -827,18 +867,19 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in
endPosition = min<int>(endPosition, m_truncation);
// Calculate start & width
- IntPoint startPoint(tx + m_x, ty + selectionTop());
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+ IntPoint startPoint(boxOrigin.x(), boxOrigin.y() - deltaY);
TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
- int h = selectionHeight();
-
- IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, h, startPosition, endPosition));
+
+ IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, startPoint, selHeight, startPosition, endPosition));
start = markerRect.x() - startPoint.x();
width = markerRect.width();
// Store rendered rects for bad grammar markers, so we can hit-test against it elsewhere in order to
// display a toolTip. We don't do this for misspelling markers.
if (grammar) {
- markerRect.move(-tx, -ty);
+ markerRect.move(-boxOrigin.x(), -boxOrigin.y());
markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
renderer()->document()->markers()->setRenderedRectForMarker(renderer()->node(), marker, markerRect);
}
@@ -861,25 +902,25 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in
// In larger fonts, though, place the underline up near the baseline to prevent a big gap.
underlineOffset = baseline + 2;
}
- pt->drawLineForTextChecking(IntPoint(tx + m_x + start, ty + m_y + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type));
+ pt->drawLineForTextChecking(IntPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type));
}
-void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, int tx, int ty, const DocumentMarker& marker, RenderStyle* style, const Font& font)
+void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, const IntPoint& boxOrigin, const DocumentMarker& marker, RenderStyle* style, const Font& font)
{
// Use same y positioning and height as for selection, so that when the selection and this highlight are on
// the same word there are no pieces sticking out.
- int y = selectionTop();
- int h = selectionHeight();
-
+ int deltaY = logicalTop() - selectionTop();
+ int selHeight = selectionHeight();
+
int sPos = max(marker.startOffset - m_start, (unsigned)0);
int ePos = min(marker.endOffset - m_start, (unsigned)m_len);
TextRun run(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, !isLeftToRightDirection(), m_dirOverride || style->visuallyOrdered());
// Always compute and store the rect associated with this marker. The computed rect is in absolute coordinates.
- IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(m_x, y), h, sPos, ePos));
+ IntRect markerRect = enclosingIntRect(font.selectionRectForText(run, IntPoint(m_x, selectionTop()), selHeight, sPos, ePos));
markerRect = renderer()->localToAbsoluteQuad(FloatRect(markerRect)).enclosingBoundingBox();
renderer()->document()->markers()->setRenderedRectForMarker(renderer()->node(), marker, markerRect);
-
+
// Optionally highlight the text
if (renderer()->frame()->editor()->markedTextMatchesAreHighlighted()) {
Color color = marker.activeMatch ?
@@ -887,13 +928,13 @@ 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_logicalWidth, h));
- pt->drawHighlightForText(font, run, IntPoint(m_x + tx, y + ty), h, color, style->colorSpace(), sPos, ePos);
+ pt->clip(IntRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_logicalWidth, selHeight));
+ pt->drawHighlightForText(font, run, IntPoint(boxOrigin.x(), boxOrigin.y() - deltaY), selHeight, color, style->colorSpace(), sPos, ePos);
pt->restore();
}
}
-void InlineTextBox::computeRectForReplacementMarker(int /*tx*/, int /*ty*/, const DocumentMarker& marker, RenderStyle* style, const Font& font)
+void InlineTextBox::computeRectForReplacementMarker(const DocumentMarker& marker, RenderStyle* style, const Font& font)
{
// Replacement markers are not actually drawn, but their rects need to be computed for hit testing.
int y = selectionTop();
@@ -910,7 +951,7 @@ void InlineTextBox::computeRectForReplacementMarker(int /*tx*/, int /*ty*/, cons
renderer()->document()->markers()->setRenderedRectForMarker(renderer()->node(), marker, markerRect);
}
-void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, RenderStyle* style, const Font& font, bool background)
+void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const IntPoint& boxOrigin, RenderStyle* style, const Font& font, bool background)
{
if (!renderer()->node())
return;
@@ -954,17 +995,17 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re
// marker intersects this run. Paint it.
switch (marker.type) {
case DocumentMarker::Spelling:
- paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false);
+ paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, false);
break;
case DocumentMarker::Grammar:
- paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, true);
+ paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, true);
break;
case DocumentMarker::TextMatch:
- paintTextMatchMarker(pt, tx, ty, marker, style, font);
+ paintTextMatchMarker(pt, boxOrigin, marker, style, font);
break;
case DocumentMarker::CorrectionIndicator:
- computeRectForReplacementMarker(tx, ty, marker, style, font);
- paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false);
+ computeRectForReplacementMarker(marker, style, font);
+ paintSpellingOrGrammarMarker(pt, boxOrigin, marker, style, font, false);
break;
case DocumentMarker::Replacement:
case DocumentMarker::RejectedCorrection:
@@ -977,11 +1018,8 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re
}
-void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, int tx, int ty, const CompositionUnderline& underline)
+void InlineTextBox::paintCompositionUnderline(GraphicsContext* ctx, const IntPoint& boxOrigin, const CompositionUnderline& underline)
{
- tx += m_x;
- ty += m_y;
-
if (m_truncation == cFullTruncation)
return;
@@ -1022,7 +1060,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 + logicalHeight() - lineThickness), width, textRenderer()->document()->printing());
+ ctx->drawLineForText(IntPoint(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness), width, textRenderer()->document()->printing());
}
int InlineTextBox::caretMinOffset() const
diff --git a/WebCore/rendering/InlineTextBox.h b/WebCore/rendering/InlineTextBox.h
index f010c39..9c4c72f 100644
--- a/WebCore/rendering/InlineTextBox.h
+++ b/WebCore/rendering/InlineTextBox.h
@@ -127,7 +127,7 @@ public:
bool containsCaretOffset(int offset) const; // false for offset after line break
// Needs to be public, so the static paintTextWithShadows() function can use it.
- static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque);
+ static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque, bool vertical);
private:
InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
@@ -140,19 +140,19 @@ private:
// denote no truncation (the whole run paints) and full truncation (nothing paints at all).
protected:
- void paintCompositionBackground(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&, int startPos, int endPos);
- void paintDocumentMarkers(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&, bool background);
- void paintCompositionUnderline(GraphicsContext*, int tx, int ty, const CompositionUnderline&);
+ void paintCompositionBackground(GraphicsContext*, const IntPoint& boxOrigin, RenderStyle*, const Font&, int startPos, int endPos);
+ void paintDocumentMarkers(GraphicsContext*, const IntPoint& boxOrigin, RenderStyle*, const Font&, bool background);
+ void paintCompositionUnderline(GraphicsContext*, const IntPoint& boxOrigin, const CompositionUnderline&);
#if PLATFORM(MAC)
void paintCustomHighlight(int tx, int ty, const AtomicString& type);
#endif
private:
- void paintDecoration(GraphicsContext*, int tx, int ty, int decoration, const ShadowData*);
- void paintSelection(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&);
- void paintSpellingOrGrammarMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&, bool grammar);
- void paintTextMatchMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&);
- void computeRectForReplacementMarker(int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&);
+ void paintDecoration(GraphicsContext*, const IntPoint& boxOrigin, int decoration, const ShadowData*);
+ void paintSelection(GraphicsContext*, const IntPoint& boxOrigin, RenderStyle*, const Font&);
+ void paintSpellingOrGrammarMarker(GraphicsContext*, const IntPoint& boxOrigin, const DocumentMarker&, RenderStyle*, const Font&, bool grammar);
+ void paintTextMatchMarker(GraphicsContext*, const IntPoint& boxOrigin, const DocumentMarker&, RenderStyle*, const Font&);
+ void computeRectForReplacementMarker(const DocumentMarker&, RenderStyle*, const Font&);
};
inline RenderText* InlineTextBox::textRenderer() const
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index d951277..e4ac673 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -260,7 +260,6 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
updateBeforeAfterContent(BEFORE);
updateBeforeAfterContent(AFTER);
}
- updateFirstLetter();
}
void RenderBlock::updateBeforeAfterContent(PseudoId pseudoId)
@@ -2284,8 +2283,10 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
}
}
+ IntPoint childPoint(tx, ty);
+ adjustForFlippedBlocksWritingMode(child, childPoint, ParentToChildFlippingAdjustment);
if (!child->hasSelfPaintingLayer() && !child->isFloating())
- child->paint(info, tx, ty);
+ child->paint(info, childPoint.x(), childPoint.y());
// Check for page-break-after: always, and if it's set, break and bail.
bool checkAfterAlways = !childrenInline() && (usePrintRect && child->style()->pageBreakAfter() == PBALWAYS);
@@ -2418,18 +2419,19 @@ void RenderBlock::paintFloats(PaintInfo& paintInfo, int tx, int ty, bool preserv
if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer()) {
PaintInfo currentPaintInfo(paintInfo);
currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
- int currentTX = tx + r->left() - r->m_renderer->x() + r->m_renderer->marginLeft();
- int currentTY = ty + r->top() - r->m_renderer->y() + r->m_renderer->marginTop();
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ IntPoint childPoint(tx + r->left() + r->m_renderer->marginLeft() - r->m_renderer->x(),
+ ty + r->top() + r->m_renderer->marginTop() - r->m_renderer->y());
+ adjustForFlippedBlocksWritingMode(r->m_renderer, childPoint, ParentToChildFlippingAdjustment);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
if (!preservePhase) {
currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
currentPaintInfo.phase = PaintPhaseFloat;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
currentPaintInfo.phase = PaintPhaseForeground;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
currentPaintInfo.phase = PaintPhaseOutline;
- r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
+ r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
}
}
}
@@ -4052,14 +4054,10 @@ 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 = availableLogicalWidth();
- if (child->minPreferredLogicalWidth() > availableWidth)
- return 0;
-
int y = yPos;
while (true) {
int widthAtY = availableLogicalWidthForLine(y, false);
- if (widthAtY == availableWidth)
+ if (widthAtY == availableLogicalWidth())
return y - yPos;
int oldChildY = child->y();
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 66c8659..4956fc0 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -181,6 +181,8 @@ public:
int collapsedMarginBeforeForChild(RenderBox* child) const;
int collapsedMarginAfterForChild(RenderBox* child) const;
+ virtual void updateFirstLetter();
+
class MarginValues {
public:
MarginValues(int beforePos, int beforeNeg, int afterPos, int afterNeg)
@@ -269,8 +271,6 @@ protected:
virtual int firstLineBoxBaseline() const;
virtual int lastLineBoxBaseline() const;
- virtual void updateFirstLetter();
-
virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
// Delay update scrollbar until finishDelayRepaint() will be
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index ce84d31..0b2387d 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -215,6 +215,7 @@ InlineFlowBox* RenderBlock::createLineBoxes(RenderObject* obj, bool firstLine)
ASSERT(newBox->isInlineFlowBox());
parentBox = static_cast<InlineFlowBox*>(newBox);
parentBox->setFirstLineStyleBit(firstLine);
+ parentBox->setIsVertical(!style()->isHorizontalWritingMode());
constructedNewBox = true;
}
@@ -1013,7 +1014,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica
trailingFloatsLineBox->setConstructed();
GlyphOverflowAndFallbackFontsMap textBoxDataMap;
trailingFloatsLineBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap);
- trailingFloatsLineBox->setBlockDirectionOverflowPositions(logicalHeight(), bottomLayoutOverflow, logicalHeight(), bottomVisualOverflow, 0);
+ trailingFloatsLineBox->setBlockDirectionOverflowPositions(logicalHeight(), bottomLayoutOverflow, logicalHeight(), bottomVisualOverflow);
trailingFloatsLineBox->setBlockLogicalHeight(logicalHeight());
}
if (lastFloat) {
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index ac40ee9..ebd965f 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -309,19 +309,29 @@ void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
}
}
+ bool isBodyRenderer = isBody();
+ bool isRootRenderer = isRoot();
+
// Set the text color if we're the body.
- if (isBody())
+ if (isBodyRenderer)
document()->setTextColor(style()->visitedDependentColor(CSSPropertyColor));
- else if (isRoot() && (!oldStyle || oldStyle->writingMode() != style()->writingMode() || oldStyle->direction() != style()->direction())) {
- // Propagate the new block flow and direction up to the RenderView.
- // FIXME: WinIE seems to propagate from the <body> as well. We may want to consider doing that at some point.
+
+ if ((isRootRenderer || isBodyRenderer) && (!oldStyle || oldStyle->writingMode() != style()->writingMode() || oldStyle->direction() != style()->direction())) {
+ // Propagate the new writing mode and direction up to the RenderView.
RenderView* viewRenderer = view();
RenderStyle* viewStyle = viewRenderer->style();
- if (viewStyle->writingMode() != style()->writingMode() || viewStyle->direction() != style()->direction()) {
- viewStyle->setWritingMode(style()->writingMode());
+ if (isRootRenderer || !document()->directionSetOnDocumentElement()) {
viewStyle->setDirection(style()->direction());
- viewRenderer->setNeedsLayoutAndPrefWidthsRecalc();
+ if (isBodyRenderer)
+ document()->documentElement()->renderer()->style()->setDirection(style()->direction());
}
+
+ if (isRootRenderer || !document()->writingModeSetOnDocumentElement()) {
+ viewStyle->setWritingMode(style()->writingMode());
+ if (isBodyRenderer)
+ document()->documentElement()->renderer()->style()->setWritingMode(style()->writingMode());
+ }
+ setNeedsLayoutAndPrefWidthsRecalc();
}
}
@@ -3243,4 +3253,51 @@ int RenderBox::baselinePosition(bool /*firstLine*/, LineDirectionMode direction,
return 0;
}
+void RenderBox::blockDirectionOverflow(bool isLineVertical, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow,
+ int& logicalTopVisualOverflow, int& logicalBottomVisualOverflow)
+{
+ if (isLineVertical) {
+ logicalTopLayoutOverflow = leftLayoutOverflow();
+ logicalBottomLayoutOverflow = rightLayoutOverflow();
+ logicalTopVisualOverflow = leftVisualOverflow();
+ logicalBottomVisualOverflow = rightVisualOverflow();
+ } else {
+ logicalTopLayoutOverflow = topLayoutOverflow();
+ logicalBottomLayoutOverflow = bottomLayoutOverflow();
+ logicalTopVisualOverflow = topVisualOverflow();
+ logicalBottomVisualOverflow = bottomVisualOverflow();
+ }
+}
+
+void RenderBox::adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint& point, FlippingAdjustment adjustment)
+{
+ if (!style()->isFlippedBlocksWritingMode())
+ return;
+
+ // The child is going to add in its x() and y(), so we have to make sure it ends up in
+ // the right place.
+ if (style()->isHorizontalWritingMode())
+ point.move(0, height() - child->height() - child->y() - (adjustment == ParentToChildFlippingAdjustment ? child->y() : 0));
+ else
+ point.move(width() - child->width() - child->x() - (adjustment == ParentToChildFlippingAdjustment ? child->x() : 0), 0);
+}
+
+int RenderBox::convertFromFlippedWritingMode(int logicalPosition)
+{
+ if (!style()->isFlippedBlocksWritingMode())
+ return logicalPosition;
+ return logicalHeight() - logicalPosition;
+}
+
+IntSize RenderBox::locationOffsetIncludingFlipping()
+{
+ if (!parent() || !parent()->isBox())
+ return locationOffset();
+
+ RenderBox* parent = parentBox();
+ IntPoint localPoint(x(), y());
+ parent->adjustForFlippedBlocksWritingMode(this, localPoint, ChildToParentFlippingAdjustment);
+ return IntSize(localPoint.x(), localPoint.y());
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 2e37657..bcf95e9 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -155,6 +155,9 @@ public:
void addOverflowFromChild(RenderBox* child, const IntSize& delta);
void clearLayoutOverflow();
+ void blockDirectionOverflow(bool isLineVertical, int& logicalTopLayoutOverflow, int& logicalBottomLayoutOverflow,
+ int& logicalTopVisualOverflow, int& logicalBottomVisualOverflow);
+
int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
int contentLogicalWidth() const { return style()->isHorizontalWritingMode() ? contentWidth() : contentHeight(); }
@@ -281,7 +284,7 @@ public:
bool stretchesToViewport() const
{
- return document()->inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody()) && !isWritingModeRoot();
+ return document()->inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody());
}
virtual IntSize intrinsicSize() const { return IntSize(); }
@@ -374,9 +377,16 @@ public:
virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
int getVisibleWidth() const { return m_visibleWidth; }
#endif
+=======
+ enum FlippingAdjustment { ChildToParentFlippingAdjustment, ParentToChildFlippingAdjustment };
+ void adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint&, FlippingAdjustment);
+ int convertFromFlippedWritingMode(int position);
+ IntSize locationOffsetIncludingFlipping();
+>>>>>>> webkit.org at r70949
protected:
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index ec065a6..e83b709 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -524,10 +524,23 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
IntSize topLeft, topRight, bottomLeft, bottomRight;
style()->getBorderRadiiForRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- context->addRoundedRectClip(borderRect, includeLeftEdge ? topLeft : IntSize(),
- includeRightEdge ? topRight : IntSize(),
- includeLeftEdge ? bottomLeft : IntSize(),
- includeRightEdge ? bottomRight : IntSize());
+ if (!includeLeftEdge) {
+ topLeft = IntSize();
+ if (box->isVertical())
+ topRight = IntSize();
+ else
+ bottomLeft = IntSize();
+ }
+
+ if (!includeRightEdge) {
+ if (box->isVertical())
+ bottomLeft = IntSize();
+ else
+ topRight = IntSize();
+ bottomRight = IntSize();
+ }
+
+ context->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
clippedToBorderRadius = true;
}
@@ -1002,7 +1015,7 @@ static bool borderWillArcInnerEdge(const IntSize& firstRadius, const IntSize& se
}
void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
- const RenderStyle* style, bool begin, bool end)
+ const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
if (paintNinePieceImage(graphicsContext, tx, ty, w, h, style, style->borderImage()))
return;
@@ -1025,10 +1038,12 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
EBorderStyle leftStyle = style->borderLeftStyle();
EBorderStyle rightStyle = style->borderRightStyle();
- bool renderTop = topStyle > BHIDDEN && !topTransparent;
- bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
- bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
- bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+ bool horizontal = style->isHorizontalWritingMode();
+
+ bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+ bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+ bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+ bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
bool renderRadii = false;
Path roundedPath;
@@ -1039,32 +1054,52 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- IntRect innerBorderRect = borderInnerRect(borderRect, style->borderTopWidth(), style->borderBottomWidth(),
- style->borderLeftWidth(), style->borderRightWidth());
+ int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+ int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+ int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+ int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+ IntRect innerBorderRect = borderInnerRect(borderRect, topWidth, bottomWidth, leftWidth, rightWidth);
IntSize innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius;
- style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, style->borderTopWidth(), style->borderBottomWidth(),
- style->borderLeftWidth(), style->borderRightWidth(), innerTopLeftRadius, innerTopRightRadius,
- innerBottomLeftRadius, innerBottomRightRadius);
+
+ style->getInnerBorderRadiiForRectWithBorderWidths(innerBorderRect, topWidth, bottomWidth, leftWidth, rightWidth, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
+
+ IntSize innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight;
- if (begin) {
+ if (includeLogicalLeftEdge) {
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ innerTopLeft = innerTopLeftRadius;
+ if (horizontal) {
+ bottomLeft = bottomLeftRadius;
+ innerBottomLeft = innerBottomLeftRadius;
+ } else {
+ topRight = topRightRadius;
+ innerTopRight = innerTopRightRadius;
+ }
}
- if (end) {
- topRight = topRightRadius;
+
+ if (includeLogicalRightEdge) {
+ if (horizontal) {
+ topRight = topRightRadius;
+ innerTopRight = innerTopRightRadius;
+ } else {
+ bottomLeft = bottomLeftRadius;
+ innerBottomLeft = innerBottomLeftRadius;
+ }
bottomRight = bottomRightRadius;
+ innerBottomRight = innerBottomRightRadius;
}
- renderRadii = true;
-
- // Clip to the inner and outer radii rects.
- graphicsContext->save();
- graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeftRadius, innerTopRightRadius, innerBottomLeftRadius, innerBottomRightRadius);
-
- roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
- graphicsContext->addPath(roundedPath);
+ renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+
+ if (renderRadii) {
+ // Clip to the inner and outer radii rects.
+ graphicsContext->save();
+ graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ graphicsContext->clipOutRoundedRect(innerBorderRect, innerTopLeft, innerTopRight, innerBottomLeft, innerBottomRight);
+ roundedPath.addRoundedRect(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ graphicsContext->addPath(roundedPath);
+ }
}
bool upperLeftBorderStylesMatch = renderLeft && (topStyle == leftStyle) && (topColor == leftColor);
@@ -1078,7 +1113,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(topLeft, topRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderTopWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSTop, upperLeftBorderStylesMatch, upperRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderTopWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderTopWidth(), thickness, BSTop, style, topColor, topStyle);
graphicsContext->restore();
@@ -1099,7 +1134,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, bottomRight, style->borderLeftWidth(), style->borderRightWidth(), style->borderBottomWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSBottom, lowerLeftBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderBottomWidth(), style->borderLeftWidth()), style->borderRightWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderBottomWidth(), thickness, BSBottom, style, bottomColor, bottomStyle);
graphicsContext->restore();
@@ -1122,7 +1157,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRadii && borderWillArcInnerEdge(bottomLeft, topLeft, style->borderBottomWidth(), style->borderTopWidth(), style->borderLeftWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSLeft, upperLeftBorderStylesMatch, lowerLeftBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderLeftWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderLeftWidth(), thickness, BSLeft, style, leftColor, leftStyle);
graphicsContext->restore();
@@ -1141,7 +1176,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
if (renderRight) {
if (renderRadii && borderWillArcInnerEdge(bottomRight, topRight, style->borderBottomWidth(), style->borderTopWidth(), style->borderRightWidth())) {
graphicsContext->save();
- clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style);
+ clipBorderSidePolygon(graphicsContext, borderRect, topLeft, topRight, bottomLeft, bottomRight, BSRight, upperRightBorderStylesMatch, lowerRightBorderStylesMatch, style, includeLogicalLeftEdge, includeLogicalRightEdge);
float thickness = max(max(style->borderRightWidth(), style->borderTopWidth()), style->borderBottomWidth());
drawBoxSideFromPath(graphicsContext, borderRect, roundedPath, style->borderRightWidth(), thickness, BSRight, style, rightColor, rightStyle);
graphicsContext->restore();
@@ -1168,7 +1203,7 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#else
void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
- const RenderStyle* style, bool begin, bool end)
+ const RenderStyle* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
// FIXME: This old version of paintBorder should be removed when all ports implement
// GraphicsContext::clipConvexPolygon()!! This should happen soon.
@@ -1190,10 +1225,11 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
EBorderStyle leftStyle = style->borderLeftStyle();
EBorderStyle rightStyle = style->borderRightStyle();
- bool renderTop = topStyle > BHIDDEN && !topTransparent;
- bool renderLeft = leftStyle > BHIDDEN && begin && !leftTransparent;
- bool renderRight = rightStyle > BHIDDEN && end && !rightTransparent;
- bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent;
+ bool horizontal = style->isHorizontalWritingMode();
+ bool renderTop = topStyle > BHIDDEN && !topTransparent && (horizontal || includeLogicalLeftEdge);
+ bool renderLeft = leftStyle > BHIDDEN && !leftTransparent && (!horizontal || includeLogicalLeftEdge);
+ bool renderRight = rightStyle > BHIDDEN && !rightTransparent && (!horizontal || includeLogicalRightEdge);
+ bool renderBottom = bottomStyle > BHIDDEN && !bottomTransparent && (horizontal || includeLogicalRightEdge);
bool renderRadii = false;
IntSize topLeft, topRight, bottomLeft, bottomRight;
@@ -1204,20 +1240,29 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
style->getBorderRadiiForRect(borderRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- if (begin) {
+ if (includeLogicalLeftEdge) {
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ if (horizontal)
+ bottomLeft = bottomLeftRadius;
+ else
+ topRight = topRightRadius;
}
- if (end) {
- topRight = topRightRadius;
+
+ if (includeLogicalRightEdge) {
+ if (horizontal)
+ topRight = topRightRadius;
+ else
+ bottomLeft = bottomLeftRadius;
bottomRight = bottomRightRadius;
}
- renderRadii = true;
-
- // Clip to the rounded rectangle.
- graphicsContext->save();
- graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ renderRadii = !topLeft.isZero() || !topRight.isZero() || !bottomLeft.isZero() || !bottomRight.isZero();
+
+ if (renderRadii) {
+ // Clip to the rounded rectangle.
+ graphicsContext->save();
+ graphicsContext->addRoundedRectClip(borderRect, topLeft, topRight, bottomLeft, bottomRight);
+ }
}
int firstAngleStart, secondAngleStart, firstAngleSpan, secondAngleSpan;
@@ -1519,7 +1564,9 @@ void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx,
}
#endif
-void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style)
+void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContext, const IntRect& box, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight,
+ const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+ bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
FloatPoint quad[4];
int tx = box.x();
@@ -1527,47 +1574,37 @@ void RenderBoxModelObject::clipBorderSidePolygon(GraphicsContext* graphicsContex
int w = box.width();
int h = box.height();
+ bool horizontal = style->isHorizontalWritingMode();
+ int leftWidth = (!horizontal || includeLogicalLeftEdge) ? style->borderLeftWidth() : 0;
+ int rightWidth = (!horizontal || includeLogicalRightEdge) ? style->borderRightWidth() : 0;
+ int topWidth = (horizontal || includeLogicalLeftEdge) ? style->borderTopWidth() : 0;
+ int bottomWidth = (horizontal || includeLogicalRightEdge) ? style->borderBottomWidth() : 0;
+
// For each side, create an array of FloatPoints where each point is based on whichever value in each corner
// is larger -- the radius width/height or the border width/height -- as appropriate.
switch (side) {
case BSTop:
quad[0] = FloatPoint(tx, ty);
- quad[1] = FloatPoint(
- tx + max(topLeft.width(), (int) style->borderLeftWidth()),
- ty + max(topLeft.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + w - max(topRight.width(), (int) style->borderRightWidth()),
- ty + max(topRight.height(), (int)style->borderTopWidth()));
+ quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+ quad[2] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
quad[3] = FloatPoint(tx + w, ty);
break;
case BSLeft:
quad[0] = FloatPoint(tx, ty);
- quad[1] = FloatPoint(
- tx + max(topLeft.width(), (int) style->borderLeftWidth()),
- ty + max(topLeft.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + max(bottomLeft.width(), (int) style->borderLeftWidth()),
- ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + max(topLeft.width(), leftWidth), ty + max(topLeft.height(), topWidth));
+ quad[2] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
quad[3] = FloatPoint(tx, ty + h);
break;
case BSBottom:
quad[0] = FloatPoint(tx, ty + h);
- quad[1] = FloatPoint(
- tx + max(bottomLeft.width(), (int) style->borderLeftWidth()),
- ty + h - max(bottomLeft.height(), (int)style->borderBottomWidth()));
- quad[2] = FloatPoint(
- tx + w - max(bottomRight.width(), (int) style->borderRightWidth()),
- ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + max(bottomLeft.width(), leftWidth), ty + h - max(bottomLeft.height(), bottomWidth));
+ quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
quad[3] = FloatPoint(tx + w, ty + h);
break;
case BSRight:
quad[0] = FloatPoint(tx + w, ty);
- quad[1] = FloatPoint(
- tx + w - max(topRight.width(), (int) style->borderRightWidth()),
- ty + max(topRight.height(), (int) style->borderTopWidth()));
- quad[2] = FloatPoint(
- tx + w - max(bottomRight.width(), (int) style->borderRightWidth()),
- ty + h - max(bottomRight.height(), (int)style->borderBottomWidth()));
+ quad[1] = FloatPoint(tx + w - max(topRight.width(), rightWidth), ty + max(topRight.height(), topWidth));
+ quad[2] = FloatPoint(tx + w - max(bottomRight.width(), rightWidth), ty + h - max(bottomRight.height(), bottomWidth));
quad[3] = FloatPoint(tx + w, ty + h);
break;
default:
@@ -1610,7 +1647,7 @@ static inline void uniformlyExpandBorderRadii(int delta, IntSize& topLeft, IntSi
bottomRight.clampNegativeToZero();
}
-void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool begin, bool end)
+void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int ty, int w, int h, const RenderStyle* s, ShadowStyle shadowStyle, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
// FIXME: Deal with border-image. Would be great to use border-image as a mask.
@@ -1624,36 +1661,53 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
IntSize bottomRight;
bool hasBorderRadius = s->hasBorderRadius();
- if (hasBorderRadius && (begin || end)) {
+ bool isHorizontal = s->isHorizontalWritingMode();
+ if (hasBorderRadius && (includeLogicalLeftEdge || includeLogicalRightEdge)) {
IntSize topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
s->getBorderRadiiForRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
- if (begin) {
+ if (includeLogicalLeftEdge) {
if (shadowStyle == Inset) {
topLeftRadius.expand(-borderLeft(), -borderTop());
topLeftRadius.clampNegativeToZero();
- bottomLeftRadius.expand(-borderLeft(), -borderBottom());
- bottomLeftRadius.clampNegativeToZero();
+ if (isHorizontal) {
+ bottomLeftRadius.expand(-borderLeft(), -borderBottom());
+ bottomLeftRadius.clampNegativeToZero();
+ } else {
+ topRightRadius.expand(-borderRight(), -borderTop());
+ topRightRadius.clampNegativeToZero();
+ }
}
topLeft = topLeftRadius;
- bottomLeft = bottomLeftRadius;
+ if (isHorizontal)
+ bottomLeft = bottomLeftRadius;
+ else
+ topRight = topRightRadius;
}
- if (end) {
+ if (includeLogicalRightEdge) {
if (shadowStyle == Inset) {
- topRightRadius.expand(-borderRight(), -borderTop());
- topRightRadius.clampNegativeToZero();
+ if (isHorizontal) {
+ topRightRadius.expand(-borderRight(), -borderTop());
+ topRightRadius.clampNegativeToZero();
+ } else {
+ bottomLeftRadius.expand(-borderLeft(), -borderBottom());
+ bottomLeftRadius.clampNegativeToZero();
+ }
bottomRightRadius.expand(-borderRight(), -borderBottom());
bottomRightRadius.clampNegativeToZero();
}
- topRight = topRightRadius;
+ if (isHorizontal)
+ topRight = topRightRadius;
+ else
+ bottomLeft = bottomLeftRadius;
bottomRight = bottomRightRadius;
}
}
if (shadowStyle == Inset) {
- rect.move(begin ? borderLeft() : 0, borderTop());
- rect.setWidth(rect.width() - (begin ? borderLeft() : 0) - (end ? borderRight() : 0));
- rect.setHeight(rect.height() - borderTop() - borderBottom());
+ rect.move(includeLogicalLeftEdge || !isHorizontal ? borderLeft() : 0, includeLogicalLeftEdge || isHorizontal ? borderTop() : 0);
+ rect.setWidth(rect.width() - ((includeLogicalLeftEdge || !isHorizontal) ? borderLeft() : 0) - ((includeLogicalRightEdge || !isHorizontal) ? borderRight() : 0));
+ rect.setHeight(rect.height() - ((includeLogicalLeftEdge || isHorizontal) ? borderTop() : 0) - ((includeLogicalRightEdge || isHorizontal) ? borderBottom() : 0));
}
bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundColor).isValid() && s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() == 255;
@@ -1739,12 +1793,22 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
context->fillRect(rect, shadowColor, s->colorSpace());
continue;
}
- if (!begin) {
- holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
- holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+
+ if (!includeLogicalLeftEdge) {
+ if (isHorizontal) {
+ holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
+ holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+ } else {
+ holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
+ holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
+ }
+ }
+ if (!includeLogicalRightEdge) {
+ if (isHorizontal)
+ holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
+ else
+ holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowBlur);
}
- if (!end)
- holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index 33d7ca2..121601f 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -109,9 +109,9 @@ public:
virtual void childBecameNonInline(RenderObject* /*child*/) { }
- void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
+ void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
bool paintNinePieceImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
- void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool begin = true, bool end = true);
+ void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, InlineFlowBox* = 0, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
// The difference between this inline's baseline position and the line's baseline position.
@@ -137,7 +137,9 @@ private:
IntSize calculateFillTileSize(const FillLayer*, IntSize scaledSize) const;
- void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style);
+ void clipBorderSidePolygon(GraphicsContext*, const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft,
+ const IntSize& bottomRight, const BoxSide side, bool firstEdgeMatches, bool secondEdgeMatches, const RenderStyle* style,
+ bool includeLogicalLeftEdge, bool includeLogicalRightEdge);
friend class RenderView;
diff --git a/WebCore/rendering/RenderFlexibleBox.cpp b/WebCore/rendering/RenderFlexibleBox.cpp
index 83ec721..d4dc75a 100644
--- a/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/WebCore/rendering/RenderFlexibleBox.cpp
@@ -926,7 +926,7 @@ void RenderFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool relayoutC
continue;
if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))
- || (child->style()->height().isAuto() && child->isBlockFlow() && !child->needsLayout())) {
+ || (child->style()->height().isAuto() && child->isBlockFlow())) {
child->setChildNeedsLayout(true, false);
// Dirty all the positioned objects.
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index a160381..11ae66f 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -524,8 +524,13 @@ void RenderLayer::setHasVisibleContent(bool b)
RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
m_repaintRect = renderer()->clippedOverflowRectForRepaint(repaintContainer);
m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
- if (!isNormalFlowOnly())
- dirtyStackingContextZOrderLists();
+ if (!isNormalFlowOnly()) {
+ for (RenderLayer* sc = stackingContext(); sc; sc = sc->stackingContext()) {
+ sc->dirtyZOrderLists();
+ if (sc->hasVisibleContent())
+ break;
+ }
+ }
}
if (parent())
parent()->childVisibilityChanged(m_hasVisibleContent);
@@ -672,7 +677,7 @@ void RenderLayer::updateLayerPosition()
setHeight(box->bottomLayoutOverflow());
}
- localPoint += box->locationOffset();
+ localPoint += box->locationOffsetIncludingFlipping();
}
// Clear our cached clip rect information.
@@ -686,13 +691,13 @@ void RenderLayer::updateLayerPosition()
if (curr->isBox() && !curr->isTableRow()) {
// Rows and cells share the same coordinate space (that of the section).
// Omit them when computing our xpos/ypos.
- localPoint += toRenderBox(curr)->locationOffset();
+ localPoint += toRenderBox(curr)->locationOffsetIncludingFlipping();
}
curr = curr->parent();
}
if (curr->isBox() && curr->isTableRow()) {
// Put ourselves into the row coordinate space.
- localPoint -= toRenderBox(curr)->locationOffset();
+ localPoint -= toRenderBox(curr)->locationOffsetIncludingFlipping();
}
}
@@ -2472,7 +2477,7 @@ void RenderLayer::paintLayer(RenderLayer* rootLayer, GraphicsContext* p,
if (paintingRoot && !renderer()->isDescendantOf(paintingRoot))
paintingRootForRenderer = paintingRoot;
- if (overlapTestRequests)
+ if (overlapTestRequests && isSelfPaintingLayer())
performOverlapTests(*overlapTestRequests, layerBounds);
// We want to paint our layer, but only if we intersect the damage rect.
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index 3d9445d..060c7c6 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -47,22 +47,17 @@
#include "RenderBox.h"
#include "ScrollBehavior.h"
#include "ScrollbarClient.h"
-#include "Timer.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
-class CachedResource;
class HitTestRequest;
class HitTestResult;
class HitTestingTransformState;
-class RenderFrameSet;
class RenderMarquee;
class RenderReplica;
class RenderScrollbarPart;
class RenderStyle;
-class RenderTable;
-class RenderText;
class RenderView;
class Scrollbar;
class TransformationMatrix;
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 52a814c..ce7690a 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -1166,13 +1166,14 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim
if (!keyframeStyle)
continue;
- // get timing function
+ // Get timing function.
RefPtr<TimingFunction> tf = keyframeStyle->hasAnimations() ? (*keyframeStyle->animations()).animation(0)->timingFunction() : 0;
- if (currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
+ bool isFirstOrLastKeyframe = key == 0 || key == 1;
+ if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
transformVector.insert(new TransformAnimationValue(key, &(keyframeStyle->transform()), tf));
- if (currentKeyframe.containsProperty(CSSPropertyOpacity))
+ if ((hasOpacity && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyOpacity))
opacityVector.insert(new FloatAnimationValue(key, keyframeStyle->opacity(), tf));
}
diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp
index 1e58e63..e5fc791 100644
--- a/WebCore/rendering/RenderLineBoxList.cpp
+++ b/WebCore/rendering/RenderLineBoxList.cpp
@@ -145,6 +145,57 @@ void RenderLineBoxList::dirtyLineBoxes()
curr->dirtyLineBoxes();
}
+bool RenderLineBoxList::rangeIntersectsDirtyRect(RenderBoxModelObject* renderer, int logicalTop, int logicalBottom, const PaintInfo& paintInfo, int tx, int ty) const
+{
+ RenderBox* block;
+ if (renderer->isBox())
+ block = toRenderBox(renderer);
+ else
+ block = renderer->containingBlock();
+ int physicalStart = block->convertFromFlippedWritingMode(logicalTop);
+ int physicalEnd = block->convertFromFlippedWritingMode(logicalBottom);
+ int physicalExtent = abs(physicalEnd - physicalStart);
+ physicalStart = min(physicalStart, physicalEnd);
+
+ if (renderer->style()->isHorizontalWritingMode()) {
+ physicalStart += ty;
+ if (physicalStart >= paintInfo.rect.bottom() || physicalStart + physicalExtent <= paintInfo.rect.y())
+ return false;
+ } else {
+ physicalStart += tx;
+ if (physicalStart >= paintInfo.rect.right() || physicalStart + physicalExtent <= paintInfo.rect.x())
+ return false;
+ }
+
+ return true;
+}
+
+bool RenderLineBoxList::anyLineIntersectsDirtyRect(RenderBoxModelObject* renderer, const PaintInfo& paintInfo, int tx, int ty, bool usePrintRect) const
+{
+ // We can check the first box and last box and avoid painting if we don't
+ // intersect. 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.
+ int firstLineTop = firstLineBox()->topVisibleOverflow();
+ if (usePrintRect && !firstLineBox()->parent())
+ firstLineTop = min(firstLineTop, firstLineBox()->root()->lineTop());
+ int lastLineBottom = lastLineBox()->bottomVisibleOverflow();
+ if (usePrintRect && !lastLineBox()->parent())
+ lastLineBottom = max(lastLineBottom, lastLineBox()->root()->lineBottom());
+ int logicalTop = firstLineTop - renderer->maximalOutlineSize(paintInfo.phase);
+ int logicalBottom = renderer->maximalOutlineSize(paintInfo.phase) + lastLineBottom;
+
+ return rangeIntersectsDirtyRect(renderer, logicalTop, logicalBottom, paintInfo, tx, ty);
+}
+
+bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, int tx, int ty) const
+{
+ int logicalTop = min(box->topVisibleOverflow(), box->root()->selectionTop()) - renderer->maximalOutlineSize(paintInfo.phase);
+ int logicalBottom = box->bottomVisibleOverflow() + renderer->maximalOutlineSize(paintInfo.phase);
+
+ return rangeIntersectsDirtyRect(renderer, logicalTop, logicalBottom, paintInfo, tx, ty);
+}
+
void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintInfo, int tx, int ty) const
{
// Only paint during the foreground/selection phases.
@@ -164,20 +215,7 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
RenderView* v = renderer->view();
bool usePrintRect = !v->printRect().isEmpty();
- // We can check the first box and last box and avoid painting if we don't
- // intersect. 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.
- int firstLineTop = firstLineBox()->topVisibleOverflow();
- if (usePrintRect && !firstLineBox()->parent())
- firstLineTop = min(firstLineTop, firstLineBox()->root()->lineTop());
- int lastLineBottom = lastLineBox()->bottomVisibleOverflow();
- if (usePrintRect && !lastLineBox()->parent())
- lastLineBottom = max(lastLineBottom, lastLineBox()->root()->lineBottom());
- int yPos = firstLineTop - renderer->maximalOutlineSize(paintInfo.phase);
- int h = renderer->maximalOutlineSize(paintInfo.phase) + lastLineBottom - yPos;
- yPos += ty;
- if (yPos >= paintInfo.rect.bottom() || yPos + h <= paintInfo.rect.y())
+ if (!anyLineIntersectsDirtyRect(renderer, paintInfo, tx, ty, usePrintRect))
return;
PaintInfo info(paintInfo);
@@ -189,11 +227,9 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
if (usePrintRect) {
- // FIXME: This is a feeble effort to avoid splitting a line across two pages.
- // It is utterly inadequate, and this should not be done at paint time at all.
- // The whole way objects break across pages needs to be redone.
- // Try to avoid splitting a line vertically, but only if it's less than the height
- // of the entire page.
+ // FIXME: This is the deprecated pagination model that is still needed
+ // for embedded views inside AppKit. AppKit is incapable of paginating vertical
+ // text pages, so we don't have to deal with vertical lines at all here.
int topForPaginationCheck = curr->topVisibleOverflow();
int bottomForPaginationCheck = curr->bottomVisibleOverflow();
if (!curr->parent()) {
@@ -216,11 +252,7 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
}
}
- int top = min(curr->topVisibleOverflow(), curr->root()->selectionTop()) - renderer->maximalOutlineSize(info.phase);
- int bottom = curr->bottomVisibleOverflow() + renderer->maximalOutlineSize(info.phase);
- h = bottom - top;
- yPos = ty + top;
- if (yPos < info.rect.bottom() && yPos + h > info.rect.y())
+ if (lineIntersectsDirtyRect(renderer, curr, info, tx, ty))
curr->paint(info, tx, ty);
}
@@ -246,20 +278,26 @@ bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq
if (!firstLineBox())
return false;
+ bool isVertical = firstLineBox()->isVertical();
+
+ int logicalPointStart = isVertical ? x - result.leftPadding() : y - result.topPadding();
+ int logicalPointEnd = isVertical ? x + result.rightPadding() : y + result.bottomPadding();
+ int offset = isVertical ? tx : ty;
+
// We can check the first box and last box and avoid hit testing if we don't
// 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.topPadding() >= ty + lastLineBox()->root()->bottomVisibleOverflow()
- || y + result.bottomPadding() < ty + firstLineBox()->root()->topVisibleOverflow())
+ if (logicalPointStart >= offset + lastLineBox()->root()->logicalBottomVisibleOverflow()
+ || logicalPointEnd < offset + firstLineBox()->root()->logicalTopVisibleOverflow())
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.bottomPadding() >= ty + curr->root()->topVisibleOverflow()
- && y - result.topPadding() < ty + curr->root()->bottomVisibleOverflow()) {
+ if (logicalPointEnd >= offset + curr->root()->logicalTopVisibleOverflow()
+ && logicalPointStart < offset + curr->root()->logicalBottomVisibleOverflow()) {
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/RenderLineBoxList.h b/WebCore/rendering/RenderLineBoxList.h
index f7d9960..9ffacdf 100644
--- a/WebCore/rendering/RenderLineBoxList.h
+++ b/WebCore/rendering/RenderLineBoxList.h
@@ -67,6 +67,10 @@ public:
bool hitTest(RenderBoxModelObject*, const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction) const;
private:
+ bool anyLineIntersectsDirtyRect(RenderBoxModelObject*, const PaintInfo&, int x, int y, bool usePrintRect) const;
+ bool lineIntersectsDirtyRect(RenderBoxModelObject*, InlineFlowBox*, const PaintInfo&, int x, int y) const;
+ bool rangeIntersectsDirtyRect(RenderBoxModelObject*, int logicalTop, int logicalBottom, const PaintInfo&, int x, int y) const;
+
// For block flows, each box represents the root inline box for a line in the
// paragraph.
// For inline flows, each box represents a portion of that inline.
diff --git a/WebCore/rendering/RenderMeter.h b/WebCore/rendering/RenderMeter.h
index 6d4c53b..e776186 100644
--- a/WebCore/rendering/RenderMeter.h
+++ b/WebCore/rendering/RenderMeter.h
@@ -23,7 +23,7 @@
#if ENABLE(METER_TAG)
#include "RenderBlock.h"
-#include "RenderProgress.h"
+#include "RenderIndicator.h"
#include "RenderWidget.h"
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index a569759..237dbaa 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -100,6 +100,7 @@ void RenderSVGImage::updateFromElement()
m_updateCachedRepaintRect = true;
setNeedsLayout(true);
}
+ RenderSVGModelObject::updateFromElement();
}
void RenderSVGImage::paint(PaintInfo& paintInfo, int, int)
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index 3203ddf..50cf68e 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -35,6 +35,7 @@
#include "ImageData.h"
#include "IntRect.h"
#include "RenderSVGResource.h"
+#include "RenderSVGResourceFilterPrimitive.h"
#include "SVGElement.h"
#include "SVGFilter.h"
#include "SVGFilterElement.h"
@@ -205,13 +206,13 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
if (!lastEffect)
return false;
- // Determine the filter primitive subregions of every effect.
- lastEffect->determineFilterPrimitiveSubregion(filterData->filter.get());
- if (!fitsInMaximumImageSize(filterData->filter->maxImageSize(), scale)) {
- // At least one FilterEffect has a too big image size,
- // recalculate the effect sizes with new scale factor.
+ RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(lastEffect, filterData->filter.get());
+ FloatRect subRegion = lastEffect->maxEffectRect();
+ // At least one FilterEffect has a too big image size,
+ // recalculate the effect sizes with new scale factors.
+ if (!fitsInMaximumImageSize(subRegion.size(), scale)) {
filterData->filter->setFilterResolution(scale);
- lastEffect->determineFilterPrimitiveSubregion(filterData->filter.get());
+ RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(lastEffect, filterData->filter.get());
}
// If the drawingRegion is empty, we have something like <g filter=".."/>.
diff --git a/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp b/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp
index f7381fa..bf2ef6e 100644
--- a/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilterPrimitive.cpp
@@ -28,12 +28,76 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "RenderSVGResourceFilterPrimitive.h"
+#include "SVGFEImage.h"
namespace WebCore {
-RenderSVGResourceFilterPrimitive::RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement)
- : RenderSVGHiddenContainer(filterPrimitiveElement)
+FloatRect RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(FilterEffect* effect, SVGFilter* filter)
{
+ FloatRect uniteRect;
+ FloatRect subregionBoundingBox = effect->effectBoundaries();
+ FloatRect subregion = subregionBoundingBox;
+
+ if (effect->filterEffectType() != FilterEffectTypeTile) {
+ // FETurbulence, FEImage and FEFlood don't have input effects, take the filter region as unite rect.
+ if (unsigned numberOfInputEffects = effect->inputEffects().size()) {
+ for (unsigned i = 0; i < numberOfInputEffects; ++i)
+ uniteRect.unite(determineFilterPrimitiveSubregion(effect->inputEffect(i), filter));
+ } else
+ uniteRect = filter->filterRegionInUserSpace();
+ } else {
+ determineFilterPrimitiveSubregion(effect->inputEffect(0), filter);
+ uniteRect = filter->filterRegionInUserSpace();
+ }
+
+ if (filter->effectBoundingBoxMode()) {
+ subregion = uniteRect;
+ // Avoid the calling of a virtual method several times.
+ FloatRect targetBoundingBox = filter->targetBoundingBox();
+
+ if (effect->hasX())
+ subregion.setX(targetBoundingBox.x() + subregionBoundingBox.x() * targetBoundingBox.width());
+
+ if (effect->hasY())
+ subregion.setY(targetBoundingBox.y() + subregionBoundingBox.y() * targetBoundingBox.height());
+
+ if (effect->hasWidth())
+ subregion.setWidth(subregionBoundingBox.width() * targetBoundingBox.width());
+
+ if (effect->hasHeight())
+ subregion.setHeight(subregionBoundingBox.height() * targetBoundingBox.height());
+ } else {
+ if (!effect->hasX())
+ subregion.setX(uniteRect.x());
+
+ if (!effect->hasY())
+ subregion.setY(uniteRect.y());
+
+ if (!effect->hasWidth())
+ subregion.setWidth(uniteRect.width());
+
+ if (!effect->hasHeight())
+ subregion.setHeight(uniteRect.height());
+ }
+
+ effect->setFilterPrimitiveSubregion(subregion);
+
+ FloatRect absoluteSubregion = filter->mapLocalRectToAbsoluteRect(subregion);
+ FloatSize filterResolution = filter->filterResolution();
+ absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
+
+ // FEImage needs the unclipped subregion in absolute coordinates to determine the correct
+ // destination rect in combination with preserveAspectRatio.
+ if (effect->filterEffectType() == FilterEffectTypeImage)
+ reinterpret_cast<FEImage*>(effect)->setAbsoluteSubregion(absoluteSubregion);
+
+ // Clip every filter effect to the filter region.
+ FloatRect absoluteScaledFilterRegion = filter->filterRegion();
+ absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.height());
+ absoluteSubregion.intersect(absoluteScaledFilterRegion);
+
+ effect->setMaxEffectRect(enclosingIntRect(absoluteSubregion));
+ return subregion;
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderSVGResourceFilterPrimitive.h b/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
index b054203..c890ffe 100644
--- a/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
+++ b/WebCore/rendering/RenderSVGResourceFilterPrimitive.h
@@ -31,12 +31,20 @@
#include "RenderSVGHiddenContainer.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
+#include "SVGFilter.h"
namespace WebCore {
class RenderSVGResourceFilterPrimitive : public RenderSVGHiddenContainer {
public:
- explicit RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement);
+
+ explicit RenderSVGResourceFilterPrimitive(SVGFilterPrimitiveStandardAttributes* filterPrimitiveElement)
+ : RenderSVGHiddenContainer(filterPrimitiveElement)
+ {
+ }
+
+ // They depend on the RenderObject argument of RenderSVGResourceFilter::applyResource.
+ static FloatRect determineFilterPrimitiveSubregion(FilterEffect* effect, SVGFilter* filter);
private:
virtual const char* renderName() const { return "RenderSVGResourceFilterPrimitive"; }
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 10133b2..ed27899 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -161,10 +161,11 @@ void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, c
// Create the luminance mask.
IntRect maskImageRect(IntPoint(), maskerData->maskImage->size());
- RefPtr<ImageData> imageData(maskerData->maskImage->getUnmultipliedImageData(maskImageRect));
- CanvasPixelArray* srcPixelArray(imageData->data());
+ RefPtr<ImageData> imageData = maskerData->maskImage->getUnmultipliedImageData(maskImageRect);
+ ByteArray* srcPixelArray = imageData->data()->data();
- for (unsigned pixelOffset = 0; pixelOffset < srcPixelArray->length(); pixelOffset += 4) {
+ unsigned pixelArrayLength = srcPixelArray->length();
+ for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
unsigned char a = srcPixelArray->get(pixelOffset + 3);
if (!a)
continue;
diff --git a/WebCore/rendering/RenderScrollbar.cpp b/WebCore/rendering/RenderScrollbar.cpp
index e7a70a4..44a0126 100644
--- a/WebCore/rendering/RenderScrollbar.cpp
+++ b/WebCore/rendering/RenderScrollbar.cpp
@@ -47,13 +47,19 @@ RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation o
// FIXME: We need to do this because RenderScrollbar::styleChanged is called as soon as the scrollbar is created.
// Update the scrollbar size.
+ int width = 0;
+ int height = 0;
updateScrollbarPart(ScrollbarBGPart);
- RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart);
- if (!part)
- return;
-
- part->layout();
- setFrameRect(IntRect(0, 0, part->width(), part->height()));
+ if (RenderScrollbarPart* part = m_parts.get(ScrollbarBGPart)) {
+ part->layout();
+ width = part->width();
+ height = part->height();
+ } else if (this->orientation() == HorizontalScrollbar)
+ width = this->width();
+ else
+ height = this->height();
+
+ setFrameRect(IntRect(0, 0, width, height));
}
RenderScrollbar::~RenderScrollbar()
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index 4855bab..3d6b04b 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -216,49 +216,43 @@ int RenderTextControl::selectionEnd()
return indexForVisiblePosition(frame->selection()->end());
}
-void RenderTextControl::setSelectionStart(int start)
+bool RenderTextControl::hasVisibleTextArea() const
{
- HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*>(node());
- setSelectionRange(start, max(start, element->selectionEnd()));
+ return style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height();
}
-void RenderTextControl::setSelectionEnd(int end)
+void setSelectionRange(Node* node, int start, int end)
{
- HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*>(node());
- setSelectionRange(min(end, element->selectionStart()), end);
-}
+ ASSERT(node);
+ node->document()->updateLayoutIgnorePendingStylesheets();
-void RenderTextControl::select()
-{
- setSelectionRange(0, text().length());
-}
+ if (!node->renderer() || !node->renderer()->isTextControl())
+ return;
-void RenderTextControl::setSelectionRange(int start, int end)
-{
end = max(end, 0);
start = min(max(start, 0), end);
- ASSERT(!document()->childNeedsAndNotInStyleRecalc());
+ RenderTextControl* control = toRenderTextControl(node->renderer());
- if (style()->visibility() == HIDDEN || !m_innerText || !m_innerText->renderer() || !m_innerText->renderBox()->height()) {
- cacheSelection(start, end);
+ if (control->hasVisibleTextArea()) {
+ control->cacheSelection(start, end);
return;
}
- VisiblePosition startPosition = visiblePositionForIndex(start);
+ VisiblePosition startPosition = control->visiblePositionForIndex(start);
VisiblePosition endPosition;
if (start == end)
endPosition = startPosition;
else
- endPosition = visiblePositionForIndex(end);
+ endPosition = control->visiblePositionForIndex(end);
// startPosition and endPosition can be null position for example when
// "-webkit-user-select: none" style attribute is specified.
if (startPosition.isNotNull() && endPosition.isNotNull()) {
- ASSERT(startPosition.deepEquivalent().node()->shadowAncestorNode() == node() && endPosition.deepEquivalent().node()->shadowAncestorNode() == node());
+ ASSERT(startPosition.deepEquivalent().node()->shadowAncestorNode() == node && endPosition.deepEquivalent().node()->shadowAncestorNode() == node);
}
VisibleSelection newSelection = VisibleSelection(startPosition, endPosition);
- if (Frame* frame = this->frame())
+ if (Frame* frame = node->document()->frame())
frame->selection()->setSelection(newSelection);
}
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index 84d7b0b..b75de0e 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -42,10 +42,6 @@ public:
int selectionStart();
int selectionEnd();
- void setSelectionStart(int);
- void setSelectionEnd(int);
- void select();
- void setSelectionRange(int start, int end);
PassRefPtr<Range> selection(int start, int end) const;
virtual void subtreeHasChanged();
@@ -109,11 +105,16 @@ private:
String finishText(Vector<UChar>&) const;
+ bool hasVisibleTextArea() const;
+ friend void setSelectionRange(Node*, int start, int end);
+
bool m_wasChangedSinceLastChangeEvent;
bool m_lastChangeWasUserEdit;
RefPtr<TextControlInnerTextElement> m_innerText;
};
+void setSelectionRange(Node*, int start, int end);
+
inline RenderTextControl* toRenderTextControl(RenderObject* object)
{
ASSERT(!object || object->isTextControl());
diff --git a/WebCore/rendering/RenderTextFragment.cpp b/WebCore/rendering/RenderTextFragment.cpp
index 705c095..ec62d85 100644
--- a/WebCore/rendering/RenderTextFragment.cpp
+++ b/WebCore/rendering/RenderTextFragment.cpp
@@ -23,6 +23,7 @@
#include "config.h"
#include "RenderTextFragment.h"
+#include "RenderBlock.h"
#include "Text.h"
namespace WebCore {
@@ -57,6 +58,16 @@ PassRefPtr<StringImpl> RenderTextFragment::originalText() const
return result->substring(start(), end());
}
+void RenderTextFragment::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderText::styleDidChange(diff, oldStyle);
+
+ if (RenderBlock* block = blockForAccompanyingFirstLetter()) {
+ block->style()->removeCachedPseudoStyle(FIRST_LETTER);
+ block->updateFirstLetter();
+ }
+}
+
void RenderTextFragment::destroy()
{
if (m_firstLetter)
@@ -92,4 +103,15 @@ UChar RenderTextFragment::previousCharacter() const
return RenderText::previousCharacter();
}
+RenderBlock* RenderTextFragment::blockForAccompanyingFirstLetter() const
+{
+ if (!m_firstLetter)
+ return 0;
+ for (RenderObject* block = m_firstLetter->parent(); block; block = block->parent()) {
+ if (block->style()->hasPseudoStyle(FIRST_LETTER) && block->canHaveChildren() && block->isRenderBlock())
+ return toRenderBlock(block);
+ }
+ return 0;
+}
+
} // namespace WebCore
diff --git a/WebCore/rendering/RenderTextFragment.h b/WebCore/rendering/RenderTextFragment.h
index abb3fa4..c251f81 100644
--- a/WebCore/rendering/RenderTextFragment.h
+++ b/WebCore/rendering/RenderTextFragment.h
@@ -50,9 +50,13 @@ public:
StringImpl* contentString() const { return m_contentString.get(); }
virtual PassRefPtr<StringImpl> originalText() const;
+protected:
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+
private:
virtual void setTextInternal(PassRefPtr<StringImpl>);
virtual UChar previousCharacter() const;
+ RenderBlock* blockForAccompanyingFirstLetter() const;
unsigned m_start;
unsigned m_end;
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 0538d99..3349403 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -105,6 +105,11 @@ void RenderView::computePreferredLogicalWidths()
m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
}
+bool RenderView::isChildAllowed(RenderObject* child, RenderStyle*) const
+{
+ return child->isBox();
+}
+
void RenderView::layout()
{
if (!document()->paginated())
diff --git a/WebCore/rendering/RenderView.h b/WebCore/rendering/RenderView.h
index 8f64766..81cb686 100644
--- a/WebCore/rendering/RenderView.h
+++ b/WebCore/rendering/RenderView.h
@@ -46,6 +46,8 @@ public:
virtual bool requiresLayer() const { return true; }
+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
+
virtual void layout();
virtual void computeLogicalWidth();
virtual void computeLogicalHeight();
diff --git a/WebCore/rendering/RootInlineBox.cpp b/WebCore/rendering/RootInlineBox.cpp
index c7fcaeb..178b1ad 100644
--- a/WebCore/rendering/RootInlineBox.cpp
+++ b/WebCore/rendering/RootInlineBox.cpp
@@ -149,7 +149,7 @@ void RootInlineBox::addHighlightOverflow()
FloatRect rootRect(0, selectionTop(), logicalWidth(), selectionHeight());
IntRect inflatedRect = enclosingIntRect(page->chrome()->client()->customHighlightRect(renderer()->node(), renderer()->style()->highlight(), rootRect));
setInlineDirectionOverflowPositions(leftLayoutOverflow(), rightLayoutOverflow(), min(leftVisualOverflow(), inflatedRect.x()), max(rightVisualOverflow(), inflatedRect.right()));
- setBlockDirectionOverflowPositions(topLayoutOverflow(), bottomLayoutOverflow(), min(topVisualOverflow(), inflatedRect.y()), max(bottomVisualOverflow(), inflatedRect.bottom()), logicalHeight());
+ setBlockDirectionOverflowPositions(topLayoutOverflow(), bottomLayoutOverflow(), min(topVisualOverflow(), inflatedRect.y()), max(bottomVisualOverflow(), inflatedRect.bottom()));
}
void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, int tx, int ty, const AtomicString& highlightType)
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index 5d5b8b3..f9641f4 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -21,9 +21,9 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
#include "config.h"
#include "TextControlInnerElements.h"
@@ -107,18 +107,18 @@ void TextControlInnerElement::attachInnerElement(Node* parent, PassRefPtr<Render
setRenderer(renderer);
renderer->setStyle(style);
}
-
+
// Set these explicitly since this normally happens during an attach()
setAttached();
setInDocument();
-
+
// For elements without a shadow parent, add the node to the DOM normally.
if (!m_shadowParent) {
// FIXME: This code seems very wrong. Why are we magically adding |this| to the DOM here?
// We shouldn't be calling parser API methods outside of the parser!
parent->deprecatedParserAddChild(this);
}
-
+
// Add the renderer to the render tree
if (renderer)
parent->renderer()->addChild(renderer);
@@ -208,7 +208,7 @@ void SearchFieldCancelButtonElement::detach()
{
if (m_capturing) {
if (Frame* frame = document()->frame())
- frame->eventHandler()->setCapturingMouseEventsNode(0);
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
}
TextControlInnerElement::detach();
}
@@ -281,9 +281,9 @@ void SpinButtonElement::defaultEventHandler(Event* event)
if (!box) {
if (!event->defaultHandled())
HTMLDivElement::defaultEventHandler(event);
- return;
+ return;
}
-
+
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
if (input->disabled() || input->isReadOnlyFormControl()) {
if (!event->defaultHandled())
@@ -431,7 +431,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
if (event->type() == eventNames().clickEvent) {
switch (m_state) {
case Idle:
- if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect()))
+ if (speechInput()->startRecognition(m_listenerId, input->renderer()->absoluteBoundingBoxRect(), input->computeInheritedLanguage(), input->getAttribute(webkitgrammarAttr)))
setState(Recording);
break;
case Recording:
@@ -471,14 +471,16 @@ void InputFieldSpeechButtonElement::didCompleteRecognition(int)
setState(Idle);
}
-void InputFieldSpeechButtonElement::setRecognitionResult(int, const String& result)
+void InputFieldSpeechButtonElement::setRecognitionResult(int, const SpeechInputResultArray& results)
{
+ m_results = results;
+
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
// The call to setValue() below dispatches an event, and an event handler in the page might
// remove the input element from DOM. To make sure it remains valid until we finish our work
// here, we take a temporary reference.
RefPtr<HTMLInputElement> holdRef(input);
- input->setValue(result);
+ input->setValue(results.isEmpty() ? "" : results[0]->utterance());
input->dispatchWebkitSpeechChangeEvent();
renderer()->repaint();
}
@@ -487,7 +489,7 @@ void InputFieldSpeechButtonElement::detach()
{
if (m_capturing) {
if (Frame* frame = document()->frame())
- frame->eventHandler()->setCapturingMouseEventsNode(0);
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
}
if (m_state != Idle)
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index c146a42..46c1c8e 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -141,7 +141,7 @@ public:
// SpeechInputListener methods.
void didCompleteRecording(int);
void didCompleteRecognition(int);
- void setRecognitionResult(int, const String& result);
+ void setRecognitionResult(int, const SpeechInputResultArray&);
private:
InputFieldSpeechButtonElement(HTMLElement*);
@@ -151,6 +151,7 @@ private:
bool m_capturing;
SpeechInputState m_state;
int m_listenerId;
+ SpeechInputResultArray m_results;
};
#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/rendering/style/CursorList.h b/WebCore/rendering/style/CursorList.h
index 1b82684..a1d1fe7 100644
--- a/WebCore/rendering/style/CursorList.h
+++ b/WebCore/rendering/style/CursorList.h
@@ -40,6 +40,8 @@ public:
const CursorData& operator[](int i) const { return m_vector[i]; }
CursorData& operator[](int i) { return m_vector[i]; }
+ const CursorData& at(size_t i) const { return m_vector.at(i); }
+ CursorData& at(size_t i) { return m_vector.at(i); }
bool operator==(const CursorList& o) const { return m_vector == o.m_vector; }
bool operator!=(const CursorList& o) const { return m_vector != o.m_vector; }
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index b56bb1e..ec77367 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -27,6 +27,7 @@
#include "FontSelector.h"
#include "RenderArena.h"
#include "RenderObject.h"
+#include "ScaleTransformOperation.h"
#include "StyleImage.h"
#include <wtf/StdLibExtras.h>
#include <algorithm>
@@ -244,6 +245,19 @@ RenderStyle* RenderStyle::addCachedPseudoStyle(PassRefPtr<RenderStyle> pseudo)
return result;
}
+void RenderStyle::removeCachedPseudoStyle(PseudoId pid)
+{
+ if (!m_cachedPseudoStyles)
+ return;
+ for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) {
+ RenderStyle* pseudoStyle = m_cachedPseudoStyles->at(i).get();
+ if (pseudoStyle->styleType() == pid) {
+ m_cachedPseudoStyles->remove(i);
+ return;
+ }
+ }
+}
+
bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const
{
return inherited_flags != other->inherited_flags ||
@@ -680,6 +694,17 @@ void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize&
}
}
+void RenderStyle::setPageScaleTransform(float scale)
+{
+ if (scale == 1)
+ return;
+ TransformOperations transform;
+ transform.operations().append(ScaleTransformOperation::create(scale, scale, ScaleTransformOperation::SCALE));
+ setTransform(transform);
+ setTransformOriginX(Length(0, Fixed));
+ setTransformOriginY(Length(0, Fixed));
+}
+
void RenderStyle::setTextShadow(ShadowData* val, bool add)
{
ASSERT(!val || (!val->spread() && val->style() == Normal));
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 96645cf..f14e8f5 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -325,6 +325,7 @@ public:
RenderStyle* getCachedPseudoStyle(PseudoId) const;
RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
+ void removeCachedPseudoStyle(PseudoId);
const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
@@ -641,6 +642,7 @@ public:
void getTextShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
void getTextShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
void getTextShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
+ void getTextShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
@@ -660,6 +662,7 @@ public:
void getBoxShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
void getBoxShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
void getBoxShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
+ void getBoxShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
EBoxSizing boxSizing() const { return m_box->boxSizing(); }
@@ -711,6 +714,7 @@ public:
enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
+ void setPageScaleTransform(float);
bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
// End CSS3 Getters
@@ -752,6 +756,7 @@ public:
WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
bool isHorizontalWritingMode() const { return writingMode() == TopToBottomWritingMode || writingMode() == BottomToTopWritingMode; }
bool isFlippedLinesWritingMode() const { return writingMode() == LeftToRightWritingMode || writingMode() == BottomToTopWritingMode; }
+ bool isFlippedBlocksWritingMode() const { return writingMode() == RightToLeftWritingMode || writingMode() == BottomToTopWritingMode; }
ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); }
@@ -1327,6 +1332,10 @@ private:
{
return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
}
+ void getShadowBlockDirectionExtent(const ShadowData* shadow, int& logicalTop, int& logicalBottom) const
+ {
+ return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
+ }
// Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
const Color& borderLeftColor() const { return surround->border.left().color(); }
diff --git a/WebCore/rendering/svg/SVGInlineTextBox.cpp b/WebCore/rendering/svg/SVGInlineTextBox.cpp
index 0458af5..7dd779a 100644
--- a/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -523,7 +523,7 @@ void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyl
FloatSize extraOffset;
if (shadow)
- extraOffset = applyShadowToGraphicsContext(context, shadow, shadowRect, false /* stroked */, true /* opaque */);
+ extraOffset = applyShadowToGraphicsContext(context, shadow, shadowRect, false /* stroked */, true /* opaque */, false /* vertical */);
font.drawText(context, textRun, textOrigin + extraOffset, startPosition, endPosition);
restoreGraphicsContextAfterTextPainting(context, textRun);
diff --git a/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
index c3f4b6a..2474a5c 100644
--- a/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
+++ b/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -57,20 +57,17 @@ void SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextSubtree(RenderS
propagateLayoutAttributes(textRoot, atCharacter, lastCharacter);
}
-static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, SVGLengthList* list, Vector<float>& floatValues, unsigned textContentLength)
+static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, const SVGLengthList& list, Vector<float>& floatValues, unsigned textContentLength)
{
ASSERT(lengthContext);
- ASSERT(list);
- unsigned length = list->numberOfItems();
+ unsigned length = list.size();
if (length > textContentLength)
length = textContentLength;
floatValues.reserveCapacity(length);
- ExceptionCode ec = 0;
for (unsigned i = 0; i < length; ++i) {
- SVGLength length = list->getItem(i, ec);
- ASSERT(!ec);
+ const SVGLength& length = list.at(i);
floatValues.append(length.value(lengthContext));
}
}
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index dc61e22..020ddb9 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -32,60 +32,65 @@
#include "DOMStringList.h"
#include "IDBDatabaseException.h"
#include "IDBObjectStoreBackendImpl.h"
+#include "IDBSQLiteDatabase.h"
#include "IDBTransactionBackendInterface.h"
#include "IDBTransactionCoordinator.h"
-#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
namespace WebCore {
-static bool extractMetaData(SQLiteDatabase* sqliteDatabase, const String& expectedName, String& foundVersion)
+static bool extractMetaData(SQLiteDatabase& sqliteDatabase, const String& name, String& foundVersion, int64& foundId)
{
- SQLiteStatement metaDataQuery(*sqliteDatabase, "SELECT name, version FROM MetaData");
- if (metaDataQuery.prepare() != SQLResultOk || metaDataQuery.step() != SQLResultRow)
- return false;
-
- if (metaDataQuery.getColumnText(0) != expectedName) {
- LOG_ERROR("Name in MetaData (%s) doesn't match expected (%s) for IndexedDB", metaDataQuery.getColumnText(0).utf8().data(), expectedName.utf8().data());
+ SQLiteStatement databaseQuery(sqliteDatabase, "SELECT id, version FROM Databases WHERE name = ?");
+ if (databaseQuery.prepare() != SQLResultOk) {
ASSERT_NOT_REACHED();
+ return false;
}
- foundVersion = metaDataQuery.getColumnText(1);
+ databaseQuery.bindText(1, name);
+ if (databaseQuery.step() != SQLResultRow)
+ return false;
- if (metaDataQuery.step() == SQLResultRow) {
- LOG_ERROR("More than one row found in MetaData table");
- ASSERT_NOT_REACHED();
- }
+ foundId = databaseQuery.getColumnInt64(0);
+ foundVersion = databaseQuery.getColumnText(1);
+ if (databaseQuery.step() == SQLResultRow)
+ ASSERT_NOT_REACHED();
return true;
}
-static bool setMetaData(SQLiteDatabase* sqliteDatabase, const String& name, const String& description, const String& version)
+static bool setMetaData(SQLiteDatabase& sqliteDatabase, const String& name, const String& description, const String& version, int64_t& rowId)
{
- ASSERT(!name.isNull() && !description.isNull() && !version.isNull());
-
- sqliteDatabase->executeCommand("DELETE FROM MetaData");
-
- SQLiteStatement insert(*sqliteDatabase, "INSERT INTO MetaData (name, description, version) VALUES (?, ?, ?)");
- if (insert.prepare() != SQLResultOk) {
- LOG_ERROR("Failed to prepare MetaData insert statement for IndexedDB");
+ ASSERT(!name.isNull());
+ ASSERT(!description.isNull());
+ ASSERT(!version.isNull());
+
+ String sql = rowId != IDBDatabaseBackendImpl::InvalidId ? "UPDATE Databases SET name = ?, description = ?, version = ? WHERE id = ?"
+ : "INSERT INTO Databases (name, description, version) VALUES (?, ?, ?)";
+ SQLiteStatement query(sqliteDatabase, sql);
+ if (query.prepare() != SQLResultOk) {
+ ASSERT_NOT_REACHED();
return false;
}
- insert.bindText(1, name);
- insert.bindText(2, description);
- insert.bindText(3, version);
+ query.bindText(1, name);
+ query.bindText(2, description);
+ query.bindText(3, version);
+ if (rowId != IDBDatabaseBackendImpl::InvalidId)
+ query.bindInt64(4, rowId);
- if (insert.step() != SQLResultDone) {
- LOG_ERROR("Failed to insert row into MetaData for IndexedDB");
+ if (query.step() != SQLResultDone)
return false;
- }
+
+ if (rowId == IDBDatabaseBackendImpl::InvalidId)
+ rowId = sqliteDatabase.lastInsertRowID();
return true;
}
-IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> sqliteDatabase, IDBTransactionCoordinator* coordinator)
+IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, IDBSQLiteDatabase* sqliteDatabase, IDBTransactionCoordinator* coordinator)
: m_sqliteDatabase(sqliteDatabase)
+ , m_id(InvalidId)
, m_name(name)
, m_description(description)
, m_version("")
@@ -94,9 +99,10 @@ IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String&
ASSERT(!m_name.isNull());
ASSERT(!m_description.isNull());
- extractMetaData(m_sqliteDatabase.get(), m_name, m_version);
- setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
-
+ bool success = extractMetaData(m_sqliteDatabase->db(), m_name, m_version, m_id);
+ ASSERT_UNUSED(success, success == (m_id != InvalidId));
+ if (!setMetaData(m_sqliteDatabase->db(), m_name, m_description, m_version, m_id))
+ ASSERT_NOT_REACHED(); // FIXME: Need better error handling.
loadObjectStores();
}
@@ -110,7 +116,12 @@ void IDBDatabaseBackendImpl::setDescription(const String& description)
return;
m_description = description;
- setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
+ setMetaData(m_sqliteDatabase->db(), m_name, m_description, m_version, m_id);
+}
+
+SQLiteDatabase& IDBDatabaseBackendImpl::sqliteDatabase() const
+{
+ return m_sqliteDatabase->db();
}
PassRefPtr<DOMStringList> IDBDatabaseBackendImpl::objectStores() const
@@ -144,7 +155,7 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObject
void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
- SQLiteStatement insert(database->sqliteDatabase(), "INSERT INTO ObjectStores (name, keyPath, doAutoIncrement) VALUES (?, ?, ?)");
+ SQLiteStatement insert(database->sqliteDatabase(), "INSERT INTO ObjectStores (name, keyPath, doAutoIncrement, databaseId) VALUES (?, ?, ?, ?)");
if (insert.prepare() != SQLResultOk) {
transaction->abort();
return;
@@ -152,6 +163,7 @@ void IDBDatabaseBackendImpl::createObjectStoreInternal(ScriptExecutionContext*,
insert.bindText(1, objectStore->name());
insert.bindText(2, objectStore->keyPath());
insert.bindInt(3, static_cast<int>(objectStore->autoIncrement()));
+ insert.bindInt64(4, database->id());
if (insert.step() != SQLResultDone) {
transaction->abort();
return;
@@ -217,8 +229,9 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal
void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
+ int64_t databaseId = database->id();
database->m_version = version;
- if (!setMetaData(database->m_sqliteDatabase.get(), database->m_name, database->m_description, database->m_version)) {
+ if (!setMetaData(database->m_sqliteDatabase->db(), database->m_name, database->m_description, database->m_version, databaseId)) {
// FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
@@ -240,10 +253,12 @@ void IDBDatabaseBackendImpl::close()
void IDBDatabaseBackendImpl::loadObjectStores()
{
- SQLiteStatement objectStoresQuery(sqliteDatabase(), "SELECT id, name, keyPath, doAutoIncrement FROM ObjectStores");
+ SQLiteStatement objectStoresQuery(sqliteDatabase(), "SELECT id, name, keyPath, doAutoIncrement FROM ObjectStores WHERE databaseId = ?");
bool ok = objectStoresQuery.prepare() == SQLResultOk;
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
+ objectStoresQuery.bindInt64(1, m_id);
+
while (objectStoresQuery.step() == SQLResultRow) {
int64_t id = objectStoresQuery.getColumnInt64(0);
String name = objectStoresQuery.getColumnText(1);
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.h b/WebCore/storage/IDBDatabaseBackendImpl.h
index bb6429c..53e1a5f 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.h
+++ b/WebCore/storage/IDBDatabaseBackendImpl.h
@@ -36,19 +36,23 @@
namespace WebCore {
class IDBObjectStoreBackendImpl;
+class IDBSQLiteDatabase;
class IDBTransactionCoordinator;
class SQLiteDatabase;
class IDBDatabaseBackendImpl : public IDBDatabaseBackendInterface {
public:
- static PassRefPtr<IDBDatabaseBackendImpl> create(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator* coordinator)
+ static PassRefPtr<IDBDatabaseBackendImpl> create(const String& name, const String& description, IDBSQLiteDatabase* database, IDBTransactionCoordinator* coordinator)
{
return adoptRef(new IDBDatabaseBackendImpl(name, description, database, coordinator));
}
virtual ~IDBDatabaseBackendImpl();
void setDescription(const String& description);
- SQLiteDatabase& sqliteDatabase() const { return *m_sqliteDatabase.get(); }
+ SQLiteDatabase& sqliteDatabase() const;
+
+ static const int64_t InvalidId = 0;
+ int64_t id() const { return m_id; }
virtual String name() const { return m_name; }
virtual String description() const { return m_description; }
@@ -65,7 +69,7 @@ public:
IDBTransactionCoordinator* transactionCoordinator() const { return m_transactionCoordinator.get(); }
private:
- IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator*);
+ IDBDatabaseBackendImpl(const String& name, const String& description, IDBSQLiteDatabase* database, IDBTransactionCoordinator*);
void loadObjectStores();
@@ -78,7 +82,8 @@ private:
static void addObjectStoreToMap(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>);
static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version);
- OwnPtr<SQLiteDatabase> m_sqliteDatabase;
+ RefPtr<IDBSQLiteDatabase> m_sqliteDatabase;
+ int64 m_id;
String m_name;
String m_description;
String m_version;
diff --git a/WebCore/storage/IDBDatabaseException.h b/WebCore/storage/IDBDatabaseException.h
index 251cfc9..945773c 100644
--- a/WebCore/storage/IDBDatabaseException.h
+++ b/WebCore/storage/IDBDatabaseException.h
@@ -42,9 +42,8 @@ public:
}
~IDBDatabaseException() { }
- // Keep in sync with what's in the .idl file.
enum ErrorCode {
- UNKNOWN_ERR = 0,
+ UNKNOWN_ERR = 1,
NON_TRANSIENT_ERR = 1,
NOT_FOUND_ERR = 2,
CONSTRAINT_ERR = 3,
diff --git a/WebCore/storage/IDBDatabaseException.idl b/WebCore/storage/IDBDatabaseException.idl
index 88e6e7e..1f15fc0 100644
--- a/WebCore/storage/IDBDatabaseException.idl
+++ b/WebCore/storage/IDBDatabaseException.idl
@@ -28,7 +28,8 @@ module storage {
interface [
Conditional=INDEXED_DATABASE
] IDBDatabaseException {
- const unsigned short UNKNOWN_ERR = 0;
+ // FIXME: These error codes conflict with others.
+ const unsigned short UNKNOWN_ERR = 1;
const unsigned short NON_TRANSIENT_ERR = 1;
const unsigned short NOT_FOUND_ERR = 2;
const unsigned short CONSTRAINT_ERR = 3;
diff --git a/WebCore/storage/IDBFactoryBackendImpl.cpp b/WebCore/storage/IDBFactoryBackendImpl.cpp
index c18294d..1905c0c 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.cpp
+++ b/WebCore/storage/IDBFactoryBackendImpl.cpp
@@ -33,8 +33,8 @@
#include "FileSystem.h"
#include "IDBDatabaseBackendImpl.h"
#include "IDBDatabaseException.h"
+#include "IDBSQLiteDatabase.h"
#include "IDBTransactionCoordinator.h"
-#include "SQLiteDatabase.h"
#include "SecurityOrigin.h"
#include <wtf/Threading.h>
#include <wtf/UnusedParam.h>
@@ -52,7 +52,13 @@ IDBFactoryBackendImpl::~IDBFactoryBackendImpl()
{
}
-static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name, const String& pathBase, int64_t maximumSize)
+void IDBFactoryBackendImpl::removeSQLiteDatabase(const String& filePath)
+{
+ ASSERT(m_sqliteDatabaseMap.contains(filePath));
+ m_sqliteDatabaseMap.remove(filePath);
+}
+
+static PassRefPtr<IDBSQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, const String& pathBase, int64_t maximumSize, const String& fileIdentifier, IDBFactoryBackendImpl* factory)
{
String path = ":memory:";
if (!pathBase.isEmpty()) {
@@ -62,54 +68,46 @@ static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOri
return 0;
}
- path = pathByAppendingComponent(pathBase, IDBFactoryBackendImpl::databaseFileName(name, securityOrigin));
+ path = pathByAppendingComponent(pathBase, IDBFactoryBackendImpl::databaseFileName(securityOrigin));
}
- OwnPtr<SQLiteDatabase> sqliteDatabase = adoptPtr(new SQLiteDatabase());
- if (!sqliteDatabase->open(path)) {
+ RefPtr<IDBSQLiteDatabase> sqliteDatabase = IDBSQLiteDatabase::create(fileIdentifier, factory);
+ if (!sqliteDatabase->db().open(path)) {
// FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
LOG_ERROR("Failed to open database file %s for IndexedDB", path.utf8().data());
return 0;
}
- sqliteDatabase->setMaximumSize(maximumSize);
+ // FIXME: Error checking?
+ sqliteDatabase->db().setMaximumSize(maximumSize);
+ sqliteDatabase->db().turnOnIncrementalAutoVacuum();
+
return sqliteDatabase.release();
}
-static bool createTables(SQLiteDatabase* sqliteDatabase)
+static bool createTables(SQLiteDatabase& sqliteDatabase)
{
- // FIXME: Remove all the drop table commands once the on disk structure stabilizes.
static const char* commands[] = {
- "DROP TABLE IF EXISTS MetaData",
- "CREATE TABLE IF NOT EXISTS MetaData (id INTEGER PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL, version TEXT NOT NULL)",
+ "CREATE TABLE IF NOT EXISTS Databases (id INTEGER PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL, version TEXT NOT NULL)",
+ "CREATE UNIQUE INDEX IF NOT EXISTS Databases_name ON Databases(name)",
- "DROP TABLE IF EXISTS ObjectStores",
- "CREATE TABLE IF NOT EXISTS ObjectStores (id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE, keyPath TEXT, doAutoIncrement INTEGER NOT NULL)",
- "DROP INDEX IF EXISTS ObjectStores_name",
- "CREATE UNIQUE INDEX IF NOT EXISTS ObjectStores_name ON ObjectStores(name)",
+ "CREATE TABLE IF NOT EXISTS ObjectStores (id INTEGER PRIMARY KEY, name TEXT NOT NULL, keyPath TEXT, doAutoIncrement INTEGER NOT NULL, databaseId INTEGER NOT NULL REFERENCES Databases(id))",
+ "CREATE UNIQUE INDEX IF NOT EXISTS ObjectStores_composit ON ObjectStores(databaseId, name)",
- "DROP TABLE IF EXISTS Indexes",
- "CREATE TABLE IF NOT EXISTS Indexes (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), name TEXT NOT NULL UNIQUE, keyPath TEXT, isUnique INTEGER NOT NULL)",
- "DROP INDEX IF EXISTS Indexes_composit",
+ "CREATE TABLE IF NOT EXISTS Indexes (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), name TEXT NOT NULL, keyPath TEXT, isUnique INTEGER NOT NULL)",
"CREATE UNIQUE INDEX IF NOT EXISTS Indexes_composit ON Indexes(objectStoreId, name)",
- "DROP TABLE IF EXISTS ObjectStoreData",
- "CREATE TABLE IF NOT EXISTS ObjectStoreData (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), keyString TEXT UNIQUE, keyDate INTEGER UNIQUE, keyNumber INTEGER UNIQUE, value TEXT NOT NULL)",
- "DROP INDEX IF EXISTS ObjectStoreData_composit",
+ "CREATE TABLE IF NOT EXISTS ObjectStoreData (id INTEGER PRIMARY KEY, objectStoreId INTEGER NOT NULL REFERENCES ObjectStore(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, value TEXT NOT NULL)",
"CREATE UNIQUE INDEX IF NOT EXISTS ObjectStoreData_composit ON ObjectStoreData(keyString, keyDate, keyNumber, objectStoreId)",
- "DROP TABLE IF EXISTS IndexData",
"CREATE TABLE IF NOT EXISTS IndexData (id INTEGER PRIMARY KEY, indexId INTEGER NOT NULL REFERENCES Indexes(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, objectStoreDataId INTEGER NOT NULL REFERENCES ObjectStoreData(id))",
- "DROP INDEX IF EXISTS IndexData_composit",
"CREATE INDEX IF NOT EXISTS IndexData_composit ON IndexData(keyString, keyDate, keyNumber, indexId)",
- "DROP INDEX IF EXISTS IndexData_objectStoreDataId",
"CREATE INDEX IF NOT EXISTS IndexData_objectStoreDataId ON IndexData(objectStoreDataId)",
- "DROP INDEX IF EXISTS IndexData_indexId",
"CREATE INDEX IF NOT EXISTS IndexData_indexId ON IndexData(indexId)"
};
for (size_t i = 0; i < arraysize(commands); ++i) {
- if (!sqliteDatabase->executeCommand(commands[i])) {
+ if (!sqliteDatabase.executeCommand(commands[i])) {
// FIXME: We should try to recover from this situation. Maybe nuke the database and start over?
LOG_ERROR("Failed to run the following command for IndexedDB: %s", commands[i]);
return false;
@@ -120,7 +118,9 @@ static bool createTables(SQLiteDatabase* sqliteDatabase)
void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir, int64_t maximumSize)
{
- IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
+ String fileIdentifier = securityOrigin->databaseIdentifier();
+ String uniqueIdentifier = fileIdentifier + "@" + name;
+ IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(uniqueIdentifier);
if (it != m_databaseBackendMap.end()) {
if (!description.isNull())
it->second->setDescription(description); // The description may have changed.
@@ -130,22 +130,29 @@ void IDBFactoryBackendImpl::open(const String& name, const String& description,
// FIXME: Everything from now on should be done on another thread.
- OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name, dataDir, maximumSize);
- if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
- return;
+ RefPtr<IDBSQLiteDatabase> sqliteDatabase;
+ SQLiteDatabaseMap::iterator it2 = m_sqliteDatabaseMap.find(fileIdentifier);
+ if (it2 != m_sqliteDatabaseMap.end())
+ sqliteDatabase = it2->second;
+ else {
+ sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this);
+
+ if (!sqliteDatabase || !createTables(sqliteDatabase->db())) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
+ return;
+ }
+ m_sqliteDatabaseMap.set(fileIdentifier, sqliteDatabase.get());
}
- RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, description, sqliteDatabase.release(), m_transactionCoordinator.get());
+ RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, description, sqliteDatabase.get(), m_transactionCoordinator.get());
callbacks->onSuccess(databaseBackend.get());
- m_databaseBackendMap.set(name, databaseBackend.release());
+ m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.release());
}
-String IDBFactoryBackendImpl::databaseFileName(const String& name, SecurityOrigin* securityOrigin)
+String IDBFactoryBackendImpl::databaseFileName(SecurityOrigin* securityOrigin)
{
String databaseIdentifier = securityOrigin->databaseIdentifier();
- String santizedName = encodeForFileName(name);
- return databaseIdentifier + "@" + santizedName + ".indexeddb";
+ return databaseIdentifier + ".indexeddb";
}
} // namespace WebCore
diff --git a/WebCore/storage/IDBFactoryBackendImpl.h b/WebCore/storage/IDBFactoryBackendImpl.h
index 211b7fa..381c402 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.h
+++ b/WebCore/storage/IDBFactoryBackendImpl.h
@@ -39,6 +39,7 @@ namespace WebCore {
class DOMStringList;
class IDBDatabaseBackendImpl;
+class IDBSQLiteDatabase;
class IDBTransactionCoordinator;
class IDBFactoryBackendImpl : public IDBFactoryBackendInterface {
@@ -49,18 +50,26 @@ public:
}
virtual ~IDBFactoryBackendImpl();
+ // IDBSQLiteDatabase's lifetime may be shorter than ours, so we need notification when it dies.
+ void removeSQLiteDatabase(const String& filePath);
+
virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize);
- static String databaseFileName(const String& name, SecurityOrigin*);
+ static String databaseFileName(SecurityOrigin*);
private:
IDBFactoryBackendImpl();
+ // FIXME: Just hold a weak pointer.
typedef HashMap<String, RefPtr<IDBDatabaseBackendImpl> > IDBDatabaseBackendMap;
IDBDatabaseBackendMap m_databaseBackendMap;
+
+ typedef HashMap<String, IDBSQLiteDatabase*> SQLiteDatabaseMap;
+ SQLiteDatabaseMap m_sqliteDatabaseMap;
+
RefPtr<IDBTransactionCoordinator> m_transactionCoordinator;
- // We only create one instance of this class at a time.
+ // Only one instance of the factory should exist at any given time.
static IDBFactoryBackendImpl* idbFactoryBackendImpl;
};
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
index f3aee91..4892556 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.cpp
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.cpp
@@ -131,25 +131,25 @@ static PassRefPtr<IDBKey> fetchKeyFromKeyPath(SerializedScriptValue* value, cons
return keys[0].release();
}
-static bool putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScriptValue* value, int64_t objectStoreId, int64_t* dataRowId)
+static bool putObjectStoreData(SQLiteDatabase& db, IDBKey* key, SerializedScriptValue* value, int64_t objectStoreId, int64_t& dataRowId)
{
- String sql = *dataRowId != -1 ? "UPDATE ObjectStoreData SET keyString = ?, keyDate = ?, keyNumber = ?, value = ? WHERE id = ?"
- : "INSERT INTO ObjectStoreData (keyString, keyDate, keyNumber, value, objectStoreId) VALUES (?, ?, ?, ?, ?)";
+ String sql = dataRowId != IDBObjectStoreBackendImpl::InvalidId ? "UPDATE ObjectStoreData SET keyString = ?, keyDate = ?, keyNumber = ?, value = ? WHERE id = ?"
+ : "INSERT INTO ObjectStoreData (keyString, keyDate, keyNumber, value, objectStoreId) VALUES (?, ?, ?, ?, ?)";
SQLiteStatement query(db, sql);
if (query.prepare() != SQLResultOk)
return false;
key->bindWithNulls(query, 1);
query.bindText(4, value->toWireString());
- if (*dataRowId != -1)
- query.bindInt(5, *dataRowId);
+ if (dataRowId != IDBDatabaseBackendImpl::InvalidId)
+ query.bindInt64(5, dataRowId);
else
query.bindInt64(5, objectStoreId);
if (query.step() != SQLResultDone)
return false;
- if (*dataRowId == -1)
- *dataRowId = db.lastInsertRowID();
+ if (dataRowId == IDBDatabaseBackendImpl::InvalidId)
+ dataRowId = db.lastInsertRowID();
return true;
}
@@ -238,8 +238,8 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
// Before this point, don't do any mutation. After this point, rollback the transaction in case of error.
- int64_t dataRowId = isExistingValue ? getQuery.getColumnInt(0) : -1;
- if (!putObjectStoreData(objectStore->sqliteDatabase(), key.get(), value.get(), objectStore->id(), &dataRowId)) {
+ int64_t dataRowId = isExistingValue ? getQuery.getColumnInt(0) : InvalidId;
+ if (!putObjectStoreData(objectStore->sqliteDatabase(), key.get(), value.get(), objectStore->id(), dataRowId)) {
// FIXME: The Indexed Database specification does not have an error code dedicated to I/O errors.
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
transaction->abort();
@@ -394,11 +394,14 @@ void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> prpRange, uns
void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> range, unsigned short tmpDirection, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
+ bool leftBound = range && (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE);
+ bool rightBound = range && (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE);
+
// Several files depend on this order of selects.
String sql = "SELECT id, keyString, keyDate, keyNumber, value FROM ObjectStoreData WHERE ";
- if (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (leftBound)
sql += range->left()->leftCursorWhereFragment(range->leftWhereClauseComparisonOperator());
- if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (rightBound)
sql += range->right()->rightCursorWhereFragment(range->rightWhereClauseComparisonOperator());
sql += "objectStoreId = ? ORDER BY ";
@@ -413,9 +416,9 @@ void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, Pass
ASSERT_UNUSED(ok, ok); // FIXME: Better error handling?
int currentColumn = 1;
- if (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (leftBound)
currentColumn += range->left()->bind(*query, currentColumn);
- if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE)
+ if (rightBound)
currentColumn += range->right()->bind(*query, currentColumn);
query->bindInt64(currentColumn, objectStore->id());
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.h b/WebCore/storage/IDBObjectStoreBackendImpl.h
index 09223b1..60e011f 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.h
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.h
@@ -52,6 +52,7 @@ public:
}
virtual ~IDBObjectStoreBackendImpl();
+ static const int64_t InvalidId = 0;
int64_t id() const
{
ASSERT(m_id != InvalidId);
@@ -94,8 +95,6 @@ private:
static void removeIndexFromMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
static void addIndexToMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>);
- static const int64_t InvalidId = 0;
-
RefPtr<IDBDatabaseBackendImpl> m_database;
int64_t m_id;
diff --git a/WebCore/storage/IDBRequest.cpp b/WebCore/storage/IDBRequest.cpp
index c67e379..cbd635c 100644
--- a/WebCore/storage/IDBRequest.cpp
+++ b/WebCore/storage/IDBRequest.cpp
@@ -59,15 +59,6 @@ IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> sourc
IDBRequest::~IDBRequest()
{
- // 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(IDBTransactionBackendInterface* transaction)
@@ -159,6 +150,7 @@ void IDBRequest::timerFired(Timer<IDBRequest>*)
{
ASSERT(m_selfRef);
ASSERT(m_pendingEvents.size());
+ // FIXME: We should handle the stop event and stop any timers when we see it. We can then assert here that scriptExecutionContext is non-null.
// We need to keep self-referencing ourself, otherwise it's possible we'll be deleted.
// But in some cases, suspend() could be called while we're dispatching an event, so we
@@ -172,6 +164,10 @@ void IDBRequest::timerFired(Timer<IDBRequest>*)
Vector<PendingEvent> pendingEvents;
pendingEvents.swap(m_pendingEvents);
for (size_t i = 0; i < pendingEvents.size(); ++i) {
+ // It's possible we've navigated in which case we'll crash.
+ if (!scriptExecutionContext())
+ return;
+
if (pendingEvents[i].m_error) {
ASSERT(!pendingEvents[i].m_result);
dispatchEvent(IDBErrorEvent::create(m_source, *pendingEvents[i].m_error));
diff --git a/WebKit/mac/WebView/WebHTMLRepresentationInternal.h b/WebCore/storage/IDBSQLiteDatabase.cpp
index d42b400..e881917 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentationInternal.h
+++ b/WebCore/storage/IDBSQLiteDatabase.cpp
@@ -1,18 +1,15 @@
/*
- * Copyright (C) 2008 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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
@@ -26,8 +23,26 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebHTMLRepresentationPrivate.h>
+#include "config.h"
+#include "IDBSQLiteDatabase.h"
-@interface WebHTMLRepresentation (WebInternal)
-+ (NSArray *)supportedNonImageMIMETypes;
-@end
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBFactoryBackendImpl.h"
+
+namespace WebCore {
+
+IDBSQLiteDatabase::IDBSQLiteDatabase(String identifier, IDBFactoryBackendImpl* factory)
+ : m_identifier(identifier)
+ , m_factory(factory)
+{
+}
+
+IDBSQLiteDatabase::~IDBSQLiteDatabase()
+{
+ m_factory->removeSQLiteDatabase(m_identifier);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBSQLiteDatabase.h b/WebCore/storage/IDBSQLiteDatabase.h
new file mode 100644
index 0000000..0556506
--- /dev/null
+++ b/WebCore/storage/IDBSQLiteDatabase.h
@@ -0,0 +1,62 @@
+/*
+ * 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 IDBSQLiteDatabase_h
+#define IDBSQLiteDatabase_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "SQLiteDatabase.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class IDBFactoryBackendImpl;
+
+class IDBSQLiteDatabase : public RefCounted<IDBSQLiteDatabase> {
+public:
+ static PassRefPtr<IDBSQLiteDatabase> create(String identifier, IDBFactoryBackendImpl* factory)
+ {
+ return adoptRef(new IDBSQLiteDatabase(identifier, factory));
+ }
+ ~IDBSQLiteDatabase();
+
+ SQLiteDatabase& db() { return m_db; }
+
+private:
+ IDBSQLiteDatabase(String identifier, IDBFactoryBackendImpl* factory);
+
+ SQLiteDatabase m_db;
+ String m_identifier;
+ RefPtr<IDBFactoryBackendImpl> m_factory;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBSQLiteDatabase_h
diff --git a/WebCore/storage/IDBTransactionBackendImpl.cpp b/WebCore/storage/IDBTransactionBackendImpl.cpp
index 5016a3f..2b1f732 100644
--- a/WebCore/storage/IDBTransactionBackendImpl.cpp
+++ b/WebCore/storage/IDBTransactionBackendImpl.cpp
@@ -147,7 +147,7 @@ void IDBTransactionBackendImpl::taskTimerFired(Timer<IDBTransactionBackendImpl>*
TaskQueue queue;
queue.swap(m_taskQueue);
- while (!queue.isEmpty()) {
+ while (!queue.isEmpty() && m_state != Finished) {
OwnPtr<ScriptExecutionContext::Task> task(queue.first().release());
queue.removeFirst();
m_pendingEvents++;
diff --git a/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h b/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
index a660198..ab23bae 100644
--- a/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
+++ b/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h
@@ -22,11 +22,7 @@
#define DeprecatedSVGAnimatedPropertyTraits_h
#if ENABLE(SVG)
-#include "FloatRect.h"
#include "PlatformString.h"
-#include "SVGAngle.h"
-#include "SVGLength.h"
-#include "SVGLengthList.h"
#include "SVGNumberList.h"
#include "SVGPreserveAspectRatio.h"
#include "SVGTransformList.h"
@@ -36,78 +32,6 @@ namespace WebCore {
template<typename Type>
struct DeprecatedSVGAnimatedPropertyTraits : public Noncopyable { };
-// SVGAnimatedAngle
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<SVGAngle> : public Noncopyable {
- typedef const SVGAngle& PassType;
- typedef SVGAngle ReturnType;
- typedef SVGAngle StoredType;
-
- static ReturnType null() { return SVGAngle(); }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return type.valueAsString(); }
-};
-
-// SVGAnimatedBoolean
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<bool> : public Noncopyable {
- typedef const bool& PassType;
- typedef bool ReturnType;
- typedef bool StoredType;
-
- static ReturnType null() { return false; }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return type ? "true" : "false"; }
-};
-
-// SVGAnimatedEnumeration
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<int> : public Noncopyable {
- typedef const int& PassType;
- typedef int ReturnType;
- typedef int StoredType;
-
- static ReturnType null() { return 0; }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return String::number(type); }
-};
-
-// SVGAnimatedInteger
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<long> : public Noncopyable {
- typedef const long& PassType;
- typedef long ReturnType;
- typedef long StoredType;
-
- static ReturnType null() { return 0l; }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return String::number(type); }
-};
-
-// SVGAnimatedLength
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<SVGLength> : public Noncopyable {
- typedef const SVGLength& PassType;
- typedef SVGLength ReturnType;
- typedef SVGLength StoredType;
-
- static ReturnType null() { return SVGLength(); }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return type.valueAsString(); }
-};
-
-// SVGAnimatedLengthList
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<SVGLengthList*> : public Noncopyable {
- typedef SVGLengthList* PassType;
- typedef SVGLengthList* ReturnType;
- typedef RefPtr<SVGLengthList> StoredType;
-
- static ReturnType null() { return 0; }
- static ReturnType toReturnType(const StoredType& type) { return type.get(); }
- static String toString(PassType type) { return type ? type->valueAsString() : String(); }
-};
-
// SVGAnimatedNumber
template<>
struct DeprecatedSVGAnimatedPropertyTraits<float> : public Noncopyable {
@@ -144,18 +68,6 @@ struct DeprecatedSVGAnimatedPropertyTraits<SVGPreserveAspectRatio> : public Nonc
static String toString(PassType type) { return type.valueAsString(); }
};
-// SVGAnimatedRect
-template<>
-struct DeprecatedSVGAnimatedPropertyTraits<FloatRect> : public Noncopyable {
- typedef const FloatRect& PassType;
- typedef FloatRect ReturnType;
- typedef FloatRect StoredType;
-
- static ReturnType null() { return FloatRect(); }
- static ReturnType toReturnType(const StoredType& type) { return type; }
- static String toString(PassType type) { return String::format("%f %f %f %f", type.x(), type.y(), type.width(), type.height()); }
-};
-
// SVGAnimatedString
template<>
struct DeprecatedSVGAnimatedPropertyTraits<String> : public Noncopyable {
diff --git a/WebCore/svg/DeprecatedSVGAnimatedTemplate.h b/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
index 8e29f50..939db59 100644
--- a/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
+++ b/WebCore/svg/DeprecatedSVGAnimatedTemplate.h
@@ -28,9 +28,7 @@
namespace WebCore {
- class SVGAngle;
class SVGElement;
- class SVGLengthList;
class SVGNumberList;
class SVGPreserveAspectRatio;
class SVGTransformList;
@@ -74,7 +72,7 @@ namespace WebCore {
struct DeprecatedSVGAnimatedTypeWrapperKeyHash {
static unsigned hash(const DeprecatedSVGAnimatedTypeWrapperKey& key)
{
- return StringImpl::computeHash(reinterpret_cast<const UChar*>(&key), sizeof(DeprecatedSVGAnimatedTypeWrapperKey) / sizeof(UChar));
+ return WTF::StringHasher::createBlobHash<sizeof(DeprecatedSVGAnimatedTypeWrapperKey)>(&key);
}
static bool equal(const DeprecatedSVGAnimatedTypeWrapperKey& a, const DeprecatedSVGAnimatedTypeWrapperKey& b)
@@ -156,16 +154,9 @@ namespace WebCore {
}
// Common type definitions, to ease IDL generation.
- typedef DeprecatedSVGAnimatedTemplate<SVGAngle> SVGAnimatedAngle;
- typedef DeprecatedSVGAnimatedTemplate<bool> SVGAnimatedBoolean;
- typedef DeprecatedSVGAnimatedTemplate<int> SVGAnimatedEnumeration;
- typedef DeprecatedSVGAnimatedTemplate<long> SVGAnimatedInteger;
- typedef DeprecatedSVGAnimatedTemplate<SVGLength> SVGAnimatedLength;
- typedef DeprecatedSVGAnimatedTemplate<SVGLengthList*> SVGAnimatedLengthList;
typedef DeprecatedSVGAnimatedTemplate<float> SVGAnimatedNumber;
typedef DeprecatedSVGAnimatedTemplate<SVGNumberList*> SVGAnimatedNumberList;
typedef DeprecatedSVGAnimatedTemplate<SVGPreserveAspectRatio> SVGAnimatedPreserveAspectRatio;
- typedef DeprecatedSVGAnimatedTemplate<FloatRect> SVGAnimatedRect;
typedef DeprecatedSVGAnimatedTemplate<String> SVGAnimatedString;
typedef DeprecatedSVGAnimatedTemplate<SVGTransformList*> SVGAnimatedTransformList;
diff --git a/WebCore/svg/SVGAElement.h b/WebCore/svg/SVGAElement.h
index b43f192..0effda2 100644
--- a/WebCore/svg/SVGAElement.h
+++ b/WebCore/svg/SVGAElement.h
@@ -23,7 +23,7 @@
#define SVGAElement_h
#if ENABLE(SVG)
-
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -68,7 +68,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGAElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGAElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGAngle.cpp b/WebCore/svg/SVGAngle.cpp
index 6702904..6475064 100644
--- a/WebCore/svg/SVGAngle.cpp
+++ b/WebCore/svg/SVGAngle.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.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
@@ -19,111 +20,217 @@
*/
#include "config.h"
-#include "SVGAngle.h"
#if ENABLE(SVG)
+#include "SVGAngle.h"
+#include "SVGParserUtilities.h"
+#include <wtf/text/StringConcatenate.h>
#include <wtf/MathExtras.h>
namespace WebCore {
SVGAngle::SVGAngle()
- : m_unitType(SVG_ANGLETYPE_UNKNOWN)
- , m_value(0)
+ : m_unitType(SVG_ANGLETYPE_UNSPECIFIED)
, m_valueInSpecifiedUnits(0)
{
}
+float SVGAngle::value() const
+{
+ switch (m_unitType) {
+ case SVG_ANGLETYPE_GRAD:
+ return grad2deg(m_valueInSpecifiedUnits);
+ case SVG_ANGLETYPE_RAD:
+ return rad2deg(m_valueInSpecifiedUnits);
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_UNKNOWN:
+ case SVG_ANGLETYPE_DEG:
+ return m_valueInSpecifiedUnits;
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
void SVGAngle::setValue(float value)
{
- m_value = value;
+ switch (m_unitType) {
+ case SVG_ANGLETYPE_GRAD:
+ m_valueInSpecifiedUnits = deg2grad(value);
+ break;
+ case SVG_ANGLETYPE_RAD:
+ m_valueInSpecifiedUnits = deg2rad(value);
+ break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_UNKNOWN:
+ case SVG_ANGLETYPE_DEG:
+ m_valueInSpecifiedUnits = value;
+ break;
+ }
+}
+
+inline SVGAngle::SVGAngleType stringToAngleType(const UChar*& ptr, const UChar* end)
+{
+ // If there's no unit given, the angle type is unspecified.
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNSPECIFIED;
+
+ const UChar firstChar = *ptr;
+
+ // If the unit contains only one character, the angle type is unknown.
+ ++ptr;
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+
+ const UChar secondChar = *ptr;
+
+ // If the unit contains only two characters, the angle type is unknown.
+ ++ptr;
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+
+ const UChar thirdChar = *ptr;
+ if (firstChar == 'd' && secondChar == 'e' && thirdChar == 'g')
+ return SVGAngle::SVG_ANGLETYPE_DEG;
+ if (firstChar == 'r' && secondChar == 'a' && thirdChar == 'd')
+ return SVGAngle::SVG_ANGLETYPE_RAD;
+
+ // If the unit contains three characters, but is not deg or rad, then it's unknown.
+ ++ptr;
+ if (ptr == end)
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
+
+ const UChar fourthChar = *ptr;
+
+ if (firstChar == 'g' && secondChar == 'r' && thirdChar == 'a' && fourthChar == 'd')
+ return SVGAngle::SVG_ANGLETYPE_GRAD;
+
+ return SVGAngle::SVG_ANGLETYPE_UNKNOWN;
}
-// calc m_value
-void SVGAngle::calculate()
+String SVGAngle::valueAsString() const
{
- if (m_unitType == SVG_ANGLETYPE_GRAD)
- m_value = grad2deg(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_RAD)
- m_value = rad2deg(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_UNSPECIFIED || m_unitType == SVG_ANGLETYPE_DEG)
- m_value = m_valueInSpecifiedUnits;
+ switch (m_unitType) {
+ case SVG_ANGLETYPE_DEG:
+ return makeString(String::number(m_valueInSpecifiedUnits), "deg");
+ case SVG_ANGLETYPE_RAD:
+ return makeString(String::number(m_valueInSpecifiedUnits), "rad");
+ case SVG_ANGLETYPE_GRAD:
+ return makeString(String::number(m_valueInSpecifiedUnits), "grad");
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_UNKNOWN:
+ return makeString(String::number(m_valueInSpecifiedUnits));
+ }
+
+ ASSERT_NOT_REACHED();
+ return String();
}
-void SVGAngle::setValueInSpecifiedUnits(float valueInSpecifiedUnits)
+void SVGAngle::setValueAsString(const String& value, ExceptionCode& ec)
{
+ if (value.isEmpty()) {
+ m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
+ return;
+ }
+
+ float valueInSpecifiedUnits = 0;
+ const UChar* ptr = value.characters();
+ const UChar* end = ptr + value.length();
+
+ if (!parseNumber(ptr, end, valueInSpecifiedUnits, false)) {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
+ SVGAngleType unitType = stringToAngleType(ptr, end);
+ if (unitType == SVG_ANGLETYPE_UNKNOWN) {
+ ec = SYNTAX_ERR;
+ return;
+ }
+
+ m_unitType = unitType;
m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- calculate();
}
-void SVGAngle::setValueAsString(const String& s)
+void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionCode& ec)
{
- m_valueAsString = s;
-
- bool bOK;
- m_valueInSpecifiedUnits = m_valueAsString.toFloat(&bOK);
- m_unitType = SVG_ANGLETYPE_UNSPECIFIED;
-
- if (!bOK) {
- if (m_valueAsString.endsWith("deg"))
- m_unitType = SVG_ANGLETYPE_DEG;
- else if (m_valueAsString.endsWith("grad"))
- m_unitType = SVG_ANGLETYPE_GRAD;
- else if (m_valueAsString.endsWith("rad"))
- m_unitType = SVG_ANGLETYPE_RAD;
+ if (unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
+ ec = NOT_SUPPORTED_ERR;
+ return;
}
-
- calculate();
+
+ if (unitType != m_unitType)
+ m_unitType = static_cast<SVGAngleType>(unitType);
+
+ m_valueInSpecifiedUnits = valueInSpecifiedUnits;
}
-String SVGAngle::valueAsString() const
+void SVGAngle::convertToSpecifiedUnits(unsigned short unitType, ExceptionCode& ec)
{
- m_valueAsString = String::number(m_valueInSpecifiedUnits);
+ if (unitType == SVG_ANGLETYPE_UNKNOWN || m_unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
+ ec = NOT_SUPPORTED_ERR;
+ return;
+ }
+
+ if (unitType == m_unitType)
+ return;
switch (m_unitType) {
+ case SVG_ANGLETYPE_RAD:
+ switch (unitType) {
+ case SVG_ANGLETYPE_GRAD:
+ m_valueInSpecifiedUnits = rad2grad(m_valueInSpecifiedUnits);
+ break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ case SVG_ANGLETYPE_DEG:
+ m_valueInSpecifiedUnits = rad2deg(m_valueInSpecifiedUnits);
+ break;
+ case SVG_ANGLETYPE_RAD:
+ case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ break;
+ case SVG_ANGLETYPE_GRAD:
+ switch (unitType) {
+ case SVG_ANGLETYPE_RAD:
+ m_valueInSpecifiedUnits = grad2rad(m_valueInSpecifiedUnits);
+ break;
case SVG_ANGLETYPE_UNSPECIFIED:
case SVG_ANGLETYPE_DEG:
- m_valueAsString += "deg";
+ m_valueInSpecifiedUnits = grad2deg(m_valueInSpecifiedUnits);
+ break;
+ case SVG_ANGLETYPE_GRAD:
+ case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
break;
+ }
+ break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ // Spec: For angles, a unitless value is treated the same as if degrees were specified.
+ case SVG_ANGLETYPE_DEG:
+ switch (unitType) {
case SVG_ANGLETYPE_RAD:
- m_valueAsString += "rad";
+ m_valueInSpecifiedUnits = deg2rad(m_valueInSpecifiedUnits);
break;
case SVG_ANGLETYPE_GRAD:
- m_valueAsString += "grad";
+ m_valueInSpecifiedUnits = deg2grad(m_valueInSpecifiedUnits);
break;
+ case SVG_ANGLETYPE_UNSPECIFIED:
+ break;
+ case SVG_ANGLETYPE_DEG:
case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
break;
+ }
+ break;
+ case SVG_ANGLETYPE_UNKNOWN:
+ ASSERT_NOT_REACHED();
+ break;
}
-
- return m_valueAsString;
-}
-
-void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits)
-{
- m_unitType = (SVGAngleType)unitType;
- m_valueInSpecifiedUnits = valueInSpecifiedUnits;
- calculate();
-}
-
-void SVGAngle::convertToSpecifiedUnits(unsigned short unitType)
-{
- if (m_unitType == unitType)
- return;
- if (m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_RAD)
- m_valueInSpecifiedUnits = deg2rad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_RAD)
- m_valueInSpecifiedUnits = grad2rad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_DEG && unitType == SVG_ANGLETYPE_GRAD)
- m_valueInSpecifiedUnits = deg2grad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_GRAD)
- m_valueInSpecifiedUnits = rad2grad(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_RAD && unitType == SVG_ANGLETYPE_DEG)
- m_valueInSpecifiedUnits = rad2deg(m_valueInSpecifiedUnits);
- else if (m_unitType == SVG_ANGLETYPE_GRAD && unitType == SVG_ANGLETYPE_DEG)
- m_valueInSpecifiedUnits = grad2deg(m_valueInSpecifiedUnits);
-
- m_unitType = (SVGAngleType)unitType;
+ m_unitType = static_cast<SVGAngleType>(unitType);
}
}
diff --git a/WebCore/svg/SVGAngle.h b/WebCore/svg/SVGAngle.h
index de5c3ce..4afaa4b 100644
--- a/WebCore/svg/SVGAngle.h
+++ b/WebCore/svg/SVGAngle.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.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
@@ -22,44 +23,41 @@
#define SVGAngle_h
#if ENABLE(SVG)
-#include "PlatformString.h"
+#include "ExceptionCode.h"
+#include <wtf/text/WTFString.h>
namespace WebCore {
- class SVGAngle {
- public:
- SVGAngle();
+class SVGAngle {
+public:
+ SVGAngle();
- enum SVGAngleType {
- SVG_ANGLETYPE_UNKNOWN = 0,
- SVG_ANGLETYPE_UNSPECIFIED = 1,
- SVG_ANGLETYPE_DEG = 2,
- SVG_ANGLETYPE_RAD = 3,
- SVG_ANGLETYPE_GRAD = 4
- };
-
- SVGAngleType unitType() const { return m_unitType; }
+ enum SVGAngleType {
+ SVG_ANGLETYPE_UNKNOWN = 0,
+ SVG_ANGLETYPE_UNSPECIFIED = 1,
+ SVG_ANGLETYPE_DEG = 2,
+ SVG_ANGLETYPE_RAD = 3,
+ SVG_ANGLETYPE_GRAD = 4
+ };
- void setValue(float);
- float value() const { return m_value; }
+ SVGAngleType unitType() const { return m_unitType; }
- void setValueInSpecifiedUnits(float valueInSpecifiedUnits);
- float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
+ void setValue(float);
+ float value() const;
- void setValueAsString(const String&);
- String valueAsString() const;
+ void setValueInSpecifiedUnits(float valueInSpecifiedUnits) { m_valueInSpecifiedUnits = valueInSpecifiedUnits; }
+ float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
- void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
- void convertToSpecifiedUnits(unsigned short unitType);
+ void setValueAsString(const String&, ExceptionCode&);
+ String valueAsString() const;
- private:
- SVGAngleType m_unitType;
- float m_value;
- float m_valueInSpecifiedUnits;
- mutable String m_valueAsString;
+ void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionCode&);
+ void convertToSpecifiedUnits(unsigned short unitType, ExceptionCode&);
- void calculate();
- };
+private:
+ SVGAngleType m_unitType;
+ float m_valueInSpecifiedUnits;
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGAngle.idl b/WebCore/svg/SVGAngle.idl
index cb5148c..b36670a 100644
--- a/WebCore/svg/SVGAngle.idl
+++ b/WebCore/svg/SVGAngle.idl
@@ -22,22 +22,26 @@
module svg {
- interface [Conditional=SVG, PODType=SVGAngle] SVGAngle {
+ interface [Conditional=SVG] SVGAngle {
// Angle Unit Types
- const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
+ const unsigned short SVG_ANGLETYPE_UNKNOWN = 0;
const unsigned short SVG_ANGLETYPE_UNSPECIFIED = 1;
- const unsigned short SVG_ANGLETYPE_DEG = 2;
- const unsigned short SVG_ANGLETYPE_RAD = 3;
- const unsigned short SVG_ANGLETYPE_GRAD = 4;
-
+ const unsigned short SVG_ANGLETYPE_DEG = 2;
+ const unsigned short SVG_ANGLETYPE_RAD = 3;
+ const unsigned short SVG_ANGLETYPE_GRAD = 4;
+
readonly attribute unsigned short unitType;
- attribute float value;
- attribute float valueInSpecifiedUnits;
- attribute [ConvertNullToNullString] DOMString valueAsString;
-
- void newValueSpecifiedUnits(in unsigned short unitType,
- in float valueInSpecifiedUnits);
- void convertToSpecifiedUnits(in unsigned short unitType);
+ attribute [StrictTypeChecking] float value;
+ attribute [StrictTypeChecking] float valueInSpecifiedUnits;
+
+ attribute [ConvertNullToNullString] DOMString valueAsString
+ setter raises(DOMException);
+
+ void newValueSpecifiedUnits(in unsigned short unitType, in float valueInSpecifiedUnits)
+ raises(DOMException);
+
+ void convertToSpecifiedUnits(in unsigned short unitType)
+ raises(DOMException);
};
}
diff --git a/WebCore/svg/SVGAnimatedAngle.h b/WebCore/svg/SVGAnimatedAngle.h
new file mode 100644
index 0000000..bda7a36
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedAngle.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedAngle_h
+#define SVGAnimatedAngle_h
+
+#if ENABLE(SVG)
+#include "SVGAngle.h"
+#include "SVGAnimatedPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedPropertyTearOff<SVGAngle> SVGAnimatedAngle;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedBoolean.h b/WebCore/svg/SVGAnimatedBoolean.h
new file mode 100644
index 0000000..b316e21
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedBoolean.h
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedBoolean_h
+#define SVGAnimatedBoolean_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedStaticPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedStaticPropertyTearOff<bool> SVGAnimatedBoolean;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedBoolean.idl b/WebCore/svg/SVGAnimatedBoolean.idl
index e4b831e..2591c50 100644
--- a/WebCore/svg/SVGAnimatedBoolean.idl
+++ b/WebCore/svg/SVGAnimatedBoolean.idl
@@ -26,9 +26,8 @@
module svg {
interface [Conditional=SVG] SVGAnimatedBoolean {
- attribute boolean baseVal
- /*setter raises(DOMException)*/;
- readonly attribute boolean animVal;
+ attribute [StrictTypeChecking] boolean baseVal;
+ readonly attribute [StrictTypeChecking] boolean animVal;
};
}
diff --git a/WebCore/svg/SVGAnimatedEnumeration.h b/WebCore/svg/SVGAnimatedEnumeration.h
new file mode 100644
index 0000000..4e5f073
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedEnumeration.h
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedEnumeration_h
+#define SVGAnimatedEnumeration_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedStaticPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedStaticPropertyTearOff<int> SVGAnimatedEnumeration;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedEnumeration.idl b/WebCore/svg/SVGAnimatedEnumeration.idl
index 26d5064..8a9d3b4 100644
--- a/WebCore/svg/SVGAnimatedEnumeration.idl
+++ b/WebCore/svg/SVGAnimatedEnumeration.idl
@@ -26,8 +26,7 @@
module svg {
interface [Conditional=SVG] SVGAnimatedEnumeration {
- attribute unsigned short baseVal
- /*setter raises(DOMException)*/;
+ attribute unsigned short baseVal;
readonly attribute unsigned short animVal;
};
diff --git a/WebCore/svg/SVGAnimatedInteger.h b/WebCore/svg/SVGAnimatedInteger.h
new file mode 100644
index 0000000..6d1c85d
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedInteger.h
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedInteger_h
+#define SVGAnimatedInteger_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedStaticPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedStaticPropertyTearOff<long> SVGAnimatedInteger;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedLength.h b/WebCore/svg/SVGAnimatedLength.h
new file mode 100644
index 0000000..0504fd7
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedLength.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedLength_h
+#define SVGAnimatedLength_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedPropertyTearOff.h"
+#include "SVGLength.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedPropertyTearOff<SVGLength> SVGAnimatedLength;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedLengthList.h b/WebCore/svg/SVGAnimatedLengthList.h
new file mode 100644
index 0000000..fcd8197
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedLengthList.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedLengthList_h
+#define SVGAnimatedLengthList_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedListPropertyTearOff.h"
+#include "SVGLengthList.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedListPropertyTearOff<SVGLengthList> SVGAnimatedLengthList;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimatedRect.h b/WebCore/svg/SVGAnimatedRect.h
new file mode 100644
index 0000000..ee94352
--- /dev/null
+++ b/WebCore/svg/SVGAnimatedRect.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedRect_h
+#define SVGAnimatedRect_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include "SVGAnimatedPropertyTearOff.h"
+
+namespace WebCore {
+
+typedef SVGAnimatedPropertyTearOff<FloatRect> SVGAnimatedRect;
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGAnimationElement.h b/WebCore/svg/SVGAnimationElement.h
index da48dd6..2e11fe6 100644
--- a/WebCore/svg/SVGAnimationElement.h
+++ b/WebCore/svg/SVGAnimationElement.h
@@ -24,10 +24,10 @@
#ifndef SVGAnimationElement_h
#define SVGAnimationElement_h
#if ENABLE(SVG_ANIMATION)
-
#include "ElementTimeControl.h"
#include "Path.h"
#include "SMILTime.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGSMILElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGStringList.h"
@@ -106,7 +106,7 @@ namespace WebCore {
float calculatePercentForSpline(float percent, unsigned splineIndex) const;
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
bool m_animationValid;
diff --git a/WebCore/svg/SVGCircleElement.h b/WebCore/svg/SVGCircleElement.h
index 4eb9262..5c3a62f 100644
--- a/WebCore/svg/SVGCircleElement.h
+++ b/WebCore/svg/SVGCircleElement.h
@@ -22,6 +22,8 @@
#define SVGCircleElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -49,12 +51,12 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx)
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::cyAttr, SVGLength, Cy, cy)
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::rAttr, SVGLength, R, r)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::cyAttr, SVGLength, Cy, cy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCircleElement, SVGNames::rAttr, SVGLength, R, r)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGCircleElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGClipPathElement.h b/WebCore/svg/SVGClipPathElement.h
index 7d8ada2..f28915a 100644
--- a/WebCore/svg/SVGClipPathElement.h
+++ b/WebCore/svg/SVGClipPathElement.h
@@ -22,7 +22,7 @@
#define SVGClipPathElement_h
#if ENABLE(SVG)
-#include "RenderObject.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -30,6 +30,8 @@
namespace WebCore {
+class RenderObject;
+
class SVGClipPathElement : public SVGStyledTransformableElement,
public SVGTests,
public SVGLangSpace,
@@ -50,10 +52,10 @@ private:
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
}
diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.h b/WebCore/svg/SVGComponentTransferFunctionElement.h
index 8b888af..d46668b 100644
--- a/WebCore/svg/SVGComponentTransferFunctionElement.h
+++ b/WebCore/svg/SVGComponentTransferFunctionElement.h
@@ -22,8 +22,7 @@
#define SVGComponentTransferFunctionElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "SVGElement.h"
-#include "SVGNames.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGNumberList.h"
#include "FEComponentTransfer.h"
@@ -40,7 +39,7 @@ namespace WebCore {
virtual void synchronizeProperty(const QualifiedName&);
private:
- DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::typeAttr, int, Type, type)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::typeAttr, int, Type, type)
DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::tableValuesAttr, SVGNumberList*, TableValues, tableValues)
DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::slopeAttr, float, Slope, slope)
DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::interceptAttr, float, Intercept, intercept)
diff --git a/WebCore/svg/SVGCursorElement.h b/WebCore/svg/SVGCursorElement.h
index ce4d129..e09739a 100644
--- a/WebCore/svg/SVGCursorElement.h
+++ b/WebCore/svg/SVGCursorElement.h
@@ -22,7 +22,8 @@
#define SVGCursorElement_h
#if ENABLE(SVG)
-#include "SVGLength.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGElement.h"
#include "SVGTests.h"
#include "SVGURIReference.h"
@@ -53,14 +54,14 @@ namespace WebCore {
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
- DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCursorElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGCursorElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
HashSet<SVGElement*> m_clients;
};
diff --git a/WebCore/svg/SVGDefsElement.h b/WebCore/svg/SVGDefsElement.h
index 4a60bb5..ecf2d69 100644
--- a/WebCore/svg/SVGDefsElement.h
+++ b/WebCore/svg/SVGDefsElement.h
@@ -22,6 +22,7 @@
#define SVGDefsElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -45,7 +46,7 @@ namespace WebCore {
virtual void synchronizeProperty(const QualifiedName&);
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp
index ea79e78..6c2c4a2 100644
--- a/WebCore/svg/SVGElement.cpp
+++ b/WebCore/svg/SVGElement.cpp
@@ -42,6 +42,8 @@
#include "SVGElementRareData.h"
#include "SVGNames.h"
#include "SVGSVGElement.h"
+#include "SVGStyledLocatableElement.h"
+#include "SVGTextElement.h"
#include "SVGURIReference.h"
#include "SVGUseElement.h"
#include "ScriptEventListener.h"
@@ -179,6 +181,19 @@ const HashSet<SVGElementInstance*>& SVGElement::instancesForElement() const
return rareSVGData()->elementInstances();
}
+bool SVGElement::boundingBox(FloatRect& rect, SVGLocatable::StyleUpdateStrategy styleUpdateStrategy) const
+{
+ if (isStyledLocatable()) {
+ rect = static_cast<const SVGStyledLocatableElement*>(this)->getBBox(styleUpdateStrategy);
+ return true;
+ }
+ if (hasTagName(SVGNames::textTag)) {
+ rect = static_cast<const SVGTextElement*>(this)->getBBox(styleUpdateStrategy);
+ return true;
+ }
+ return false;
+}
+
void SVGElement::setCursorElement(SVGCursorElement* cursorElement)
{
ensureRareSVGData()->setCursorElement(cursorElement);
diff --git a/WebCore/svg/SVGElement.h b/WebCore/svg/SVGElement.h
index 5681284..517515f 100644
--- a/WebCore/svg/SVGElement.h
+++ b/WebCore/svg/SVGElement.h
@@ -24,6 +24,7 @@
#if ENABLE(SVG)
#include "SVGDocumentExtensions.h"
+#include "SVGLocatable.h"
#include "StyledElement.h"
namespace WebCore {
@@ -71,6 +72,8 @@ namespace WebCore {
const HashSet<SVGElementInstance*>& instancesForElement() const;
+ bool boundingBox(FloatRect&, SVGLocatable::StyleUpdateStrategy = SVGLocatable::AllowStyleUpdate) const;
+
void setCursorElement(SVGCursorElement*);
void setCursorImageValue(CSSCursorImageValue*);
diff --git a/WebCore/svg/SVGEllipseElement.h b/WebCore/svg/SVGEllipseElement.h
index cad329e..3bd7a50 100644
--- a/WebCore/svg/SVGEllipseElement.h
+++ b/WebCore/svg/SVGEllipseElement.h
@@ -22,6 +22,8 @@
#define SVGEllipseElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -49,13 +51,13 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx)
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::cyAttr, SVGLength, Cy, cy)
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::rxAttr, SVGLength, Rx, rx)
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::ryAttr, SVGLength, Ry, ry)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::cyAttr, SVGLength, Cy, cy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::rxAttr, SVGLength, Rx, rx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGEllipseElement, SVGNames::ryAttr, SVGLength, Ry, ry)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGExternalResourcesRequired.cpp b/WebCore/svg/SVGExternalResourcesRequired.cpp
index c976b0f..beae203 100644
--- a/WebCore/svg/SVGExternalResourcesRequired.cpp
+++ b/WebCore/svg/SVGExternalResourcesRequired.cpp
@@ -24,6 +24,7 @@
#include "SVGExternalResourcesRequired.h"
#include "Attr.h"
+#include "SVGNames.h"
namespace WebCore {
diff --git a/WebCore/svg/SVGExternalResourcesRequired.h b/WebCore/svg/SVGExternalResourcesRequired.h
index 5f0d8e9..7a37267 100644
--- a/WebCore/svg/SVGExternalResourcesRequired.h
+++ b/WebCore/svg/SVGExternalResourcesRequired.h
@@ -22,28 +22,26 @@
#define SVGExternalResourcesRequired_h
#if ENABLE(SVG)
-#include "SVGElement.h"
-#include "SVGNames.h"
-
namespace WebCore {
- class Attribute;
+class Attribute;
+class QualifiedName;
- // Notes on a SVG 1.1 spec discrepancy:
- // The SVG DOM defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the
- // SVG language definition says that externalResourcesRequired is not animated. Because the SVG language definition
- // states that externalResourcesRequired cannot be animated, the animVal will always be the same as the baseVal.
- // FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired
- class SVGExternalResourcesRequired {
- public:
- virtual ~SVGExternalResourcesRequired() { }
+// Notes on a SVG 1.1 spec discrepancy:
+// The SVG DOM defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the
+// SVG language definition says that externalResourcesRequired is not animated. Because the SVG language definition
+// states that externalResourcesRequired cannot be animated, the animVal will always be the same as the baseVal.
+// FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired
+class SVGExternalResourcesRequired {
+public:
+ virtual ~SVGExternalResourcesRequired() { }
- bool parseMappedAttribute(Attribute*);
- bool isKnownAttribute(const QualifiedName&);
+ bool parseMappedAttribute(Attribute*);
+ bool isKnownAttribute(const QualifiedName&);
- protected:
- virtual void setExternalResourcesRequiredBaseValue(DeprecatedSVGAnimatedPropertyTraits<bool>::PassType) = 0;
- };
+protected:
+ virtual void setExternalResourcesRequiredBaseValue(const bool&) = 0;
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEBlendElement.h b/WebCore/svg/SVGFEBlendElement.h
index c8c5deb..a0010be 100644
--- a/WebCore/svg/SVGFEBlendElement.h
+++ b/WebCore/svg/SVGFEBlendElement.h
@@ -40,7 +40,7 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2)
- DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEColorMatrixElement.h b/WebCore/svg/SVGFEColorMatrixElement.h
index 5d626a2..5ec301f 100644
--- a/WebCore/svg/SVGFEColorMatrixElement.h
+++ b/WebCore/svg/SVGFEColorMatrixElement.h
@@ -41,7 +41,7 @@ private:
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList*, Values, values)
};
diff --git a/WebCore/svg/SVGFECompositeElement.h b/WebCore/svg/SVGFECompositeElement.h
index 6d47cac..95443e4 100644
--- a/WebCore/svg/SVGFECompositeElement.h
+++ b/WebCore/svg/SVGFECompositeElement.h
@@ -41,7 +41,7 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)
- DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k2Attr, float, K2, k2)
DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k3Attr, float, K3, k3)
diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.h b/WebCore/svg/SVGFEConvolveMatrixElement.h
index 5c4e8c4..cb31949 100644
--- a/WebCore/svg/SVGFEConvolveMatrixElement.h
+++ b/WebCore/svg/SVGFEConvolveMatrixElement.h
@@ -42,17 +42,17 @@ private:
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY)
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::kernelMatrixAttr, SVGNumberList*, KernelMatrix, kernelMatrix)
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::divisorAttr, float, Divisor, divisor)
DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::biasAttr, float, Bias, bias)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, long, TargetX, targetX)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, long, TargetY, targetY)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, int, EdgeMode, edgeMode)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, long, TargetX, targetX)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, long, TargetY, targetY)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, int, EdgeMode, edgeMode)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
- DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, bool, PreserveAlpha, preserveAlpha)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, bool, PreserveAlpha, preserveAlpha)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
index d2e15f8..ccdf8a0 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp
@@ -32,9 +32,6 @@
namespace WebCore {
-char SVGKernelUnitLengthXIdentifier[] = "SVGKernelUnitLengthX";
-char SVGKernelUnitLengthYIdentifier[] = "SVGKernelUnitLengthY";
-
inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* document)
: SVGFilterPrimitiveStandardAttributes(tagName, document)
, m_diffuseConstant(1)
@@ -47,6 +44,18 @@ PassRefPtr<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(cons
return adoptRef(new SVGFEDiffuseLightingElement(tagName, document));
}
+const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
+ return s_identifier;
+}
+
void SVGFEDiffuseLightingElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h
index e0dbfc4..b8f56a6 100644
--- a/WebCore/svg/SVGFEDiffuseLightingElement.h
+++ b/WebCore/svg/SVGFEDiffuseLightingElement.h
@@ -28,9 +28,6 @@
namespace WebCore {
-extern char SVGKernelUnitLengthXIdentifier[];
-extern char SVGKernelUnitLengthYIdentifier[];
-
class FEDiffuseLighting;
class SVGColor;
@@ -46,11 +43,14 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& kernelUnitLengthXIdentifier();
+ static const AtomicString& kernelUnitLengthYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant)
DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
PassRefPtr<LightSource> findLights() const;
};
diff --git a/WebCore/svg/SVGFEDisplacementMapElement.h b/WebCore/svg/SVGFEDisplacementMapElement.h
index 21fd83f..c42783c 100644
--- a/WebCore/svg/SVGFEDisplacementMapElement.h
+++ b/WebCore/svg/SVGFEDisplacementMapElement.h
@@ -41,8 +41,8 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2)
- DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
- DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::scaleAttr, float, Scale, scale)
};
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.cpp b/WebCore/svg/SVGFEGaussianBlurElement.cpp
index a9fef61..e307a8ea 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.cpp
+++ b/WebCore/svg/SVGFEGaussianBlurElement.cpp
@@ -29,9 +29,6 @@
namespace WebCore {
-char SVGStdDeviationXAttrIdentifier[] = "SVGStdDeviationXAttr";
-char SVGStdDeviationYAttrIdentifier[] = "SVGStdDeviationYAttr";
-
inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* document)
: SVGFilterPrimitiveStandardAttributes(tagName, document)
{
@@ -42,6 +39,18 @@ PassRefPtr<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const Qual
return adoptRef(new SVGFEGaussianBlurElement(tagName, document));
}
+const AtomicString& SVGFEGaussianBlurElement::stdDeviationXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGStdDeviationX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFEGaussianBlurElement::stdDeviationYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGStdDeviationY"));
+ return s_identifier;
+}
+
void SVGFEGaussianBlurElement::setStdDeviation(float x, float y)
{
setStdDeviationXBaseValue(x);
diff --git a/WebCore/svg/SVGFEGaussianBlurElement.h b/WebCore/svg/SVGFEGaussianBlurElement.h
index 90f956c..d1579a5 100644
--- a/WebCore/svg/SVGFEGaussianBlurElement.h
+++ b/WebCore/svg/SVGFEGaussianBlurElement.h
@@ -27,9 +27,6 @@
namespace WebCore {
-extern char SVGStdDeviationXAttrIdentifier[];
-extern char SVGStdDeviationYAttrIdentifier[];
-
class SVGFEGaussianBlurElement : public SVGFilterPrimitiveStandardAttributes {
public:
static PassRefPtr<SVGFEGaussianBlurElement> create(const QualifiedName&, Document*);
@@ -44,9 +41,12 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& stdDeviationXIdentifier();
+ static const AtomicString& stdDeviationYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationXAttrIdentifier, float, StdDeviationX, stdDeviationX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationYAttrIdentifier, float, StdDeviationY, stdDeviationY)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), float, StdDeviationX, stdDeviationX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), float, StdDeviationY, stdDeviationY)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFEImageElement.h b/WebCore/svg/SVGFEImageElement.h
index b5fad48..901cb19 100644
--- a/WebCore/svg/SVGFEImageElement.h
+++ b/WebCore/svg/SVGFEImageElement.h
@@ -62,7 +62,7 @@ private:
DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
CachedResourceHandle<CachedImage> m_cachedImage;
OwnPtr<ImageBuffer> m_targetImage;
diff --git a/WebCore/svg/SVGFEMorphologyElement.h b/WebCore/svg/SVGFEMorphologyElement.h
index 6bbc20c..671e7f0 100644
--- a/WebCore/svg/SVGFEMorphologyElement.h
+++ b/WebCore/svg/SVGFEMorphologyElement.h
@@ -43,8 +43,11 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& radiusXIdentifier();
+ static const AtomicString& radiusYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1)
- DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusXAttrIdentifier, float, RadiusX, radiusX)
DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusYAttrIdentifier, float, RadiusY, radiusY)
};
diff --git a/WebCore/svg/SVGFESpecularLightingElement.cpp b/WebCore/svg/SVGFESpecularLightingElement.cpp
index 1647525..949b183 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.cpp
+++ b/WebCore/svg/SVGFESpecularLightingElement.cpp
@@ -45,6 +45,18 @@ PassRefPtr<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(co
return adoptRef(new SVGFESpecularLightingElement(tagName, document));
}
+const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
+ return s_identifier;
+}
+
void SVGFESpecularLightingElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h
index 378bc49..82093eb 100644
--- a/WebCore/svg/SVGFESpecularLightingElement.h
+++ b/WebCore/svg/SVGFESpecularLightingElement.h
@@ -28,9 +28,6 @@
namespace WebCore {
-extern char SVGKernelUnitLengthXIdentifier[];
-extern char SVGKernelUnitLengthYIdentifier[];
-
class SVGFESpecularLightingElement : public SVGFilterPrimitiveStandardAttributes {
public:
static PassRefPtr<SVGFESpecularLightingElement> create(const QualifiedName&, Document*);
@@ -42,12 +39,15 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
+ static const AtomicString& kernelUnitLengthXIdentifier();
+ static const AtomicString& kernelUnitLengthYIdentifier();
+
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1)
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant)
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
PassRefPtr<LightSource> findLights() const;
};
diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp
index 5339e02..7a4d7d4 100644
--- a/WebCore/svg/SVGFETurbulenceElement.cpp
+++ b/WebCore/svg/SVGFETurbulenceElement.cpp
@@ -28,9 +28,6 @@
namespace WebCore {
-char SVGBaseFrequencyXIdentifier[] = "SVGBaseFrequencyX";
-char SVGBaseFrequencyYIdentifier[] = "SVGBaseFrequencyY";
-
inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* document)
: SVGFilterPrimitiveStandardAttributes(tagName, document)
, m_numOctaves(1)
@@ -44,6 +41,18 @@ PassRefPtr<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const Qualifie
return adoptRef(new SVGFETurbulenceElement(tagName, document));
}
+const AtomicString& SVGFETurbulenceElement::baseFrequencyXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGBaseFrequencyX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGBaseFrequencyY"));
+ return s_identifier;
+}
+
void SVGFETurbulenceElement::parseMappedAttribute(Attribute* attr)
{
const String& value = attr->value();
diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h
index 20e9ed6..cbe0643 100644
--- a/WebCore/svg/SVGFETurbulenceElement.h
+++ b/WebCore/svg/SVGFETurbulenceElement.h
@@ -27,9 +27,6 @@
namespace WebCore {
-extern char SVGBaseFrequencyXIdentifier[];
-extern char SVGBaseFrequencyYIdentifier[];
-
enum SVGStitchOptions {
SVG_STITCHTYPE_UNKNOWN = 0,
SVG_STITCHTYPE_STITCH = 1,
@@ -48,12 +45,15 @@ private:
virtual void synchronizeProperty(const QualifiedName&);
virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyXIdentifier, float, BaseFrequencyX, baseFrequencyX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyYIdentifier, float, BaseFrequencyY, baseFrequencyY)
- DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
+ static const AtomicString& baseFrequencyXIdentifier();
+ static const AtomicString& baseFrequencyYIdentifier();
+
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyXIdentifier(), float, BaseFrequencyX, baseFrequencyX)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyYIdentifier(), float, BaseFrequencyY, baseFrequencyY)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::seedAttr, float, Seed, seed)
- DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
- DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp
index 3418b9d..8c56c46 100644
--- a/WebCore/svg/SVGFilterElement.cpp
+++ b/WebCore/svg/SVGFilterElement.cpp
@@ -39,9 +39,6 @@
namespace WebCore {
-char SVGFilterResXIdentifier[] = "SVGFilterResX";
-char SVGFilterResYIdentifier[] = "SVGFilterResY";
-
inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* document)
: SVGStyledElement(tagName, document)
, SVGURIReference()
@@ -63,6 +60,18 @@ PassRefPtr<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagNa
return adoptRef(new SVGFilterElement(tagName, document));
}
+const AtomicString& SVGFilterElement::filterResXIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGFilterResX"));
+ return s_identifier;
+}
+
+const AtomicString& SVGFilterElement::filterResYIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGFilterResY"));
+ return s_identifier;
+}
+
void SVGFilterElement::setFilterRes(unsigned long filterResX, unsigned long filterResY)
{
setFilterResXBaseValue(filterResX);
diff --git a/WebCore/svg/SVGFilterElement.h b/WebCore/svg/SVGFilterElement.h
index c228fe7..ce9f75e 100644
--- a/WebCore/svg/SVGFilterElement.h
+++ b/WebCore/svg/SVGFilterElement.h
@@ -24,6 +24,8 @@
#define SVGFilterElement_h
#if ENABLE(SVG) && ENABLE(FILTERS)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "RenderObject.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
@@ -32,9 +34,6 @@
namespace WebCore {
-extern char SVGFilterResXIdentifier[];
-extern char SVGFilterResYIdentifier[];
-
class SVGFilterElement : public SVGStyledElement,
public SVGURIReference,
public SVGLangSpace,
@@ -59,20 +58,24 @@ private:
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResXIdentifier, long, FilterResX, filterResX)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFilterElement, SVGNames::filterResAttr, SVGFilterResYIdentifier, long, FilterResY, filterResY)
+ static const AtomicString& filterResXIdentifier();
+ static const AtomicString& filterResYIdentifier();
+
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterElement, SVGNames::heightAttr, SVGLength, Height, height)
+
+ DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFilterElement, SVGNames::filterResAttr, filterResXIdentifier(), long, FilterResX, filterResX)
+ DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFilterElement, SVGNames::filterResAttr, filterResYIdentifier(), long, FilterResY, filterResY)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
}
diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
index 0ffa1c9..6202888 100644
--- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
+++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
@@ -24,6 +24,8 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "FilterEffect.h"
#include "RenderSVGResource.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGFilterBuilder.h"
#include "SVGFilterElement.h"
#include "SVGNames.h"
@@ -60,10 +62,10 @@ private:
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, SVGLength, Height, height)
DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, String, Result, result)
};
diff --git a/WebCore/svg/SVGFitToViewBox.h b/WebCore/svg/SVGFitToViewBox.h
index ecc89bb..df41fce 100644
--- a/WebCore/svg/SVGFitToViewBox.h
+++ b/WebCore/svg/SVGFitToViewBox.h
@@ -39,7 +39,7 @@ public:
bool parseMappedAttribute(Document*, Attribute*);
bool isKnownAttribute(const QualifiedName&);
- virtual void setViewBoxBaseValue(DeprecatedSVGAnimatedPropertyTraits<FloatRect>::PassType) = 0;
+ virtual void setViewBoxBaseValue(const FloatRect&) = 0;
virtual void setPreserveAspectRatioBaseValue(DeprecatedSVGAnimatedPropertyTraits<SVGPreserveAspectRatio>::PassType) = 0;
private:
diff --git a/WebCore/svg/SVGFontElement.h b/WebCore/svg/SVGFontElement.h
index 98bf766..e81ac61 100644
--- a/WebCore/svg/SVGFontElement.h
+++ b/WebCore/svg/SVGFontElement.h
@@ -23,6 +23,7 @@
#define SVGFontElement_h
#if ENABLE(SVG_FONTS)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGGlyphElement.h"
#include "SVGGlyphMap.h"
@@ -74,7 +75,7 @@ private:
void ensureGlyphCache() const;
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGFontElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFontElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
mutable KerningPairVector m_horizontalKerningPairs;
mutable KerningPairVector m_verticalKerningPairs;
diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp
index 4884074..0c74d08 100644
--- a/WebCore/svg/SVGFontFaceElement.cpp
+++ b/WebCore/svg/SVGFontFaceElement.cpp
@@ -288,7 +288,7 @@ void SVGFontFaceElement::rebuildFontFace()
list = srcElement->srcValue();
}
- if (!list)
+ if (!list || !list->length())
return;
// Parse in-memory CSS rules
diff --git a/WebCore/svg/SVGFontFaceSrcElement.cpp b/WebCore/svg/SVGFontFaceSrcElement.cpp
index 891ddcd..e003944 100644
--- a/WebCore/svg/SVGFontFaceSrcElement.cpp
+++ b/WebCore/svg/SVGFontFaceSrcElement.cpp
@@ -47,10 +47,13 @@ PassRefPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const
{
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ RefPtr<CSSFontFaceSrcValue> srcValue;
if (child->hasTagName(font_face_uriTag))
- list->append(static_cast<SVGFontFaceUriElement*>(child)->srcValue());
+ srcValue = static_cast<SVGFontFaceUriElement*>(child)->srcValue();
else if (child->hasTagName(font_face_nameTag))
- list->append(static_cast<SVGFontFaceNameElement*>(child)->srcValue());
+ srcValue = static_cast<SVGFontFaceNameElement*>(child)->srcValue();
+ if (srcValue && srcValue->resource().length())
+ list->append(srcValue);
}
return list;
}
diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h
index a587134..55ddb3c 100644
--- a/WebCore/svg/SVGForeignObjectElement.h
+++ b/WebCore/svg/SVGForeignObjectElement.h
@@ -21,6 +21,8 @@
#define SVGForeignObjectElement_h
#if ENABLE(SVG) && ENABLE(SVG_FOREIGN_OBJECT)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGTests.h"
#include "SVGLangSpace.h"
#include "SVGURIReference.h"
@@ -50,16 +52,16 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGForeignObjectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGGElement.h b/WebCore/svg/SVGGElement.h
index b47eaba..b0003d1 100644
--- a/WebCore/svg/SVGGElement.h
+++ b/WebCore/svg/SVGGElement.h
@@ -22,6 +22,7 @@
#define SVGGElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -53,7 +54,7 @@ namespace WebCore {
virtual bool rendererIsNeeded(RenderStyle*);
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGGradientElement.h b/WebCore/svg/SVGGradientElement.h
index d1e7914..fdfb72c 100644
--- a/WebCore/svg/SVGGradientElement.h
+++ b/WebCore/svg/SVGGradientElement.h
@@ -23,6 +23,7 @@
#if ENABLE(SVG)
#include "Gradient.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGStyledElement.h"
#include "SVGTransformList.h"
@@ -48,15 +49,15 @@ namespace WebCore {
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod)
- DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits)
DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientTransformAttr, SVGTransformList*, GradientTransform, gradientTransform)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGGradientElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGGradientElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGImageElement.h b/WebCore/svg/SVGImageElement.h
index 9024415..ee105d2 100644
--- a/WebCore/svg/SVGImageElement.h
+++ b/WebCore/svg/SVGImageElement.h
@@ -22,6 +22,8 @@
#define SVGImageElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGImageLoader.h"
@@ -64,17 +66,17 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
virtual void willMoveToNewOwnerDocument();
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGImageElement, SVGNames::heightAttr, SVGLength, Height, height)
DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGImageElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
SVGImageLoader m_imageLoader;
};
diff --git a/WebCore/svg/SVGLength.idl b/WebCore/svg/SVGLength.idl
index d1cb572..166019e 100644
--- a/WebCore/svg/SVGLength.idl
+++ b/WebCore/svg/SVGLength.idl
@@ -22,7 +22,7 @@
module svg {
- interface [Conditional=SVG, PODType=SVGLength] SVGLength {
+ interface [Conditional=SVG] SVGLength {
// Length Unit Types
const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
const unsigned short SVG_LENGTHTYPE_NUMBER = 1;
diff --git a/WebCore/svg/SVGLengthList.cpp b/WebCore/svg/SVGLengthList.cpp
index 2149e04..3ab7c1a 100644
--- a/WebCore/svg/SVGLengthList.cpp
+++ b/WebCore/svg/SVGLengthList.cpp
@@ -24,18 +24,13 @@
#include "SVGLengthList.h"
#include "SVGParserUtilities.h"
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
-SVGLengthList::SVGLengthList(const QualifiedName& attributeName)
- : SVGPODList<SVGLength>(attributeName)
-{
-}
-
void SVGLengthList::parse(const String& value, SVGLengthMode mode)
{
- ExceptionCode ec = 0;
- clear(ec);
+ clear();
const UChar* ptr = value.characters();
const UChar* end = ptr + value.length();
@@ -48,25 +43,24 @@ void SVGLengthList::parse(const String& value, SVGLengthMode mode)
SVGLength length(mode);
if (!length.setValueAsString(String(start, ptr - start)))
return;
- appendItem(length, ec);
+ append(length);
skipOptionalSpacesOrDelimiter(ptr, end);
}
}
String SVGLengthList::valueAsString() const
{
- String result;
+ StringBuilder builder;
- ExceptionCode ec = 0;
- for (unsigned int i = 0; i < numberOfItems(); ++i) {
+ unsigned size = this->size();
+ for (unsigned i = 0; i < size; ++i) {
if (i > 0)
- result += ", ";
+ builder.append(", ");
- result += getItem(i, ec).valueAsString();
- ASSERT(ec == 0);
+ builder.append(at(i).valueAsString());
}
- return result;
+ return builder.toString();
}
}
diff --git a/WebCore/svg/SVGLengthList.h b/WebCore/svg/SVGLengthList.h
index 27b958f..8b08557 100644
--- a/WebCore/svg/SVGLengthList.h
+++ b/WebCore/svg/SVGLengthList.h
@@ -23,21 +23,17 @@
#if ENABLE(SVG)
#include "SVGLength.h"
-#include "SVGList.h"
+#include <wtf/Vector.h>
namespace WebCore {
- class SVGLengthList : public SVGPODList<SVGLength> {
- public:
- static PassRefPtr<SVGLengthList> create(const QualifiedName& attributeName) { return adoptRef(new SVGLengthList(attributeName)); }
+class SVGLengthList : public Vector<SVGLength> {
+public:
+ SVGLengthList() { }
- void parse(const String& value, SVGLengthMode);
-
- String valueAsString() const;
-
- private:
- SVGLengthList(const QualifiedName&);
- };
+ void parse(const String& value, SVGLengthMode);
+ String valueAsString() const;
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGLengthList.idl b/WebCore/svg/SVGLengthList.idl
index a5771d2..73a8d21 100644
--- a/WebCore/svg/SVGLengthList.idl
+++ b/WebCore/svg/SVGLengthList.idl
@@ -26,7 +26,7 @@
module svg {
- interface [Conditional=SVG] SVGLengthList {
+ interface [Conditional=SVG, SVGListProperty=SVGLengthList] SVGLengthList {
readonly attribute unsigned long numberOfItems;
void clear()
diff --git a/WebCore/svg/SVGLineElement.h b/WebCore/svg/SVGLineElement.h
index 55a268c..4e876e1 100644
--- a/WebCore/svg/SVGLineElement.h
+++ b/WebCore/svg/SVGLineElement.h
@@ -22,6 +22,8 @@
#define SVGLineElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -53,13 +55,13 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1)
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::y1Attr, SVGLength, Y1, y1)
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::x2Attr, SVGLength, X2, x2)
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::y2Attr, SVGLength, Y2, y2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::y1Attr, SVGLength, Y1, y1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::x2Attr, SVGLength, X2, x2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLineElement, SVGNames::y2Attr, SVGLength, Y2, y2)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGLineElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGLinearGradientElement.h b/WebCore/svg/SVGLinearGradientElement.h
index 86bebf3..4ebe9f6 100644
--- a/WebCore/svg/SVGLinearGradientElement.h
+++ b/WebCore/svg/SVGLinearGradientElement.h
@@ -22,6 +22,8 @@
#define SVGLinearGradientElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGGradientElement.h"
namespace WebCore {
@@ -47,10 +49,10 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1)
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::y1Attr, SVGLength, Y1, y1)
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::x2Attr, SVGLength, X2, x2)
- DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::y2Attr, SVGLength, Y2, y2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::y1Attr, SVGLength, Y1, y1)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::x2Attr, SVGLength, X2, x2)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGLinearGradientElement, SVGNames::y2Attr, SVGLength, Y2, y2)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGMPathElement.h b/WebCore/svg/SVGMPathElement.h
index 1bbe7d3..c025cf9 100644
--- a/WebCore/svg/SVGMPathElement.h
+++ b/WebCore/svg/SVGMPathElement.h
@@ -21,8 +21,9 @@
#define SVGMPathElement_h
#if ENABLE(SVG)
-#include "SVGURIReference.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
+#include "SVGURIReference.h"
namespace WebCore {
@@ -46,7 +47,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGMPathElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGMPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGMarkerElement.cpp b/WebCore/svg/SVGMarkerElement.cpp
index 4ff420d..ef2b3dd 100644
--- a/WebCore/svg/SVGMarkerElement.cpp
+++ b/WebCore/svg/SVGMarkerElement.cpp
@@ -35,9 +35,6 @@
namespace WebCore {
-char SVGOrientTypeAttrIdentifier[] = "SVGOrientTypeAttr";
-char SVGOrientAngleAttrIdentifier[] = "SVGOrientAngleAttr";
-
SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* document)
: SVGStyledElement(tagName, document)
, m_refX(LengthModeWidth)
@@ -55,6 +52,18 @@ PassRefPtr<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagNa
return adoptRef(new SVGMarkerElement(tagName, document));
}
+const AtomicString& SVGMarkerElement::orientTypeIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGOrientType"));
+ return s_identifier;
+}
+
+const AtomicString& SVGMarkerElement::orientAngleIdentifier()
+{
+ DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGOrientAngle"));
+ return s_identifier;
+}
+
AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
{
return SVGFitToViewBox::viewBoxToViewTransform(viewBox(), preserveAspectRatio(), viewWidth, viewHeight);
@@ -81,7 +90,8 @@ void SVGMarkerElement::parseMappedAttribute(Attribute* attr)
if (attr->value() == "auto")
setOrientTypeBaseValue(SVG_MARKER_ORIENT_AUTO);
else {
- angle.setValueAsString(attr->value());
+ ExceptionCode ec = 0;
+ angle.setValueAsString(attr->value(), ec);
setOrientTypeBaseValue(SVG_MARKER_ORIENT_ANGLE);
}
diff --git a/WebCore/svg/SVGMarkerElement.h b/WebCore/svg/SVGMarkerElement.h
index 7782739..fd67cfc 100644
--- a/WebCore/svg/SVGMarkerElement.h
+++ b/WebCore/svg/SVGMarkerElement.h
@@ -24,6 +24,8 @@
#if ENABLE(SVG)
#include "RenderObject.h"
#include "SVGAngle.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -33,9 +35,6 @@ namespace WebCore {
class Document;
-extern char SVGOrientTypeAttrIdentifier[];
-extern char SVGOrientAngleAttrIdentifier[];
-
class SVGMarkerElement : public SVGStyledElement,
public SVGLangSpace,
public SVGExternalResourcesRequired,
@@ -74,19 +73,22 @@ private:
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientTypeAttrIdentifier, int, OrientType, orientType)
- DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, SVGOrientAngleAttrIdentifier, SVGAngle, OrientAngle, orientAngle)
+ static const AtomicString& orientTypeIdentifier();
+ static const AtomicString& orientAngleIdentifier();
+
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::refYAttr, SVGLength, RefY, refY)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerWidthAttr, SVGLength, MarkerWidth, markerWidth)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerHeightAttr, SVGLength, MarkerHeight, markerHeight)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMarkerElement, SVGNames::markerUnitsAttr, int, MarkerUnits, markerUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGMarkerElement, SVGNames::orientAttr, orientTypeIdentifier(), int, OrientType, orientType)
+ DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGMarkerElement, SVGNames::orientAttr, orientAngleIdentifier(), SVGAngle, OrientAngle, orientAngle)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMarkerElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
};
diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h
index c951beb..599d184 100644
--- a/WebCore/svg/SVGMaskElement.h
+++ b/WebCore/svg/SVGMaskElement.h
@@ -22,6 +22,8 @@
#if ENABLE(SVG)
#include "RenderObject.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledLocatableElement.h"
@@ -55,15 +57,15 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskUnitsAttr, int, MaskUnits, maskUnits)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskContentUnitsAttr, int, MaskContentUnits, maskContentUnits)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMaskElement, SVGNames::maskUnitsAttr, int, MaskUnits, maskUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMaskElement, SVGNames::maskContentUnitsAttr, int, MaskContentUnits, maskContentUnits)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGMaskElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGMaskElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
}
diff --git a/WebCore/svg/SVGNumber.idl b/WebCore/svg/SVGNumber.idl
index f57ff40..32e9620 100644
--- a/WebCore/svg/SVGNumber.idl
+++ b/WebCore/svg/SVGNumber.idl
@@ -23,8 +23,7 @@
module svg {
interface [Conditional=SVG, PODType=float] SVGNumber {
- attribute float value
- setter raises(DOMException);
+ attribute float value;
};
}
diff --git a/WebCore/svg/SVGPathElement.h b/WebCore/svg/SVGPathElement.h
index 394983d..f4e2b8a 100644
--- a/WebCore/svg/SVGPathElement.h
+++ b/WebCore/svg/SVGPathElement.h
@@ -23,6 +23,7 @@
#if ENABLE(SVG)
#include "SVGAnimatedPathData.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -107,7 +108,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGPathElement, SVGNames::pathLengthAttr, float, PathLength, pathLength)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPathElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGPatternElement.h b/WebCore/svg/SVGPatternElement.h
index a93c54c..84e0415 100644
--- a/WebCore/svg/SVGPatternElement.h
+++ b/WebCore/svg/SVGPatternElement.h
@@ -22,6 +22,8 @@
#define SVGPatternElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -62,22 +64,22 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::heightAttr, SVGLength, Height, height)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternUnitsAttr, int, PatternUnits, patternUnits)
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternContentUnitsAttr, int, PatternContentUnits, patternContentUnits)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::patternUnitsAttr, int, PatternUnits, patternUnits)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::patternContentUnitsAttr, int, PatternContentUnits, patternContentUnits)
DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::patternTransformAttr, SVGTransformList*, PatternTransform, patternTransform)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGPatternElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPatternElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGPatternElement
- DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGPatternElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
};
diff --git a/WebCore/svg/SVGPoint.idl b/WebCore/svg/SVGPoint.idl
index e93baf1..46ca671 100644
--- a/WebCore/svg/SVGPoint.idl
+++ b/WebCore/svg/SVGPoint.idl
@@ -23,10 +23,8 @@
module svg {
interface [Conditional=SVG, PODType=FloatPoint] SVGPoint {
- attribute float x
- setter raises(DOMException);
- attribute float y
- setter raises(DOMException);
+ attribute float x;
+ attribute float y;
SVGPoint matrixTransform(in SVGMatrix matrix);
};
diff --git a/WebCore/svg/SVGPolyElement.h b/WebCore/svg/SVGPolyElement.h
index 6d36f4b..64d4abb 100644
--- a/WebCore/svg/SVGPolyElement.h
+++ b/WebCore/svg/SVGPolyElement.h
@@ -23,6 +23,7 @@
#if ENABLE(SVG)
#include "SVGAnimatedPoints.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -52,7 +53,7 @@ namespace WebCore {
virtual bool supportsMarkers() const { return true; }
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
mutable RefPtr<SVGPointList> m_points;
};
diff --git a/WebCore/svg/SVGRadialGradientElement.h b/WebCore/svg/SVGRadialGradientElement.h
index 61333af..f223514 100644
--- a/WebCore/svg/SVGRadialGradientElement.h
+++ b/WebCore/svg/SVGRadialGradientElement.h
@@ -22,6 +22,8 @@
#define SVGRadialGradientElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGGradientElement.h"
namespace WebCore {
@@ -47,11 +49,11 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::cyAttr, SVGLength, Cy, cy)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::rAttr, SVGLength, R, r)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::fxAttr, SVGLength, Fx, fx)
- DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::fyAttr, SVGLength, Fy, fy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::cyAttr, SVGLength, Cy, cy)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::rAttr, SVGLength, R, r)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::fxAttr, SVGLength, Fx, fx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRadialGradientElement, SVGNames::fyAttr, SVGLength, Fy, fy)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGRect.idl b/WebCore/svg/SVGRect.idl
index 2f8799c..4231ac0 100644
--- a/WebCore/svg/SVGRect.idl
+++ b/WebCore/svg/SVGRect.idl
@@ -22,15 +22,11 @@
module svg {
- interface [Conditional=SVG, PODType=FloatRect] SVGRect {
- attribute float x
- setter raises(DOMException);
- attribute float y
- setter raises(DOMException);
- attribute float width
- setter raises(DOMException);
- attribute float height
- setter raises(DOMException);
+ interface [Conditional=SVG] SVGRect {
+ attribute [StrictTypeChecking] float x;
+ attribute [StrictTypeChecking] float y;
+ attribute [StrictTypeChecking] float width;
+ attribute [StrictTypeChecking] float height;
};
}
diff --git a/WebCore/svg/SVGRectElement.h b/WebCore/svg/SVGRectElement.h
index 668366b..8cc262f 100644
--- a/WebCore/svg/SVGRectElement.h
+++ b/WebCore/svg/SVGRectElement.h
@@ -22,6 +22,8 @@
#define SVGRectElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -49,15 +51,15 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::heightAttr, SVGLength, Height, height)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::rxAttr, SVGLength, Rx, rx)
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::ryAttr, SVGLength, Ry, ry)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::rxAttr, SVGLength, Rx, rx)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGRectElement, SVGNames::ryAttr, SVGLength, Ry, ry)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGRectElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index 7de880c..2354b27 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -186,7 +186,7 @@ void SVGSVGElement::setUseCurrentView(bool currentView)
SVGViewSpec* SVGSVGElement::currentView() const
{
if (!m_viewSpec)
- m_viewSpec = adoptPtr(new SVGViewSpec(this));
+ m_viewSpec = adoptPtr(new SVGViewSpec(const_cast<SVGSVGElement*>(this)));
return m_viewSpec.get();
}
@@ -580,9 +580,9 @@ void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement)
{
setUseCurrentView(true);
if (viewElement->hasAttribute(SVGNames::viewBoxAttr))
- currentView()->setViewBox(viewElement->viewBox());
+ currentView()->setViewBoxBaseValue(viewElement->viewBox());
else
- currentView()->setViewBox(viewBox());
+ currentView()->setViewBoxBaseValue(viewBox());
SVGPreserveAspectRatio aspectRatio;
if (viewElement->hasAttribute(SVGNames::preserveAspectRatioAttr))
diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h
index b5b10b1..b2a5812 100644
--- a/WebCore/svg/SVGSVGElement.h
+++ b/WebCore/svg/SVGSVGElement.h
@@ -22,8 +22,9 @@
#define SVGSVGElement_h
#if ENABLE(SVG)
-
#include "IntSize.h"
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -136,16 +137,16 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGSVGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSVGElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
virtual void documentWillBecomeInactive();
diff --git a/WebCore/svg/SVGSVGElement.idl b/WebCore/svg/SVGSVGElement.idl
index bcf9236..39912ec 100644
--- a/WebCore/svg/SVGSVGElement.idl
+++ b/WebCore/svg/SVGSVGElement.idl
@@ -41,14 +41,14 @@ module svg {
/*setter raises(DOMException)*/;
attribute DOMString contentStyleType
/*setter raises(DOMException)*/;
- readonly attribute [Immutable] SVGRect viewport;
+ readonly attribute SVGRect viewport;
readonly attribute float pixelUnitToMillimeterX;
readonly attribute float pixelUnitToMillimeterY;
readonly attribute float screenPixelToMillimeterX;
readonly attribute float screenPixelToMillimeterY;
attribute boolean useCurrentView
/*setter raises(DOMException)*/;
- // TODO readonly attribute [Immutable] SVGViewSpec currentView;
+ // TODO readonly attribute SVGViewSpec currentView;
attribute float currentScale
/*setter raises(DOMException)*/;
readonly attribute SVGPoint currentTranslate;
diff --git a/WebCore/svg/SVGScriptElement.h b/WebCore/svg/SVGScriptElement.h
index 6dffea6..d4eb61d 100644
--- a/WebCore/svg/SVGScriptElement.h
+++ b/WebCore/svg/SVGScriptElement.h
@@ -22,10 +22,11 @@
#define SVGScriptElement_h
#if ENABLE(SVG)
-#include "ScriptElement.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGElement.h"
-#include "SVGURIReference.h"
#include "SVGExternalResourcesRequired.h"
+#include "SVGURIReference.h"
+#include "ScriptElement.h"
namespace WebCore {
@@ -78,7 +79,7 @@ namespace WebCore {
DECLARE_ANIMATED_PROPERTY(SVGScriptElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
ScriptElementData m_data;
String m_type;
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index d4fa89c..64030bc 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -66,10 +66,13 @@ SVGStyledElement::~SVGStyledElement()
String SVGStyledElement::title() const
{
- // According to spec, we should not return titles when hovering over <svg> elements (those
+ // According to spec, we should not return titles when hovering over root <svg> elements (those
// <title> elements are the title of the document, not a tooltip) so we instantly return.
- if (hasTagName(SVGNames::svgTag))
- return String();
+ if (hasTagName(SVGNames::svgTag)) {
+ const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(this);
+ if (svg->isOutermostSVG())
+ return String();
+ }
// Walk up the tree, to find out whether we're inside a <use> shadow tree, to find the right title.
Node* parent = const_cast<SVGStyledElement*>(this);
diff --git a/WebCore/svg/SVGSwitchElement.h b/WebCore/svg/SVGSwitchElement.h
index 970cc1f..1b006ec 100644
--- a/WebCore/svg/SVGSwitchElement.h
+++ b/WebCore/svg/SVGSwitchElement.h
@@ -22,6 +22,7 @@
#define SVGSwitchElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -46,7 +47,7 @@ namespace WebCore {
virtual void synchronizeProperty(const QualifiedName&);
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGSymbolElement.h b/WebCore/svg/SVGSymbolElement.h
index 1f310f8..6c561f2 100644
--- a/WebCore/svg/SVGSymbolElement.h
+++ b/WebCore/svg/SVGSymbolElement.h
@@ -22,6 +22,7 @@
#define SVGSymbolElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGLangSpace.h"
@@ -47,10 +48,10 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGSymbolElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGSymbolElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGSymbolElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
};
diff --git a/WebCore/svg/SVGTextContentElement.h b/WebCore/svg/SVGTextContentElement.h
index a63e27a..d3aa061 100644
--- a/WebCore/svg/SVGTextContentElement.h
+++ b/WebCore/svg/SVGTextContentElement.h
@@ -22,6 +22,8 @@
#define SVGTextContentElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledElement.h"
@@ -69,11 +71,11 @@ namespace WebCore {
private:
virtual bool isTextContent() const { return true; }
- DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength)
- DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::lengthAdjustAttr, int, LengthAdjust, lengthAdjust)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextContentElement, SVGNames::lengthAdjustAttr, int, LengthAdjust, lengthAdjust)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGTextPathElement.h b/WebCore/svg/SVGTextPathElement.h
index b87dfa5..b06c2bf 100644
--- a/WebCore/svg/SVGTextPathElement.h
+++ b/WebCore/svg/SVGTextPathElement.h
@@ -67,9 +67,9 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset)
- DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::methodAttr, int, Method, method)
- DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::spacingAttr, int, Spacing, spacing)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextPathElement, SVGNames::methodAttr, int, Method, method)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGTextPathElement, SVGNames::spacingAttr, int, Spacing, spacing)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, XLinkNames::hrefAttr, String, Href, href)
diff --git a/WebCore/svg/SVGTextPositioningElement.cpp b/WebCore/svg/SVGTextPositioningElement.cpp
index cbc324d..d64dd1f 100644
--- a/WebCore/svg/SVGTextPositioningElement.cpp
+++ b/WebCore/svg/SVGTextPositioningElement.cpp
@@ -34,25 +34,33 @@ namespace WebCore {
SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* document)
: SVGTextContentElement(tagName, document)
- , m_x(SVGLengthList::create(SVGNames::xAttr))
- , m_y(SVGLengthList::create(SVGNames::yAttr))
- , m_dx(SVGLengthList::create(SVGNames::dxAttr))
- , m_dy(SVGLengthList::create(SVGNames::dyAttr))
, m_rotate(SVGNumberList::create(SVGNames::rotateAttr))
{
}
void SVGTextPositioningElement::parseMappedAttribute(Attribute* attr)
{
- if (attr->name() == SVGNames::xAttr)
- xBaseValue()->parse(attr->value(), LengthModeWidth);
- else if (attr->name() == SVGNames::yAttr)
- yBaseValue()->parse(attr->value(), LengthModeHeight);
- else if (attr->name() == SVGNames::dxAttr)
- dxBaseValue()->parse(attr->value(), LengthModeWidth);
- else if (attr->name() == SVGNames::dyAttr)
- dyBaseValue()->parse(attr->value(), LengthModeHeight);
- else if (attr->name() == SVGNames::rotateAttr)
+ if (attr->name() == SVGNames::xAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeWidth);
+ detachAnimatedXListWrappers(newList.size());
+ xBaseValue() = newList;
+ } else if (attr->name() == SVGNames::yAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeHeight);
+ detachAnimatedYListWrappers(newList.size());
+ yBaseValue() = newList;
+ } else if (attr->name() == SVGNames::dxAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeWidth);
+ detachAnimatedDxListWrappers(newList.size());
+ dxBaseValue() = newList;
+ } else if (attr->name() == SVGNames::dyAttr) {
+ SVGLengthList newList;
+ newList.parse(attr->value(), LengthModeHeight);
+ detachAnimatedDyListWrappers(newList.size());
+ dyBaseValue() = newList;
+ } else if (attr->name() == SVGNames::rotateAttr)
rotateBaseValue()->parse(attr->value());
else
SVGTextContentElement::parseMappedAttribute(attr);
@@ -144,17 +152,11 @@ void SVGTextPositioningElement::synchronizeProperty(const QualifiedName& attrNam
synchronizeRotate();
}
-static inline bool listContainsRelativeValue(SVGLengthList* list)
+static inline bool listContainsRelativeValue(const SVGLengthList& list)
{
- if (!list)
- return false;
-
- ExceptionCode ec = 0;
- int length = list->numberOfItems();
- for (int i = 0; i < length; ++i) {
- SVGLength length(list->getItem(i, ec));
- ASSERT(!ec);
-
+ unsigned size = list.size();
+ for (unsigned i = 0; i < size; ++i) {
+ const SVGLength& length = list.at(i);
if (length.isRelative())
return true;
}
@@ -200,7 +202,6 @@ SVGTextPositioningElement* SVGTextPositioningElement::elementFromRenderer(Render
return static_cast<SVGTextPositioningElement*>(node);
}
-
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGTextPositioningElement.h b/WebCore/svg/SVGTextPositioningElement.h
index 41de9f3..1fb1c3c 100644
--- a/WebCore/svg/SVGTextPositioningElement.h
+++ b/WebCore/svg/SVGTextPositioningElement.h
@@ -42,10 +42,10 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList*, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::yAttr, SVGLengthList*, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList*, Dx, dx)
- DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList*, Dy, dy)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList, X, x)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::yAttr, SVGLengthList, Y, y)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList, Dx, dx)
+ DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList, Dy, dy)
DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::rotateAttr, SVGNumberList*, Rotate, rotate)
};
diff --git a/WebCore/svg/SVGUseElement.h b/WebCore/svg/SVGUseElement.h
index b8ba71d..bb7e6d0 100644
--- a/WebCore/svg/SVGUseElement.h
+++ b/WebCore/svg/SVGUseElement.h
@@ -22,6 +22,8 @@
#define SVGUseElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedLength.h"
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGLangSpace.h"
#include "SVGStyledTransformableElement.h"
@@ -79,16 +81,16 @@ namespace WebCore {
virtual bool selfHasRelativeLengths() const;
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::xAttr, SVGLength, X, x)
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::yAttr, SVGLength, Y, y)
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::widthAttr, SVGLength, Width, width)
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::heightAttr, SVGLength, Height, height)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::xAttr, SVGLength, X, x)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::yAttr, SVGLength, Y, y)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::widthAttr, SVGLength, Width, width)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGUseElement, SVGNames::heightAttr, SVGLength, Height, height)
// SVGURIReference
DECLARE_ANIMATED_PROPERTY(SVGUseElement, XLinkNames::hrefAttr, String, Href, href)
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGUseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// Instance tree handling
void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool& foundCycle);
diff --git a/WebCore/svg/SVGViewElement.h b/WebCore/svg/SVGViewElement.h
index b483236..f0e756f 100644
--- a/WebCore/svg/SVGViewElement.h
+++ b/WebCore/svg/SVGViewElement.h
@@ -22,6 +22,7 @@
#define SVGViewElement_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGStyledElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
@@ -48,10 +49,10 @@ namespace WebCore {
virtual bool rendererIsNeeded(RenderStyle*) { return false; }
// SVGExternalResourcesRequired
- DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
+ DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGViewElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGViewElement, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
mutable RefPtr<SVGStringList> m_viewTarget;
diff --git a/WebCore/svg/SVGViewSpec.cpp b/WebCore/svg/SVGViewSpec.cpp
index 20c58ac..2eafff1 100644
--- a/WebCore/svg/SVGViewSpec.cpp
+++ b/WebCore/svg/SVGViewSpec.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-SVGViewSpec::SVGViewSpec(const SVGSVGElement* contextElement)
+SVGViewSpec::SVGViewSpec(SVGElement* contextElement)
: m_contextElement(contextElement)
, m_transform(SVGTransformList::create(SVGNames::transformAttr))
{
diff --git a/WebCore/svg/SVGViewSpec.h b/WebCore/svg/SVGViewSpec.h
index cf64bca..6fcc94e 100644
--- a/WebCore/svg/SVGViewSpec.h
+++ b/WebCore/svg/SVGViewSpec.h
@@ -21,6 +21,8 @@
#define SVGViewSpec_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
+#include "SVGElement.h"
#include "SVGFitToViewBox.h"
#include "SVGZoomAndPan.h"
@@ -29,14 +31,13 @@
namespace WebCore {
class SVGElement;
- class SVGSVGElement;
class SVGTransformList;
class SVGViewSpec : public SVGFitToViewBox,
public SVGZoomAndPan,
public Noncopyable {
public:
- SVGViewSpec(const SVGSVGElement*);
+ SVGViewSpec(SVGElement*);
bool parseViewSpec(const String&);
@@ -51,13 +52,13 @@ namespace WebCore {
String viewTargetString() const { return m_viewTargetString; }
SVGElement* viewTarget() const;
- SVGSVGElement* contextElement() const { return const_cast<SVGSVGElement*>(m_contextElement); }
+ SVGElement* contextElement() const { return const_cast<SVGElement*>(m_contextElement); }
private:
- const SVGSVGElement* m_contextElement;
+ SVGElement* m_contextElement;
// SVGFitToViewBox
- DECLARE_ANIMATED_PROPERTY(SVGViewSpec, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
+ DECLARE_ANIMATED_PROPERTY_NEW(SVGViewSpec, SVGNames::viewBoxAttr, FloatRect, ViewBox, viewBox)
DECLARE_ANIMATED_PROPERTY(SVGViewSpec, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
mutable RefPtr<SVGTransformList> m_transform;
diff --git a/WebCore/svg/SVGZoomEvent.idl b/WebCore/svg/SVGZoomEvent.idl
index 520f202..7ddd08f 100644
--- a/WebCore/svg/SVGZoomEvent.idl
+++ b/WebCore/svg/SVGZoomEvent.idl
@@ -26,7 +26,7 @@
module svg {
interface [Conditional=SVG] SVGZoomEvent : UIEvent {
- readonly attribute [Immutable] SVGRect zoomRectScreen;
+ readonly attribute SVGRect zoomRectScreen;
readonly attribute float previousScale;
readonly attribute [Immutable] SVGPoint previousTranslate;
readonly attribute float newScale;
diff --git a/WebCore/svg/graphics/filters/SVGFilter.cpp b/WebCore/svg/graphics/filters/SVGFilter.cpp
index dfdccd7..e7b61db 100644
--- a/WebCore/svg/graphics/filters/SVGFilter.cpp
+++ b/WebCore/svg/graphics/filters/SVGFilter.cpp
@@ -23,8 +23,6 @@
#if ENABLE(SVG) && ENABLE(FILTERS)
#include "SVGFilter.h"
-#include "SVGFEImage.h"
-
namespace WebCore {
SVGFilter::SVGFilter(const AffineTransform& absoluteTransform, const FloatRect& absoluteSourceDrawingRegion, const FloatRect& targetBoundingBox, const FloatRect& filterRegion, bool effectBBoxMode)
@@ -38,64 +36,6 @@ SVGFilter::SVGFilter(const AffineTransform& absoluteTransform, const FloatRect&
m_absoluteFilterRegion = absoluteTransform.mapRect(filterRegion);
}
-void SVGFilter::determineFilterPrimitiveSubregion(FilterEffect* effect, const FloatRect& unionOfPreviousPrimitiveSubregions)
-{
- FloatRect subRegionBBox = effect->effectBoundaries();
- FloatRect newSubRegion = subRegionBBox;
-
- if (m_effectBBoxMode) {
- newSubRegion = unionOfPreviousPrimitiveSubregions;
-
- if (effect->hasX())
- newSubRegion.setX(m_targetBoundingBox.x() + subRegionBBox.x() * m_targetBoundingBox.width());
-
- if (effect->hasY())
- newSubRegion.setY(m_targetBoundingBox.y() + subRegionBBox.y() * m_targetBoundingBox.height());
-
- if (effect->hasWidth())
- newSubRegion.setWidth(subRegionBBox.width() * m_targetBoundingBox.width());
-
- if (effect->hasHeight())
- newSubRegion.setHeight(subRegionBBox.height() * m_targetBoundingBox.height());
- } else {
- if (!effect->hasX())
- newSubRegion.setX(unionOfPreviousPrimitiveSubregions.x());
-
- if (!effect->hasY())
- newSubRegion.setY(unionOfPreviousPrimitiveSubregions.y());
-
- if (!effect->hasWidth())
- newSubRegion.setWidth(unionOfPreviousPrimitiveSubregions.width());
-
- if (!effect->hasHeight())
- newSubRegion.setHeight(unionOfPreviousPrimitiveSubregions.height());
- }
-
- effect->setFilterPrimitiveSubregion(newSubRegion);
- // TODO: Everything above should be moved to a first phase of layout in RenderSVGResourceFilterPrimitive.
- // The scaling of the subregion to the repaint rect should be merged with a more intelligent repaint logic
- // and moved to the second phase of layout in RenderSVGResourceFilterPrimitive.
- // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
- newSubRegion = m_absoluteTransform.mapRect(newSubRegion);
- newSubRegion.scale(filterResolution().width(), filterResolution().height());
-
- // FEImage needs the unclipped subregion in absolute coordinates to determine the correct
- // destination rect in combination with preserveAspectRatio.
- if (effect->filterEffectType() == FilterEffectTypeImage) {
- FEImage* imageEffect = static_cast<FEImage*>(effect);
- imageEffect->setAbsoluteSubregion(newSubRegion);
- }
-
- // Clip every filter effect to the filter region.
- FloatRect absoluteScaledFilterRegion = m_absoluteFilterRegion;
- absoluteScaledFilterRegion.scale(filterResolution().width(), filterResolution().height());
- newSubRegion.intersect(absoluteScaledFilterRegion);
-
- effect->setMaxEffectRect(enclosingIntRect(newSubRegion));
- if (effect->filterEffectType() != FilterEffectTypeSourceInput)
- m_maxImageSize = m_maxImageSize.expandedTo(newSubRegion.size());
-}
-
float SVGFilter::applyHorizontalScale(float value) const
{
if (m_effectBBoxMode)
diff --git a/WebCore/svg/graphics/filters/SVGFilter.h b/WebCore/svg/graphics/filters/SVGFilter.h
index 1b19e9f..6465f9f 100644
--- a/WebCore/svg/graphics/filters/SVGFilter.h
+++ b/WebCore/svg/graphics/filters/SVGFilter.h
@@ -43,14 +43,13 @@ public:
virtual FloatRect filterRegion() const { return m_absoluteFilterRegion; }
virtual FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { return m_absoluteTransform.inverse().mapPoint(point); }
+ FloatRect mapLocalRectToAbsoluteRect(const FloatRect& rect) const { return m_absoluteTransform.mapRect(rect); }
virtual float applyHorizontalScale(float value) const;
virtual float applyVerticalScale(float value) const;
virtual FloatRect sourceImageRect() const { return m_absoluteSourceDrawingRegion; }
-
- virtual FloatSize maxImageSize() const { return m_maxImageSize; }
- virtual void determineFilterPrimitiveSubregion(FilterEffect*, const FloatRect&);
+ FloatRect targetBoundingBox() const { return m_targetBoundingBox; }
private:
SVGFilter(const AffineTransform& absoluteTransform, const FloatRect& absoluteSourceDrawingRegion, const FloatRect& targetBoundingBox, const FloatRect& filterRegion, bool effectBBoxMode);
@@ -61,7 +60,6 @@ private:
FloatRect m_absoluteFilterRegion;
FloatRect m_filterRegion;
bool m_effectBBoxMode;
- FloatSize m_maxImageSize;
};
} // namespace WebCore
diff --git a/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h b/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
new file mode 100644
index 0000000..c002d09
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedListPropertyTearOff_h
+#define SVGAnimatedListPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+#include "SVGListPropertyTearOff.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGPropertyTearOff;
+
+template<typename PropertyType>
+class SVGAnimatedListPropertyTearOff : public SVGAnimatedProperty {
+public:
+ SVGProperty* baseVal()
+ {
+ if (!m_baseVal)
+ m_baseVal = SVGListPropertyTearOff<PropertyType>::create(this, BaseValRole, m_property);
+ return m_baseVal.get();
+ }
+
+ SVGProperty* animVal()
+ {
+ if (!m_animVal)
+ m_animVal = SVGListPropertyTearOff<PropertyType>::create(this, AnimValRole, m_property);
+ return m_animVal.get();
+ }
+
+ virtual bool isAnimatedListTearOff() const { return true; }
+
+ int removeItemFromList(SVGProperty* property, bool shouldSynchronizeWrappers)
+ {
+ // FIXME: No animVal support.
+ if (!m_baseVal)
+ return -1;
+
+ typedef SVGPropertyTearOff<typename SVGPropertyTraits<PropertyType>::ListItemType> ListItemTearOff;
+ return static_pointer_cast<SVGListPropertyTearOff<PropertyType> >(m_baseVal)->removeItemFromList(static_cast<ListItemTearOff*>(property), shouldSynchronizeWrappers);
+ }
+
+ void detachListWrappers(unsigned newListSize)
+ {
+ if (m_baseVal)
+ static_pointer_cast<SVGListPropertyTearOff<PropertyType> >(m_baseVal)->detachListWrappers(newListSize);
+ if (m_animVal)
+ static_pointer_cast<SVGListPropertyTearOff<PropertyType> >(m_animVal)->detachListWrappers(newListSize);
+ }
+
+private:
+ friend class SVGAnimatedProperty;
+
+ static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ {
+ ASSERT(contextElement);
+ return adoptRef(new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, property));
+ }
+
+ SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ : SVGAnimatedProperty(contextElement, attributeName)
+ , m_property(property)
+ {
+ }
+
+private:
+ PropertyType& m_property;
+
+ RefPtr<SVGProperty> m_baseVal;
+ RefPtr<SVGProperty> m_animVal;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedListPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGAnimatedProperty.h b/WebCore/svg/properties/SVGAnimatedProperty.h
new file mode 100644
index 0000000..1c25935
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedProperty.h
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedProperty_h
+#define SVGAnimatedProperty_h
+
+#if ENABLE(SVG)
+#include "QualifiedName.h"
+#include "SVGAnimatedPropertyDescription.h"
+#include "SVGElement.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class SVGElement;
+class SVGProperty;
+
+class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty> {
+public:
+ SVGElement* contextElement() const { return m_contextElement.get(); }
+ const QualifiedName& attributeName() const { return m_attributeName; }
+
+ void commitChange()
+ {
+ ASSERT(m_contextElement);
+ m_contextElement->invalidateSVGAttributes();
+ m_contextElement->svgAttributeChanged(m_attributeName);
+ }
+
+ virtual bool isAnimatedListTearOff() const { return false; }
+
+ // Caching facilities.
+ typedef HashMap<SVGAnimatedPropertyDescription, RefPtr<SVGAnimatedProperty>, SVGAnimatedPropertyDescriptionHash, SVGAnimatedPropertyDescriptionHashTraits> Cache;
+
+ virtual ~SVGAnimatedProperty()
+ {
+ // Remove wrapper from cache.
+ Cache* cache = animatedPropertyCache();
+ const Cache::const_iterator end = cache->end();
+ for (Cache::const_iterator it = cache->begin(); it != end; ++it) {
+ if (it->second == this) {
+ cache->remove(it->first);
+ break;
+ }
+ }
+ }
+
+ template<typename TearOffType, typename PropertyType>
+ static PassRefPtr<TearOffType> lookupOrCreateWrapper(SVGElement* element, const QualifiedName& attributeName, const AtomicString& attributeIdentifier, PropertyType& property)
+ {
+ SVGAnimatedPropertyDescription key(element, attributeIdentifier);
+ RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key);
+ if (!wrapper) {
+ wrapper = TearOffType::create(element, attributeName, property);
+ animatedPropertyCache()->set(key, wrapper);
+ }
+
+ return static_pointer_cast<TearOffType>(wrapper).release();
+ }
+
+ template<typename TearOffType>
+ static TearOffType* lookupWrapper(SVGElement* element, const AtomicString& attributeIdentifier)
+ {
+ SVGAnimatedPropertyDescription key(element, attributeIdentifier);
+ return static_pointer_cast<TearOffType>(animatedPropertyCache()->get(key)).get();
+ }
+
+protected:
+ SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName)
+ : m_contextElement(contextElement)
+ , m_attributeName(attributeName)
+ {
+ }
+
+private:
+ static Cache* animatedPropertyCache()
+ {
+ static Cache* s_cache = new Cache;
+ return s_cache;
+ }
+
+ RefPtr<SVGElement> m_contextElement;
+ const QualifiedName& m_attributeName;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedProperty_h
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyDescription.h b/WebCore/svg/properties/SVGAnimatedPropertyDescription.h
new file mode 100644
index 0000000..6fb5e66
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedPropertyDescription.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.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.
+ */
+
+#ifndef SVGAnimatedPropertyDescription_h
+#define SVGAnimatedPropertyDescription_h
+
+#if ENABLE(SVG)
+#include <wtf/HashMap.h>
+#include <wtf/text/AtomicString.h>
+
+namespace WebCore {
+
+class SVGElement;
+
+struct SVGAnimatedPropertyDescription {
+ // Empty value
+ SVGAnimatedPropertyDescription()
+ : m_element(0)
+ , m_attributeName(0)
+ {
+ }
+
+ // Deleted value
+ SVGAnimatedPropertyDescription(WTF::HashTableDeletedValueType)
+ : m_element(reinterpret_cast<SVGElement*>(-1))
+ {
+ }
+
+ bool isHashTableDeletedValue() const
+ {
+ return m_element == reinterpret_cast<SVGElement*>(-1);
+ }
+
+ SVGAnimatedPropertyDescription(SVGElement* element, const AtomicString& attributeName)
+ : m_element(element)
+ , m_attributeName(attributeName.impl())
+ {
+ ASSERT(m_element);
+ ASSERT(m_attributeName);
+ }
+
+ bool operator==(const SVGAnimatedPropertyDescription& other) const
+ {
+ return m_element == other.m_element && m_attributeName == other.m_attributeName;
+ }
+
+ SVGElement* m_element;
+ AtomicStringImpl* m_attributeName;
+};
+
+struct SVGAnimatedPropertyDescriptionHash {
+ static unsigned hash(const SVGAnimatedPropertyDescription& key)
+ {
+ return WTF::StringHasher::createBlobHash<sizeof(SVGAnimatedPropertyDescription)>(&key);
+ }
+
+ static bool equal(const SVGAnimatedPropertyDescription& a, const SVGAnimatedPropertyDescription& b)
+ {
+ return a == b;
+ }
+
+ static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+struct SVGAnimatedPropertyDescriptionHashTraits : WTF::GenericHashTraits<SVGAnimatedPropertyDescription> {
+ static const bool emptyValueIsZero = true;
+
+ static void constructDeletedValue(SVGAnimatedPropertyDescription& slot)
+ {
+ new (&slot) SVGAnimatedPropertyDescription(WTF::HashTableDeletedValue);
+ }
+
+ static bool isDeletedValue(const SVGAnimatedPropertyDescription& value)
+ {
+ return value.isHashTableDeletedValue();
+ }
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedPropertyDescription_h
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyMacros.h b/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
new file mode 100644
index 0000000..12d0565
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedPropertyMacros.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.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.
+ */
+
+#ifndef SVGAnimatedPropertyMacros_h
+#define SVGAnimatedPropertyMacros_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedListPropertyTearOff.h"
+#include "SVGAnimatedStaticPropertyTearOff.h"
+#include "SVGAnimatedPropertySynchronizer.h"
+#include "SVGAnimatedPropertyTearOff.h"
+#include "SVGNames.h" // FIXME: Temporary hack, until we expand the macros in all files, so we don't need a global SVGNames.h include
+#include "SVGPropertyTraits.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+struct SVGSynchronizableAnimatedProperty {
+ SVGSynchronizableAnimatedProperty()
+ : value(SVGPropertyTraits<PropertyType>::initialValue())
+ , shouldSynchronize(false)
+ {
+ }
+
+ template<typename ConstructorParameter1>
+ SVGSynchronizableAnimatedProperty(const ConstructorParameter1& value1)
+ : value(value1)
+ , shouldSynchronize(false)
+ {
+ }
+
+ template<typename ConstructorParameter1, typename ConstructorParameter2>
+ SVGSynchronizableAnimatedProperty(const ConstructorParameter1& value1, const ConstructorParameter2& value2)
+ : value(value1, value2)
+ , shouldSynchronize(false)
+ {
+ }
+
+ PropertyType value;
+ bool shouldSynchronize : 1;
+};
+
+// FIXME: These macros should be removed, after the transition to the new SVGAnimatedProperty concept is finished.
+#define DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, TearOffType, PropertyType, UpperProperty, LowerProperty) \
+public: \
+PropertyType& LowerProperty() const \
+{ \
+ return m_##LowerProperty.value; \
+} \
+\
+PropertyType& LowerProperty##BaseValue() const \
+{ \
+ return m_##LowerProperty.value; \
+} \
+\
+void set##UpperProperty##BaseValue(const PropertyType& type) \
+{ \
+ m_##LowerProperty.value = type; \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ contextElement->invalidateSVGAttributes(); \
+} \
+\
+void synchronize##UpperProperty() \
+{ \
+ if (!m_##LowerProperty.shouldSynchronize) \
+ return; \
+ AtomicString value(SVGPropertyTraits<PropertyType>::toString(LowerProperty##BaseValue())); \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ SVGAnimatedPropertySynchronizer<IsDerivedFromSVGElement<OwnerType>::value>::synchronize(contextElement, DOMAttribute, value); \
+} \
+\
+PassRefPtr<TearOffType> LowerProperty##Animated() \
+{ \
+ m_##LowerProperty.shouldSynchronize = true; \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ return SVGAnimatedProperty::lookupOrCreateWrapper<TearOffType, PropertyType>(contextElement, DOMAttribute, SVGDOMAttributeIdentifier, m_##LowerProperty.value); \
+} \
+private: \
+ mutable SVGSynchronizableAnimatedProperty<PropertyType> m_##LowerProperty;
+
+#define DECLARE_ANIMATED_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS_NEW(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedStaticPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_STATIC_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedStaticPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty)
+
+#define DECLARE_ANIMATED_LIST_PROPERTY_NEW(OwnerType, DOMAttribute, PropertyType, UpperProperty, LowerProperty) \
+DECLARE_ANIMATED_PROPERTY_NEW_SHARED(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedListPropertyTearOff<PropertyType>, PropertyType, UpperProperty, LowerProperty) \
+\
+void detachAnimated##UpperProperty##ListWrappers(unsigned newListSize) \
+{ \
+ SVGElement* contextElement = GetOwnerElementForType<OwnerType, IsDerivedFromSVGElement<OwnerType>::value>::ownerElement(this); \
+ SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGAnimatedListPropertyTearOff<PropertyType> >(contextElement, DOMAttribute.localName()); \
+ if (!wrapper) \
+ return; \
+ static_cast<SVGAnimatedListPropertyTearOff<PropertyType>*>(wrapper)->detachListWrappers(newListSize); \
+}
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedPropertyMacros_h
diff --git a/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h b/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
index 476f1fd..2b816ab 100644
--- a/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
+++ b/WebCore/svg/properties/SVGAnimatedPropertySynchronizer.h
@@ -20,8 +20,6 @@
#ifndef SVGAnimatedPropertySynchronizer_h
#define SVGAnimatedPropertySynchronizer_h
-#include "DeprecatedSVGAnimatedPropertyTraits.h"
-
#if ENABLE(SVG)
namespace WebCore {
diff --git a/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h b/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
new file mode 100644
index 0000000..252a4b4
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedPropertyTearOff_h
+#define SVGAnimatedPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+#include "SVGPropertyTearOff.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGAnimatedPropertyTearOff : public SVGAnimatedProperty {
+public:
+ SVGProperty* baseVal()
+ {
+ if (!m_baseVal)
+ m_baseVal = SVGPropertyTearOff<PropertyType>::create(this, BaseValRole, m_property);
+ return m_baseVal.get();
+ }
+
+ SVGProperty* animVal()
+ {
+ if (!m_animVal)
+ m_animVal = SVGPropertyTearOff<PropertyType>::create(this, AnimValRole, m_property);
+ return m_animVal.get();
+ }
+
+private:
+ friend class SVGAnimatedProperty;
+
+ static PassRefPtr<SVGAnimatedPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ {
+ ASSERT(contextElement);
+ return adoptRef(new SVGAnimatedPropertyTearOff<PropertyType>(contextElement, attributeName, property));
+ }
+
+ SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ : SVGAnimatedProperty(contextElement, attributeName)
+ , m_property(property)
+ {
+ }
+
+private:
+ PropertyType& m_property;
+
+ RefPtr<SVGProperty> m_baseVal;
+ RefPtr<SVGProperty> m_animVal;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h b/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
new file mode 100644
index 0000000..930569e
--- /dev/null
+++ b/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGAnimatedStaticPropertyTearOff_h
+#define SVGAnimatedStaticPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGAnimatedStaticPropertyTearOff : public SVGAnimatedProperty {
+public:
+ PropertyType& baseVal()
+ {
+ return m_property;
+ }
+
+ PropertyType& animVal()
+ {
+ // FIXME: No animVal support.
+ return m_property;
+ }
+
+ void setBaseVal(const PropertyType& property)
+ {
+ m_property = property;
+ commitChange();
+ }
+
+ // FIXME: No animVal support.
+ void setAnimVal(const PropertyType&) { }
+
+private:
+ friend class SVGAnimatedProperty;
+
+ static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ {
+ ASSERT(contextElement);
+ return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, property));
+ }
+
+ SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)
+ : SVGAnimatedProperty(contextElement, attributeName)
+ , m_property(property)
+ {
+ }
+
+private:
+ PropertyType& m_property;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGAnimatedStaticPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGListPropertyTearOff.h b/WebCore/svg/properties/SVGListPropertyTearOff.h
new file mode 100644
index 0000000..2801168
--- /dev/null
+++ b/WebCore/svg/properties/SVGListPropertyTearOff.h
@@ -0,0 +1,382 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGListPropertyTearOff_h
+#define SVGListPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "ExceptionCode.h"
+#include "SVGAnimatedProperty.h"
+#include "SVGPropertyTearOff.h"
+#include "SVGPropertyTraits.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGAnimatedListPropertyTearOff;
+
+template<typename PropertyType>
+class SVGListPropertyTearOff : public SVGProperty {
+public:
+ typedef SVGListPropertyTearOff<PropertyType> Self;
+
+ typedef typename SVGPropertyTraits<PropertyType>::ListItemType ListItemType;
+ typedef SVGPropertyTearOff<ListItemType> ListItemTearOff;
+ typedef PassRefPtr<ListItemTearOff> PassListItemTearOff;
+ typedef Vector<RefPtr<ListItemTearOff> > ListWrapperCache;
+
+ // Used for [SVGAnimatedProperty] types (for example: SVGAnimatedLengthList::baseVal())
+ static PassRefPtr<Self> create(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& values)
+ {
+ ASSERT(animatedProperty);
+ return adoptRef(new Self(animatedProperty, role, values));
+ }
+
+ // Used for non-animated POD types (for example: SVGStringList).
+ static PassRefPtr<Self> create(const PropertyType& initialValue)
+ {
+ return adoptRef(new Self(initialValue));
+ }
+
+ int removeItemFromList(ListItemTearOff* removeItem, bool shouldSynchronizeWrappers)
+ {
+ // Lookup item in cache and remove its corresponding wrapper.
+ unsigned size = m_wrappers.size();
+ ASSERT(size == m_values->size());
+ for (unsigned i = 0; i < size; ++i) {
+ RefPtr<ListItemTearOff>& item = m_wrappers.at(i);
+ if (item != removeItem)
+ continue;
+
+ item->detachWrapper();
+ m_wrappers.remove(i);
+ m_values->remove(i);
+
+ if (shouldSynchronizeWrappers)
+ commitChange();
+
+ return i;
+ }
+
+ return -1;
+ }
+
+ void detachListWrappers(unsigned newListSize)
+ {
+ // See SVGPropertyTearOff::detachWrapper() for an explaination what's happening here.
+ unsigned size = m_wrappers.size();
+ ASSERT(size == m_values->size());
+ for (unsigned i = 0; i < size; ++i) {
+ RefPtr<ListItemTearOff>& item = m_wrappers.at(i);
+ if (!item)
+ continue;
+ item->detachWrapper();
+ }
+
+ // Reinitialize the wrapper cache to be equal to the new values size, after the XML DOM changed the list.
+ if (newListSize)
+ m_wrappers.fill(0, newListSize);
+ else
+ m_wrappers.clear();
+ }
+
+ // SVGList API
+ void clear(ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return;
+ }
+
+ detachListWrappers(0);
+ m_values->clear();
+ }
+
+ unsigned numberOfItems() const
+ {
+ return m_values->size();
+ }
+
+ PassListItemTearOff initialize(PassListItemTearOff passNewItem, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
+ removeItemFromListIfNeeded(newItem.get(), 0);
+
+ // Spec: Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter.
+ detachListWrappers(0);
+ m_values->clear();
+
+ m_values->append(newItem->propertyReference());
+ m_wrappers.append(newItem);
+
+ commitChange();
+ return newItem.release();
+ }
+
+ PassListItemTearOff getItem(unsigned index, ExceptionCode& ec)
+ {
+ if (index >= m_values->size()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ // Spec: Returns the specified item from the list. The returned item is the item itself and not a copy.
+ // Any changes made to the item are immediately reflected in the list.
+ ASSERT(m_values->size() == m_wrappers.size());
+ RefPtr<ListItemTearOff> wrapper = m_wrappers.at(index);
+ if (!wrapper) {
+ // Create new wrapper, which is allowed to directly modify the item in the list, w/o copying and cache the wrapper in our map.
+ // It is also associated with our animated property, so it can notify the SVG Element which holds the SVGAnimated*List
+ // that it has been modified (and thus can call svgAttributeChanged(associatedAttributeName)).
+ wrapper = ListItemTearOff::create(m_animatedProperty.get(), UndefinedRole, m_values->at(index));
+ m_wrappers.at(index) = wrapper;
+ }
+
+ return wrapper.release();
+ }
+
+ PassListItemTearOff insertItemBefore(PassListItemTearOff passNewItem, unsigned index, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
+ if (index > m_values->size())
+ index = m_values->size();
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ removeItemFromListIfNeeded(newItem.get(), &index);
+
+ // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be
+ // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list.
+ m_values->insert(index, newItem->propertyReference());
+
+ // Store new wrapper at position 'index', change its underlying value, so mutations of newItem, directly affect the item in the list.
+ m_wrappers.insert(index, newItem);
+
+ commitChange();
+ return newItem.release();
+ }
+
+ PassListItemTearOff replaceItem(PassListItemTearOff passNewItem, unsigned index, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ if (index >= m_values->size()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
+ removeItemFromListIfNeeded(newItem.get(), &index);
+
+ // Detach the existing wrapper.
+ RefPtr<ListItemTearOff>& oldItem = m_wrappers.at(index);
+ if (oldItem)
+ oldItem->detachWrapper();
+
+ // Update the value and the wrapper at the desired position 'index'.
+ m_values->at(index) = newItem->propertyReference();
+ m_wrappers.at(index) = newItem;
+
+ commitChange();
+ return newItem.release();
+ }
+
+ PassListItemTearOff removeItem(unsigned index, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ if (index >= m_values->size()) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Detach the existing wrapper.
+ RefPtr<ListItemTearOff>& oldItem = m_wrappers.at(index);
+ if (oldItem) {
+ oldItem->detachWrapper();
+ m_wrappers.remove(index);
+ }
+
+ m_values->remove(index);
+
+ commitChange();
+ return oldItem.release();
+ }
+
+ PassListItemTearOff appendItem(PassListItemTearOff passNewItem, ExceptionCode& ec)
+ {
+ if (m_role == AnimValRole) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = TYPE_MISMATCH_ERR;
+ return 0;
+ }
+
+ RefPtr<ListItemTearOff> newItem = passNewItem;
+ ASSERT(m_values->size() == m_wrappers.size());
+
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ removeItemFromListIfNeeded(newItem.get(), 0);
+
+ // Append the value and wrapper at the end of the list.
+ m_values->append(newItem->propertyReference());
+ m_wrappers.append(newItem);
+
+ commitChange();
+ return newItem.release();
+ }
+
+private:
+ SVGListPropertyTearOff(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& values)
+ : m_animatedProperty(animatedProperty)
+ , m_role(role)
+ , m_values(&values)
+ , m_valuesIsCopy(false)
+ {
+ // Using operator & is completly fine, as SVGAnimatedProperty owns this reference,
+ // and we're guaranteed to live as long as SVGAnimatedProperty does.
+ if (!values.isEmpty())
+ m_wrappers.fill(0, values.size());
+ }
+
+ SVGListPropertyTearOff(const PropertyType& initialValue)
+ : m_animatedProperty(0)
+ , m_role(UndefinedRole)
+ , m_values(new PropertyType(initialValue))
+ , m_valuesIsCopy(true)
+ {
+ }
+
+ virtual ~SVGListPropertyTearOff()
+ {
+ if (m_valuesIsCopy)
+ delete m_values;
+ }
+
+ void commitChange()
+ {
+ // Update existing wrappers, as the index in the m_values list has changed.
+ unsigned size = m_wrappers.size();
+ ASSERT(size == m_values->size());
+ for (unsigned i = 0; i < size; ++i) {
+ RefPtr<ListItemTearOff>& item = m_wrappers.at(i);
+ if (!item)
+ continue;
+ item->setAnimatedProperty(m_animatedProperty.get());
+ item->setValue(m_values->at(i));
+ }
+
+ ASSERT(!m_valuesIsCopy);
+ ASSERT(m_animatedProperty);
+ m_animatedProperty->commitChange();
+ }
+
+ void removeItemFromListIfNeeded(ListItemTearOff* newItem, unsigned* indexToModify)
+ {
+ // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ SVGAnimatedProperty* animatedPropertyOfItem = newItem->animatedProperty();
+ if (!animatedPropertyOfItem || !animatedPropertyOfItem->isAnimatedListTearOff())
+ return;
+
+ // 'newItem' is already living in another list. If it's not our list, synchronize the other lists wrappers after the removal.
+ bool livesInOtherList = animatedPropertyOfItem != m_animatedProperty;
+ int removedIndex = static_cast<SVGAnimatedListPropertyTearOff<PropertyType>*>(animatedPropertyOfItem)->removeItemFromList(newItem, livesInOtherList);
+ ASSERT(removedIndex != -1);
+
+ if (!indexToModify)
+ return;
+
+ // If the item lived in our list, adjust the insertion index.
+ if (!livesInOtherList) {
+ unsigned& index = *indexToModify;
+ // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item.
+ if (static_cast<unsigned>(removedIndex) < index)
+ --index;
+ }
+ }
+
+private:
+ // Back pointer to the animated property that created us
+ // For example (text.x.baseVal): m_animatedProperty points to the 'x' SVGAnimatedLengthList object
+ RefPtr<SVGAnimatedProperty> m_animatedProperty;
+
+ // The role of this property (baseVal or animVal)
+ SVGPropertyRole m_role;
+
+ // For the example above (text.x.baseVal): A reference to the SVGLengthList& stored in the SVGTextElement, which we can directly modify
+ PropertyType* m_values;
+ bool m_valuesIsCopy : 1;
+
+ // A list of wrappers, which is always in sync between m_values.
+ ListWrapperCache m_wrappers;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGListPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGProperty.h b/WebCore/svg/properties/SVGProperty.h
new file mode 100644
index 0000000..43167b7
--- /dev/null
+++ b/WebCore/svg/properties/SVGProperty.h
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGProperty_h
+#define SVGProperty_h
+
+#if ENABLE(SVG)
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+enum SVGPropertyRole {
+ UndefinedRole,
+ BaseValRole,
+ AnimValRole
+};
+
+class SVGProperty : public RefCounted<SVGProperty> {
+public:
+ virtual ~SVGProperty() { }
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGProperty_h
diff --git a/WebCore/svg/properties/SVGPropertyTearOff.h b/WebCore/svg/properties/SVGPropertyTearOff.h
new file mode 100644
index 0000000..17588b4
--- /dev/null
+++ b/WebCore/svg/properties/SVGPropertyTearOff.h
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ */
+
+#ifndef SVGPropertyTearOff_h
+#define SVGPropertyTearOff_h
+
+#if ENABLE(SVG)
+#include "SVGAnimatedProperty.h"
+#include "SVGElement.h"
+#include "SVGProperty.h"
+
+namespace WebCore {
+
+template<typename PropertyType>
+class SVGPropertyTearOff : public SVGProperty {
+public:
+ typedef SVGPropertyTearOff<PropertyType> Self;
+
+ // Used for [SVGAnimatedProperty] types (for example: SVGAnimatedLength::baseVal()).
+ // Also used for list tear offs (for example: text.x.baseVal.getItem(0)).
+ static PassRefPtr<Self> create(SVGAnimatedProperty* animatedProperty, SVGPropertyRole, PropertyType& value)
+ {
+ ASSERT(animatedProperty);
+ return adoptRef(new Self(animatedProperty, value));
+ }
+
+ // Used for non-animated POD types (for example: SVGLength).
+ static PassRefPtr<Self> create(const PropertyType& initialValue)
+ {
+ return adoptRef(new Self(initialValue));
+ }
+
+ PropertyType& propertyReference() { return *m_value; }
+ SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty.get(); }
+
+ virtual int removeItemFromList(SVGAnimatedProperty*) { return -1; }
+
+ // Used only by the list tear offs!
+ void setValue(PropertyType& value)
+ {
+ if (m_valueIsCopy)
+ delete m_value;
+ m_valueIsCopy = false;
+ m_value = &value;
+ }
+
+ void setAnimatedProperty(SVGAnimatedProperty* animatedProperty) { m_animatedProperty = animatedProperty; }
+
+ SVGElement* contextElement() const
+ {
+ if (!m_animatedProperty || m_valueIsCopy)
+ return 0;
+ return m_animatedProperty->contextElement();
+ }
+
+ void detachWrapper()
+ {
+ // Switch from a live value, to a non-live value.
+ // For example: <text x="50"/>
+ // var item = text.x.baseVal.getItem(0);
+ // text.setAttribute("x", "100");
+ // item.value still has to report '50' and it has to be possible to modify 'item'
+ // w/o changing the "new item" (with x=100) in the text element.
+ // Whenever the XML DOM modifies the "x" attribute, all existing wrappers are detached, using this function.
+ ASSERT(!m_valueIsCopy);
+ m_value = new PropertyType(*m_value);
+ m_valueIsCopy = true;
+ }
+
+ void commitChange()
+ {
+ if (!m_animatedProperty || m_valueIsCopy)
+ return;
+ m_animatedProperty->commitChange();
+ }
+
+private:
+ SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, PropertyType& value)
+ : m_animatedProperty(animatedProperty)
+ , m_value(&value)
+ , m_valueIsCopy(false)
+ {
+ // Using operator & is completly fine, as SVGAnimatedProperty owns this reference,
+ // and we're guaranteed to live as long as SVGAnimatedProperty does.
+ }
+
+ SVGPropertyTearOff(const PropertyType& initialValue)
+ : m_animatedProperty(0)
+ , m_value(new PropertyType(initialValue))
+ , m_valueIsCopy(true)
+ {
+ }
+
+ virtual ~SVGPropertyTearOff()
+ {
+ if (m_valueIsCopy)
+ delete m_value;
+ }
+
+ RefPtr<SVGAnimatedProperty> m_animatedProperty;
+ PropertyType* m_value;
+ bool m_valueIsCopy : 1;
+};
+
+}
+
+#endif // ENABLE(SVG)
+#endif // SVGPropertyTearOff_h
diff --git a/WebCore/svg/properties/SVGPropertyTraits.h b/WebCore/svg/properties/SVGPropertyTraits.h
new file mode 100644
index 0000000..8d82a61
--- /dev/null
+++ b/WebCore/svg/properties/SVGPropertyTraits.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.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.
+ */
+
+#ifndef SVGPropertyTraits_h
+#define SVGPropertyTraits_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include "SVGAngle.h"
+#include "SVGLength.h"
+#include "SVGLengthList.h"
+#include "SVGPreserveAspectRatio.h"
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+template<typename PropertyType>
+struct SVGPropertyTraits { };
+
+template<>
+struct SVGPropertyTraits<SVGAngle> {
+ static SVGAngle initialValue() { return SVGAngle(); }
+ static String toString(const SVGAngle& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<bool> {
+ static bool initialValue() { return false; }
+ static String toString(bool type) { return type ? "true" : "false"; }
+};
+
+template<>
+struct SVGPropertyTraits<int> {
+ static int initialValue() { return 0; }
+ static String toString(int type) { return String::number(type); }
+};
+
+template<>
+struct SVGPropertyTraits<long> {
+ static long initialValue() { return 0; }
+ static String toString(long type) { return String::number(type); }
+};
+
+template<>
+struct SVGPropertyTraits<SVGLength> {
+ static SVGLength initialValue() { return SVGLength(); }
+ static String toString(const SVGLength& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<SVGLengthList> {
+ typedef SVGLength ListItemType;
+
+ static SVGLengthList initialValue() { return SVGLengthList(); }
+ static String toString(const SVGLengthList& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<float> {
+ static float initialValue() { return 0; }
+ static String toString(float type) { return String::number(type); }
+};
+
+template<>
+struct SVGPropertyTraits<SVGPreserveAspectRatio> {
+ static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); }
+ static String toString(const SVGPreserveAspectRatio& type) { return type.valueAsString(); }
+};
+
+template<>
+struct SVGPropertyTraits<FloatRect> {
+ static FloatRect initialValue() { return FloatRect(); }
+ static String toString(const FloatRect& type)
+ {
+ StringBuilder builder;
+ builder.append(String::number(type.x()));
+ builder.append(' ');
+ builder.append(String::number(type.y()));
+ builder.append(' ');
+ builder.append(String::number(type.width()));
+ builder.append(' ');
+ builder.append(String::number(type.height()));
+ builder.append(' ');
+ return builder.toString();
+ }
+};
+
+template<>
+struct SVGPropertyTraits<String> {
+ static String initialValue() { return String(); }
+ static String toString(const String& type) { return type; }
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/webaudio/AudioContext.cpp b/WebCore/webaudio/AudioContext.cpp
index f971e6a..da7df1b 100644
--- a/WebCore/webaudio/AudioContext.cpp
+++ b/WebCore/webaudio/AudioContext.cpp
@@ -34,6 +34,8 @@
#include "AudioChannelSplitter.h"
#include "AudioGainNode.h"
#include "AudioListener.h"
+#include "AudioNodeInput.h"
+#include "AudioNodeOutput.h"
#include "AudioPannerNode.h"
#include "CachedAudio.h"
#include "ConvolverNode.h"
@@ -390,12 +392,12 @@ void AudioContext::unlock()
m_contextGraphMutex.unlock();
}
-bool AudioContext::isAudioThread()
+bool AudioContext::isAudioThread() const
{
return currentThread() == m_audioThread;
}
-bool AudioContext::isGraphOwner()
+bool AudioContext::isGraphOwner() const
{
return currentThread() == m_graphOwnerThread;
}
@@ -406,6 +408,23 @@ void AudioContext::addDeferredFinishDeref(AudioNode* node, AudioNode::RefType re
m_deferredFinishDerefList.append(AudioContext::RefInfo(node, refType));
}
+void AudioContext::handlePreRenderTasks()
+{
+ ASSERT(isAudioThread());
+
+ // At the beginning of every render quantum, try to update the internal rendering graph state (from main thread changes).
+ // It's OK if the tryLock() fails, we'll just take slightly longer to pick up the changes.
+ bool mustReleaseLock;
+ if (tryLock(mustReleaseLock)) {
+ // Fixup the state of any dirty AudioNodeInputs and AudioNodeOutputs.
+ handleDirtyAudioNodeInputs();
+ handleDirtyAudioNodeOutputs();
+
+ if (mustReleaseLock)
+ unlock();
+ }
+}
+
void AudioContext::handlePostRenderTasks()
{
ASSERT(isAudioThread());
@@ -424,6 +443,10 @@ void AudioContext::handlePostRenderTasks()
// Finally actually delete.
deleteMarkedNodes();
+ // Fixup the state of any dirty AudioNodeInputs and AudioNodeOutputs.
+ handleDirtyAudioNodeInputs();
+ handleDirtyAudioNodeOutputs();
+
if (mustReleaseLock)
unlock();
}
@@ -456,6 +479,18 @@ void AudioContext::deleteMarkedNodes()
while (size_t n = m_nodesToDelete.size()) {
AudioNode* node = m_nodesToDelete[n - 1];
m_nodesToDelete.removeLast();
+
+ // Before deleting the node, clear out any AudioNodeInputs from m_dirtyAudioNodeInputs.
+ unsigned numberOfInputs = node->numberOfInputs();
+ for (unsigned i = 0; i < numberOfInputs; ++i)
+ m_dirtyAudioNodeInputs.remove(node->input(i));
+
+ // Before deleting the node, clear out any AudioNodeOutputs from m_dirtyAudioNodeOutputs.
+ unsigned numberOfOutputs = node->numberOfOutputs();
+ for (unsigned i = 0; i < numberOfOutputs; ++i)
+ m_dirtyAudioNodeOutputs.remove(node->output(i));
+
+ // Finally, delete it.
delete node;
// Don't delete too many nodes per render quantum since we don't want to do too much work in the realtime audio thread.
@@ -464,6 +499,39 @@ void AudioContext::deleteMarkedNodes()
}
}
+void AudioContext::markAudioNodeInputDirty(AudioNodeInput* input)
+{
+ ASSERT(isGraphOwner());
+ m_dirtyAudioNodeInputs.add(input);
+}
+
+void AudioContext::markAudioNodeOutputDirty(AudioNodeOutput* output)
+{
+ ASSERT(isGraphOwner());
+ m_dirtyAudioNodeOutputs.add(output);
+}
+
+void AudioContext::handleDirtyAudioNodeInputs()
+{
+ ASSERT(isGraphOwner());
+
+ for (HashSet<AudioNodeInput*>::iterator i = m_dirtyAudioNodeInputs.begin(); i != m_dirtyAudioNodeInputs.end(); ++i)
+ (*i)->updateRenderingState();
+
+ m_dirtyAudioNodeInputs.clear();
+}
+
+void AudioContext::handleDirtyAudioNodeOutputs()
+{
+ ASSERT(isGraphOwner());
+
+ for (HashSet<AudioNodeOutput*>::iterator i = m_dirtyAudioNodeOutputs.begin(); i != m_dirtyAudioNodeOutputs.end(); ++i)
+ (*i)->updateRenderingState();
+
+ m_dirtyAudioNodeOutputs.clear();
+}
+
+
} // namespace WebCore
#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioContext.h b/WebCore/webaudio/AudioContext.h
index 9fe1347..b79cd14 100644
--- a/WebCore/webaudio/AudioContext.h
+++ b/WebCore/webaudio/AudioContext.h
@@ -29,6 +29,7 @@
#include "AudioBus.h"
#include "AudioDestinationNode.h"
#include "HRTFDatabaseLoader.h"
+#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -107,6 +108,9 @@ public:
// 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 start of each render quantum.
+ void handlePreRenderTasks();
+
// Called at the end of each render quantum.
void handlePostRenderTasks();
@@ -132,7 +136,7 @@ public:
void setAudioThread(ThreadIdentifier thread) { m_audioThread = thread; } // FIXME: check either not initialized or the same
ThreadIdentifier audioThread() const { return m_audioThread; }
- bool isAudioThread();
+ bool isAudioThread() const;
// Returns true only after the audio thread has been started and then shutdown.
bool isAudioThreadFinished() { return m_isAudioThreadFinished; }
@@ -147,7 +151,7 @@ public:
void unlock();
// Returns true if this thread owns the context's lock.
- bool isGraphOwner();
+ bool isGraphOwner() const;
class AutoLocker {
public:
@@ -173,6 +177,10 @@ public:
// In the audio thread at the start of each render cycle, we'll call handleDeferredFinishDerefs().
void handleDeferredFinishDerefs();
+
+ // Only accessed when the graph lock is held.
+ void markAudioNodeInputDirty(AudioNodeInput*);
+ void markAudioNodeOutputDirty(AudioNodeOutput*);
private:
AudioContext(Document*);
@@ -214,6 +222,12 @@ private:
Vector<AudioNode*> m_nodesToDelete;
Vector<RefPtr<CachedAudio> > m_cachedAudioReferences;
+
+ // Only accessed when the graph lock is held.
+ HashSet<AudioNodeInput*> m_dirtyAudioNodeInputs;
+ HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs;
+ void handleDirtyAudioNodeInputs();
+ void handleDirtyAudioNodeOutputs();
OwnPtr<AudioBus> m_temporaryMonoBus;
OwnPtr<AudioBus> m_temporaryStereoBus;
diff --git a/WebCore/webaudio/AudioNode.cpp b/WebCore/webaudio/AudioNode.cpp
index 9335c10..18ddd3b 100644
--- a/WebCore/webaudio/AudioNode.cpp
+++ b/WebCore/webaudio/AudioNode.cpp
@@ -1,29 +1,25 @@
/*
- * Copyright (C) 2010 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 met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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
+ * 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 OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * 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.
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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"
diff --git a/WebCore/webaudio/AudioNode.h b/WebCore/webaudio/AudioNode.h
index 52f886d..069407d 100644
--- a/WebCore/webaudio/AudioNode.h
+++ b/WebCore/webaudio/AudioNode.h
@@ -1,29 +1,25 @@
/*
- * Copyright (C) 2010 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 met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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
+ * 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 OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * 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.
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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
@@ -134,6 +130,8 @@ public:
static void printNodeCounts();
#endif
+ bool isMarkedForDeletion() const { return m_isMarkedForDeletion; }
+
protected:
// Inputs and outputs must be created before the AudioNode is initialized.
void addInput(PassOwnPtr<AudioNodeInput>);
diff --git a/WebCore/webaudio/AudioNode.idl b/WebCore/webaudio/AudioNode.idl
index 5ed47cb..dad5454 100644
--- a/WebCore/webaudio/AudioNode.idl
+++ b/WebCore/webaudio/AudioNode.idl
@@ -1,29 +1,25 @@
/*
- * Copyright (C) 2010 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 met:
- *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * 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.
+ * 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
+ * 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 OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * 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.
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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 {
diff --git a/WebCore/webaudio/AudioNodeInput.cpp b/WebCore/webaudio/AudioNodeInput.cpp
new file mode 100644
index 0000000..9fd1852
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeInput.cpp
@@ -0,0 +1,270 @@
+/*
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioNodeInput.h"
+
+#include "AudioContext.h"
+#include "AudioNode.h"
+#include "AudioNodeOutput.h"
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+AudioNodeInput::AudioNodeInput(AudioNode* node)
+ : m_node(node)
+ , m_renderingStateNeedUpdating(false)
+{
+ m_monoSummingBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames));
+ m_stereoSummingBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames));
+}
+
+void AudioNodeInput::connect(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ // Check if we're already connected to this output.
+ if (m_outputs.contains(output))
+ return;
+
+ output->addInput(this);
+ m_outputs.add(output);
+ changedOutputs();
+
+ // Sombody has just connected to us, so count it as a reference.
+ node()->ref(AudioNode::RefTypeConnection);
+}
+
+void AudioNodeInput::disconnect(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ // First try to disconnect from "active" connections.
+ if (m_outputs.contains(output)) {
+ m_outputs.remove(output);
+ changedOutputs();
+ output->removeInput(this);
+ node()->deref(AudioNode::RefTypeConnection); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+ return;
+ }
+
+ // Otherwise, try to disconnect from disabled connections.
+ if (m_disabledOutputs.contains(output)) {
+ m_disabledOutputs.remove(output);
+ output->removeInput(this);
+ node()->deref(AudioNode::RefTypeDisabled); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+}
+
+void AudioNodeInput::disable(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ ASSERT(m_outputs.contains(output));
+
+ m_disabledOutputs.add(output);
+ m_outputs.remove(output);
+ changedOutputs();
+
+ node()->ref(AudioNode::RefTypeDisabled);
+ node()->deref(AudioNode::RefTypeConnection); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+}
+
+void AudioNodeInput::enable(AudioNodeOutput* output)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(output && node());
+ if (!output || !node())
+ return;
+
+ ASSERT(m_disabledOutputs.contains(output));
+
+ // Move output from disabled list to active list.
+ m_outputs.add(output);
+ m_disabledOutputs.remove(output);
+ changedOutputs();
+
+ node()->ref(AudioNode::RefTypeConnection);
+ node()->deref(AudioNode::RefTypeDisabled); // Note: it's important to return immediately after all deref() calls since the node may be deleted.
+}
+
+void AudioNodeInput::changedOutputs()
+{
+ ASSERT(context()->isGraphOwner());
+ if (!m_renderingStateNeedUpdating && !node()->isMarkedForDeletion()) {
+ context()->markAudioNodeInputDirty(this);
+ m_renderingStateNeedUpdating = true;
+ }
+}
+
+void AudioNodeInput::updateRenderingState()
+{
+ ASSERT(context()->isAudioThread() && context()->isGraphOwner());
+
+ if (m_renderingStateNeedUpdating && !node()->isMarkedForDeletion()) {
+ // Copy from m_outputs to m_renderingOutputs.
+ m_renderingOutputs.resize(m_outputs.size());
+ unsigned j = 0;
+ for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i, ++j) {
+ AudioNodeOutput* output = *i;
+ m_renderingOutputs[j] = output;
+ output->updateRenderingState();
+ }
+
+ node()->checkNumberOfChannelsForInput(this);
+
+ m_renderingStateNeedUpdating = false;
+ }
+}
+
+unsigned AudioNodeInput::numberOfChannels() const
+{
+ // Find the number of channels of the connection with the largest number of channels.
+ unsigned maxChannels = 1; // one channel is the minimum allowed
+
+ for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i) {
+ AudioNodeOutput* output = *i;
+ maxChannels = max(maxChannels, output->bus()->numberOfChannels());
+ }
+
+ return maxChannels;
+}
+
+unsigned AudioNodeInput::numberOfRenderingChannels()
+{
+ ASSERT(context()->isAudioThread());
+
+ // Find the number of channels of the rendering connection with the largest number of channels.
+ unsigned maxChannels = 1; // one channel is the minimum allowed
+
+ for (unsigned i = 0; i < numberOfRenderingConnections(); ++i)
+ maxChannels = max(maxChannels, renderingOutput(i)->bus()->numberOfChannels());
+
+ return maxChannels;
+}
+
+AudioBus* AudioNodeInput::bus()
+{
+ ASSERT(context()->isAudioThread());
+
+ // Handle single connection specially to allow for in-place processing.
+ if (numberOfRenderingConnections() == 1)
+ return renderingOutput(0)->bus();
+
+ // Multiple connections case (or no connections).
+ return internalSummingBus();
+}
+
+AudioBus* AudioNodeInput::internalSummingBus()
+{
+ ASSERT(context()->isAudioThread());
+
+ // We must pick a summing bus which is the right size to handle the largest connection.
+ switch (numberOfRenderingChannels()) {
+ case 1:
+ return m_monoSummingBus.get();
+ case 2:
+ return m_stereoSummingBus.get();
+ // FIXME: could implement more than just mono and stereo mixing in the future
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+void AudioNodeInput::sumAllConnections(AudioBus* summingBus, size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+
+ // We shouldn't be calling this method if there's only one connection, since it's less efficient.
+ ASSERT(numberOfRenderingConnections() > 1);
+
+ ASSERT(summingBus);
+ if (!summingBus)
+ return;
+
+ summingBus->zero();
+
+ for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) {
+ AudioNodeOutput* output = renderingOutput(i);
+ ASSERT(output);
+
+ // Render audio from this output.
+ AudioBus* connectionBus = output->pull(0, framesToProcess);
+
+ // Sum, with unity-gain.
+ summingBus->sumFrom(*connectionBus);
+ }
+}
+
+AudioBus* AudioNodeInput::pull(AudioBus* inPlaceBus, size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+
+ // Handle single connection case.
+ if (numberOfRenderingConnections() == 1) {
+ // The output will optimize processing using inPlaceBus if it's able.
+ AudioNodeOutput* output = this->renderingOutput(0);
+ return output->pull(inPlaceBus, framesToProcess);
+ }
+
+ AudioBus* internalSummingBus = this->internalSummingBus();
+
+ if (!numberOfRenderingConnections()) {
+ // At least, generate silence if we're not connected to anything.
+ // FIXME: if we wanted to get fancy, we could propagate a 'silent hint' here to optimize the downstream graph processing.
+ internalSummingBus->zero();
+ return internalSummingBus;
+ }
+
+ // Handle multiple connections case.
+ sumAllConnections(internalSummingBus, framesToProcess);
+
+ return internalSummingBus;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioNodeInput.h b/WebCore/webaudio/AudioNodeInput.h
new file mode 100644
index 0000000..1d90986
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeInput.h
@@ -0,0 +1,125 @@
+/*
+ * 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 AudioNodeInput_h
+#define AudioNodeInput_h
+
+#include "AudioBus.h"
+#include "AudioNode.h"
+#include <wtf/HashSet.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AudioNode;
+class AudioNodeOutput;
+
+// An AudioNodeInput represents an input to an AudioNode and can be connected from one or more AudioNodeOutputs.
+// In the case of multiple connections, the input will act as a unity-gain summing junction, mixing all the outputs.
+// The number of channels of the input's bus is the maximum of the number of channels of all its connections.
+
+class AudioNodeInput {
+public:
+ AudioNodeInput(AudioNode*);
+
+ // Can be called from any thread.
+ AudioNode* node() const { return m_node; }
+ AudioContext* context() { return m_node->context(); }
+
+ // Must be called with the context's graph lock.
+ void connect(AudioNodeOutput*);
+ void disconnect(AudioNodeOutput*);
+
+ // disable() will take the output out of the active connections list and set aside in a disabled list.
+ // enable() will put the output back into the active connections list.
+ // Must be called with the context's graph lock.
+ void enable(AudioNodeOutput*);
+ void disable(AudioNodeOutput*);
+
+ // pull() processes all of the AudioNodes connected to us.
+ // In the case of multiple connections it sums the result into an internal summing bus.
+ // In the single connection case, it allows in-place processing where possible using inPlaceBus.
+ // It returns the bus which it rendered into, returning inPlaceBus if in-place processing was performed.
+ // Called from context's audio thread.
+ AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess);
+
+ // bus() contains the rendered audio after pull() has been called for each time quantum.
+ // Called from context's audio thread.
+ AudioBus* bus();
+
+ // This copies m_outputs to m_renderingOutputs. Please see comments for these lists below.
+ // This must be called when we own the context's graph lock in the audio thread at the very start or end of the render quantum.
+ void updateRenderingState();
+
+ // Rendering code accesses its version of the current connections here.
+ unsigned numberOfRenderingConnections() const { return m_renderingOutputs.size(); }
+ AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i]; }
+ const AudioNodeOutput* renderingOutput(unsigned i) const { return m_renderingOutputs[i]; }
+ bool isConnected() const { return numberOfRenderingConnections() > 0; }
+
+ // The number of channels of the connection with the largest number of channels.
+ unsigned numberOfChannels() const;
+
+private:
+ AudioNode* m_node;
+
+ // m_outputs contains the AudioNodeOutputs representing current connections which are not disabled.
+ // The rendering code should never use this directly, but instead uses m_renderingOutputs.
+ HashSet<AudioNodeOutput*> m_outputs;
+
+ // numberOfConnections() should never be called from the audio rendering thread.
+ // Instead numberOfRenderingConnections() and renderingOutput() should be used.
+ unsigned numberOfConnections() const { return m_outputs.size(); }
+
+ // This must be called whenever we modify m_outputs.
+ void changedOutputs();
+
+ // m_renderingOutputs is a copy of m_outputs which will never be modified during the graph rendering on the audio thread.
+ // This is the list which is used by the rendering code.
+ // Whenever m_outputs is modified, the context is told so it can later update m_renderingOutputs from m_outputs at a safe time.
+ // Most of the time, m_renderingOutputs is identical to m_outputs.
+ Vector<AudioNodeOutput*> m_renderingOutputs;
+
+ // m_renderingStateNeedUpdating keeps track if m_outputs is modified.
+ bool m_renderingStateNeedUpdating;
+
+ // The number of channels of the rendering connection with the largest number of channels.
+ unsigned numberOfRenderingChannels();
+
+ // m_disabledOutputs contains the AudioNodeOutputs which are disabled (will not be processed) by the audio graph rendering.
+ // But, from JavaScript's perspective, these outputs are still connected to us.
+ // Generally, these represent disabled connections from "notes" which have finished playing but are not yet garbage collected.
+ HashSet<AudioNodeOutput*> m_disabledOutputs;
+
+ // Called from context's audio thread.
+ AudioBus* internalSummingBus();
+ void sumAllConnections(AudioBus* summingBus, size_t framesToProcess);
+
+ OwnPtr<AudioBus> m_monoSummingBus;
+ OwnPtr<AudioBus> m_stereoSummingBus;
+};
+
+} // namespace WebCore
+
+#endif // AudioNodeInput_h
diff --git a/WebCore/webaudio/AudioNodeOutput.cpp b/WebCore/webaudio/AudioNodeOutput.cpp
new file mode 100644
index 0000000..4c777e6
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeOutput.cpp
@@ -0,0 +1,216 @@
+/*
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioNodeOutput.h"
+
+#include "AudioBus.h"
+#include "AudioContext.h"
+#include "AudioNodeInput.h"
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+AudioNodeOutput::AudioNodeOutput(AudioNode* node, unsigned numberOfChannels)
+ : m_node(node)
+ , m_numberOfChannels(numberOfChannels)
+ , m_desiredNumberOfChannels(numberOfChannels)
+ , m_internalOutputBus(0)
+ , m_actualDestinationBus(0)
+ , m_isEnabled(true)
+ , m_renderingFanOutCount(0)
+{
+ m_monoInternalBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames));
+ m_stereoInternalBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames));
+ setInternalBus();
+}
+
+void AudioNodeOutput::setNumberOfChannels(unsigned numberOfChannels)
+{
+ ASSERT(context()->isGraphOwner());
+
+ m_desiredNumberOfChannels = numberOfChannels;
+
+ if (context()->isAudioThread()) {
+ // If we're in the audio thread then we can take care of it right away (we should be at the very start or end of a rendering quantum).
+ updateNumberOfChannels();
+ } else {
+ // Let the context take care of it in the audio thread in the pre and post render tasks.
+ context()->markAudioNodeOutputDirty(this);
+ }
+}
+
+void AudioNodeOutput::setInternalBus()
+{
+ switch (m_numberOfChannels) {
+ case 0:
+ case 1:
+ m_internalOutputBus = m_monoInternalBus.get();
+ break;
+ case 2:
+ m_internalOutputBus = m_stereoInternalBus.get();
+ break;
+ default:
+ // FIXME: later we can fully implement more than stereo, 5.1, etc.
+ ASSERT_NOT_REACHED();
+ }
+
+ // This may later be changed in pull() to point to an in-place bus with the same number of channels.
+ m_actualDestinationBus = m_internalOutputBus;
+}
+
+void AudioNodeOutput::updateRenderingState()
+{
+ updateNumberOfChannels();
+ m_renderingFanOutCount = fanOutCount();
+}
+
+void AudioNodeOutput::updateNumberOfChannels()
+{
+ ASSERT(context()->isAudioThread() && context()->isGraphOwner());
+
+ if (m_numberOfChannels != m_desiredNumberOfChannels) {
+ m_numberOfChannels = m_desiredNumberOfChannels;
+ setInternalBus();
+ propagateChannelCount();
+ }
+}
+
+void AudioNodeOutput::propagateChannelCount()
+{
+ ASSERT(context()->isAudioThread() && context()->isGraphOwner());
+
+ if (isChannelCountKnown()) {
+ // Announce to any nodes we're connected to that we changed our channel count for its input.
+ for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
+ AudioNodeInput* input = *i;
+ AudioNode* connectionNode = input->node();
+ connectionNode->checkNumberOfChannelsForInput(input);
+ }
+ }
+}
+
+AudioBus* AudioNodeOutput::pull(AudioBus* inPlaceBus, size_t framesToProcess)
+{
+ ASSERT(context()->isAudioThread());
+ ASSERT(m_renderingFanOutCount > 0);
+
+ // Causes our AudioNode to process if it hasn't already for this render quantum.
+ // We try to do in-place processing (using inPlaceBus) if at all possible,
+ // but we can't process in-place if we're connected to more than one input (fan-out > 1).
+ // In this case pull() is called multiple times per rendering quantum, and the processIfNecessary() call below will
+ // cause our node to process() only the first time, caching the output in m_internalOutputBus for subsequent calls.
+
+ bool isInPlace = inPlaceBus && inPlaceBus->numberOfChannels() == numberOfChannels() && m_renderingFanOutCount == 1;
+
+ // Setup the actual destination bus for processing when our node's process() method gets called in processIfNecessary() below.
+ m_actualDestinationBus = isInPlace ? inPlaceBus : m_internalOutputBus;
+
+ node()->processIfNecessary(framesToProcess);
+ return m_actualDestinationBus;
+}
+
+AudioBus* AudioNodeOutput::bus() const
+{
+ ASSERT(const_cast<AudioNodeOutput*>(this)->context()->isAudioThread());
+ ASSERT(m_actualDestinationBus);
+ return m_actualDestinationBus;
+}
+
+unsigned AudioNodeOutput::renderingFanOutCount() const
+{
+ return m_renderingFanOutCount;
+}
+
+unsigned AudioNodeOutput::fanOutCount()
+{
+ ASSERT(context()->isGraphOwner());
+ return m_inputs.size();
+}
+
+void AudioNodeOutput::addInput(AudioNodeInput* input)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(input);
+ if (!input)
+ return;
+
+ m_inputs.add(input);
+}
+
+void AudioNodeOutput::removeInput(AudioNodeInput* input)
+{
+ ASSERT(context()->isGraphOwner());
+
+ ASSERT(input);
+ if (!input)
+ return;
+
+ m_inputs.remove(input);
+}
+
+void AudioNodeOutput::disconnectAllInputs()
+{
+ ASSERT(context()->isGraphOwner());
+
+ // AudioNodeInput::disconnect() changes m_inputs by calling removeInput().
+ while (!m_inputs.isEmpty()) {
+ AudioNodeInput* input = *m_inputs.begin();
+ input->disconnect(this);
+ }
+}
+
+void AudioNodeOutput::disable()
+{
+ ASSERT(context()->isGraphOwner());
+
+ if (m_isEnabled) {
+ for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
+ AudioNodeInput* input = *i;
+ input->disable(this);
+ }
+ m_isEnabled = false;
+ }
+}
+
+void AudioNodeOutput::enable()
+{
+ ASSERT(context()->isGraphOwner());
+
+ if (!m_isEnabled) {
+ for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) {
+ AudioNodeInput* input = *i;
+ input->enable(this);
+ }
+ m_isEnabled = true;
+ }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioNodeOutput.h b/WebCore/webaudio/AudioNodeOutput.h
new file mode 100644
index 0000000..7114b38
--- /dev/null
+++ b/WebCore/webaudio/AudioNodeOutput.h
@@ -0,0 +1,134 @@
+/*
+ * 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 AudioNodeOutput_h
+#define AudioNodeOutput_h
+
+#include "AudioBus.h"
+#include "AudioNode.h"
+#include <wtf/HashSet.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AudioContext;
+class AudioNodeInput;
+
+// AudioNodeOutput represents a single output for an AudioNode.
+// It may be connected to one or more AudioNodeInputs.
+
+class AudioNodeOutput {
+public:
+ // It's OK to pass 0 for numberOfChannels in which case setNumberOfChannels() must be called later on.
+ AudioNodeOutput(AudioNode*, unsigned numberOfChannels);
+
+ // Can be called from any thread.
+ AudioNode* node() const { return m_node; }
+ AudioContext* context() { return m_node->context(); }
+
+ // Causes our AudioNode to process if it hasn't already for this render quantum.
+ // It returns the bus containing the processed audio for this output, returning inPlaceBus if in-place processing was possible.
+ // Called from context's audio thread.
+ AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess);
+
+ // bus() will contain the rendered audio after pull() is called for each rendering time quantum.
+ // Called from context's audio thread.
+ AudioBus* bus() const;
+
+ // fanOutCount() is the number of AudioNodeInputs that we're connected to.
+ // This function should not be called in audio thread rendering code, instead renderingFanOutCount() should be used.
+ // It must be called with the context's graph lock.
+ unsigned fanOutCount();
+
+ // renderingFanOutCount() is the number of AudioNodeInputs that we're connected to during rendering.
+ // Unlike fanOutCount() it will not change during the course of a render quantum.
+ unsigned renderingFanOutCount() const;
+
+ // It must be called with the context's graph lock.
+ void disconnectAllInputs();
+
+ void setNumberOfChannels(unsigned);
+ unsigned numberOfChannels() const { return m_numberOfChannels; }
+ bool isChannelCountKnown() const { return numberOfChannels() > 0; }
+
+ // Disable/Enable happens when there are still JavaScript references to a node, but it has otherwise "finished" its work.
+ // For example, when a note has finished playing. It is kept around, because it may be played again at a later time.
+ // They must be called with the context's graph lock.
+ void disable();
+ void enable();
+
+ // updateRenderingState() is called in the audio thread at the start or end of the render quantum to handle any recent changes to the graph state.
+ // It must be called with the context's graph lock.
+ void updateRenderingState();
+
+private:
+ AudioNode* m_node;
+
+ friend class AudioNodeInput;
+
+ // These are called from AudioNodeInput.
+ // They must be called with the context's graph lock.
+ void addInput(AudioNodeInput*);
+ void removeInput(AudioNodeInput*);
+
+ // setInternalBus() sets m_internalOutputBus appropriately for the number of channels.
+ // It is called in the constructor or in the audio thread with the context's graph lock.
+ void setInternalBus();
+
+ // Announce to any nodes we're connected to that we changed our channel count for its input.
+ // It must be called in the audio thread with the context's graph lock.
+ void propagateChannelCount();
+
+ // updateNumberOfChannels() is called in the audio thread at the start or end of the render quantum to pick up channel changes.
+ // It must be called with the context's graph lock.
+ void updateNumberOfChannels();
+
+ // m_numberOfChannels will only be changed in the audio thread.
+ // The main thread sets m_desiredNumberOfChannels which will later get picked up in the audio thread in updateNumberOfChannels().
+ unsigned m_numberOfChannels;
+ unsigned m_desiredNumberOfChannels;
+
+ // m_internalOutputBus will point to either m_monoInternalBus or m_stereoInternalBus.
+ // It must only be changed in the audio thread (or constructor).
+ AudioBus* m_internalOutputBus;
+ OwnPtr<AudioBus> m_monoInternalBus;
+ OwnPtr<AudioBus> m_stereoInternalBus;
+
+ // m_actualDestinationBus is set in pull() and will either point to one of our internal busses or to the in-place bus.
+ // It must only be changed in the audio thread (or constructor).
+ AudioBus* m_actualDestinationBus;
+
+ HashSet<AudioNodeInput*> m_inputs;
+ typedef HashSet<AudioNodeInput*>::iterator InputsIterator;
+ bool m_isEnabled;
+
+ // For the purposes of rendering, keeps track of the number of inputs we're connected to.
+ // This value should only be changed at the very start or end of the rendering quantum.
+ unsigned m_renderingFanOutCount;
+};
+
+} // namespace WebCore
+
+#endif // AudioNodeOutput_h
diff --git a/WebCore/webaudio/DelayNode.cpp b/WebCore/webaudio/DelayNode.cpp
new file mode 100644
index 0000000..29fceae
--- /dev/null
+++ b/WebCore/webaudio/DelayNode.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:
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "DelayNode.h"
+
+namespace WebCore {
+
+DelayNode::DelayNode(AudioContext* context, double sampleRate)
+ : AudioBasicProcessorNode(context, sampleRate)
+{
+ m_processor = adoptPtr(new DelayProcessor(sampleRate, 1));
+ setType(NodeTypeDelay);
+}
+
+AudioParam* DelayNode::delayTime()
+{
+ return delayProcessor()->delayTime();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/DelayNode.h b/WebCore/webaudio/DelayNode.h
new file mode 100644
index 0000000..93ad227
--- /dev/null
+++ b/WebCore/webaudio/DelayNode.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.
+ *
+ * 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 DelayNode_h
+#define DelayNode_h
+
+#include "AudioBasicProcessorNode.h"
+#include "DelayProcessor.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class AudioParam;
+
+class DelayNode : public AudioBasicProcessorNode {
+public:
+ static PassRefPtr<DelayNode> create(AudioContext* context, double sampleRate)
+ {
+ return adoptRef(new DelayNode(context, sampleRate));
+ }
+
+ AudioParam* delayTime();
+
+private:
+ DelayNode(AudioContext*, double sampleRate);
+
+ DelayProcessor* delayProcessor() { return static_cast<DelayProcessor*>(processor()); }
+};
+
+} // namespace WebCore
+
+#endif // DelayNode_h
diff --git a/WebCore/webaudio/DelayNode.idl b/WebCore/webaudio/DelayNode.idl
new file mode 100644
index 0000000..7756627
--- /dev/null
+++ b/WebCore/webaudio/DelayNode.idl
@@ -0,0 +1,32 @@
+/*
+ * 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 audio {
+ interface [
+ Conditional=WEB_AUDIO,
+ GenerateToJS
+ ] DelayNode : AudioNode {
+ readonly attribute AudioParam delayTime;
+ };
+}
diff --git a/WebCore/webaudio/DelayProcessor.cpp b/WebCore/webaudio/DelayProcessor.cpp
new file mode 100644
index 0000000..5fdc8df
--- /dev/null
+++ b/WebCore/webaudio/DelayProcessor.cpp
@@ -0,0 +1,54 @@
+/*
+ * 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"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "DelayProcessor.h"
+
+#include "DelayDSPKernel.h"
+
+namespace WebCore {
+
+DelayProcessor::DelayProcessor(double sampleRate, unsigned numberOfChannels)
+ : AudioDSPKernelProcessor(sampleRate, numberOfChannels)
+{
+ m_delayTime = AudioParam::create("delayTime", 0.0, 0.0, 1.0);
+}
+
+DelayProcessor::~DelayProcessor()
+{
+ if (isInitialized())
+ uninitialize();
+}
+
+PassOwnPtr<AudioDSPKernel> DelayProcessor::createKernel()
+{
+ return adoptPtr(new DelayDSPKernel(this));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/DelayProcessor.h b/WebCore/webaudio/DelayProcessor.h
new file mode 100644
index 0000000..4844c4b
--- /dev/null
+++ b/WebCore/webaudio/DelayProcessor.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.
+ *
+ * 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 DelayProcessor_h
+#define DelayProcessor_h
+
+#include "AudioDSPKernelProcessor.h"
+#include "AudioParam.h"
+
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class AudioDSPKernel;
+
+class DelayProcessor : public AudioDSPKernelProcessor {
+public:
+ DelayProcessor(double sampleRate, unsigned numberOfChannels);
+ virtual ~DelayProcessor();
+
+ virtual PassOwnPtr<AudioDSPKernel> createKernel();
+
+ AudioParam* delayTime() const { return m_delayTime.get(); }
+
+private:
+ RefPtr<AudioParam> m_delayTime;
+};
+
+} // namespace WebCore
+
+#endif // DelayProcessor_h
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 45bb206..01c2bef 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -36,7 +36,7 @@
#include "CookieJar.h"
#include "Document.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
#include "Logging.h"
#include "Page.h"
#include "PlatformString.h"
@@ -67,14 +67,14 @@ WebSocketChannel::WebSocketChannel(ScriptExecutionContext* context, WebSocketCha
, m_closed(false)
, m_shouldDiscardReceivedData(false)
, m_unhandledBufferedAmount(0)
-#if ENABLE(INSPECTOR)
, m_identifier(0)
-#endif
{
-#if ENABLE(INSPECTOR)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didCreateWebSocket(identifier(), url, m_context->url());
-#endif
+ if (m_context->isDocument())
+ if (Page* page = static_cast<Document*>(m_context)->page())
+ m_identifier = page->progress()->createUniqueIdentifier();
+
+ if (m_identifier)
+ InspectorInstrumentation::didCreateWebSocket(m_context, m_identifier, url, m_context->url());
}
WebSocketChannel::~WebSocketChannel()
@@ -124,11 +124,8 @@ void WebSocketChannel::close()
void WebSocketChannel::disconnect()
{
LOG(Network, "WebSocketChannel %p disconnect", this);
-#if ENABLE(INSPECTOR)
- if (m_context)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didCloseWebSocket(identifier());
-#endif
+ if (m_identifier && m_context)
+ InspectorInstrumentation::didCloseWebSocket(m_context, m_identifier);
m_handshake.clearScriptExecutionContext();
m_client = 0;
m_context = 0;
@@ -154,10 +151,8 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
ASSERT(handle == m_handle);
if (!m_context)
return;
-#if ENABLE(INSPECTOR)
- if (InspectorController* controller = m_context->inspectorController())
- controller->willSendWebSocketHandshakeRequest(identifier(), m_handshake.clientHandshakeRequest());
-#endif
+ if (m_identifier)
+ InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_context, m_identifier, m_handshake.clientHandshakeRequest());
CString handshakeMessage = m_handshake.clientHandshakeMessage();
if (!handle->send(handshakeMessage.data(), handshakeMessage.length())) {
m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Error sending handshake message.", 0, m_handshake.clientOrigin());
@@ -168,11 +163,8 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
void WebSocketChannel::didClose(SocketStreamHandle* handle)
{
LOG(Network, "WebSocketChannel %p didClose", this);
-#if ENABLE(INSPECTOR)
- if (m_context)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didCloseWebSocket(identifier());
-#endif
+ if (m_identifier && m_context)
+ InspectorInstrumentation::didCloseWebSocket(m_context, m_identifier);
ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
m_closed = true;
if (m_handle) {
@@ -276,10 +268,8 @@ bool WebSocketChannel::processBuffer()
if (headerLength <= 0)
return false;
if (m_handshake.mode() == WebSocketHandshake::Connected) {
-#if ENABLE(INSPECTOR)
- if (InspectorController* controller = m_context->inspectorController())
- controller->didReceiveWebSocketHandshakeResponse(identifier(), m_handshake.serverHandshakeResponse());
-#endif
+ if (m_identifier)
+ InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(m_context, m_identifier, m_handshake.serverHandshakeResponse());
if (!m_handshake.serverSetCookie().isEmpty()) {
if (m_context->isDocument()) {
Document* document = static_cast<Document*>(m_context);
@@ -397,21 +387,6 @@ void WebSocketChannel::resumeTimerFired(Timer<WebSocketChannel>* timer)
didClose(m_handle.get());
}
-#if ENABLE(INSPECTOR)
-unsigned long WebSocketChannel::identifier()
-{
- if (m_identifier)
- return m_identifier;
-
- if (InspectorController* controller = m_context->inspectorController())
- if (Page* page = controller->inspectedPage())
- m_identifier = page->progress()->createUniqueIdentifier();
-
- ASSERT(m_identifier);
- return m_identifier;
-}
-#endif // ENABLE(INSPECTOR)
-
} // namespace WebCore
#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/websockets/WebSocketChannel.h b/WebCore/websockets/WebSocketChannel.h
index a08e6bb..9c52377 100644
--- a/WebCore/websockets/WebSocketChannel.h
+++ b/WebCore/websockets/WebSocketChannel.h
@@ -84,10 +84,6 @@ namespace WebCore {
bool processBuffer();
void resumeTimerFired(Timer<WebSocketChannel>* timer);
-#if ENABLE(INSPECTOR)
- unsigned long identifier();
-#endif
-
ScriptExecutionContext* m_context;
WebSocketChannelClient* m_client;
WebSocketHandshake m_handshake;
@@ -101,9 +97,7 @@ namespace WebCore {
bool m_shouldDiscardReceivedData;
unsigned long m_unhandledBufferedAmount;
-#if ENABLE(INSPECTOR)
- unsigned long m_identifier;
-#endif
+ unsigned long m_identifier; // m_identifier == 0 means that we could not obtain a valid identifier.
};
} // namespace WebCore
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index a535191..345e5b7 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -69,6 +69,7 @@
#include "DOMFileSystemSync.h"
#include "ErrorCallback.h"
#include "FileError.h"
+#include "FileException.h"
#include "FileSystemCallback.h"
#include "FileSystemCallbacks.h"
#include "LocalFileSystem.h"
@@ -355,13 +356,13 @@ void WorkerContext::revokeObjectURL(const String& blobURLString)
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));
+ DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::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));
+ DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -372,13 +373,13 @@ PassRefPtr<DOMFileSystemSync> WorkerContext::requestFileSystemSync(int type, lon
{
ec = 0;
if (!AsyncFileSystem::isAvailable() || !securityOrigin()->canAccessFileSystem()) {
- ec = SECURITY_ERR;
+ ec = FileException::SECURITY_ERR;
return 0;
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent) {
- ec = INVALID_MODIFICATION_ERR;
+ ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index bdae0cd..5fd009c 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -90,7 +90,6 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
result->setDecoder(decoder.release());
result->write(documentSource);
- result->finishParsing();
result->close();
return result.release();
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4c9ebbe..9a6a950 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,42 @@
+2010-10-28 Mark Rowe <mrowe@apple.com>
+
+ Stop allowing deprecated methods to be used in NetscapePluginHostProxy.mm now
+ that deprecated methods are no longer used.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2010-10-26 Dan Bernstein <mitz@apple.com>
+
+ Build fix.
+
+ * WebKit.xcodeproj/project.pbxproj: Allow deprecated methods to be used in NetscapePluginHostProxy.mm.
+
+2010-10-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48186> Remove unneeded WebHTMLRepresentationInternal.h header
+
+ Reviewed by Sam Weinig.
+
+ The only method defined in WebHTMLRepresentationInternal.h is
+ also defined in WebHTMLRepresentation.h, so use that instead.
+
+ * WebKit.xcodeproj/project.pbxproj: Removed references to
+ WebHTMLRepresentationInternal.h.
+
+2010-10-21 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48047> Fix warnings found by check-Xcode-source-file-types
+
+ Reviewed by Adam Roben.
+
+ Fixes the following warning:
+
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'WebStringTruncator.h'.
+ 1 issues found for WebKit/WebKit.xcodeproj/project.pbxproj.
+
+ * WebKit.xcodeproj/project.pbxproj: Removed explicit file type
+ for WebStringTruncator.h to make it match other header files.
+
2010-10-20 Nikolas Zimmermann <nzimmermann@rim.com>
Not reviewed.
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 3eaa49f..be3caeb 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -87,7 +87,6 @@
37D1DCA91065928C0068F7EF /* WebJSPDFDoc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D1DCA71065928C0068F7EF /* WebJSPDFDoc.mm */; };
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F4484D10338E8C0030E55E /* WebWorkersPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */; };
- 441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */; };
44BB8B141241A022001E3A22 /* WebArchiveInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */; };
4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; };
4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
@@ -485,7 +484,6 @@
39446080020F50ED0ECA1767 /* WebHistoryItem.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHistoryItem.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
41F4484D10338E8C0030E55E /* WebWorkersPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebWorkersPrivate.h; path = mac/Workers/WebWorkersPrivate.h; sourceTree = "<group>"; };
41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebWorkersPrivate.mm; path = mac/Workers/WebWorkersPrivate.mm; sourceTree = "<group>"; };
- 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationInternal.h; sourceTree = "<group>"; };
449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
44BB8B131241A022001E3A22 /* WebArchiveInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebArchiveInternal.h; sourceTree = "<group>"; };
4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
@@ -717,7 +715,7 @@
F53444CF02E87CBA018635CA /* WebKitStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatisticsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5927D4E02D26C5E01CA2DBB /* WebKitErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitErrors.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F59668C802AD2923018635CA /* WebStringTruncator.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebStringTruncator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F59668C802AD2923018635CA /* WebStringTruncator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebStringTruncator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F59668C902AD2923018635CA /* WebStringTruncator.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebStringTruncator.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F59EAE410253C8DE018635CA /* WebCoreStatistics.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreStatistics.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -1253,7 +1251,6 @@
children = (
35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */,
35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.mm */,
- 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */,
F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */,
35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */,
35081D9502B6D4D80ACA2ACA /* WebHTMLView.mm */,
@@ -1495,7 +1492,6 @@
939810140824BF01008DF038 /* WebHistoryPrivate.h in Headers */,
1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */,
939810550824BF01008DF038 /* WebHTMLRepresentation.h in Headers */,
- 441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */,
939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */,
939810570824BF01008DF038 /* WebHTMLView.h in Headers */,
939810A10824BF01008DF038 /* WebHTMLViewInternal.h in Headers */,
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index bd2faa8..9eeb48b 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,703 @@
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * src/BackForwardListClientImpl.h: Use BackForwardListImpl.h.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl): Cast to BackForwardList* before calling setClient.
+
+2010-10-28 Michael Nordman <michaeln@google.com>
+
+ Reviewed by ap.
+
+ [Chrome] Fix an appcache regression introduced in r69226
+ https://bugs.webkit.org/show_bug.cgi?id=48592
+ Provide a noop method body ApplicationCacheHost::maybeLoadMainResourceForRedirect.
+
+ * src/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
+
+2010-10-29 Aaron Colwell <acolwell@chromium.org>
+
+ Reviewed by James Robinson.
+
+ Fix globalAlpha support when using drawImage() to copy a video frame
+ to a 2D canvas context.
+ https://bugs.webkit.org/show_bug.cgi?id=48094
+
+ This fix applies the globalAlpha value to the canvas before passing it
+ down to the lower layers that don't have access to the graphics
+ context. This makes sure that any drawing on the canvas will have the
+ proper global alpha value applied.
+
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::paint):
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * src/FrameLoaderClientImpl.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::dispatchDidBecomeFrameset):
+
+2010-10-29 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add close button to network view, make tests pass
+ for resource manager on all ports.
+ https://bugs.webkit.org/show_bug.cgi?id=48628
+
+ * src/js/Tests.js:
+
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Roben and David Kilzer.
+
+ Fix and cleanup of build systems
+ https://bugs.webkit.org/show_bug.cgi?id=48342
+
+ * features.gypi: Remove unnecessary ENABLE_SANDBOX.
+
+2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use the nearest
+ language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show,
+ http://codereview.chromium.org/3595018/show and
+ https://bugs.webkit.org/show_bug.cgi?id=47420.
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+ * public/WebSpeechInputControllerMock.h:
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::create):
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ * src/WebSpeechInputControllerMockImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+
+2010-10-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel, Peter Kasting, and Darin Fisher.
+ (Eric reviewed the CoreGraphics interactions, Peter reviewed the image
+ decoder interaction, and Darin Fisher SGTMed the policy decision.)
+
+ [chromium] Chromium Mac should use WebKit's image decoders
+ https://bugs.webkit.org/show_bug.cgi?id=47974
+
+ Enable WebKit's image decoders.
+
+ * features.gypi:
+
+2010-10-28 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ [Chromium] History related tests REGRESSED after r70723
+ https://bugs.webkit.org/show_bug.cgi?id=48513
+
+ Since r70723 made BackForwardList::currentItem no longer be virtual,
+ we were not reaching the implementation in Chromium's
+ BackForwardListClientImpl, and for Chromium currentItem is not the same
+ as itemAtIndex(0).
+
+ The fix is to make itemAtIndex(0) have the currentItem() behavior, which
+ lets us keep currentItem as non-virtual (and remove its implementation
+ from the Chromium side).
+
+ This also switches Chromium to use the default implementation of
+ backItem() and forwardItem() (vs. the old stubs that just had
+ ASSERT_NOT_REACHED) since they're actually reacheable with Chromium
+ code thanks to the calls in FrameLoader::checkDidPerformFirstNavigation.
+
+ * src/BackForwardListClientImpl.cpp:
+ (WebKit::BackForwardListClientImpl::itemAtIndex):
+ * src/BackForwardListClientImpl.h:
+
+2010-10-28 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Support FileSystem in chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=47643
+ Update the chromium DEPS to pick up corresponding webkit_support change.
+ Also add a temporary glue implementation with FIXME comment to
+ WebFrameClient::openFileSystem.
+
+ * DEPS:
+ * public/WebFrameClient.h:
+ (WebKit::WebFrameClient::openFileSystem):
+
+2010-10-28 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Remove obsolete public/API methods in chromium port
+ https://bugs.webkit.org/show_bug.cgi?id=48504
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+
+2010-10-27 Eric Uhrhane <ericu@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Metadata queries should return full file info, not just modification time
+ https://bugs.webkit.org/show_bug.cgi?id=48098
+
+ * src/AssertMatchingEnums.cpp: Ensure WebFileInfo and FileMetadata use the same values for file/directory indicators.
+ * src/WebFileSystemCallbacksImpl.cpp:
+ (WebKit::WebFileSystemCallbacksImpl::didReadMetadata): Pass through the new information.
+
+2010-10-27 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] WebGL does not work with the compositor in test_shell
+ https://bugs.webkit.org/show_bug.cgi?id=48470
+
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer):
+ - Properly restore the draw framebuffer after resolving.
+ (WebKit::WebGraphicsContext3DDefaultImpl::prepareTexture):
+ - Make the context current before calling resolveMultisampledFramebuffer.
+
+2010-10-27 Stuart Morgan <stuartmorgan@chromium.org>
+
+ Reviewed by David Levin.
+
+ Include caps lock state when converting NSEvent modifiers to
+ WebInputEvent
+
+ https://bugs.webkit.org/show_bug.cgi?id=47917
+
+ * src/mac/WebInputEventFactory.mm:
+ (WebKit::modifiersFromEvent):
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by James Robinson.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=48465
+
+ * features.gypi:
+
+2010-10-25 Tony Chang <tony@chromium.org>
+
+ Reviewed by Anders Carlsson.
+
+ compile TestNetscapePlugIn on chromium linux
+ https://bugs.webkit.org/show_bug.cgi?id=48274
+
+ * WebKit.gyp: Enable compilation of TestNetscapePlugIn on Linux.
+
+2010-10-27 Satish Sampath <satish@chromium.org>
+
+ Unreviewed, rolling out r70665.
+ http://trac.webkit.org/changeset/70665
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ Need to address Alexey's review comments.
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+ * public/WebSpeechInputControllerMock.h:
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ * src/WebSpeechInputControllerMockImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+
+2010-10-27 ZHenyao Mo <zmo@google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Must enable GL_POINT_SPRITE in GraphicsContext3D implementations
+ https://bugs.webkit.org/show_bug.cgi?id=45908
+
+ * src/WebGraphicsContext3DDefaultImpl.cpp: Enable for chromium --in-process-webgl port.
+ (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+
+2010-10-27 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use the nearest
+ language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show and
+ http://codereview.chromium.org/3595018/show. The last of the 4 patches
+ depends also on the language tag validation provided by this patch:
+ https://bugs.webkit.org/show_bug.cgi?id=48225.
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+ * public/WebSpeechInputControllerMock.h:
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::create):
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ * src/WebSpeechInputControllerMockImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+
+2010-10-26 Victoria Kirst <vrk@google.com>
+
+ Reviewed by David Levin.
+
+ Fix compile when ACCELERATED_COMPOSITING flag is not set
+ https://bugs.webkit.org/show_bug.cgi?id=48373
+
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl):
+ (WebKit::WebMediaPlayerClientImpl::readyStateChanged):
+ (WebKit::WebMediaPlayerClientImpl::load):
+ * src/WebMediaPlayerClientImpl.h:
+
+2010-10-26 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ Rolling in r70512 again.
+
+ spellcheck='' should be the same as spellcheck="true"
+ https://bugs.webkit.org/show_bug.cgi?id=25539
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+ * src/EditorClientImpl.cpp:
+ (WebKit::EditorClientImpl::shouldSpellcheckByDefault):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::transferLoadingResourceFromPage):
+ Empty method.
+ * src/FrameLoaderClientImpl.h:
+
+2010-10-26 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Add a 'grammar' attribute for speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=48339
+
+ To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a
+ speech enabled input element. This is passed without validation to the speech recognizer. Typical values
+ could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI.
+ It is up to the recognizer to interpret the value and use it as an aid in recognition.
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ * src/WebSpeechInputControllerMockImpl.h:
+
+2010-10-26 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: update stale comments referring to WebIndexedDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=48325
+
+ WebIndexedDatabase was renamed to WebIDBFactory in
+ http://trac.webkit.org/changeset/64344, but some comments referring to
+ it were left unchanged.
+
+ * public/WebIDBCursor.h:
+ * public/WebIDBDatabase.h:
+ * public/WebIDBDatabaseError.h:
+ * public/WebIDBIndex.h:
+ * public/WebIDBObjectStore.h:
+ * public/WebIDBTransaction.h:
+ * src/WebIDBDatabaseImpl.h:
+
+2010-10-22 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ Implement copy-texture-to-parent-texture API for WebGraphicsContext3DDefaultImpl.
+ https://bugs.webkit.org/show_bug.cgi?id=48152
+
+ This allows the in-process implementation to do accelerated canvas and
+ accelerated compositing together. It requires some changes landed
+ in chromium 63528, so this patch also rolls chromium DEPS to 63722
+ (current LKGR).
+
+ Covered by fast/canvas/arc360.html, and many more when run with
+ --accelerated-compositing and --accelerated-2d-canvas.
+
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+ Add member vars to save the currently-bound texture and for the
+ texture-to-texture FBO.
+ (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+ Delete the texture-to-texture FBO on destruction.
+
+ (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+ Generate the texture-to-texture FBO.
+ (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM):
+ Check for support of the glGetTexLevelParameteriv function (required
+ for this implementation).
+ (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM):
+ Implement the extension: bind the FBO, bind the child texture, then
+ do a glCopyTexImage2D() into the parent texture.
+ (WebKit::WebGraphicsContext3DDefaultImpl::bindTexture):
+ Record the newly-bound texture in m_boundTexture.
+ * src/WebGraphicsContext3DDefaultImpl.h:
+ Add the two new member variables.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::graphicsContext3D):
+ Make sure the graphics context is reshaped to the correct size on all
+ platforms.
+
+2010-10-26 Alexey Marinichev <amarinichev@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ [chromium] Check getGraphicsResetStatusARB and reinitialize the
+ renderer in an error is returned.
+ https://bugs.webkit.org/show_bug.cgi?id=47848
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::composite): added getGraphicsResetStatusARB check
+ (WebKit::WebViewImpl::reallocateRenderer): added
+ * src/WebViewImpl.h:
+
+2010-10-26 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Andreas Kling.
+
+ Valgrind failure in GraphicsContext3DInternal::reshape
+ https://bugs.webkit.org/show_bug.cgi?id=48284
+
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+
+2010-10-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Fix IndexedDB crashes
+ https://bugs.webkit.org/show_bug.cgi?id=48266
+
+ Make WebIDBObjectStoreImpl match the way that WebIDBIndexImpl passes
+ in cursor parameters (which is the correct way). KeyRange knows how
+ to convert itself to a WebCore type--even if the value is null.
+
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::openCursor):
+
+2010-10-26 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Remove obsolete public/API methods in chromium port.
+ https://bugs.webkit.org/show_bug.cgi?id=48330
+
+ * public/WebSpeechInputListener.h:
+
+2010-10-26 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Quota for IndexedDB should be per origin not per database
+ https://bugs.webkit.org/show_bug.cgi?id=48064
+
+ * public/WebIDBFactory.h:
+ * public/WebSecurityOrigin.h:
+ * src/WebIDBFactory.cpp:
+ (WebKit::WebIDBFactory::databaseFileName):
+ * src/WebSecurityOrigin.cpp:
+ (WebKit::WebSecurityOrigin::get):
+
+2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70512.
+ http://trac.webkit.org/changeset/70512
+ https://bugs.webkit.org/show_bug.cgi?id=48314
+
+ crashes many tests (Requested by inferno-sec on #webkit).
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+ * src/EditorClientImpl.cpp:
+ (WebKit::EditorClientImpl::shouldSpellcheckByDefault):
+
+2010-10-25 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ spellcheck='' should be the same as spellcheck="true"
+ https://bugs.webkit.org/show_bug.cgi?id=25539
+
+ Followed API rename in WebCore.
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+ * src/EditorClientImpl.cpp:
+ (WebKit::EditorClientImpl::shouldSpellcheckByDefault):
+
+2010-10-25 Satish Sampath <satish@chromium.org>
+
+ Unreviewed, fix for a build break caused by my earlier patch.
+
+ * public/WebSpeechInputListener.h:
+ (WebKit::WebSpeechInputListener::setRecognitionResult): Explicitly invoking the correct constructor.
+
+2010-10-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Allow embedder to pass on all the speech recognition results to the input element.
+ https://bugs.webkit.org/show_bug.cgi?id=48068
+
+ * WebKit.gyp: Added new files
+ * public/WebSpeechInputListener.h:
+ * public/WebSpeechInputResult.h: Added, wrapper around WebCore::SpeechInputResult
+ (WebKit::WebSpeechInputResult::WebSpeechInputResult):
+ (WebKit::WebSpeechInputResult::~WebSpeechInputResult):
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::setRecognitionResult): Accepts an array instead of a single string.
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult):
+ * src/WebSpeechInputControllerMockImpl.h:
+ * src/WebSpeechInputResult.cpp: Added.
+ (WebKit::WebSpeechInputResult::reset):
+ (WebKit::WebSpeechInputResult::WebSpeechInputResult):
+ (WebKit::WebSpeechInputResult::set):
+ (WebKit::WebSpeechInputResult::operator PassRefPtr<WebCore::SpeechInputResult>):
+
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70451.
+ http://trac.webkit.org/changeset/70451
+ https://bugs.webkit.org/show_bug.cgi?id=48249
+
+ Broke set-unloaded-frame-location.html under Qt (Requested by
+ caseq on #webkit).
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::executeScript):
+ (WebKit::WebFrameImpl::executeScriptInIsolatedWorld):
+ (WebKit::WebFrameImpl::executeScriptAndReturnValue):
+
+2010-10-25 Peter Rybin <peter.rybin@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ HTML parser should provide script column position within HTML document to JavaScript engine
+ https://bugs.webkit.org/show_bug.cgi?id=45271
+
+ Replaces script line number with TextPosition structure.
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::executeScript):
+ (WebKit::WebFrameImpl::executeScriptInIsolatedWorld):
+ (WebKit::WebFrameImpl::executeScriptAndReturnValue):
+
+2010-10-20 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Renumber FileError/FileException error codes per latest File API spec changes
+ https://bugs.webkit.org/show_bug.cgi?id=47936
+
+ * public/WebFileError.h:
+ * src/AssertMatchingEnums.cpp:
+ * src/AsyncFileWriterChromium.cpp:
+ (WebCore::AsyncFileWriterChromium::didFail):
+
+2010-10-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70361.
+ http://trac.webkit.org/changeset/70361
+ https://bugs.webkit.org/show_bug.cgi?id=48217
+
+ Chromium tests NoInitialAutocompleteForReadOnly and
+ InitialAutocomplete don't complete (Requested by yuzo on
+ #webkit).
+
+ * public/WebDocument.h:
+
+2010-10-22 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Turning on the Autocomplete implementation on the Chromium side.
+ https://bugs.webkit.org/show_bug.cgi?id=41283
+
+ * public/WebDocument.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::createWindow):
+ * src/ChromeClientImpl.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::dispatchCreatePage):
+ * src/FrameLoaderClientImpl.h:
+ Add NavigationAction parameter.
+
+2010-10-22 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70301.
+ http://trac.webkit.org/changeset/70301
+ https://bugs.webkit.org/show_bug.cgi?id=48126
+
+ "Lang attribute layout tests failing" (Requested by satish on
+ #webkit).
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+ * public/WebSpeechInputControllerMock.h:
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ * src/WebSpeechInputControllerMockImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+
+2010-10-22 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Patch the current speech input implementation to use and validate the
+ nearest language tag. The language is now passed to the startRecognition
+ methods so that language-specific recognition could be used. Also added
+ a second parameter to setMockSpeechInputResult for the language used in
+ speech recognition.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ This is the 2nd of a 4-sided patch in Chromium and WebKit. For more
+ details see http://codereview.chromium.org/3615005/show and
+ http://codereview.chromium.org/3595018/show.
+
+ * public/WebSpeechInputController.h:
+ (WebKit::WebSpeechInputController::startRecognition):
+ * public/WebSpeechInputControllerMock.h:
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::create):
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ * src/WebSpeechInputControllerMockImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+
+2010-10-21 Yuzo Fujishima <yuzo@google.com>
+
+ Unreviewed build fix attempt for Chromium Linux Debug Clang
+
+ * public/WebExternalPopupMenu.h:
+
+2010-10-21 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] roll chromium DEPS to include forwarding headers refactor
+ https://bugs.webkit.org/show_bug.cgi?id=48097
+
+ * DEPS: Roll chromium forward to include new forwarding headers script
+ * WebKit.gyp: This dependency always existed, it's just exposed now
+ that the header files are in a different include dir.
+
+2010-10-21 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium: use dedicated event listener type in EventListenerWrapper.
+ https://bugs.webkit.org/show_bug.cgi?id=48059
+
+ * src/EventListenerWrapper.cpp:
+ (WebKit::EventListenerWrapper::EventListenerWrapper):
+
+2010-10-21 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Adding an API that allows external
+ popup menus, without the use of WebCore::PopupMenuChromium.
+ Once this is hooked up in Chromium, the plan is to remove
+ entirely the external case from PopupMenuChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=46016
+
+ * WebKit.gyp:
+ * public/WebExternalPopupMenu.h: Added.
+ * public/WebExternalPopupMenuClient.h: Added.
+ * public/WebMenuItemInfo.h:
+ (WebKit::WebMenuItemInfo::WebMenuItemInfo):
+ * public/WebView.h:
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::createExternalPopupMenu):
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::createPopupMenu):
+ * src/ExternalPopupMenu.cpp: Added.
+ * src/ExternalPopupMenu.h: Added.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::setUseExternalPopupMenus):
+ (WebKit::WebViewImpl::useExternalPopupMenus):
+ * src/WebViewImpl.h:
+
2010-10-20 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r70165.
@@ -66,10 +766,10 @@
(WebKit::WebViewImpl::WebViewImpl):
* src/WebViewImpl.h:
-2010-10-19 Leandro Gracia Gil <leandrogracia@google.com>
+2010-10-20 Leandro Gracia Gil <leandrogracia@google.com>
Reviewed by Jeremy Orlow.
-
+
Patch the current speech input implementation to use and validate the
nearest language tag. The language is now passed to the startRecognition
methods so that language-specific recognition could be used. Also added
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 86a9387..aaf0b0a 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': '63057'
+ 'chromium_rev': '64214'
}
deps = {
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index e1e1a5f..f121c5f 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -150,6 +150,8 @@
'public/WebEditingAction.h',
'public/WebElement.h',
'public/WebExceptionCode.h',
+ 'public/WebExternalPopupMenu.h',
+ 'public/WebExternalPopupMenuClient.h',
'public/WebFileChooserCompletion.h',
'public/WebFileChooserParams.h',
'public/WebFileError.h',
@@ -255,6 +257,7 @@
'public/WebSpeechInputController.h',
'public/WebSpeechInputControllerMock.h',
'public/WebSpeechInputListener.h',
+ 'public/WebSpeechInputResult.h',
'public/WebStorageArea.h',
'public/WebStorageEventDispatcher.h',
'public/WebStorageNamespace.h',
@@ -325,6 +328,8 @@
'src/EditorClientImpl.h',
'src/EventListenerWrapper.cpp',
'src/EventListenerWrapper.h',
+ 'src/ExternalPopupMenu.cpp',
+ 'src/ExternalPopupMenu.h',
'src/FrameLoaderClientImpl.cpp',
'src/FrameLoaderClientImpl.h',
'src/FrameNetworkingContextImpl.h',
@@ -514,6 +519,7 @@
'src/WebSharedWorkerImpl.h',
'src/WebSpeechInputControllerMockImpl.cpp',
'src/WebSpeechInputControllerMockImpl.h',
+ 'src/WebSpeechInputResult.cpp',
'src/WebStorageAreaImpl.cpp',
'src/WebStorageAreaImpl.h',
'src/WebStorageEventDispatcherImpl.cpp',
@@ -875,6 +881,9 @@
'sources/': [
['exclude', 'Win\\.cpp$'],
],
+ 'dependencies': [
+ 'TestNetscapePlugIn',
+ ],
'actions': [
{
'action_name': 'repack_locale',
@@ -902,7 +911,6 @@
'dependencies': [
'copy_mesa',
'LayoutTestHelper',
- 'TestNetscapePlugIn',
],
'mac_bundle_resources': [
'<(ahem_path)',
@@ -957,6 +965,11 @@
['exclude', '(Gtk|Linux)\\.cpp$']
]
}],
+ ['inside_chromium_build==0', {
+ 'dependencies': [
+ '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
+ ]
+ }],
],
},
], # targets
@@ -967,6 +980,54 @@
'type': 'executable',
'sources': ['../../WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'],
}],
+ }, { # OS!="win"
+ 'targets': [
+ {
+ 'target_name': 'TestNetscapePlugIn',
+ 'type': 'loadable_module',
+ 'sources': [ '<@(test_plugin_files)' ],
+ 'dependencies': [
+ '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ ],
+ 'include_dirs': [
+ '<(chromium_src_dir)',
+ '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn',
+ '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
+ ],
+
+ 'conditions': [
+ ['OS=="mac"', {
+ 'mac_bundle': 1,
+ # It would be nice to name this
+ # TestNetscapePlugIn, but that name is already
+ # used by the fork of this plugin in Chromium.
+ 'product_name': 'WebKitTestNetscapePlugIn',
+ 'product_extension': 'plugin',
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
+ '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
+ '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
+ ]
+ },
+ 'xcode_settings': {
+ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
+ # This is a temporary fork of
+ # DRT/TestNetscapePlugIn/mac/Info.plist. Once
+ # we get rid of our forked plugin in the
+ # chromium repo, we can share the same
+ # Info.plist.
+ 'INFOPLIST_FILE': '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist',
+ },
+ }],
+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
+ 'cflags': [
+ '-fvisibility=default',
+ ],
+ }],
+ ],
+ },
+ ],
}],
['OS=="mac"', {
'targets': [
@@ -989,42 +1050,6 @@
'files': ['<(PRODUCT_DIR)/osmesa.so'],
}],
},
- {
- 'target_name': 'TestNetscapePlugIn',
- 'type': 'loadable_module',
- 'sources': [ '<@(test_plugin_files)' ],
- 'dependencies': [
- '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
- ],
- 'include_dirs': [
- '<(chromium_src_dir)',
- '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn',
- '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
- ],
-
- # Mac specific stuff.
- 'mac_bundle': 1,
- # It would be nice to name this TestNetscapePlugIn, but
- # that name is already used by the fork of this plugin in
- # Chromium.
- 'product_name': 'WebKitTestNetscapePlugIn',
- 'product_extension': 'plugin',
- 'link_settings': {
- 'libraries': [
- '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
- '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
- '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
- ]
- },
- 'xcode_settings': {
- 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
- # This is a temporary fork of
- # DRT/TestNetscapePlugIn/mac/Info.plist. Once we get
- # rid of our forked plugin in the chromium repo, we
- # can share the same Info.plist.
- 'INFOPLIST_FILE': '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist',
- },
- }
],
}],
], # conditions
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index 1e78b04..cd6bf20 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -69,7 +69,6 @@
'ENABLE_ORIENTATION_EVENTS=0',
'ENABLE_PROGRESS_TAG=1',
'ENABLE_RUBY=1',
- 'ENABLE_SANDBOX=1',
'ENABLE_SHARED_WORKERS=1',
'ENABLE_SVG=1',
'ENABLE_SVG_ANIMATION=1',
@@ -80,6 +79,7 @@
'ENABLE_TOUCH_EVENTS=1',
'ENABLE_V8_SCRIPT_DEBUG_SERVER=1',
'ENABLE_VIDEO=1',
+ 'ENABLE_WEB_AUDIO=0',
'ENABLE_WEB_SOCKETS=1',
'ENABLE_WEB_TIMING=1',
'ENABLE_WORKERS=1',
@@ -88,6 +88,7 @@
'ENABLE_XSLT=1',
'WTF_USE_ACCELERATED_COMPOSITING=1',
'WTF_USE_WEBP=1',
+ 'WTF_USE_WEBKIT_IMAGE_DECODERS=1',
],
'use_accelerated_compositing%': 1,
diff --git a/WebKit/chromium/public/WebExternalPopupMenu.h b/WebKit/chromium/public/WebExternalPopupMenu.h
new file mode 100644
index 0000000..49630cf
--- /dev/null
+++ b/WebKit/chromium/public/WebExternalPopupMenu.h
@@ -0,0 +1,46 @@
+/*
+ * 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 WebExternalPopupMenu_h
+#define WebExternalPopupMenu_h
+
+namespace WebKit {
+
+struct WebRect;
+
+class WebExternalPopupMenu {
+public:
+ virtual void show(const WebRect& bounds) = 0;
+ virtual void close() = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebExternalPopupMenu_h
diff --git a/WebKit/chromium/public/WebExternalPopupMenuClient.h b/WebKit/chromium/public/WebExternalPopupMenuClient.h
new file mode 100644
index 0000000..e01bc2d
--- /dev/null
+++ b/WebKit/chromium/public/WebExternalPopupMenuClient.h
@@ -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.
+ */
+
+#ifndef WebExternalPopupMenuClient_h
+#define WebExternalPopupMenuClient_h
+
+namespace WebKit {
+
+class WebExternalPopupMenuClient {
+public:
+ // Should be called when the currently selected item in the popup menu
+ // changed. Can be -1 if there is no selection.
+ virtual void didChangeSelection(int index) = 0;
+
+ // Should be called when an index has been accepted.
+ // Note that it is not safe to access this WebExternalPopupClientMenu after
+ // this has been called as it might not be valid anymore.
+ virtual void didAcceptIndex(int index) = 0;
+
+ // Should be called when the popup menu was discarded (closed without a
+ // selection.
+ // Note that it is not safe to access this WebExternalPopupClientMenu after
+ // this has been called as it might not be valid anymore.
+ virtual void didCancel() = 0;
+};
+
+} // namespace WebKit
+
+#endif // WebExternalPopupMenuClient_h
diff --git a/WebKit/chromium/public/WebFileError.h b/WebKit/chromium/public/WebFileError.h
index cfe8882..e7a17c3 100644
--- a/WebKit/chromium/public/WebFileError.h
+++ b/WebKit/chromium/public/WebFileError.h
@@ -34,15 +34,18 @@ namespace WebKit {
// File-related error code defined in HTML5 File API.
enum WebFileError {
- WebFileErrorNoModificationAllowed = 7,
- WebFileErrorNotFound = 8,
- WebFileErrorInvalidState = 11,
- WebFileErrorInvalidModification = 13,
- WebFileErrorSecurity = 18,
- WebFileErrorAbort = 20,
- WebFileErrorQuotaExceeded = 22,
- WebFileErrorNotReadable = 24,
- WebFileErrorEncoding = 26,
+ WebFileErrorNotFound = 1,
+ WebFileErrorSecurity = 2,
+ WebFileErrorAbort = 3,
+ WebFileErrorNotReadable = 4,
+ WebFileErrorEncoding = 5,
+ WebFileErrorNoModificationAllowed = 6,
+ WebFileErrorInvalidState = 7,
+ WebFileErrorSyntax = 8,
+ WebFileErrorInvalidModification = 9,
+ WebFileErrorQuotaExceeded = 10,
+ WebFileErrorTypeMismatch = 11,
+ WebFileErrorPathExists = 12,
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
index 458604e..c5cfc21 100644
--- a/WebKit/chromium/public/WebFrameClient.h
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -355,10 +355,8 @@ public:
WebFrame*, WebFileSystem::Type, long long size,
bool create, WebFileSystemCallbacks*) { }
- // This method will be deleted once chromium uses the new method above.
- virtual void openFileSystem(
- WebFrame*, WebFileSystem::Type, long long size,
- WebFileSystemCallbacks*) { }
+ // FIXME: This method should be deleted once chromium implements the new method above.
+ virtual void openFileSystem(WebFrame* frame, WebFileSystem::Type type, long long size, WebFileSystemCallbacks* callbacks) { return openFileSystem(frame, type, size, true, callbacks); }
protected:
~WebFrameClient() { }
diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h
index 2e5e98b..98f7a6b 100644
--- a/WebKit/chromium/public/WebIDBCursor.h
+++ b/WebKit/chromium/public/WebIDBCursor.h
@@ -35,7 +35,7 @@
namespace WebKit {
-// See comment in WebIndexedDatabase for a high level overview these classes.
+// See comment in WebIDBFactory for a high level overview these classes.
class WebIDBCursor {
public:
virtual ~WebIDBCursor() { }
diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h
index c67a117..19096cc 100644
--- a/WebKit/chromium/public/WebIDBDatabase.h
+++ b/WebKit/chromium/public/WebIDBDatabase.h
@@ -37,7 +37,7 @@ class WebIDBCallbacks;
class WebIDBObjectStore;
class WebIDBTransaction;
-// See comment in WebIndexedDatabase for a high level overview of these classes.
+// See comment in WebIDBFactory for a high level overview of these classes.
class WebIDBDatabase {
public:
virtual ~WebIDBDatabase() { }
diff --git a/WebKit/chromium/public/WebIDBDatabaseError.h b/WebKit/chromium/public/WebIDBDatabaseError.h
index a237d5f..c181f78 100644
--- a/WebKit/chromium/public/WebIDBDatabaseError.h
+++ b/WebKit/chromium/public/WebIDBDatabaseError.h
@@ -37,7 +37,7 @@ namespace WebCore { class IDBDatabaseError; }
namespace WebKit {
-// See comment in WebIndexedDatabase for a high level overview these classes.
+// See comment in WebIDBFactory for a high level overview these classes.
class WebIDBDatabaseError {
public:
~WebIDBDatabaseError() { reset(); }
diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h
index c7fbe02..66ceadb 100755
--- a/WebKit/chromium/public/WebIDBFactory.h
+++ b/WebKit/chromium/public/WebIDBFactory.h
@@ -58,6 +58,8 @@ public:
}
// The file name that would be used for persisting a given indexed database on the file system.
+ WEBKIT_API static WebString databaseFileName(const WebSecurityOrigin&);
+ // FIXME: Remove after roll.
WEBKIT_API static WebString databaseFileName(const WebString& name, const WebSecurityOrigin&);
};
diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h
index 7c77878..0c0d79a 100644
--- a/WebKit/chromium/public/WebIDBIndex.h
+++ b/WebKit/chromium/public/WebIDBIndex.h
@@ -36,7 +36,7 @@ class WebIDBCallbacks;
class WebIDBKey;
class WebIDBKeyRange;
-// See comment in WebIndexedDatabase for a high level overview of these classes.
+// See comment in WebIDBFactory for a high level overview of these classes.
class WebIDBIndex {
public:
virtual ~WebIDBIndex() { }
diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h
index 60d3325..171fe78 100644
--- a/WebKit/chromium/public/WebIDBKey.h
+++ b/WebKit/chromium/public/WebIDBKey.h
@@ -82,7 +82,6 @@ public:
#endif
private:
-
WebPrivatePtr<WebCore::IDBKey> m_private;
};
diff --git a/WebKit/chromium/public/WebIDBObjectStore.h b/WebKit/chromium/public/WebIDBObjectStore.h
index f5f1473..89dae02 100755
--- a/WebKit/chromium/public/WebIDBObjectStore.h
+++ b/WebKit/chromium/public/WebIDBObjectStore.h
@@ -38,7 +38,7 @@ namespace WebKit {
class WebIDBKeyRange;
class WebIDBTransaction;
-// See comment in WebIndexedDatabase for a high level overview these classes.
+// See comment in WebIDBFactory for a high level overview these classes.
class WebIDBObjectStore {
public:
virtual ~WebIDBObjectStore() { }
diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h
index 6a739c3..385dd1e 100644
--- a/WebKit/chromium/public/WebIDBTransaction.h
+++ b/WebKit/chromium/public/WebIDBTransaction.h
@@ -35,7 +35,7 @@ namespace WebKit {
class WebIDBObjectStore;
class WebIDBTransactionCallbacks;
-// See comment in WebIndexedDatabase for a high level overview of these classes.
+// See comment in WebIDBFactory for a high level overview of these classes.
class WebIDBTransaction {
public:
virtual ~WebIDBTransaction() { }
diff --git a/WebKit/chromium/public/WebMenuItemInfo.h b/WebKit/chromium/public/WebMenuItemInfo.h
index d513e66..445dfb4 100644
--- a/WebKit/chromium/public/WebMenuItemInfo.h
+++ b/WebKit/chromium/public/WebMenuItemInfo.h
@@ -44,6 +44,15 @@ struct WebMenuItemInfo {
Group,
Separator,
};
+
+ WebMenuItemInfo()
+ : type(Option)
+ , action(0)
+ , enabled(false)
+ , checked(false)
+ {
+ }
+
WebString label;
Type type;
unsigned action;
diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h
index efcb2e9..a241682 100644
--- a/WebKit/chromium/public/WebSecurityOrigin.h
+++ b/WebKit/chromium/public/WebSecurityOrigin.h
@@ -100,6 +100,7 @@ public:
WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>&);
WebSecurityOrigin& operator=(const WTF::PassRefPtr<WebCore::SecurityOrigin>&);
operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const;
+ WebCore::SecurityOrigin* get() const;
#endif
private:
diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h
index 5408741..6ed546f 100644
--- a/WebKit/chromium/public/WebSpeechInputController.h
+++ b/WebKit/chromium/public/WebSpeechInputController.h
@@ -35,7 +35,9 @@
namespace WebKit {
+class WebString;
struct WebRect;
+class WebString;
// Provides an embedder API called by WebKit.
class WebSpeechInputController {
@@ -43,7 +45,7 @@ public:
// Starts speech recognition. Speech will get recorded until the endpointer detects silence,
// runs to the limit or stopRecording is called. Progress indications and the recognized
// text are returned via the listener interface.
- virtual bool startRecognition(int requestId, const WebRect&)
+ virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar)
{
WEBKIT_ASSERT_NOT_REACHED();
return false;
diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h
index 9a26235..b4c50a0 100644
--- a/WebKit/chromium/public/WebSpeechInputControllerMock.h
+++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h
@@ -44,6 +44,10 @@ public:
WebSpeechInputListener* listener);
virtual ~WebSpeechInputControllerMock() { }
+ virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0;
+
+ // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
+ // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
virtual void setMockRecognitionResult(const WebString& result) = 0;
};
diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h
index 6dc3d49..091f984 100644
--- a/WebKit/chromium/public/WebSpeechInputListener.h
+++ b/WebKit/chromium/public/WebSpeechInputListener.h
@@ -31,6 +31,8 @@
#ifndef WebSpeechInputListener_h
#define WebSpeechInputListener_h
+#include "WebSpeechInputResult.h"
+
namespace WebKit {
class WebString;
@@ -47,19 +49,19 @@ public:
// WebSpeechInputController::stopRecording() was called.
// Typically after this call the listener would update the UI to reflect that recognition is
// in progress.
- virtual void didCompleteRecording(int) = 0;
+ virtual void didCompleteRecording(int) { WEBKIT_ASSERT_NOT_REACHED(); }
// Gives results from speech recognition, either partial or the final results.
// This method can potentially get called multiple times if there are partial results
// available as the user keeps speaking. If the speech could not be recognized properly
// or if there was any other errors in the process, this method may never be called.
- virtual void setRecognitionResult(int, const WebString&) = 0;
+ virtual void setRecognitionResult(int, const WebSpeechInputResultArray&) { WEBKIT_ASSERT_NOT_REACHED(); }
// Informs that speech recognition has completed. This gets invoked irrespective of whether
// recognition was succesful or not, whether setRecognitionResult() was invoked or not. The
// handler typically frees up any temporary resources allocated and waits for the next speech
// recognition request.
- virtual void didCompleteRecognition(int) = 0;
+ virtual void didCompleteRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); }
protected:
~WebSpeechInputListener() { }
diff --git a/WebKit/chromium/public/WebSpeechInputResult.h b/WebKit/chromium/public/WebSpeechInputResult.h
new file mode 100644
index 0000000..8f1a8f5
--- /dev/null
+++ b/WebKit/chromium/public/WebSpeechInputResult.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 WebSpeechInputResult_h
+#define WebSpeechInputResult_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+#include "WebString.h"
+#include "WebVector.h"
+
+namespace WebCore {
+class SpeechInputResult;
+}
+
+namespace WebKit {
+
+// This class holds one speech recognition result including the text and other related
+// fields, as received from the embedder.
+class WebSpeechInputResult {
+public:
+ WebSpeechInputResult() { }
+ ~WebSpeechInputResult() { reset(); }
+
+ WEBKIT_API void set(const WebString& utterance, double confidence);
+ WEBKIT_API void reset();
+
+#if WEBKIT_IMPLEMENTATION
+ WebSpeechInputResult(const WTF::PassRefPtr<WebCore::SpeechInputResult>&);
+ operator WTF::PassRefPtr<WebCore::SpeechInputResult>() const;
+#endif
+
+private:
+ WebPrivatePtr<WebCore::SpeechInputResult> m_private;
+};
+
+typedef WebVector<WebSpeechInputResult> WebSpeechInputResultArray;
+
+} // namespace WebKit
+
+#endif // WebSpeechInputResult_h
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index e504bd7..ce8e512 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -69,13 +69,13 @@ public:
UserContentInjectInAllFrames,
UserContentInjectInTopFrameOnly
};
-
+
// Controls which documents user styles are injected into.
enum UserStyleInjectionTime {
UserStyleInjectInExistingDocuments,
UserStyleInjectInSubsequentDocuments
};
-
+
// Initialization ------------------------------------------------------
@@ -315,6 +315,12 @@ public:
virtual void performCustomContextMenuAction(unsigned action) = 0;
+ // Popup menu ----------------------------------------------------------
+
+ // Sets whether select popup menus should be rendered by the browser.
+ WEBKIT_API static void setUseExternalPopupMenus(bool);
+
+
// Visited link state --------------------------------------------------
// Tells all WebView instances to update the visited link state for the
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index 858cb2a..edd9579 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -48,6 +48,8 @@ class WebAccessibilityObject;
class WebDeviceOrientationClient;
class WebDragData;
class WebElement;
+class WebExternalPopupMenu;
+class WebExternalPopupMenuClient;
class WebFileChooserCompletion;
class WebFrame;
class WebGeolocationService;
@@ -87,6 +89,8 @@ public:
// responsible for rendering the contents of the popup menu.
virtual WebWidget* createPopupMenu(WebPopupType) { return 0; }
virtual WebWidget* createPopupMenu(const WebPopupMenuInfo&) { return 0; }
+ virtual WebExternalPopupMenu* createExternalPopupMenu(
+ const WebPopupMenuInfo&, WebExternalPopupMenuClient*) { return 0; }
// Create a session storage namespace object associated with this WebView.
virtual WebStorageNamespace* createSessionStorageNamespace(unsigned quota) { return 0; }
diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp
index f1b1a91..a6e66c6 100644
--- a/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -113,6 +113,11 @@ void ApplicationCacheHost::selectCacheWithManifest(const KURL& manifestURL)
}
}
+void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&)
+{
+ // N/A to the chromium port
+}
+
bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse& response)
{
if (m_internal) {
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index 9647a44..c6ab85a 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -37,6 +37,8 @@
#include "ApplicationCacheHost.h"
#include "AsyncFileSystem.h"
#include "EditorInsertAction.h"
+#include "FileError.h"
+#include "FileMetadata.h"
#include "FontDescription.h"
#include "FontSmoothingMode.h"
#include "HTMLInputElement.h"
@@ -56,6 +58,8 @@
#include "WebClipboard.h"
#include "WebCursorInfo.h"
#include "WebEditingAction.h"
+#include "WebFileError.h"
+#include "WebFileInfo.h"
#include "WebFileSystem.h"
#include "WebFontDescription.h"
#include "WebIDBKey.h"
@@ -361,4 +365,20 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType);
#if ENABLE(FILE_SYSTEM)
COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary);
COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory);
#endif
+
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorNotFound, FileError::NOT_FOUND_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorSecurity, FileError::SECURITY_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorAbort, FileError::ABORT_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorNotReadable, FileError::NOT_READABLE_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorEncoding, FileError::ENCODING_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorNoModificationAllowed, FileError::NO_MODIFICATION_ALLOWED_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorInvalidState, FileError::INVALID_STATE_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorSyntax, FileError::SYNTAX_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorInvalidModification, FileError::INVALID_MODIFICATION_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorQuotaExceeded, FileError::QUOTA_EXCEEDED_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorTypeMismatch, FileError::TYPE_MISMATCH_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorPathExists, FileError::PATH_EXISTS_ERR);
diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.cpp b/WebKit/chromium/src/AsyncFileWriterChromium.cpp
index 8969094..71cf3b5 100644
--- a/WebKit/chromium/src/AsyncFileWriterChromium.cpp
+++ b/WebKit/chromium/src/AsyncFileWriterChromium.cpp
@@ -85,7 +85,7 @@ void AsyncFileWriterChromium::didTruncate()
void AsyncFileWriterChromium::didFail(WebKit::WebFileError error)
{
- m_client->didFail(error);
+ m_client->didFail(static_cast<FileError::ErrorCode>(error));
}
} // namespace
diff --git a/WebKit/chromium/src/BackForwardListClientImpl.cpp b/WebKit/chromium/src/BackForwardListClientImpl.cpp
index 2976329..af659bc 100644
--- a/WebKit/chromium/src/BackForwardListClientImpl.cpp
+++ b/WebKit/chromium/src/BackForwardListClientImpl.cpp
@@ -84,14 +84,15 @@ void BackForwardListClientImpl::goToItem(HistoryItem* item)
m_pendingHistoryItem = 0;
}
-HistoryItem* BackForwardListClientImpl::currentItem()
-{
- return m_currentItem.get();
-}
-
HistoryItem* BackForwardListClientImpl::itemAtIndex(int index)
{
- if (!m_webView->client() || index > forwardListCount() || -index > backListCount())
+ if (!m_webView->client())
+ return 0;
+
+ if (!index)
+ return m_currentItem.get();
+
+ if (index > forwardListCount() || -index > backListCount())
return 0;
// Since we don't keep the entire back/forward list, we have no way to
diff --git a/WebKit/chromium/src/BackForwardListClientImpl.h b/WebKit/chromium/src/BackForwardListClientImpl.h
index 1d8beb0..b795ecf 100644
--- a/WebKit/chromium/src/BackForwardListClientImpl.h
+++ b/WebKit/chromium/src/BackForwardListClientImpl.h
@@ -31,7 +31,7 @@
#ifndef BackForwardListClientImpl_h
#define BackForwardListClientImpl_h
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
namespace WebKit {
class WebViewImpl;
@@ -50,7 +50,6 @@ private:
// WebCore::BackForwardListClient methods:
virtual void addItem(PassRefPtr<WebCore::HistoryItem>);
virtual void goToItem(WebCore::HistoryItem*);
- virtual WebCore::HistoryItem* currentItem();
virtual WebCore::HistoryItem* itemAtIndex(int index);
virtual int backListCount();
virtual int forwardListCount();
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 4f1705f..df13b29 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -40,6 +40,7 @@
#include "DatabaseTracker.h"
#include "Document.h"
#include "DocumentLoader.h"
+#include "ExternalPopupMenu.h"
#include "FileChooser.h"
#include "FloatRect.h"
#include "FrameLoadRequest.h"
@@ -51,6 +52,7 @@
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "IntRect.h"
+#include "NavigationAction.h"
#include "Node.h"
#include "NotificationPresenterImpl.h"
#include "Page.h"
@@ -251,7 +253,7 @@ void ChromeClientImpl::focusedNodeChanged(Node* node)
}
Page* ChromeClientImpl::createWindow(
- Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features)
+ Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features, const NavigationAction&)
{
if (!m_webView->client())
return 0;
@@ -833,6 +835,9 @@ bool ChromeClientImpl::selectItemWritingDirectionIsNatural()
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client) const
{
+ if (WebViewImpl::useExternalPopupMenus())
+ return adoptRef(new ExternalPopupMenu(client, m_webView->client()));
+
return adoptRef(new PopupMenuChromium(client));
}
diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h
index b1208f7..039fc1b 100644
--- a/WebKit/chromium/src/ChromeClientImpl.h
+++ b/WebKit/chromium/src/ChromeClientImpl.h
@@ -71,7 +71,7 @@ public:
virtual void takeFocus(WebCore::FocusDirection);
virtual void focusedNodeChanged(WebCore::Node*);
virtual WebCore::Page* createWindow(
- WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
+ WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
virtual void show();
virtual bool canRunModal();
virtual void runModal();
diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp
index d9ccb17..d33a06b 100644
--- a/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -241,7 +241,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) {
data.isSpellCheckingEnabled = true;
// Spellchecking might be enabled for the field, but could be disabled on the node.
- if (m_webView->focusedWebCoreFrame()->editor()->spellCheckingEnabledInFocusedNode())
+ if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode())
data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
}
}
diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp
index 11977b6..bc1d206 100644
--- a/WebKit/chromium/src/EditorClientImpl.cpp
+++ b/WebKit/chromium/src/EditorClientImpl.cpp
@@ -124,7 +124,7 @@ bool EditorClientImpl::shouldSpellcheckByDefault()
const Editor* editor = frame->editor();
if (!editor)
return false;
- if (editor->spellCheckingEnabledInFocusedNode())
+ if (editor->isSpellCheckingEnabledInFocusedNode())
return true;
const Document* document = frame->document();
if (!document)
diff --git a/WebKit/chromium/src/EventListenerWrapper.cpp b/WebKit/chromium/src/EventListenerWrapper.cpp
index 706ba21..6360932 100644
--- a/WebKit/chromium/src/EventListenerWrapper.cpp
+++ b/WebKit/chromium/src/EventListenerWrapper.cpp
@@ -40,7 +40,7 @@
namespace WebKit {
EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener)
- : EventListener(EventListener::JSEventListenerType)
+ : EventListener(EventListener::NativeEventListenerType)
, m_webDOMEventListener(webDOMEventListener)
{
}
diff --git a/WebKit/chromium/src/ExternalPopupMenu.cpp b/WebKit/chromium/src/ExternalPopupMenu.cpp
new file mode 100644
index 0000000..a0243eb
--- /dev/null
+++ b/WebKit/chromium/src/ExternalPopupMenu.cpp
@@ -0,0 +1,141 @@
+/*
+ * 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 "ExternalPopupMenu.h"
+
+#include "FrameView.h"
+#include "IntPoint.h"
+#include "PopupMenuClient.h"
+#include "TextDirection.h"
+#include "WebExternalPopupMenu.h"
+#include "WebMenuItemInfo.h"
+#include "WebPopupMenuInfo.h"
+#include "WebVector.h"
+#include "WebViewClient.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+ExternalPopupMenu::ExternalPopupMenu(PopupMenuClient* popupMenuClient,
+ WebViewClient* webViewClient)
+ : m_popupMenuClient(popupMenuClient)
+ , m_webViewClient(webViewClient)
+ , m_webExternalPopupMenu(0)
+{
+}
+
+ExternalPopupMenu::~ExternalPopupMenu()
+{
+}
+
+void ExternalPopupMenu::show(const IntRect& rect, FrameView* v, int index)
+{
+ // WebCore reuses the PopupMenu of a page.
+ // For simplicity, we do recreate the actual external popup everytime.
+ hide();
+
+ WebPopupMenuInfo info;
+ getPopupMenuInfo(&info);
+ m_webExternalPopupMenu =
+ m_webViewClient->createExternalPopupMenu(info, this);
+ m_webExternalPopupMenu->show(v->contentsToWindow(rect));
+}
+
+void ExternalPopupMenu::hide()
+{
+ if (m_popupMenuClient)
+ m_popupMenuClient->popupDidHide();
+ if (!m_webExternalPopupMenu)
+ return;
+ m_webExternalPopupMenu->close();
+ m_webExternalPopupMenu = 0;
+}
+
+void ExternalPopupMenu::updateFromElement()
+{
+}
+
+void ExternalPopupMenu::disconnectClient()
+{
+ hide();
+ m_popupMenuClient = 0;
+}
+
+void ExternalPopupMenu::didChangeSelection(int index)
+{
+ if (m_popupMenuClient)
+ m_popupMenuClient->selectionChanged(index);
+}
+
+void ExternalPopupMenu::didAcceptIndex(int index)
+{
+ if (m_popupMenuClient) {
+ m_popupMenuClient->valueChanged(index);
+ m_popupMenuClient->popupDidHide();
+ }
+ m_webExternalPopupMenu = 0;
+}
+
+void ExternalPopupMenu::didCancel()
+{
+ if (m_popupMenuClient)
+ m_popupMenuClient->popupDidHide();
+ m_webExternalPopupMenu = 0;
+}
+
+void ExternalPopupMenu::getPopupMenuInfo(WebPopupMenuInfo* info)
+{
+ int itemCount = m_popupMenuClient->listSize();
+ WebVector<WebPopupMenuInfo::Item> items(
+ static_cast<size_t>(itemCount));
+ for (int i = 0; i < itemCount; ++i) {
+ WebPopupMenuInfo::Item& popupItem = items[i];
+ popupItem.label = m_popupMenuClient->itemText(i);
+ if (m_popupMenuClient->itemIsSeparator(i))
+ popupItem.type = WebMenuItemInfo::Separator;
+ else if (m_popupMenuClient->itemIsLabel(i))
+ popupItem.type = WebMenuItemInfo::Group;
+ else
+ popupItem.type = WebMenuItemInfo::Option;
+ popupItem.enabled = m_popupMenuClient->itemIsEnabled(i);
+ }
+
+ info->itemHeight = m_popupMenuClient->menuStyle().font().height();
+ info->itemFontSize =
+ static_cast<int>(m_popupMenuClient->menuStyle().font().size());
+ info->selectedIndex = m_popupMenuClient->selectedIndex();
+ info->rightAligned =
+ m_popupMenuClient->menuStyle().textDirection() == WebCore::RTL;
+ info->items.swap(items);
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/ExternalPopupMenu.h b/WebKit/chromium/src/ExternalPopupMenu.h
new file mode 100644
index 0000000..6963e8d
--- /dev/null
+++ b/WebKit/chromium/src/ExternalPopupMenu.h
@@ -0,0 +1,82 @@
+/*
+ * 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 ExternalPopupMenu_h
+#define ExternalPopupMenu_h
+
+#include "PopupMenu.h"
+#include "WebExternalPopupMenuClient.h"
+
+namespace WebCore {
+class FrameView;
+class IntRect;
+class PopupMenuClient;
+}
+
+namespace WebKit {
+
+class WebExternalPopupMenu;
+class WebViewClient;
+struct WebPopupMenuInfo;
+
+// The ExternalPopupMenu connects the actual implementation of the popup menu
+// to the WebCore popup menu.
+class ExternalPopupMenu : public WebCore::PopupMenu,
+ public WebExternalPopupMenuClient {
+public:
+ ExternalPopupMenu(WebCore::PopupMenuClient*, WebViewClient*);
+ virtual ~ExternalPopupMenu();
+
+private:
+ // WebCore::PopupMenu methods:
+ virtual void show(const WebCore::IntRect&, WebCore::FrameView*, int index);
+ virtual void hide();
+ virtual void updateFromElement();
+ virtual void disconnectClient();
+
+ // WebExternalPopupClient methods:
+ virtual void didChangeSelection(int index);
+ virtual void didAcceptIndex(int index);
+ virtual void didCancel();
+
+ // Fills |info| with the popup menu information contained in the
+ // WebCore::PopupMenuClient associated with this ExternalPopupMenu.
+ void getPopupMenuInfo(WebPopupMenuInfo* info);
+
+ WebCore::PopupMenuClient* m_popupMenuClient;
+ WebViewClient* m_webViewClient;
+
+ // The actual implementor of the show menu.
+ WebExternalPopupMenu* m_webExternalPopupMenu;
+};
+
+} // namespace WebKit
+
+#endif // ExternalPopupMenu_h
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index b4c62f4..29141ac 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -812,11 +812,11 @@ void FrameLoaderClientImpl::dispatchDidFirstVisuallyNonEmptyLayout()
m_webFrame->client()->didFirstVisuallyNonEmptyLayout(m_webFrame);
}
-Frame* FrameLoaderClientImpl::dispatchCreatePage()
+Frame* FrameLoaderClientImpl::dispatchCreatePage(const NavigationAction& action)
{
struct WindowFeatures features;
Page* newPage = m_webFrame->frame()->page()->chrome()->createWindow(
- m_webFrame->frame(), FrameLoadRequest(), features);
+ m_webFrame->frame(), FrameLoadRequest(), features, action);
// Make sure that we have a valid disposition. This should have been set in
// the preceeding call to dispatchDecidePolicyForNewWindowAction.
@@ -1342,6 +1342,10 @@ void FrameLoaderClientImpl::transitionToCommittedForNewPage()
makeDocumentView();
}
+void FrameLoaderClientImpl::dispatchDidBecomeFrameset(bool)
+{
+}
+
bool FrameLoaderClientImpl::canCachePage() const
{
// Since we manage the cache, always report this page as non-cacheable to
@@ -1385,6 +1389,11 @@ void FrameLoaderClientImpl::didTransferChildFrameToNewDocument(Page*)
m_webFrame->setClient(newParent->client());
}
+void FrameLoaderClientImpl::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
+ notImplemented();
+}
+
PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
const IntSize& size, // FIXME: how do we use this?
HTMLPlugInElement* element,
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h
index 0b15db6..ef00ed3 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -112,7 +112,7 @@ public:
virtual void dispatchDidFinishLoad();
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual WebCore::Frame* dispatchCreatePage();
+ virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction function, const WTF::String& mime_type, const WebCore::ResourceRequest&);
virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState> form_state, const WTF::String& frame_name);
@@ -169,6 +169,7 @@ public:
virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
virtual bool canCachePage() const;
virtual void download(
WebCore::ResourceHandle*, const WebCore::ResourceRequest&,
@@ -180,6 +181,7 @@ public:
const WTF::String& referrer, bool allowsScrolling,
int marginWidth, int marginHeight);
virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, 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/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 963d440..b5ed384 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -32,15 +32,21 @@
#include "SpeechInputClientImpl.h"
#include "PlatformString.h"
+#include "SpeechInputListener.h"
#include "WebSpeechInputController.h"
#include "WebString.h"
#include "WebViewClient.h"
-#include "page/SpeechInputListener.h"
+#include <wtf/PassOwnPtr.h>
#if ENABLE(INPUT_SPEECH)
namespace WebKit {
+PassOwnPtr<SpeechInputClientImpl> SpeechInputClientImpl::create(WebViewClient* client)
+{
+ return adoptPtr(new SpeechInputClientImpl(client));
+}
+
SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client)
: m_controller(web_view_client ? web_view_client->speechInputController(this) : 0)
, m_listener(0)
@@ -56,10 +62,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener)
m_listener = listener;
}
-bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect)
+bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar)
{
ASSERT(m_listener);
- return m_controller->startRecognition(requestId, elementRect);
+ return m_controller->startRecognition(requestId, elementRect, language, grammar);
}
void SpeechInputClientImpl::stopRecording(int requestId)
@@ -86,10 +92,13 @@ void SpeechInputClientImpl::didCompleteRecognition(int requestId)
m_listener->didCompleteRecognition(requestId);
}
-void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebString& result)
+void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebSpeechInputResultArray& results)
{
ASSERT(m_listener);
- m_listener->setRecognitionResult(requestId, result);
+ WebCore::SpeechInputResultArray webcoreResults(results.size());
+ for (size_t i = 0; i < results.size(); ++i)
+ webcoreResults[i] = results[i];
+ m_listener->setRecognitionResult(requestId, webcoreResults);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h
index 817b32b..520803a 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.h
+++ b/WebKit/chromium/src/SpeechInputClientImpl.h
@@ -33,8 +33,11 @@
#if ENABLE(INPUT_SPEECH)
+#include "SpeechInputClient.h"
#include "WebSpeechInputListener.h"
-#include "page/SpeechInputClient.h"
+#include <wtf/Forward.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
class SpeechInputListener;
@@ -49,21 +52,23 @@ class SpeechInputClientImpl
: public WebCore::SpeechInputClient,
public WebSpeechInputListener {
public:
- SpeechInputClientImpl(WebViewClient*);
+ static PassOwnPtr<SpeechInputClientImpl> create(WebViewClient*);
virtual ~SpeechInputClientImpl();
// SpeechInputClient methods.
void setListener(WebCore::SpeechInputListener*);
- bool startRecognition(int, const WebCore::IntRect&);
+ bool startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar);
void stopRecording(int);
void cancelRecognition(int);
// WebSpeechInputListener methods.
void didCompleteRecording(int);
- void setRecognitionResult(int, const WebString&);
+ void setRecognitionResult(int, const WebSpeechInputResultArray&);
void didCompleteRecognition(int);
private:
+ SpeechInputClientImpl(WebViewClient*);
+
WebSpeechInputController* m_controller; // To call into the embedder.
WebCore::SpeechInputListener* m_listener;
};
diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
index f44e8f1..52a4032 100644
--- a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
+++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
@@ -34,6 +34,7 @@
#include "AsyncFileSystemCallbacks.h"
#include "AsyncFileSystemChromium.h"
+#include "FileMetadata.h"
#include "ScriptExecutionContext.h"
#include "WebFileSystemEntry.h"
#include "WebFileInfo.h"
@@ -63,9 +64,13 @@ void WebFileSystemCallbacksImpl::didSucceed()
delete this;
}
-void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& info)
+void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& webFileInfo)
{
- m_callbacks->didReadMetadata(info.modificationTime);
+ FileMetadata fileMetadata;
+ fileMetadata.modificationTime = webFileInfo.modificationTime;
+ fileMetadata.length = webFileInfo.length;
+ fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type);
+ m_callbacks->didReadMetadata(fileMetadata);
delete this;
}
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 1625eb8..e805c55 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -73,10 +73,14 @@ WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl()
, m_texture(0)
, m_fbo(0)
, m_depthStencilBuffer(0)
+ , m_cachedWidth(0)
+ , m_cachedHeight(0)
, m_multisampleFBO(0)
, m_multisampleDepthStencilBuffer(0)
, m_multisampleColorBuffer(0)
, m_boundFBO(0)
+ , m_boundTexture(0)
+ , m_copyTextureToParentTextureFBO(0)
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
, m_scanline(0)
#endif
@@ -101,6 +105,7 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
}
glDeleteTextures(1, &m_texture);
+ glDeleteFramebuffersEXT(1, &m_copyTextureToParentTextureFBO);
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
if (m_scanline)
delete[] m_scanline;
@@ -165,12 +170,15 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute
validateAttributes();
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+ glEnable(GL_POINT_SPRITE);
if (!angleCreateCompilers()) {
angleDestroyCompilers();
return false;
}
+ glGenFramebuffersEXT(1, &m_copyTextureToParentTextureFBO);
+
m_initialized = true;
return true;
}
@@ -211,12 +219,10 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes()
void WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer(unsigned x, unsigned y, unsigned width, unsigned height)
{
if (m_attributes.antialias) {
- bool mustRestoreFBO = (m_boundFBO != m_multisampleFBO);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
- if (mustRestoreFBO)
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
}
}
@@ -280,6 +286,7 @@ void WebGraphicsContext3DDefaultImpl::prepareTexture()
{
if (!m_renderDirectlyToWebView) {
// We need to prepare our rendering results for the compositor.
+ makeContextCurrent();
resolveMultisampledFramebuffer(0, 0, m_cachedWidth, m_cachedHeight);
}
}
@@ -558,12 +565,33 @@ void WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM(const void* mem
bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM()
{
- // We don't claim support for this extension at this time
- return false;
+ // This extension requires this desktopGL-only function (GLES2 doesn't
+ // support it), so check for its existence here.
+ return glGetTexLevelParameteriv;
}
void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2)
{
+ makeContextCurrent();
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_copyTextureToParentTextureFBO);
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER,
+ GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D,
+ id,
+ 0); // level
+ glBindTexture(GL_TEXTURE_2D, id2);
+ GLsizei width, height;
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height);
+ glCopyTexImage2D(GL_TEXTURE_2D,
+ 0, // level
+ GL_RGBA,
+ 0, 0, // x, y
+ width,
+ height,
+ 0); // border
+ glBindTexture(GL_TEXTURE_2D, m_boundTexture);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
}
// Helper macros to reduce the amount of code.
@@ -688,7 +716,12 @@ void WebGraphicsContext3DDefaultImpl::bindFramebuffer(unsigned long target, WebG
DELEGATE_TO_GL_2(bindRenderbuffer, BindRenderbufferEXT, unsigned long, WebGLId)
-DELEGATE_TO_GL_2(bindTexture, BindTexture, unsigned long, WebGLId)
+void WebGraphicsContext3DDefaultImpl::bindTexture(unsigned long target, WebGLId texture)
+{
+ makeContextCurrent();
+ glBindTexture(target, texture);
+ m_boundTexture = texture;
+}
DELEGATE_TO_GL_4(blendColor, BlendColor, double, double, double, double)
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 124ceac..5eebf12 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -288,6 +288,12 @@ private:
// For tracking which FBO is bound
unsigned int m_boundFBO;
+ // For tracking which texture is bound
+ unsigned int m_boundTexture;
+
+ // FBO used for copying child texture to parent texture.
+ unsigned m_copyTextureToParentTextureFBO;
+
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
unsigned char* m_scanline;
void flipVertically(unsigned char* framebuffer,
diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h
index fda4265..94f1101 100644
--- a/WebKit/chromium/src/WebIDBDatabaseImpl.h
+++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h
@@ -39,7 +39,7 @@ namespace WebKit {
class WebIDBObjectStore;
class WebIDBTransaction;
-// See comment in WebIndexedDatabase for a high level overview these classes.
+// See comment in WebIDBFactory for a high level overview these classes.
class WebIDBDatabaseImpl : public WebIDBDatabase {
public:
WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>);
diff --git a/WebKit/chromium/src/WebIDBFactory.cpp b/WebKit/chromium/src/WebIDBFactory.cpp
index b186b68..40eff97 100755
--- a/WebKit/chromium/src/WebIDBFactory.cpp
+++ b/WebKit/chromium/src/WebIDBFactory.cpp
@@ -31,22 +31,23 @@
#include "config.h"
#include "WebIDBFactory.h"
-#if ENABLE(INDEXED_DATABASE)
-
#include "IDBFactoryBackendImpl.h"
-#include "SecurityOrigin.h"
+#include "WebSecurityOrigin.h"
+#include <wtf/UnusedParam.h>
using namespace WebCore;
namespace WebKit {
-WebString WebIDBFactory::databaseFileName(const WebString& name, const WebSecurityOrigin& origin)
+WebString WebIDBFactory::databaseFileName(const WebSecurityOrigin& origin)
{
- RefPtr<SecurityOrigin> securityOrigin;
- securityOrigin = origin;
- return IDBFactoryBackendImpl::databaseFileName(name, securityOrigin.get());
+ return IDBFactoryBackendImpl::databaseFileName(origin.get());
}
+WebString WebIDBFactory::databaseFileName(const WebString& name, const WebSecurityOrigin& origin)
+{
+ UNUSED_PARAM(name);
+ return databaseFileName(origin);
}
-#endif // ENABLE(INDEXED_DATABASE)
+}
diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index 96495fe..5dd2652 100755
--- a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -104,7 +104,7 @@ void WebIDBObjectStoreImpl::removeIndex(const WebString& name, const WebIDBTrans
void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
- m_objectStore->openCursor(IDBKeyRange::create(keyRange.left(), keyRange.right(), keyRange.flags()), direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec);
+ m_objectStore->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec);
}
} // namespace WebCore
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index e19308a..65f0fde 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -99,8 +99,10 @@ WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl()
{
// VideoLayerChromium may outlive this object so make sure all frames are
// released.
+#if USE(ACCELERATED_COMPOSITING)
if (m_videoLayer.get())
m_videoLayer->releaseCurrentFrame();
+#endif
}
void WebMediaPlayerClientImpl::networkStateChanged()
@@ -113,8 +115,10 @@ void WebMediaPlayerClientImpl::readyStateChanged()
{
ASSERT(m_mediaPlayer);
m_mediaPlayer->readyStateChanged();
+#if USE(ACCELERATED_COMPOSITING)
if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer.get())
m_videoLayer = VideoLayerChromium::create(0, this);
+#endif
}
void WebMediaPlayerClientImpl::volumeChanged(float newVolume)
@@ -185,8 +189,10 @@ void WebMediaPlayerClientImpl::load(const String& url)
// Video frame object is owned by WebMediaPlayer. Before destroying
// WebMediaPlayer all frames need to be released.
+#if USE(ACCELERATED_COMPOSITING)
if (m_videoLayer.get())
m_videoLayer->releaseCurrentFrame();
+#endif
m_webMediaPlayer.set(createWebMediaPlayer(this, frame));
if (m_webMediaPlayer.get())
@@ -396,7 +402,14 @@ void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re
// check.
if (m_webMediaPlayer.get() && !context->paintingDisabled()) {
#if WEBKIT_USING_SKIA
- m_webMediaPlayer->paint(context->platformContext()->canvas(), rect);
+ PlatformGraphicsContext* platformContext = context->platformContext();
+ WebCanvas* canvas = platformContext->canvas();
+
+ canvas->saveLayerAlpha(0, platformContext->getNormalizedAlpha());
+
+ m_webMediaPlayer->paint(canvas, rect);
+
+ canvas->restore();
#elif WEBKIT_USING_CG
m_webMediaPlayer->paint(context->platformContext(), rect);
#else
@@ -418,13 +431,6 @@ bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const
return false;
}
-#if USE(ACCELERATED_COMPOSITING)
-bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const
-{
- return m_supportsAcceleratedCompositing;
-}
-#endif
-
MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const
{
if (m_webMediaPlayer.get())
@@ -433,6 +439,12 @@ MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const
return MediaPlayer::Unknown;
}
+#if USE(ACCELERATED_COMPOSITING)
+bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const
+{
+ return m_supportsAcceleratedCompositing;
+}
+
VideoFrameChromium* WebMediaPlayerClientImpl::getCurrentFrame()
{
VideoFrameChromium* videoFrame = 0;
@@ -454,6 +466,7 @@ void WebMediaPlayerClientImpl::putCurrentFrame(VideoFrameChromium* videoFrame)
delete videoFrame;
}
}
+#endif
MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* player)
{
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h
index 6535094..ca7c43c 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h
@@ -48,7 +48,9 @@ class WebMediaPlayer;
// This class serves as a bridge between WebCore::MediaPlayer and
// WebKit::WebMediaPlayer.
class WebMediaPlayerClientImpl : public WebCore::MediaPlayerPrivateInterface
+#if USE(ACCELERATED_COMPOSITING)
, public WebCore::VideoFrameProvider
+#endif
, public WebMediaPlayerClient {
public:
@@ -110,15 +112,14 @@ public:
virtual void setSize(const WebCore::IntSize&);
virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&);
virtual bool hasSingleSecurityOrigin() const;
+ virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const;
#if USE(ACCELERATED_COMPOSITING)
virtual bool supportsAcceleratedRendering() const;
-#endif
-
- virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const;
// VideoFrameProvider methods:
virtual WebCore::VideoFrameChromium* getCurrentFrame();
virtual void putCurrentFrame(WebCore::VideoFrameChromium*);
+#endif
private:
WebMediaPlayerClientImpl();
diff --git a/WebKit/chromium/src/WebSecurityOrigin.cpp b/WebKit/chromium/src/WebSecurityOrigin.cpp
index 8685738..adccb31 100644
--- a/WebKit/chromium/src/WebSecurityOrigin.cpp
+++ b/WebKit/chromium/src/WebSecurityOrigin.cpp
@@ -143,6 +143,11 @@ WebSecurityOrigin::operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const
return PassRefPtr<SecurityOrigin>(const_cast<WebSecurityOriginPrivate*>(m_private));
}
+SecurityOrigin* WebSecurityOrigin::get() const
+{
+ return m_private;
+}
+
void WebSecurityOrigin::assign(WebSecurityOriginPrivate* p)
{
// p is already ref'd for us by the caller
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
index 60c4fed..3b56338 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -57,7 +57,12 @@ WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl()
void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result)
{
- m_webcoreMock->setRecognitionResult(result);
+ m_webcoreMock->setRecognitionResult(result, WebString::fromUTF8(""));
+}
+
+void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language)
+{
+ m_webcoreMock->setRecognitionResult(result, language);
}
void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId)
@@ -70,14 +75,14 @@ void WebSpeechInputControllerMockImpl::didCompleteRecognition(int requestId)
m_listener->didCompleteRecognition(requestId);
}
-void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WTF::String& result)
+void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WebCore::SpeechInputResultArray& result)
{
m_listener->setRecognitionResult(requestId, result);
}
-bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect)
+bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar)
{
- return m_webcoreMock->startRecognition(requestId, elementRect);
+ return m_webcoreMock->startRecognition(requestId, elementRect, language, grammar);
}
void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId)
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
index edbfca3..c98f92a 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -54,14 +54,18 @@ public:
// WebCore::SpeechInputListener methods.
void didCompleteRecording(int requestId);
void didCompleteRecognition(int requestId);
- void setRecognitionResult(int requestId, const WTF::String& result);
+ void setRecognitionResult(int requestId, const WebCore::SpeechInputResultArray& result);
// WebSpeechInputController methods.
- bool startRecognition(int requestId, const WebRect& elementRect);
+ bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar);
void cancelRecognition(int requestId);
void stopRecording(int requestId);
// WebSpeechInputControllerMock methods.
+ void setMockRecognitionResult(const WebString& result, const WebString& language);
+
+ // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched.
+ // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch.
void setMockRecognitionResult(const WebString& result);
private:
@@ -72,4 +76,3 @@ private:
} // namespace WebKit
#endif // WebSpeechInputControllerMockImpl_h
-
diff --git a/WebKit/chromium/src/WebSpeechInputResult.cpp b/WebKit/chromium/src/WebSpeechInputResult.cpp
new file mode 100644
index 0000000..1cafc84
--- /dev/null
+++ b/WebKit/chromium/src/WebSpeechInputResult.cpp
@@ -0,0 +1,54 @@
+/*
+ * 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 "WebSpeechInputResult.h"
+
+#include "SpeechInputResult.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+void WebSpeechInputResult::reset()
+{
+ m_private.reset();
+}
+
+WebSpeechInputResult::WebSpeechInputResult(const PassRefPtr<WebCore::SpeechInputResult>& value)
+ : m_private(value)
+{
+}
+
+void WebSpeechInputResult::set(const WebString& utterance, double confidence)
+{
+ m_private = WebCore::SpeechInputResult::create(utterance, confidence);
+}
+
+WebSpeechInputResult::operator PassRefPtr<WebCore::SpeechInputResult>() const
+{
+ return m_private.get();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index aeab400..57d0ca4 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -33,6 +33,7 @@
#include "AutoFillPopupMenuClient.h"
#include "AXObjectCache.h"
+#include "BackForwardListImpl.h"
#include "Chrome.h"
#include "ColorSpace.h"
#include "CompositionUnderlineVectorBuilder.h"
@@ -88,6 +89,7 @@
#include "SecurityOrigin.h"
#include "SelectionController.h"
#include "Settings.h"
+#include "SpeechInputClientImpl.h"
#include "Timer.h"
#include "TypingCommand.h"
#include "UserGestureIndicator.h"
@@ -182,6 +184,8 @@ static const PopupContainerSettings autoFillPopupSettings = {
PopupContainerSettings::DOMElementDirection,
};
+static bool shouldUseExternalPopupMenus = false;
+
// WebView ----------------------------------------------------------------
WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
@@ -193,6 +197,11 @@ WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devTools
return adoptRef(new WebViewImpl(client, devToolsClient)).leakRef();
}
+void WebView::setUseExternalPopupMenus(bool useExternalPopupMenus)
+{
+ shouldUseExternalPopupMenus = useExternalPopupMenus;
+}
+
void WebView::updateVisitedLinkState(unsigned long long linkHash)
{
Page::visitedStateChanged(PageGroup::pageGroup(pageGroupName), linkHash);
@@ -275,7 +284,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
, m_compositorCreationFailed(false)
#endif
#if ENABLE(INPUT_SPEECH)
- , m_speechInputClient(client)
+ , m_speechInputClient(SpeechInputClientImpl::create(client))
#endif
, m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))
{
@@ -298,13 +307,13 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
pageClients.dragClient = &m_dragClientImpl;
pageClients.inspectorClient = &m_inspectorClientImpl;
#if ENABLE(INPUT_SPEECH)
- pageClients.speechInputClient = &m_speechInputClient;
+ pageClients.speechInputClient = m_speechInputClient.get();
#endif
pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get();
m_page.set(new Page(pageClients));
- m_page->backForwardList()->setClient(&m_backForwardListClientImpl);
+ static_cast<BackForwardListImpl*>(m_page->backForwardList())->setClient(&m_backForwardListClientImpl);
m_page->setGroupName(pageGroupName);
m_inspectorSettingsMap.set(new SettingsMap);
@@ -1039,6 +1048,10 @@ void WebViewImpl::composite(bool finish)
// Put result onscreen.
m_layerRenderer->present();
+
+ GraphicsContext3D* context = m_layerRenderer->context();
+ if (context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
+ reallocateRenderer();
#endif
}
@@ -2107,6 +2120,11 @@ void WebViewImpl::didCommitLoad(bool* isNewNavigation)
m_observedNewNavigation = false;
}
+bool WebViewImpl::useExternalPopupMenus()
+{
+ return shouldUseExternalPopupMenus;
+}
+
bool WebViewImpl::navigationPolicyFromMouseEvent(unsigned short button,
bool ctrl, bool shift,
bool alt, bool meta,
@@ -2476,6 +2494,22 @@ void WebViewImpl::doComposite()
// Draw the actual layers...
m_layerRenderer->drawLayers(visibleRect, contentRect);
}
+
+void WebViewImpl::reallocateRenderer()
+{
+ GraphicsContext3D* context = m_layerRenderer->context();
+ RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create(context->getContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
+ // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0.
+ RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext);
+
+ // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive.
+ if (layerRenderer)
+ m_layerRenderer->transferRootLayer(layerRenderer.get());
+ m_layerRenderer = layerRenderer;
+
+ // Enable or disable accelerated compositing and request a refresh.
+ setRootGraphicsLayer(m_layerRenderer ? m_layerRenderer->rootLayer() : 0);
+}
#endif
@@ -2491,10 +2525,8 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D()
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));
-#endif
context = m_temporaryOnscreenGraphicsContext3D.get();
}
return GraphicsContext3DInternal::extractWebGraphicsContext3D(context);
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 050b5e1..0388770 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -49,7 +49,6 @@
#include "IntRect.h"
#include "LayerRendererChromium.h"
#include "NotificationPresenterImpl.h"
-#include "SpeechInputClientImpl.h"
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
@@ -74,6 +73,7 @@ class AutoFillPopupMenuClient;
class ContextMenuClientImpl;
class DeviceOrientationClientProxy;
class DragScrollTimer;
+class SpeechInputClientImpl;
class WebAccessibilityObject;
class WebDevToolsAgentClient;
class WebDevToolsAgentPrivate;
@@ -273,6 +273,10 @@ public:
// load.
void didCommitLoad(bool* isNewNavigation);
+ // Returns true if popup menus should be rendered by the browser, false if
+ // they should be rendered by WebKit (which is the default).
+ static bool useExternalPopupMenus();
+
bool contextMenuAllowed() const
{
return m_contextMenuAllowed;
@@ -406,6 +410,7 @@ private:
void updateRootLayerContents(const WebCore::IntRect&);
void doComposite();
void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&);
+ void reallocateRenderer();
#endif
WebViewClient* m_client;
@@ -543,7 +548,7 @@ private:
static const WebInputEvent* m_currentInputEvent;
#if ENABLE(INPUT_SPEECH)
- SpeechInputClientImpl m_speechInputClient;
+ OwnPtr<SpeechInputClientImpl> m_speechInputClient;
#endif
// If we attempt to fetch the on-screen GraphicsContext3D before
// the compositor has been turned on, we need to instantiate it
diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js
index 5cebb52..2b264ee 100644
--- a/WebKit/chromium/src/js/Tests.js
+++ b/WebKit/chromium/src/js/Tests.js
@@ -245,146 +245,6 @@ TestSuite.prototype.testEnableResourcesTab = function()
/**
- * Tests that correct content length is reported for resources.
- */
-TestSuite.prototype.testResourceContentLength = function()
-{
- this.showPanel("resources");
- var test = this;
-
- var png = false;
- var html = false;
- this.addSniffer(WebInspector, "updateResource",
- function(payload) {
- if (!payload.didLengthChange)
- return;
- var resource = WebInspector.resources[payload.id];
- if (!resource || !resource.url)
- return;
- if (resource.url.search("image.html") !== -1) {
- var expectedLength = 87;
- test.assertTrue(
- resource.resourceSize <= expectedLength,
- "image.html content length is greater thatn expected.");
- if (expectedLength === resource.resourceSize)
- html = true;
- } else if (resource.url.search("image.png") !== -1) {
- var expectedLength = 257796;
- test.assertTrue(
- resource.resourceSize <= expectedLength,
- "image.png content length is greater than expected.");
- if (expectedLength === resource.resourceSize)
- png = true;
- }
- if (html && png) {
- // Wait 1 second before releasing control to check that the content
- // lengths are not updated anymore.
- setTimeout(function() {
- test.releaseControl();
- }, 1000);
- }
- }, true);
-
- // Make sure resource tracking is on.
- WebInspector.panels.resources._enableResourceTracking();
- // Reload inspected page to update all resources.
- test.evaluateInConsole_(
- "window.location.reload(true);",
- function(resultText) {
- test.assertEquals("undefined", resultText, "Unexpected result of reload().");
- });
-
- // We now have some time to report results to controller.
- this.takeControl();
-};
-
-
-/**
- * Tests resource headers.
- */
-TestSuite.prototype.testResourceHeaders = function()
-{
- this.showPanel("resources");
-
- var test = this;
-
- var responseOk = false;
- var timingOk = false;
-
- this.addSniffer(WebInspector, "updateResource",
- function(payload) {
- var resource = this.resources[payload.id];
- if (!resource || resource.mainResource) {
- // We are only interested in secondary resources in this test.
- return;
- }
-
- var requestHeaders = JSON.stringify(resource.requestHeaders);
- test.assertContains(requestHeaders, "Accept");
-
- if (payload.didResponseChange) {
- var responseHeaders = JSON.stringify(resource.responseHeaders);
- test.assertContains(responseHeaders, "Content-type");
- test.assertContains(responseHeaders, "Content-Length");
- test.assertTrue(typeof resource.responseReceivedTime !== "undefined");
- responseOk = true;
- }
-
- if (payload.didTimingChange) {
- test.assertTrue(typeof resource.startTime !== "undefined");
- timingOk = true;
- }
-
- if (payload.didCompletionChange) {
- test.assertTrue(responseOk);
- test.assertTrue(timingOk);
- test.assertTrue(typeof resource.endTime !== "undefined");
- test.releaseControl();
- }
- }, true);
-
- WebInspector.panels.resources._enableResourceTracking();
- this.takeControl();
-};
-
-
-/**
- * Tests the mime type of a cached (HTTP 304) resource.
- */
-TestSuite.prototype.testCachedResourceMimeType = function()
-{
- this.showPanel("resources");
-
- var test = this;
- var hasReloaded = false;
-
- this.addSniffer(WebInspector, "updateResource",
- function(payload) {
- var resource = this.resources[payload.id];
- if (!resource || resource.mainResource) {
- // We are only interested in secondary resources in this test.
- return;
- }
-
- if (payload.didResponseChange) {
- // Test server uses a default mime type for JavaScript files.
- test.assertEquals("text/html", payload.mimeType);
- if (!hasReloaded) {
- hasReloaded = true;
- // Reload inspected page to update all resources.
- test.evaluateInConsole_("window.location.reload(true);", function() {});
- } else
- test.releaseControl();
- }
-
- }, true);
-
- WebInspector.panels.resources._enableResourceTracking();
- this.takeControl();
-};
-
-
-/**
* Tests that profiler works.
*/
TestSuite.prototype.testProfilerTab = function()
diff --git a/WebKit/chromium/src/mac/WebInputEventFactory.mm b/WebKit/chromium/src/mac/WebInputEventFactory.mm
index b4e09c0..015409e 100644
--- a/WebKit/chromium/src/mac/WebInputEventFactory.mm
+++ b/WebKit/chromium/src/mac/WebInputEventFactory.mm
@@ -856,6 +856,8 @@ static inline int modifiersFromEvent(NSEvent* event) {
modifiers |= WebInputEvent::AltKey;
if ([event modifierFlags] & NSCommandKeyMask)
modifiers |= WebInputEvent::MetaKey;
+ if ([event modifierFlags] & NSAlphaShiftKeyMask)
+ modifiers |= WebInputEvent::CapsLockOn;
// TODO(port): Set mouse button states
return modifiers;
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 1795645..bf9af1e 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,60 @@
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * ewk/ewk_history.cpp:
+ (ewk_history_new):
+ * ewk/ewk_private.h:
+ * ewk/ewk_view.cpp:
+ (_ewk_view_priv_new):
+ (ewk_view_history_enable_get):
+ (ewk_view_history_enable_set):
+ (ewk_view_history_get):
+ Use BackForwardListImpl.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchDidBecomeFrameset):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::transferLoadingResourceFromPage):
+ Empty method.
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebCoreSupport/ChromeClientEfl.cpp:
+ (WebCore::ChromeClientEfl::createWindow):
+ * WebCoreSupport/ChromeClientEfl.h:
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchCreatePage):
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+ Add NavigationAction parameter.
+
2010-10-19 Ryuan Choi <ryuan.choi@samsung.com>
Reviewed by Eric Seidel.
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index 257e824..d99f0bc 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -46,6 +46,7 @@
#include "HitTestResult.h"
#include "IntRect.h"
#include "KURL.h"
+#include "NavigationAction.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "SecurityOrigin.h"
@@ -143,7 +144,7 @@ void ChromeClientEfl::unfocus()
evas_object_focus_set(m_view, EINA_FALSE);
}
-Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features)
+Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)
{
Evas_Object* newView = ewk_view_window_create(m_view, EINA_TRUE, &features);
if (!newView)
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
index 4339b9a..f0aeb8d 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -54,7 +54,7 @@ public:
virtual void focusedNodeChanged(Node*);
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&);
virtual void show();
virtual bool canRunModal();
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 1b82239..627c1b9 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -384,6 +384,10 @@ void FrameLoaderClientEfl::didTransferChildFrameToNewDocument(Page*)
{
}
+void FrameLoaderClientEfl::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
+}
+
void FrameLoaderClientEfl::redirectDataToPlugin(Widget* pluginWidget)
{
ASSERT(!m_pluginView);
@@ -860,7 +864,7 @@ bool FrameLoaderClientEfl::canCachePage() const
return false;
}
-Frame* FrameLoaderClientEfl::dispatchCreatePage()
+Frame* FrameLoaderClientEfl::dispatchCreatePage(const NavigationAction&)
{
if (!m_view)
return 0;
@@ -919,6 +923,10 @@ void FrameLoaderClientEfl::transitionToCommittedForNewPage()
ewk_view_frame_main_cleared(m_view);
}
+void FrameLoaderClientEfl::dispatchDidBecomeFrameset(bool)
+{
+}
+
PassRefPtr<FrameNetworkingContext> FrameLoaderClientEfl::createNetworkingContext()
{
return FrameNetworkingContextEfl::create(ewk_frame_core_get(m_frame));
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
index 1b880e6..a9dd8c1 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
@@ -111,7 +111,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual Frame* dispatchCreatePage();
+ virtual Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String& MIMEType, const ResourceRequest&);
@@ -135,6 +135,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(Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const ResourceRequest&, WebCore::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);
@@ -198,6 +199,8 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
virtual void transitionToCommittedFromCachedFrame(CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual bool canCachePage() const;
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
diff --git a/WebKit/efl/ewk/ewk_history.cpp b/WebKit/efl/ewk/ewk_history.cpp
index 8387da1..0a9d349 100644
--- a/WebKit/efl/ewk/ewk_history.cpp
+++ b/WebKit/efl/ewk/ewk_history.cpp
@@ -21,7 +21,7 @@
#include "config.h"
#include "ewk_history.h"
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
#include "EWebKit.h"
#include "HistoryItem.h"
#include "Image.h"
@@ -32,7 +32,7 @@
#include <eina_safety_checks.h>
struct _Ewk_History {
- WebCore::BackForwardList *core;
+ WebCore::BackForwardListImpl *core;
};
#define EWK_HISTORY_CORE_GET_OR_RETURN(history, core_, ...) \
@@ -48,7 +48,7 @@ struct _Ewk_History {
ERR("history->core is disabled!."); \
return __VA_ARGS__; \
} \
- WebCore::BackForwardList *core_ = (history)->core
+ WebCore::BackForwardListImpl *core_ = (history)->core
struct _Ewk_History_Item {
@@ -666,11 +666,11 @@ Eina_Bool ewk_history_item_visit_last_failed(const Ewk_History_Item* item)
* Creates history for given view. Called internally by ewk_view and
* should never be called from outside.
*
- * @param core WebCore::BackForwardList instance to use internally.
+ * @param core WebCore::BackForwardListImpl instance to use internally.
*
* @return newly allocated history instance or @c NULL on errors.
*/
-Ewk_History* ewk_history_new(WebCore::BackForwardList* core)
+Ewk_History* ewk_history_new(WebCore::BackForwardListImpl* core)
{
Ewk_History* history;
EINA_SAFETY_ON_NULL_RETURN_VAL(core, 0);
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index e2624a3..c1599e3 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -21,7 +21,7 @@
#ifndef ewk_private_h
#define ewk_private_h
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
#include "EWebKit.h"
#include "Frame.h"
#include "Page.h"
@@ -108,7 +108,7 @@ void ewk_view_download_request(Evas_Object *o, Ewk_Download *download);
int ewk_view_dpi_get();
-Ewk_History *ewk_history_new(WebCore::BackForwardList *history);
+Ewk_History *ewk_history_new(WebCore::BackForwardListImpl *history);
void ewk_history_free(Ewk_History *history);
Ewk_Context_Menu *ewk_context_menu_new(Evas_Object *view, WebCore::ContextMenuController *controller);
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index f1ca733..5ff3ade 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "ewk_view.h"
+#include "BackForwardListImpl.h"
#include "Chrome.h"
#include "ChromeClientEfl.h"
#include "ContextMenuClientEfl.h"
@@ -634,7 +635,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
goto error_main_frame;
}
- priv->history = ewk_history_new(priv->page->backForwardList());
+ priv->history = ewk_history_new(static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList()));
if (!priv->history) {
CRITICAL("Could not create history instance for view.");
goto error_history;
@@ -1762,7 +1763,7 @@ Eina_Bool ewk_view_history_enable_get(const Evas_Object* o)
{
EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
- return priv->page->backForwardList()->enabled();
+ return static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->enabled();
}
/**
@@ -1778,7 +1779,7 @@ Eina_Bool ewk_view_history_enable_set(Evas_Object* o, Eina_Bool enable)
{
EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
- priv->page->backForwardList()->setEnabled(enable);
+ static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->setEnabled(enable);
return EINA_TRUE;
}
@@ -1802,7 +1803,7 @@ Ewk_History* ewk_view_history_get(const Evas_Object* o)
{
EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
- if (!priv->page->backForwardList()->enabled()) {
+ if (!static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->enabled()) {
ERR("asked history, but it's disabled! Returning 0!");
return 0;
}
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index cde04c9..cd11751 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,188 @@
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebbackforwardlist.cpp:
+ (webkit_web_back_forward_list_dispose):
+ (webkit_web_back_forward_list_new_with_web_view):
+ (webkit_web_back_forward_list_go_forward):
+ (webkit_web_back_forward_list_go_back):
+ (webkit_web_back_forward_list_contains_item):
+ (webkit_web_back_forward_list_go_to_item):
+ (webkit_web_back_forward_list_get_forward_list_with_limit):
+ (webkit_web_back_forward_list_get_back_list_with_limit):
+ (webkit_web_back_forward_list_get_back_item):
+ (webkit_web_back_forward_list_get_current_item):
+ (webkit_web_back_forward_list_get_forward_item):
+ (webkit_web_back_forward_list_get_nth_item):
+ (webkit_web_back_forward_list_get_back_length):
+ (webkit_web_back_forward_list_get_forward_length):
+ (webkit_web_back_forward_list_get_limit):
+ (webkit_web_back_forward_list_set_limit):
+ (webkit_web_back_forward_list_add_item):
+ (webkit_web_back_forward_list_clear):
+ (WebKit::core):
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_set_maintains_back_forward_list):
+ (webkit_web_view_get_back_forward_list):
+ Use BackForwardListImpl.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::dispatchDidBecomeFrameset):
+
+2010-10-29 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Add the GtkScrollablePolicy property to the webview
+ https://bugs.webkit.org/show_bug.cgi?id=48357
+
+ Added the GtkScrollablePolicy properties to the webview widget, it
+ is now required for GtkScrollable widgets in GTK+ 3.x.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebview.cpp:
+ (setHorizontalScrollPolicy): Added.
+ (setVerticalScrollPolicy): Added.
+ (getHorizontalScrollPolicy): Added.
+ (getVerticalScrollPolicy): Added.
+ (webkit_web_view_get_property):
+ (webkit_web_view_set_property):
+ (webkit_web_view_class_init):
+
+2010-10-28 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] WebKitWebFrame's load-status is not properly notified to the tests
+ https://bugs.webkit.org/show_bug.cgi?id=48048
+
+ "frame-created" signal must be issued before loading any data,
+ that way clients can correctly capture all the loading related
+ signals for that frame.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::createFrame):
+
+2010-10-27 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ getTextAtOffset returns incorrect results if a link includes text and an image
+ https://bugs.webkit.org/show_bug.cgi?id=47365
+
+ New test to make sure this bug is actually fixed.
+
+ * tests/testatk.c:
+ (testWebkitAtkLinksWithInlineImages): New test.
+ (main): Added new test.
+
+2010-10-26 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Implement DumpRenderTreeSupportGtk (similarly to DumpRenderTreeSupportQt idea)
+ https://bugs.webkit.org/show_bug.cgi?id=48199
+
+ Implemented an initial version of the DumpRenderTreeSupportGtk class.
+ The main idea is that it groups together the bodies of many LayoutTestController
+ methods, so they can directly access WebCore features. This way we eliminate the
+ need of adding APIs to WebKitGTK just to expand its test coverage through DRT.
+
+ The DumpRenderTreeSupportGtk class so far includes a getter and setter for the WebKitTabToLinksPreferenceKey
+ property as a sample implementation. Also it makes it possible to unskip fast/events/tab-focus-anchor.html and
+ to fix stderr messages from all 22 spatial-navigation tests in fast/events/spatial-navigation.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::tabsToLinks):
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: Added.
+ (DumpRenderTreeSupportGtk::DumpRenderTreeSupportGtk):
+ (DumpRenderTreeSupportGtk::~DumpRenderTreeSupportGtk):
+ (DumpRenderTreeSupportGtk::setDumpRenderTreeModeEnabled):
+ (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled): Getter to the WebKitTabToLinksPreferenceKey property.
+ (DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain): Setter to the WebKitTabToLinksPreferenceKey property.
+ (DumpRenderTreeSupportGtk::linksIncludedInFocusChain):
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h: Added.
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::transferLoadingResourceFromPage):
+ Empty method.
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+
+2010-10-26 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] Layout tables should indicate that they are not data tables via an object attribute
+ https://bugs.webkit.org/show_bug.cgi?id=35422
+
+ New unit test to check the 'layout-guess' attribute in tables.
+
+ * tests/testatk.c:
+ (atkAttributeSetAttributeNameHasValue): New, looks for a attribute
+ with a specific value, by the name of attribute.
+ (atkAttributeSetContainsAttributeName): New, just checks whether
+ an attribute with a specified name is present in the set.
+ (atkAttributeSetAttributeHasValue): Modified to relay on the new
+ function atkAttributeSetAttributeNameHasValue().
+ (testWebkitAtkLayoutAndDataTables): New test.
+ (main): Added the new test.
+
+2010-10-26 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Port to new GtkScrollable interface in GTK+ 3.x
+ https://bugs.webkit.org/show_bug.cgi?id=48202
+
+ Use the new GtkScrollable interface when compiling against GTK+
+ 3.x.
+
+ * webkit/webkitwebview.cpp:
+ (setHorizontalAdjustment):
+ (setVerticalAdjustment):
+ (getHorizontalAdjustment):
+ (getVerticalAdjustment):
+ (webkit_web_view_get_property):
+ (webkit_web_view_set_property):
+ (webkit_web_view_class_init):
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::createWindow):
+ * WebCoreSupport/ChromeClientGtk.h:
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::dispatchCreatePage):
+ * WebCoreSupport/FrameLoaderClientGtk.h:
+ Add NavigationAction parameter.
+
2010-10-20 Philippe Normand <pnormand@igalia.com>
Reviewed by Xan Lopez.
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 7e4090b..e864ea7 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -25,6 +25,7 @@
#include "ChromeClientGtk.h"
#include "Console.h"
+#include "DumpRenderTreeSupportGtk.h"
#include "FileSystem.h"
#include "FileChooser.h"
#include "FloatRect.h"
@@ -35,6 +36,7 @@
#include "HitTestResult.h"
#include "Icon.h"
#include "KURL.h"
+#include "NavigationAction.h"
#include "PlatformString.h"
#include "PopupMenuClient.h"
#include "PopupMenuGtk.h"
@@ -137,7 +139,7 @@ void ChromeClient::unfocus()
gtk_window_set_focus(GTK_WINDOW(window), NULL);
}
-Page* ChromeClient::createWindow(Frame* frame, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& coreFeatures)
+Page* ChromeClient::createWindow(Frame* frame, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& coreFeatures, const NavigationAction&)
{
WebKitWebView* webView = 0;
@@ -330,6 +332,9 @@ bool ChromeClient::shouldInterruptJavaScript()
bool ChromeClient::tabsToLinks() const
{
+ if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled())
+ return DumpRenderTreeSupportGtk::linksIncludedInFocusChain();
+
return true;
}
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
index 21c4677..b925313 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
@@ -56,7 +56,7 @@ namespace WebKit {
virtual void focusedNodeChanged(WebCore::Node*);
- virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
+ virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
virtual void show();
virtual bool canRunModal();
diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
new file mode 100644
index 0000000..8296206
--- /dev/null
+++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "DumpRenderTreeSupportGtk.h"
+
+#include "webkitwebview.h"
+#include "webkitprivate.h"
+
+using namespace WebCore;
+
+bool DumpRenderTreeSupportGtk::s_drtRun = false;
+bool DumpRenderTreeSupportGtk::s_linksIncludedInTabChain = true;
+
+DumpRenderTreeSupportGtk::DumpRenderTreeSupportGtk()
+{
+}
+
+DumpRenderTreeSupportGtk::~DumpRenderTreeSupportGtk()
+{
+}
+
+void DumpRenderTreeSupportGtk::setDumpRenderTreeModeEnabled(bool enabled)
+{
+ s_drtRun = enabled;
+}
+
+bool DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()
+{
+ return s_drtRun;
+}
+void DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(bool enabled)
+{
+ s_linksIncludedInTabChain = enabled;
+}
+
+bool DumpRenderTreeSupportGtk::linksIncludedInFocusChain()
+{
+ return s_linksIncludedInTabChain;
+}
+
diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
new file mode 100644
index 0000000..5b494ff
--- /dev/null
+++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
@@ -0,0 +1,39 @@
+/*
+ * 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DumpRenderTreeSupportGtk_h
+#define DumpRenderTreeSupportGtk_h
+
+class DumpRenderTreeSupportGtk {
+
+public:
+ DumpRenderTreeSupportGtk();
+ ~DumpRenderTreeSupportGtk();
+
+ static void setDumpRenderTreeModeEnabled(bool);
+ static bool dumpRenderTreeModeEnabled();
+
+ static void setLinksIncludedInFocusChain(bool);
+ static bool linksIncludedInFocusChain();
+
+private:
+ static bool s_drtRun;
+ static bool s_linksIncludedInTabChain;
+};
+
+#endif
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index fa17632..20aafc2 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -592,13 +592,14 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
if (!childFrame->page())
return 0;
+ g_signal_emit_by_name(webView, "frame-created", kitFrame);
+
childFrame->loader()->loadURLIntoChildFrame(url, referrer, childFrame.get());
// The frame's onload handler may have removed it from the document.
if (!childFrame->tree()->parent())
return 0;
- g_signal_emit_by_name(webView, "frame-created", kitFrame);
return childFrame.release();
}
@@ -619,6 +620,10 @@ void FrameLoaderClient::didTransferChildFrameToNewDocument(WebCore::Page*)
ASSERT(core(getViewFromFrame(m_frame)) == coreFrame->page());
}
+void FrameLoaderClient::transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, WebCore::Page*)
+{
+}
+
void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget)
{
ASSERT(!m_pluginView);
@@ -1200,7 +1205,7 @@ bool FrameLoaderClient::canCachePage() const
return true;
}
-Frame* FrameLoaderClient::dispatchCreatePage()
+Frame* FrameLoaderClient::dispatchCreatePage(const NavigationAction&)
{
WebKitWebView* webView = getViewFromFrame(m_frame);
WebKitWebView* newWebView = 0;
@@ -1308,6 +1313,10 @@ void FrameLoaderClient::transitionToCommittedForNewPage()
postCommitFrameViewSetup(m_frame, frame->view(), true);
}
+void FrameLoaderClient::dispatchDidBecomeFrameset(bool)
+{
+}
+
PassRefPtr<FrameNetworkingContext> FrameLoaderClient::createNetworkingContext()
{
return FrameNetworkingContextGtk::create(core(m_frame));
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
index 206e780..ffb3c56 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
@@ -91,7 +91,7 @@ namespace WebKit {
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual WebCore::Frame* dispatchCreatePage();
+ virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WTF::String& MIMEType, const WebCore::ResourceRequest&);
@@ -115,6 +115,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(WebCore::Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, 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);
@@ -180,6 +181,8 @@ namespace WebKit {
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual bool canCachePage() const;
virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index c8df4ef..bd6473a 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -46,6 +46,10 @@ static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo<
static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>";
+static const char* layoutAndDataTables = "<html><body><table><tr><th>Odd</th><th>Even</th></tr><tr><td>1</td><td>2</td></tr></table><table><tr><td>foo</td><td>bar</td></tr></table></body></html>";
+
+static const char* linksWithInlineImages = "<html><head><style>a.http:before {content: url(no-image.png);}</style><body><p><a class='http' href='foo'>foo</a> bar baz</p><p>foo <a class='http' href='bar'>bar</a> baz</p><p>foo bar <a class='http' href='baz'>baz</a></p></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>";
@@ -596,15 +600,25 @@ static gint compAtkAttributeName(AtkAttribute* a1, AtkAttribute* a2)
return g_strcmp0(a1->name, a2->name);
}
-static gboolean atkAttributeSetAttributeHasValue(AtkAttributeSet* set, AtkTextAttribute attribute, const gchar* value)
+static gboolean atkAttributeSetAttributeNameHasValue(AtkAttributeSet* set, const gchar* attributeName, const gchar* value)
{
- GSList *element;
+ GSList* element;
AtkAttribute at;
- gboolean result;
- at.name = (gchar *)atk_text_attribute_get_name(attribute);
+ at.name = (gchar*)attributeName;
element = g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName);
- result = element && !g_strcmp0(((AtkAttribute*)(element->data))->value, value);
- return result;
+ return element && !g_strcmp0(((AtkAttribute*)(element->data))->value, value);
+}
+
+static gboolean atkAttributeSetContainsAttributeName(AtkAttributeSet* set, const gchar* attributeName)
+{
+ AtkAttribute at;
+ at.name = (gchar*)attributeName;
+ return g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName) ? true : false;
+}
+
+static gboolean atkAttributeSetAttributeHasValue(AtkAttributeSet* set, AtkTextAttribute attribute, const gchar* value)
+{
+ return atkAttributeSetAttributeNameHasValue(set, atk_text_attribute_get_name(attribute), value);
}
static gboolean atkAttributeSetAreEqual(AtkAttributeSet* set1, AtkAttributeSet* set2)
@@ -964,6 +978,98 @@ static void testWebkitAtkGetExtents(void)
g_object_unref(webView);
}
+static void testWebkitAtkLayoutAndDataTables(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, layoutAndDataTables, 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);
+
+ // Check the non-layout table (data table)
+
+ AtkObject* table1 = atk_object_ref_accessible_child(obj, 0);
+ g_assert(ATK_IS_TABLE(table1));
+ AtkAttributeSet* set1 = atk_object_get_attributes(table1);
+ g_assert(set1);
+ g_assert(!atkAttributeSetContainsAttributeName(set1, "layout-guess"));
+ atk_attribute_set_free(set1);
+
+ // Check the layout table
+
+ AtkObject* table2 = atk_object_ref_accessible_child(obj, 1);
+ g_assert(ATK_IS_TABLE(table2));
+ AtkAttributeSet* set2 = atk_object_get_attributes(table2);
+ g_assert(set2);
+ g_assert(atkAttributeSetContainsAttributeName(set2, "layout-guess"));
+ g_assert(atkAttributeSetAttributeNameHasValue(set2, "layout-guess", "true"));
+ atk_attribute_set_free(set2);
+
+ g_object_unref(table1);
+ g_object_unref(table2);
+ g_object_unref(webView);
+}
+
+static void testWebkitAtkLinksWithInlineImages(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, linksWithInlineImages, 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* object = gtk_widget_get_accessible(GTK_WIDGET(webView));
+ g_assert(object);
+
+ // First paragraph (link at the beginning)
+ AtkObject* paragraph = atk_object_ref_accessible_child(object, 0);
+ g_assert(ATK_IS_TEXT(paragraph));
+ gint startOffset;
+ gint endOffset;
+ gchar* text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset);
+ g_assert(text);
+ g_assert_cmpstr(text, ==, "foo bar baz");
+ g_assert_cmpint(startOffset, ==, 0);
+ g_assert_cmpint(endOffset, ==, 11);
+ g_free(text);
+ g_object_unref(paragraph);
+
+ // Second paragraph (link in the middle)
+ paragraph = atk_object_ref_accessible_child(object, 1);
+ g_assert(ATK_IS_TEXT(paragraph));
+ text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset);
+ g_assert(text);
+ g_assert_cmpstr(text, ==, "foo bar baz");
+ g_assert_cmpint(startOffset, ==, 0);
+ g_assert_cmpint(endOffset, ==, 11);
+ g_free(text);
+ g_object_unref(paragraph);
+
+ // Third paragraph (link at the end)
+ paragraph = atk_object_ref_accessible_child(object, 2);
+ g_assert(ATK_IS_TEXT(paragraph));
+ text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset);
+ g_assert(text);
+ g_assert_cmpstr(text, ==, "foo bar baz");
+ g_assert_cmpint(startOffset, ==, 0);
+ g_assert_cmpint(endOffset, ==, 11);
+ g_free(text);
+ g_object_unref(paragraph);
+
+ g_object_unref(webView);
+}
+
static void testWebkitAtkListsOfItems(void)
{
WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
@@ -1116,6 +1222,8 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes);
g_test_add_func("/webkit/atk/textSelections", testWekitAtkTextSelections);
g_test_add_func("/webkit/atk/getExtents", testWebkitAtkGetExtents);
+ g_test_add_func("/webkit/atk/layoutAndDataTables", testWebkitAtkLayoutAndDataTables);
+ g_test_add_func("/webkit/atk/linksWithInlineImages", testWebkitAtkLinksWithInlineImages);
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/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index 616ee6b..261c437 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -46,7 +46,7 @@
#include <webkit/webkitsecurityorigin.h>
#include "ArchiveResource.h"
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
#include "DataObjectGtk.h"
#include "DragActions.h"
#include "Frame.h"
@@ -92,7 +92,7 @@ namespace WebKit {
WebCore::HistoryItem* core(WebKitWebHistoryItem*);
WebKitWebHistoryItem* kit(PassRefPtr<WebCore::HistoryItem>);
- WebCore::BackForwardList* core(WebKitWebBackForwardList*);
+ WebCore::BackForwardListImpl* core(WebKitWebBackForwardList*);
WebKitWebNavigationReason kit(WebCore::NavigationType type);
WebCore::NavigationType core(WebKitWebNavigationReason reason);
@@ -154,6 +154,13 @@ extern "C" {
PlatformRefPtr<GtkAdjustment> horizontalAdjustment;
PlatformRefPtr<GtkAdjustment> verticalAdjustment;
+#ifndef GTK_API_VERSION_2
+ // GtkScrollablePolicy needs to be checked when
+ // driving the scrollable adjustment values
+ GtkScrollablePolicy horizontalScrollingPolicy;
+ GtkScrollablePolicy verticalScrollingPolicy;
+#endif
+
gboolean zoomFullContent;
WebKitLoadStatus loadStatus;
CString encoding;
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index 4789de9..c5913fd 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -27,7 +27,7 @@
#include <glib.h>
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
#include "HistoryItem.h"
/**
@@ -53,7 +53,7 @@
using namespace WebKit;
struct _WebKitWebBackForwardListPrivate {
- WebCore::BackForwardList* backForwardList;
+ WebCore::BackForwardListImpl* backForwardList;
gboolean disposed;
};
@@ -64,7 +64,7 @@ G_DEFINE_TYPE(WebKitWebBackForwardList, webkit_web_back_forward_list, G_TYPE_OBJ
static void webkit_web_back_forward_list_dispose(GObject* object)
{
WebKitWebBackForwardList* list = WEBKIT_WEB_BACK_FORWARD_LIST(object);
- WebCore::BackForwardList* backForwardList = core(list);
+ WebCore::BackForwardListImpl* backForwardList = core(list);
WebKitWebBackForwardListPrivate* priv = list->priv;
if (!priv->disposed) {
@@ -115,7 +115,7 @@ WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitW
webBackForwardList = WEBKIT_WEB_BACK_FORWARD_LIST(g_object_new(WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, NULL));
WebKitWebBackForwardListPrivate* priv = webBackForwardList->priv;
- priv->backForwardList = core(webView)->backForwardList();
+ priv->backForwardList = static_cast<BackForwardListImpl*>(core(webView)->backForwardList());
priv->backForwardList->setEnabled(TRUE);
return webBackForwardList;
@@ -131,7 +131,7 @@ void webkit_web_back_forward_list_go_forward(WebKitWebBackForwardList* webBackFo
{
g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (backForwardList->enabled())
backForwardList->goForward();
}
@@ -146,7 +146,7 @@ void webkit_web_back_forward_list_go_back(WebKitWebBackForwardList* webBackForwa
{
g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (backForwardList->enabled())
backForwardList->goBack();
}
@@ -169,7 +169,7 @@ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* we
g_return_val_if_fail(historyItem != NULL, FALSE);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
return (backForwardList->enabled() ? backForwardList->containsItem(historyItem) : FALSE);
}
@@ -187,7 +187,7 @@ void webkit_web_back_forward_list_go_to_item(WebKitWebBackForwardList* webBackFo
g_return_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem));
WebCore::HistoryItem* historyItem = core(webHistoryItem);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (backForwardList->enabled() && historyItem)
backForwardList->goToItem(historyItem);
@@ -206,7 +206,7 @@ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackFor
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return NULL;
@@ -236,7 +236,7 @@ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwar
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return NULL;
@@ -265,7 +265,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackFo
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return NULL;
@@ -288,7 +288,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBac
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return NULL;
@@ -311,7 +311,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBac
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return NULL;
@@ -333,7 +333,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_nth_item(WebKitWebBackFor
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList)
return NULL;
@@ -354,7 +354,7 @@ gint webkit_web_back_forward_list_get_back_length(WebKitWebBackForwardList* webB
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), 0);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return 0;
@@ -373,7 +373,7 @@ gint webkit_web_back_forward_list_get_forward_length(WebKitWebBackForwardList* w
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), 0);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return 0;
@@ -392,7 +392,7 @@ gint webkit_web_back_forward_list_get_limit(WebKitWebBackForwardList* webBackFor
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), 0);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled())
return 0;
@@ -412,7 +412,7 @@ void webkit_web_back_forward_list_set_limit(WebKitWebBackForwardList* webBackFor
{
g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (backForwardList)
backForwardList->setCapacity(limit);
}
@@ -435,7 +435,7 @@ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForw
g_object_ref(webHistoryItem);
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
WebCore::HistoryItem* historyItem = core(webHistoryItem);
backForwardList->addItem(historyItem);
@@ -454,7 +454,7 @@ void webkit_web_back_forward_list_clear(WebKitWebBackForwardList* webBackForward
{
g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList));
- WebCore::BackForwardList* backForwardList = core(webBackForwardList);
+ WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList);
if (!backForwardList || !backForwardList->enabled() || !backForwardList->entries().size())
return;
@@ -464,7 +464,7 @@ void webkit_web_back_forward_list_clear(WebKitWebBackForwardList* webBackForward
backForwardList->setCapacity(capacity);
}
-WebCore::BackForwardList* WebKit::core(WebKitWebBackForwardList* webBackForwardList)
+WebCore::BackForwardListImpl* WebKit::core(WebKitWebBackForwardList* webBackForwardList)
{
g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL);
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index f5d0ef6..a295fce 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -42,7 +42,7 @@
#include "AXObjectCache.h"
#include "AbstractDatabase.h"
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
#include "Cache.h"
#include "ChromeClientGtk.h"
#include "ClipboardUtilitiesGtk.h"
@@ -196,12 +196,25 @@ enum {
PROP_CUSTOM_ENCODING,
PROP_ICON_URI,
PROP_IM_CONTEXT,
+#ifdef GTK_API_VERSION_2
PROP_VIEW_MODE
+#else
+ PROP_VIEW_MODE,
+ PROP_HADJUSTMENT,
+ PROP_VADJUSTMENT,
+ PROP_HSCROLL_POLICY,
+ PROP_VSCROLL_POLICY
+#endif
};
static guint webkit_web_view_signals[LAST_SIGNAL] = { 0, };
+#ifdef GTK_API_VERSION_2
G_DEFINE_TYPE(WebKitWebView, webkit_web_view, GTK_TYPE_CONTAINER)
+#else
+G_DEFINE_TYPE_WITH_CODE(WebKitWebView, webkit_web_view, GTK_TYPE_CONTAINER,
+ G_IMPLEMENT_INTERFACE(GTK_TYPE_SCROLLABLE, 0))
+#endif
static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GParamSpec* pspec, WebKitWebView* webView);
static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures);
@@ -385,6 +398,65 @@ static gboolean webkit_web_view_popup_menu_handler(GtkWidget* widget)
return webkit_web_view_forward_context_menu_event(WEBKIT_WEB_VIEW(widget), event);
}
+#ifndef GTK_API_VERSION_2
+static void setHorizontalAdjustment(WebKitWebView* webView, GtkAdjustment* adjustment)
+{
+ if (!core(webView))
+ return;
+
+ webView->priv->horizontalAdjustment = adjustment;
+ FrameView* view = core(webkit_web_view_get_main_frame(webView))->view();
+ if (!view)
+ return;
+ view->setHorizontalAdjustment(adjustment);
+}
+
+static void setVerticalAdjustment(WebKitWebView* webView, GtkAdjustment* adjustment)
+{
+ if (!core(webView))
+ return;
+
+ webView->priv->verticalAdjustment = adjustment;
+ FrameView* view = core(webkit_web_view_get_main_frame(webView))->view();
+ if (!view)
+ return;
+ view->setVerticalAdjustment(adjustment);
+}
+
+static GtkAdjustment* getHorizontalAdjustment(WebKitWebView* webView)
+{
+ return webView->priv->horizontalAdjustment.get();
+}
+
+static GtkAdjustment* getVerticalAdjustment(WebKitWebView* webView)
+{
+ return webView->priv->verticalAdjustment.get();
+}
+
+static void setHorizontalScrollPolicy(WebKitWebView* webView, GtkScrollablePolicy policy)
+{
+ webView->priv->horizontalScrollingPolicy = policy;
+ gtk_widget_queue_resize(GTK_WIDGET(webView));
+}
+
+static void setVerticalScrollPolicy(WebKitWebView* webView, GtkScrollablePolicy policy)
+{
+ webView->priv->verticalScrollingPolicy = policy;
+ gtk_widget_queue_resize(GTK_WIDGET(webView));
+}
+
+static GtkScrollablePolicy getHorizontalScrollPolicy(WebKitWebView* webView)
+{
+ return webView->priv->horizontalScrollingPolicy;
+}
+
+static GtkScrollablePolicy getVerticalScrollPolicy(WebKitWebView* webView)
+{
+ return webView->priv->verticalScrollingPolicy;
+}
+
+#endif
+
static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
{
WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
@@ -444,6 +516,20 @@ static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue*
case PROP_VIEW_MODE:
g_value_set_enum(value, webkit_web_view_get_view_mode(webView));
break;
+#ifndef GTK_API_VERSION_2
+ case PROP_HADJUSTMENT:
+ g_value_set_object(value, getHorizontalAdjustment(webView));
+ break;
+ case PROP_VADJUSTMENT:
+ g_value_set_object(value, getVerticalAdjustment(webView));
+ break;
+ case PROP_HSCROLL_POLICY:
+ g_value_set_enum(value, getHorizontalScrollPolicy(webView));
+ break;
+ case PROP_VSCROLL_POLICY:
+ g_value_set_enum(value, getVerticalScrollPolicy(webView));
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
@@ -478,6 +564,20 @@ static void webkit_web_view_set_property(GObject* object, guint prop_id, const G
case PROP_VIEW_MODE:
webkit_web_view_set_view_mode(webView, static_cast<WebKitWebViewViewMode>(g_value_get_enum(value)));
break;
+#ifndef GTK_API_VERSION_2
+ case PROP_HADJUSTMENT:
+ setHorizontalAdjustment(webView, static_cast<GtkAdjustment*>(g_value_get_object(value)));
+ break;
+ case PROP_VADJUSTMENT:
+ setVerticalAdjustment(webView, static_cast<GtkAdjustment*>(g_value_get_object(value)));
+ break;
+ case PROP_HSCROLL_POLICY:
+ setHorizontalScrollPolicy(webView, static_cast<GtkScrollablePolicy>(g_value_get_enum(value)));
+ break;
+ case PROP_VSCROLL_POLICY:
+ setVerticalScrollPolicy(webView, static_cast<GtkScrollablePolicy>(g_value_get_enum(value)));
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
@@ -908,6 +1008,7 @@ static void webkit_web_view_realize(GtkWidget* widget)
gtk_im_context_set_client_window(priv->imContext.get(), window);
}
+#ifdef GTK_API_VERSION_2
static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* hadj, GtkAdjustment* vadj)
{
if (!core(webView))
@@ -921,6 +1022,7 @@ static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAd
return;
view->setGtkAdjustments(hadj, vadj);
}
+#endif
static void webkit_web_view_container_add(GtkContainer* container, GtkWidget* widget)
{
@@ -2525,6 +2627,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
/*
* make us scrollable (e.g. addable to a GtkScrolledWindow)
*/
+#ifdef GTK_API_VERSION_2
webViewClass->set_scroll_adjustments = webkit_web_view_set_scroll_adjustments;
GTK_WIDGET_CLASS(webViewClass)->set_scroll_adjustments_signal = g_signal_new("set-scroll-adjustments",
G_TYPE_FROM_CLASS(webViewClass),
@@ -2534,6 +2637,12 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
webkit_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
+#else
+ g_object_class_override_property(objectClass, PROP_HADJUSTMENT, "hadjustment");
+ g_object_class_override_property(objectClass, PROP_VADJUSTMENT, "vadjustment");
+ g_object_class_override_property(objectClass, PROP_HSCROLL_POLICY, "hscroll-policy");
+ g_object_class_override_property(objectClass, PROP_VSCROLL_POLICY, "vscroll-policy");
+#endif
/*
* Key bindings
@@ -3322,7 +3431,7 @@ void webkit_web_view_set_maintains_back_forward_list(WebKitWebView* webView, gbo
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
- core(webView)->backForwardList()->setEnabled(flag);
+ static_cast<BackForwardListImpl*>(core(webView)->backForwardList())->setEnabled(flag);
}
/**
@@ -3337,7 +3446,7 @@ void webkit_web_view_set_maintains_back_forward_list(WebKitWebView* webView, gbo
WebKitWebBackForwardList* webkit_web_view_get_back_forward_list(WebKitWebView* webView)
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
- if (!core(webView) || !core(webView)->backForwardList()->enabled())
+ if (!core(webView) || !static_cast<BackForwardListImpl*>(core(webView)->backForwardList())->enabled())
return 0;
return webView->priv->backForwardList.get();
}
diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog
index d55ce71..7ed4fad 100644
--- a/WebKit/haiku/ChangeLog
+++ b/WebKit/haiku/ChangeLog
@@ -1,3 +1,43 @@
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/FrameLoaderClientHaiku.h:
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::dispatchDidBecomeFrameset):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::transferLoadingResourceFromPage):
+ Empty method.
+ * WebCoreSupport/FrameLoaderClientHaiku.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebCoreSupport/ChromeClientHaiku.cpp:
+ (WebCore::ChromeClientHaiku::createWindow):
+ * WebCoreSupport/ChromeClientHaiku.h:
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::dispatchCreatePage):
+ * WebCoreSupport/FrameLoaderClientHaiku.h:
+ Add NavigationAction parameter.
+
2010-09-28 Jenn Braithwaite <jennb@chromium.org>
Reviewed by Dmitry Titov.
diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
index 6c54424..134cabe 100644
--- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
@@ -34,6 +34,7 @@
#include "FrameView.h"
#include "HitTestResult.h"
#include "Icon.h"
+#include "NavigationAction.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "SecurityOrigin.h"
@@ -107,7 +108,7 @@ void ChromeClientHaiku::focusedNodeChanged(Node*)
{
}
-Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&)
+Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&)
{
notImplemented();
return 0;
diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
index 6a5b381..9409c69 100644
--- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
@@ -60,7 +60,7 @@ namespace WebCore {
void focusedNodeChanged(Node*);
- Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&);
+ Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
Page* createModalDialog(Frame*, const FrameLoadRequest&);
void show();
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
index cae0ed1..74625c5 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
@@ -645,7 +645,7 @@ void FrameLoaderClientHaiku::dispatchDidFailLoad(const ResourceError&)
notImplemented();
}
-Frame* FrameLoaderClientHaiku::dispatchCreatePage()
+Frame* FrameLoaderClientHaiku::dispatchCreatePage(const WebCore::NavigationAction&)
{
notImplemented();
return false;
@@ -745,6 +745,10 @@ void FrameLoaderClientHaiku::didTransferChildFrameToNewDocument(Page*)
{
}
+void FrameLoaderClientHaiku::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
+}
+
ObjectContentType FrameLoaderClientHaiku::objectContentType(const KURL& url, const String& mimeType)
{
notImplemented();
@@ -853,4 +857,8 @@ void FrameLoaderClientHaiku::transitionToCommittedForNewPage()
m_frame->view()->setScrollbarModes(owner->scrollingMode(), owner->scrollingMode());
}
+void FrameLoaderClientHaiku::dispatchDidBecomeFrameset(bool)
+{
+}
+
} // namespace WebCore
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
index 1701cb0..dcdb1a0 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
@@ -151,6 +151,8 @@ namespace WebCore {
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual void updateGlobalHistory();
virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
@@ -199,7 +201,7 @@ namespace WebCore {
virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
virtual void dispatchDidFailLoad(const ResourceError&);
- virtual Frame* dispatchCreatePage();
+ virtual Frame* dispatchCreatePage(const NavigationAction&);
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction,
const String&,
const ResourceRequest&);
@@ -222,6 +224,7 @@ namespace WebCore {
HTMLFrameOwnerElement*, const String& referrer,
bool allowsScrolling, int marginWidth, int marginHeight);
virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const ResourceRequest&, WebCore::Page*);
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&,
const Vector<String>&, const Vector<String>&, const String&,
bool loadManually);
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 8f1ea42..e7abf3d 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,312 @@
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * History/WebBackForwardList.mm:
+ Use BackForwardListImpl.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Rubber-stamped by Sam Weinig.
+
+ Comment for usesDocumentViews explains it backwards. This flag is true in ToT, and we do
+ create views for subframes.
+
+ * WebView/WebViewData.h: Double negation is better than a lie.
+
+2010-10-27 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Full screen video in Safari (still) exits full-screen if you switch to another
+ app on a multi-display system.
+ https://bugs.webkit.org/show_bug.cgi?id=47364
+ <rdar://problem/8382299>
+
+ The FullScreen window does not technically close when it deactivates, but the
+ two NSWindows that make up the FullScreen feature should not hide when deactivated.
+
+ * WebView/WebVideoFullscreenController.mm:
+ (createBackgroundFullscreenWindow): Do not set hidesOnDeactivate.
+ (-[WebVideoFullscreenWindow initWithContentRect:styleMask:backing:defer:]): Ditto.
+ * WebView/WebVideoFullscreenHUDWindowController.mm:
+ (-[WebVideoFullscreenHUDWindow initWithContentRect:styleMask:backing:defer:]): Ditto.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::dispatchDidBecomeFrameset):
+
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Roben and David Kilzer.
+
+ Fix and cleanup of build systems
+ https://bugs.webkit.org/show_bug.cgi?id=48342
+
+ * Configurations/FeatureDefines.xcconfig: Remove unnecessary ENABLE_SANDBOX.
+
+2010-10-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ LLVM compiler build fix
+
+ * Misc/WebDownload.mm:
+ (-[WebDownload initWithRequest:delegate:]): Changed the delegate type from id to
+ id<NSURLDownloadDelegate> to match the method signature in NSURLDownload.
+
+2010-10-28 Ivan Krstić <ike@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Remove unused experimental proxied panel interface.
+ <rdar://problem/7237059>
+
+ * Plugins/Hosted/NetscapePluginHostManager.h:
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::hostForPlugin):
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ (WebKit::NetscapePluginHostManager::instantiatePlugin):
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ * Plugins/Hosted/WebKitPluginClient.defs:
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ * WebView/WebPreferencesPrivate.h:
+
+2010-10-27 Pratik Solanki <psolanki@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Improve memSize calculation in [WebView _setCacheModel]
+ https://bugs.webkit.org/show_bug.cgi?id=48484
+
+ * WebView/WebView.mm:
+ (roundUpToPowerOf2): Added. Utility function to calculate the nearest power of 2.
+ (+[WebView _setCacheModel:]): Update memSize calculation to set it to the next
+ bigger power of 2. Also update WebCore cache settings.
+
+2010-10-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42322
+ rdar://problem/8193631
+
+ WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42333
+ rdar://problem/8193643
+
+ * History/WebBackForwardList.mm:
+ (core): Return BackForwardListImpl.
+ (kit): Take BackForwardListImpl.
+ (-[WebBackForwardList initWithBackForwardList:]): Use BackForwardListImpl.
+ (-[WebBackForwardList dealloc]): Ditto.
+ (-[WebBackForwardList finalize]): Ditto.
+ (-[WebBackForwardList description]): Ditto.
+ (-[WebBackForwardList setPageCacheSize:]): Ditto.
+ (-[WebBackForwardList pageCacheSize]): Ditto.
+ * History/WebBackForwardListInternal.h: Ditto.
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView keyDown:]): Ditto.
+ * WebView/WebView.mm:
+ (-[WebView initWithCoder:]): Ditto.
+ (-[WebView encodeWithCoder:]): Ditto.
+ (-[WebView backForwardList]): Ditto.
+ (-[WebView setMaintainsBackForwardList:]): Ditto.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Chris Marrin.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48279
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-10-27 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=48385 Add WebKit
+ SPI to scale a WebView
+ -and corresponding-
+ <rdar://problem/8107667>
+
+ This patch adds SPI to Mac WebKit that scales the page by the given
+ scale factor.
+
+ * WebView/WebView.mm:
+ (-[WebView _scaleWebView:]):
+ (-[WebView _viewScaleFactor]):
+ * WebView/WebViewPrivate.h:
+
+2010-10-27 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r70335): Incorrect article layout in Safari Reader
+ https://bugs.webkit.org/show_bug.cgi?id=48436
+
+ * Misc/WebKitVersionChecks.h: Added WEBKIT_FIRST_VERSION_WITH_GET_MATCHED_CSS_RULES_RESTRICTIONS.
+ * WebView/WebView.mm:
+ (-[WebView _needsUnrestrictedGetMatchedCSSRules]): Added. Returns YES for Safari linked against
+ versions of WebKit that did not have the cross-origin restrictions in getMatchedCSSRules().
+ (-[WebView _preferencesChangedNotification:]): Call Settings::setCrossOriginCheckInGetMatchedCSSRulesDisabled()
+ based on the above.
+
+2010-10-18 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Safari fullscreen media element tickles when it should not.
+
+ https://bugs.webkit.org/show_bug.cgi?id=47861
+
+ * WebView/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController updatePowerAssertions]):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::didTransferChildFrameToNewDocument):
+ Empty method.
+ (WebFrameLoaderClient::transferLoadingResourceFromPage):
+ Update resource tracking for a resource load that has been transferred
+ to a new page.
+
+2010-10-25 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Remove exec and globalData arguments from jsNumber
+ https://bugs.webkit.org/show_bug.cgi?id=48270
+
+ Mechanical removal of exec parameter to jsNumber
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::numberValue):
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Expose HitTestResult::absoluteMediaURL() via WebKit API
+ https://bugs.webkit.org/show_bug.cgi?id=48219
+
+ * Misc/WebElementDictionary.mm:
+ (+[WebElementDictionary initializeLookupTable]): Map WebElementMediaURLKey to
+ _absoluteMediaURL.
+ (-[WebElementDictionary _absoluteMediaURL]): Added. Returns absoluteMediaURL().
+ * WebKit.exp: Export WebElementMediaURLKey.
+ * WebView/WebView.mm: Define WebElementMediaURLKey.
+ * WebView/WebViewPrivate.h: Declare WebElementMediaURLKey.
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Removed deprecated methods from the WebHTMLHighlighter private protocol.
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::customHighlightRect): Call -highlightRectForLine:representedNode:
+ unconditionally.
+ (WebChromeClient::paintCustomHighlight): Call
+ -paintHighlightForBox:onLine:behindText:entireLine:representedNode: unconditionally.
+ * WebView/WebHTMLViewPrivate.h:
+
+2010-10-23 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Sam Weinig.
+
+ Unify globalData APIs
+ https://bugs.webkit.org/show_bug.cgi?id=47969
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::evaluate):
+ (WebKit::NetscapePluginInstanceProxy::invoke):
+ (WebKit::NetscapePluginInstanceProxy::invokeDefault):
+ (WebKit::NetscapePluginInstanceProxy::construct):
+ * WebView/WebScriptDebugDelegate.mm:
+ (-[WebScriptCallFrame evaluateWebScript:]):
+
+2010-10-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48186> Remove unneeded WebHTMLRepresentationInternal.h header
+
+ Reviewed by Sam Weinig.
+
+ The only method defined in WebHTMLRepresentationInternal.h is
+ also defined in WebHTMLRepresentation.h, so use that instead.
+
+ * WebView/WebHTMLRepresentationInternal.h: Removed.
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Initialize the new method.
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::createWindow):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::dispatchCreatePage):
+ Add NavigationAction parameter.
+
+2010-10-21 Andy Estes <aestes@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ WebKit shouldn't load a plug-in based on file extension if a MIME type
+ is specified.
+ https://bugs.webkit.org/show_bug.cgi?id=48046
+
+ If a MIME type is specified in an object or embed element, and that MIME
+ type isn't supported by an installed plug-in, WebKit shouldn't attempt
+ to find a plug-in based on the file extension of the url attribute.
+ Doing so can lead to cases where a plug-in is loaded that can't handle
+ resources of the MIME type specified by the author.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin): Only check for a pluginPackage by
+ extension if MIME type is the empty string.
+
2010-10-20 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 8732c18..d08fadf 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -94,9 +94,6 @@ ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG;
ENABLE_RUBY = $(ENABLE_RUBY_$(REAL_PLATFORM_NAME));
ENABLE_RUBY_macosx = ENABLE_RUBY;
-ENABLE_SANDBOX = $(ENABLE_SANDBOX_$(REAL_PLATFORM_NAME));
-ENABLE_SANDBOX_macosx = ENABLE_SANDBOX;
-
ENABLE_SHARED_WORKERS = $(ENABLE_SHARED_WORKERS_$(REAL_PLATFORM_NAME));
ENABLE_SHARED_WORKERS_macosx = ENABLE_SHARED_WORKERS;
@@ -112,6 +109,8 @@ ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT;
ENABLE_SVG_USE = ENABLE_SVG_USE;
ENABLE_VIDEO = ENABLE_VIDEO;
+ENABLE_WEB_AUDIO = ;
+
ENABLE_WEB_SOCKETS = $(ENABLE_WEB_SOCKETS_$(REAL_PLATFORM_NAME));
ENABLE_WEB_SOCKETS_macosx = ENABLE_WEB_SOCKETS;
@@ -125,4 +124,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebKit/mac/History/WebBackForwardList.mm b/WebKit/mac/History/WebBackForwardList.mm
index 617ee0e..e794c2f 100644
--- a/WebKit/mac/History/WebBackForwardList.mm
+++ b/WebKit/mac/History/WebBackForwardList.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -53,8 +53,10 @@
using namespace WebCore;
-typedef HashMap<BackForwardList*, WebBackForwardList*> BackForwardListMap;
+typedef HashMap<BackForwardListImpl*, WebBackForwardList*> BackForwardListMap;
+// FIXME: Instead of this we could just create a class derived from BackForwardListImpl
+// with a pointer to a WebBackForwardList in it.
static BackForwardListMap& backForwardLists()
{
DEFINE_STATIC_LOCAL(BackForwardListMap, staticBackForwardLists, ());
@@ -63,15 +65,15 @@ static BackForwardListMap& backForwardLists()
@implementation WebBackForwardList (WebBackForwardListInternal)
-BackForwardList* core(WebBackForwardList *webBackForwardList)
+BackForwardListImpl* core(WebBackForwardList *webBackForwardList)
{
if (!webBackForwardList)
return 0;
- return reinterpret_cast<BackForwardList*>(webBackForwardList->_private);
+ return reinterpret_cast<BackForwardListImpl*>(webBackForwardList->_private);
}
-WebBackForwardList *kit(BackForwardList* backForwardList)
+WebBackForwardList *kit(BackForwardListImpl* backForwardList)
{
if (!backForwardList)
return nil;
@@ -82,7 +84,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
return [[[WebBackForwardList alloc] initWithBackForwardList:backForwardList] autorelease];
}
-- (id)initWithBackForwardList:(PassRefPtr<BackForwardList>)backForwardList
+- (id)initWithBackForwardList:(PassRefPtr<BackForwardListImpl>)backForwardList
{
WebCoreThreadViolationCheckRoundOne();
self = [super init];
@@ -117,7 +119,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
if (WebCoreObjCScheduleDeallocateOnMainThread([WebBackForwardList class], self))
return;
- BackForwardList* backForwardList = core(self);
+ BackForwardListImpl* backForwardList = core(self);
ASSERT(backForwardList);
if (backForwardList) {
ASSERT(backForwardList->closed());
@@ -131,7 +133,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
- (void)finalize
{
WebCoreThreadViolationCheckRoundOne();
- BackForwardList* backForwardList = core(self);
+ BackForwardListImpl* backForwardList = core(self);
ASSERT(backForwardList);
if (backForwardList) {
ASSERT(backForwardList->closed());
@@ -265,7 +267,7 @@ static bool bumperCarBackForwardHackNeeded()
[result appendString:@"\n--------------------------------------------\n"];
[result appendString:@"WebBackForwardList:\n"];
- BackForwardList* backForwardList = core(self);
+ BackForwardListImpl* backForwardList = core(self);
HistoryItemVector& entries = backForwardList->entries();
unsigned size = entries.size();
@@ -293,14 +295,12 @@ static bool bumperCarBackForwardHackNeeded()
- (void)setPageCacheSize:(NSUInteger)size
{
- ASSERT(core(self)->isBackForwardListImpl());
- [kit(static_cast<BackForwardListImpl*>(core(self))->page()) setUsesPageCache:size != 0];
+ [kit(core(self)->page()) setUsesPageCache:size != 0];
}
- (NSUInteger)pageCacheSize
{
- ASSERT(core(self)->isBackForwardListImpl());
- return [kit(static_cast<BackForwardListImpl*>(core(self))->page()) usesPageCache] ? pageCache()->capacity() : 0;
+ return [kit(core(self)->page()) usesPageCache] ? pageCache()->capacity() : 0;
}
- (int)backListCount
diff --git a/WebKit/mac/History/WebBackForwardListInternal.h b/WebKit/mac/History/WebBackForwardListInternal.h
index 3448647..1afb833 100644
--- a/WebKit/mac/History/WebBackForwardListInternal.h
+++ b/WebKit/mac/History/WebBackForwardListInternal.h
@@ -30,12 +30,12 @@
#import <wtf/PassRefPtr.h>
namespace WebCore {
- class BackForwardList;
+ class BackForwardListImpl;
}
-WebCore::BackForwardList* core(WebBackForwardList *);
-WebBackForwardList *kit(WebCore::BackForwardList*);
+WebCore::BackForwardListImpl* core(WebBackForwardList *);
+WebBackForwardList *kit(WebCore::BackForwardListImpl*);
@interface WebBackForwardList (WebBackForwardListInternal)
-- (id)initWithBackForwardList:(PassRefPtr<WebCore::BackForwardList>)backForwardList;
+- (id)initWithBackForwardList:(PassRefPtr<WebCore::BackForwardListImpl>)backForwardList;
@end
diff --git a/WebKit/mac/Misc/WebDownload.mm b/WebKit/mac/Misc/WebDownload.mm
index 82c1259..a4d919a 100644
--- a/WebKit/mac/Misc/WebDownload.mm
+++ b/WebKit/mac/Misc/WebDownload.mm
@@ -219,7 +219,7 @@ using namespace WebCore;
[super dealloc];
}
-- (id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate
+- (id)initWithRequest:(NSURLRequest *)request delegate:(id<NSURLDownloadDelegate>)delegate
{
[self _setRealDelegate:delegate];
return [super initWithRequest:request delegate:_webInternal];
diff --git a/WebKit/mac/Misc/WebElementDictionary.mm b/WebKit/mac/Misc/WebElementDictionary.mm
index 6b2eb3d..71c4cc7 100644
--- a/WebKit/mac/Misc/WebElementDictionary.mm
+++ b/WebKit/mac/Misc/WebElementDictionary.mm
@@ -85,6 +85,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
addLookupKey(WebElementImageRectKey, @selector(_imageRect));
addLookupKey(WebElementImageURLKey, @selector(_absoluteImageURL));
addLookupKey(WebElementIsSelectedKey, @selector(_isSelected));
+ addLookupKey(WebElementMediaURLKey, @selector(_absoluteMediaURL));
addLookupKey(WebElementSpellingToolTipKey, @selector(_spellingToolTip));
addLookupKey(WebElementTitleKey, @selector(_title));
addLookupKey(WebElementLinkURLKey, @selector(_absoluteLinkURL));
@@ -216,6 +217,11 @@ static NSString* NSStringOrNil(String coreString)
return _result->absoluteImageURL();
}
+- (NSURL *)_absoluteMediaURL
+{
+ return _result->absoluteMediaURL();
+}
+
- (NSNumber *)_isSelected
{
return [NSNumber numberWithBool:_result->isSelected()];
diff --git a/WebKit/mac/Misc/WebKitVersionChecks.h b/WebKit/mac/Misc/WebKitVersionChecks.h
index 4bf2c83..9d59665 100644
--- a/WebKit/mac/Misc/WebKitVersionChecks.h
+++ b/WebKit/mac/Misc/WebKitVersionChecks.h
@@ -55,6 +55,7 @@
#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
+#define WEBKIT_FIRST_VERSION_WITH_GET_MATCHED_CSS_RULES_RESTRICTIONS 0x02160B00 // 534.11.0
#ifdef __cplusplus
extern "C" {
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
index 2645c55..4e59456 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
@@ -53,12 +53,12 @@ public:
void didCreateWindow();
private:
- NetscapePluginHostProxy* hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const WTF::String& bundleIdentifier, bool useProxiedOpenPanel);
+ NetscapePluginHostProxy* hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const WTF::String& bundleIdentifier);
NetscapePluginHostManager();
~NetscapePluginHostManager();
- bool spawnPluginHost(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel);
+ bool spawnPluginHost(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN);
bool initializeVendorPort();
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
index 322e0e8..d8cd081 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
@@ -31,10 +31,7 @@
#import "NetscapePluginInstanceProxy.h"
#import "WebLocalizableStrings.h"
#import "WebKitSystemInterface.h"
-#import "WebHostedNetscapePluginView.h"
#import "WebNetscapePluginPackage.h"
-#import "WebPreferencesPrivate.h"
-#import "WebView.h"
#import <mach/mach_port.h>
#import <servers/bootstrap.h>
#import <spawn.h>
@@ -70,7 +67,7 @@ NetscapePluginHostManager::~NetscapePluginHostManager()
{
}
-NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel)
+NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier)
{
pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(pluginPath, 0);
@@ -86,7 +83,7 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::Str
mach_port_t pluginHostPort;
ProcessSerialNumber pluginHostPSN;
- if (!spawnPluginHost(pluginPath, pluginArchitecture, clientPort, pluginHostPort, pluginHostPSN, useProxiedOpenPanel)) {
+ if (!spawnPluginHost(pluginPath, pluginArchitecture, clientPort, pluginHostPort, pluginHostPSN)) {
mach_port_destroy(mach_task_self(), clientPort);
m_pluginHosts.remove(result.first);
return 0;
@@ -103,7 +100,7 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::Str
return hostProxy;
}
-bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel)
+bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN)
{
if (m_pluginVendorPort == MACH_PORT_NULL) {
if (!initializeVendorPort())
@@ -123,7 +120,6 @@ bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_ty
pluginHostAppExecutablePath, @"pluginHostPath",
[NSNumber numberWithInt:pluginArchitecture], @"cpuType",
localization.get(), @"localization",
- [NSNumber numberWithBool:useProxiedOpenPanel], @"useProxiedOpenPanel",
nil];
NSData *data = [NSPropertyListSerialization dataFromPropertyList:launchProperties format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
@@ -217,8 +213,7 @@ void NetscapePluginHostManager::pluginHostDied(NetscapePluginHostProxy* pluginHo
PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled)
{
- WebPreferences *preferences = [[pluginView webView] preferences];
- NetscapePluginHostProxy* hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier, [preferences usesProxiedOpenPanel]);
+ NetscapePluginHostProxy* hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier);
if (!hostProxy)
return 0;
@@ -257,7 +252,7 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl
pluginHostDied(hostProxy);
// Try to spawn it again.
- hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier, [preferences usesProxiedOpenPanel]);
+ hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier);
// Create a new instance.
instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame);
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 207f062..067b8bb 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -1120,61 +1120,6 @@ kern_return_t WKPCResolveURL(mach_port_t clientPort, uint32_t pluginID, data_t u
return KERN_SUCCESS;
}
-#if !defined(BUILDING_ON_SNOW_LEOPARD)
-kern_return_t WKPCRunSyncOpenPanel(mach_port_t clientPort, data_t panelData, mach_msg_type_number_t panelDataLength)
-{
- DataDeallocator panelDataDeallocator(panelData, panelDataLength);
-
- NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort);
- if (!hostProxy)
- return KERN_FAILURE;
-
- NSOpenPanel *sheet = [NSOpenPanel openPanel];
- NSDictionary *panelState = [NSPropertyListSerialization propertyListFromData:[NSData dataWithBytes:panelData length:panelDataLength]
- mutabilityOption:NSPropertyListImmutable
- format:NULL
- errorDescription:nil];
-
- [sheet setCanChooseFiles:[[panelState objectForKey:@"canChooseFiles"] boolValue]];
- [sheet setCanChooseDirectories:[[panelState objectForKey:@"canChooseDirectories"] boolValue]];
- [sheet setResolvesAliases:[[panelState objectForKey:@"resolvesAliases"] boolValue]];
- [sheet setAllowsMultipleSelection:[[panelState objectForKey:@"allowsMultipleSelection"] boolValue]];
- [sheet setCanCreateDirectories:[[panelState objectForKey:@"canCreateDirectories"] boolValue]];
- [sheet setShowsHiddenFiles:[[panelState objectForKey:@"showsHiddenFiles"] boolValue]];
- [sheet setExtensionHidden:[[panelState objectForKey:@"isExtensionHidden"] boolValue]];
- [sheet setCanSelectHiddenExtension:[[panelState objectForKey:@"canSelectHiddenExtension"] boolValue]];
- [sheet setAllowsOtherFileTypes:[[panelState objectForKey:@"allowsOtherFileTypes"] boolValue]];
- [sheet setTreatsFilePackagesAsDirectories:[[panelState objectForKey:@"treatsFilePackagesAsDirectories"] boolValue]];
- [sheet setPrompt:[panelState objectForKey:@"prompt"]];
- [sheet setNameFieldLabel:[panelState objectForKey:@"nameFieldLabel"]];
- [sheet setMessage:[panelState objectForKey:@"message"]];
- [sheet setAllowedFileTypes:[panelState objectForKey:@"allowedFileTypes"]];
- [sheet setRequiredFileType:[panelState objectForKey:@"requiredFileType"]];
- [sheet setTitle:[panelState objectForKey:@"title"]];
- [sheet runModal];
-
- NetscapePluginHostProxy* newHostProxy = pluginProxyMap().get(clientPort);
- if (newHostProxy != hostProxy)
- return KERN_FAILURE;
-
- NSDictionary *ret = [NSDictionary dictionaryWithObjectsAndKeys:
- [sheet filenames], @"filenames",
- WKNoteOpenPanelFiles([sheet filenames]), @"extensions",
- nil];
-
- RetainPtr<NSData*> data = [NSPropertyListSerialization dataFromPropertyList:ret format:NSPropertyListBinaryFormat_v1_0 errorDescription:0];
- ASSERT(data);
-
- _WKPHSyncOpenPanelReply(hostProxy->port(), const_cast<char *>(static_cast<const char*>([data.get() bytes])), [data.get() length]);
- return KERN_SUCCESS;
-}
-#else
-kern_return_t WKPCRunSyncOpenPanel(mach_port_t clientPort, data_t panelData, mach_msg_type_number_t panelDataLength)
-{
- return KERN_FAILURE;
-}
-#endif // !defined(BUILDING_ON_SNOW_LEOPARD)
-
kern_return_t WKPCSetException(mach_port_t clientPort, data_t message, mach_msg_type_number_t messageCnt)
{
DataDeallocator deallocator(message, messageCnt);
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 0b9036a..a2d4a96 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -872,9 +872,9 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri
bool oldAllowPopups = frame->script()->allowPopupsFromPlugin();
frame->script()->setAllowPopupsFromPlugin(allowPopups);
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
Completion completion = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(script));
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
ComplType type = completion.complType();
frame->script()->setAllowPopupsFromPlugin(oldAllowPopups);
@@ -921,9 +921,9 @@ bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& me
demarshalValues(exec, argumentsData, argumentsLength, argList);
ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld());
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue value = call(exec, function, callType, callData, object, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
marshalValue(exec, value, resultData, resultLength);
exec->clearException();
@@ -956,9 +956,9 @@ bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argume
demarshalValues(exec, argumentsData, argumentsLength, argList);
ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld());
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue value = call(exec, object, callType, callData, object, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
marshalValue(exec, value, resultData, resultLength);
exec->clearException();
@@ -992,9 +992,9 @@ bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsD
demarshalValues(exec, argumentsData, argumentsLength, argList);
ProtectedPtr<JSGlobalObject> globalObject = frame->script()->globalObject(pluginWorld());
- globalObject->globalData()->timeoutChecker.start();
+ globalObject->globalData().timeoutChecker.start();
JSValue value = JSC::construct(exec, object, constructType, constructData, argList);
- globalObject->globalData()->timeoutChecker.stop();
+ globalObject->globalData().timeoutChecker.stop();
marshalValue(exec, value, resultData, resultLength);
exec->clearException();
@@ -1334,7 +1334,7 @@ bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArr
result = jsBoolean([[array objectAtIndex:index++] boolValue]);
return true;
case DoubleValueType:
- result = jsNumber(exec, [[array objectAtIndex:index++] doubleValue]);
+ result = jsNumber([[array objectAtIndex:index++] doubleValue]);
return true;
case StringValueType: {
NSString *string = [array objectAtIndex:index++];
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index 11ade8c..927a008 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -273,10 +273,10 @@ JSValue ProxyInstance::stringValue(ExecState* exec) const
return jsEmptyString(exec);
}
-JSValue ProxyInstance::numberValue(ExecState* exec) const
+JSValue ProxyInstance::numberValue(ExecState*) const
{
// FIXME: Implement something sensible.
- return jsNumber(exec, 0);
+ return jsNumber(0);
}
JSValue ProxyInstance::booleanValue() const
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
index 4129ca1..15fc5fa 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
@@ -231,9 +231,6 @@ simpleroutine PCBooleanAndDataReply(clientPort :mach_port_t;
returnValue :boolean_t;
result :data_t);
-simpleroutine PCRunSyncOpenPanel(clientPort :mach_port_t;
- panelData :data_t);
-
simpleroutine PCSetFullscreenWindowIsShowing(clientPort :mach_port_t;
isShowing :boolean_t);
diff --git a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
index 5d9df45..fa808ac 100644
--- a/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
+++ b/WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs
@@ -240,9 +240,6 @@ simpleroutine PHPluginInstancePrivateBrowsingModeDidChange(pluginHostPort :mach_
pluginID :uint32_t;
privateBrowsingEnabled :boolean_t);
-simpleroutine PHSyncOpenPanelReply(pluginHostPort :mach_port_t;
- filenames :data_t);
-
simpleroutine PHPluginInstanceSnapshot(pluginHostPort :mach_port_t;
pluginID :uint32_t;
requestID :uint32_t;
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 5f3b727..209c2b9 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -55,7 +55,7 @@ public:
virtual void focusedNodeChanged(WebCore::Node*);
- virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
+ virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
virtual void show();
virtual bool canRunModal();
diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 68e17be..3610896 100644
--- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -60,6 +60,7 @@
#import <WebCore/HitTestResult.h>
#import <WebCore/Icon.h>
#import <WebCore/IntRect.h>
+#import <WebCore/NavigationAction.h>
#import <WebCore/Page.h>
#import <WebCore/PlatformScreen.h>
#import <WebCore/PlatformString.h>
@@ -199,7 +200,7 @@ void WebChromeClient::focusedNodeChanged(Node*)
{
}
-Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features)
+Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&)
{
NSURLRequest *URLRequest = nil;
if (!request.isEmpty())
@@ -640,9 +641,7 @@ FloatRect WebChromeClient::customHighlightRect(Node* node, const AtomicString& t
WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type];
- if ([(NSObject *)highlighter respondsToSelector:@selector(highlightRectForLine:representedNode:)])
- return [highlighter highlightRectForLine:lineRect representedNode:kit(node)];
- return [highlighter highlightRectForLine:lineRect];
+ return [highlighter highlightRectForLine:lineRect representedNode:kit(node)];
END_BLOCK_OBJC_EXCEPTIONS;
@@ -660,10 +659,7 @@ void WebChromeClient::paintCustomHighlight(Node* node, const AtomicString& type,
WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type];
- if ([(NSObject *)highlighter respondsToSelector:@selector(paintHighlightForBox:onLine:behindText:entireLine:representedNode:)])
- [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine representedNode:kit(node)];
- else
- [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine];
+ [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine representedNode:kit(node)];
END_BLOCK_OBJC_EXCEPTIONS;
}
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 0baa55c..2b3b2cc 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -111,7 +111,7 @@ private:
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual WebCore::Frame* dispatchCreatePage();
+ virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction,
@@ -175,6 +175,8 @@ private:
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual bool canHandleRequest(const WebCore::ResourceRequest&) const;
virtual bool canShowMIMEType(const WTF::String& MIMEType) const;
virtual bool canShowMIMETypeAsHTML(const WTF::String& MIMEType) const;
@@ -194,6 +196,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(WebCore::Page* oldPage);
+ virtual void transferLoadingResourceFromPage(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, 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 c3fd457..3053b49 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -697,7 +697,7 @@ void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
CallFrameLoadDelegate(implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc, webView, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:), m_webFrame.get());
}
-Frame* WebFrameLoaderClient::dispatchCreatePage()
+Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction&)
{
WebView *currentWebView = getWebView(m_webFrame.get());
NSDictionary *features = [[NSDictionary alloc] init];
@@ -1253,6 +1253,10 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
}
}
+void WebFrameLoaderClient::dispatchDidBecomeFrameset(bool)
+{
+}
+
RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function)
{
// FIXME: <rdar://5634381> We need to support multiple active policy listeners.
@@ -1385,11 +1389,16 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page* oldPage)
{
- if (oldPage == core(m_webFrame.get())->page())
- return;
+}
+
+void WebFrameLoaderClient::transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, Page* oldPage)
+{
+ ASSERT(oldPage != core(m_webFrame.get())->page());
+ ASSERT(![getWebView(m_webFrame.get()) _objectForIdentifier:identifier]);
+
+ assignIdentifierToInitialRequest(identifier, loader, request);
- // Update resource tracking now that frame is in a different page.
- // TODO(jennb): update resource tracking [bug 44713]
+ [kit(oldPage) _removeObjectForIdentifier:identifier];
}
ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeType)
@@ -1629,7 +1638,7 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP
}
NSString *extension = [[pluginURL path] pathExtension];
- if (!pluginPackage && [extension length] != 0) {
+ if (!pluginPackage && [extension length] && ![MIMEType length]) {
pluginPackage = [webView _pluginForExtension:extension];
if (pluginPackage) {
NSString *newMIMEType = [pluginPackage MIMETypeForExtension:extension];
diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.mm b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
index 03cb33f..df3ea4d 100644
--- a/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
+++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
@@ -73,6 +73,7 @@ void InitWebCoreSystemInterface(void)
INIT(SetCGFontRenderingMode);
INIT(SetCONNECTProxyAuthorizationForStream);
INIT(SetCONNECTProxyForStream);
+ INIT(SetCookieStoragePrivateBrowsingEnabled);
INIT(SetDragImage);
INIT(SetNSURLConnectionDefersCallbacks);
INIT(SetNSURLRequestShouldContentSniff);
@@ -113,10 +114,6 @@ void InitWebCoreSystemInterface(void)
INIT(SupportsMultipartXMixedReplace);
#endif
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- INIT(NoteOpenPanelFiles);
-#endif
-
#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
INIT(GetHyphenationLocationBeforeIndex);
#endif
diff --git a/WebKit/mac/WebKit.exp b/WebKit/mac/WebKit.exp
index 463ab00..7c20307 100644
--- a/WebKit/mac/WebKit.exp
+++ b/WebKit/mac/WebKit.exp
@@ -65,6 +65,7 @@ _WebElementImageKey
_WebElementImageRectKey
_WebElementImageURLKey
_WebElementIsSelectedKey
+_WebElementMediaURLKey
_WebElementLinkIsLiveKey
_WebElementLinkLabelKey
_WebElementLinkTargetFrameKey
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index e76e3ca..0db12c0 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -55,7 +55,7 @@
#import "WebViewInternal.h"
#import "WebViewPrivate.h"
#import <Foundation/NSURLRequest.h>
-#import <WebCore/BackForwardList.h>
+#import <WebCore/BackForwardListImpl.h>
#import <WebCore/DragController.h>
#import <WebCore/EventHandler.h>
#import <WebCore/Frame.h>
@@ -708,7 +708,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
int index, count;
BOOL callSuper = YES;
Frame* coreFrame = [self _web_frame];
- BOOL maintainsBackForwardList = coreFrame && coreFrame->page()->backForwardList()->enabled() ? YES : NO;
+ BOOL maintainsBackForwardList = coreFrame && static_cast<BackForwardListImpl*>(coreFrame->page()->backForwardList())->enabled() ? YES : NO;
count = [characters length];
for (index = 0; index < count; ++index) {
diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h
index 1218efc..c62713f 100644
--- a/WebKit/mac/WebView/WebHTMLViewPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h
@@ -46,10 +46,6 @@
@protocol WebHTMLHighlighter
- (NSRect)highlightRectForLine:(NSRect)lineRect representedNode:(DOMNode *)node;
- (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line representedNode:(DOMNode *)node;
-
-// the following methods are deprecated and will be removed once Mail switches to the new methods <rdar://problem/5050528>
-- (NSRect)highlightRectForLine:(NSRect)lineRect;
-- (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line;
@end
extern const float _WebHTMLViewPrintingMinimumShrinkFactor;
diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
index cd9ed8f..5c6b530 100644
--- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
+++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
@@ -93,7 +93,6 @@
#define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
#define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
#define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
-#define WebKitUsesProxiedOpenPanelPreferenceKey @"WebKitUsesProxiedOpenPanel"
#define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime"
#define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
#define WebKitSpatialNavigationEnabledPreferenceKey @"WebKitSpatialNavigationEnabled"
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index ccfb632..ed06188 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -362,7 +362,6 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitShowRepaintCounterPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitAccelerated2dCanvasEnabledPreferenceKey,
- [NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
[NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitSpatialNavigationEnabledPreferenceKey,
@@ -1284,16 +1283,6 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
}
-- (BOOL)usesProxiedOpenPanel
-{
- return [self _boolValueForKey:WebKitUsesProxiedOpenPanelPreferenceKey];
-}
-
-- (void)setUsesProxiedOpenPanel:(BOOL)enabled
-{
- [self _setBoolValue:enabled forKey:WebKitUsesProxiedOpenPanelPreferenceKey];
-}
-
- (unsigned)pluginAllowedRunTime
{
return [self _integerValueForKey:WebKitPluginAllowedRunTimePreferenceKey];
diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h
index 47e6d71..2ec08e8 100644
--- a/WebKit/mac/WebView/WebPreferencesPrivate.h
+++ b/WebKit/mac/WebView/WebPreferencesPrivate.h
@@ -193,9 +193,6 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)paginateDuringLayoutEnabled;
- (void)setPaginateDuringLayoutEnabled:(BOOL)flag;
-- (BOOL)usesProxiedOpenPanel;
-- (void)setUsesProxiedOpenPanel:(BOOL)enabled;
-
- (BOOL)memoryInfoEnabled;
- (void)setMemoryInfoEnabled:(BOOL)enabled;
diff --git a/WebKit/mac/WebView/WebScriptDebugDelegate.mm b/WebKit/mac/WebView/WebScriptDebugDelegate.mm
index 9ffd36e..63a91a9 100644
--- a/WebKit/mac/WebView/WebScriptDebugDelegate.mm
+++ b/WebKit/mac/WebView/WebScriptDebugDelegate.mm
@@ -236,7 +236,7 @@ NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber";
// WebScriptCallFrame. Instead, we need to set the dynamic global object
// and evaluate the JS in the global object's global call frame.
JSGlobalObject* globalObject = _private->debugger->globalObject();
- if (self == _private->debugger->globalCallFrame() && !globalObject->globalData()->dynamicGlobalObject) {
+ if (self == _private->debugger->globalCallFrame() && !globalObject->globalData().dynamicGlobalObject) {
JSGlobalObject* globalObject = _private->debugger->globalObject();
DynamicGlobalObjectScope globalObjectScope(globalObject->globalExec(), globalObject);
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm
index 1efb93f..2687b14 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm
@@ -246,7 +246,6 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
[window setOpaque:YES];
[window setBackgroundColor:[NSColor blackColor]];
[window setLevel:level];
- [window setHidesOnDeactivate:YES];
[window setReleasedWhenClosed:NO];
return window;
}
@@ -414,11 +413,11 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
if (rate && !_isEndingFullscreen) {
[self _disableIdleSystemSleep];
[self _disableIdleDisplaySleep];
- [self _disableTickleTimer];
+ [self _enableTickleTimer];
} else {
[self _enableIdleSystemSleep];
[self _enableIdleDisplaySleep];
- [self _enableTickleTimer];
+ [self _disableTickleTimer];
}
#endif
}
@@ -475,7 +474,6 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
return nil;
[self setOpaque:NO];
[self setBackgroundColor:[NSColor clearColor]];
- [self setHidesOnDeactivate:YES];
[self setIgnoresMouseEvents:NO];
[self setAcceptsMouseMovedEvents:YES];
return self;
diff --git a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
index 1aa501e..6907311 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
@@ -91,7 +91,6 @@ static inline CGFloat webkit_CGFloor(CGFloat value)
[self setAcceptsMouseMovedEvents:YES];
[self setIgnoresMouseEvents:NO];
[self setMovableByWindowBackground:YES];
- [self setHidesOnDeactivate:YES];
return self;
}
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 9b267ef..7456898 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -110,7 +110,7 @@
#import <JavaScriptCore/JSValueRef.h>
#import <WebCore/AbstractDatabase.h>
#import <WebCore/ApplicationCacheStorage.h>
-#import <WebCore/BackForwardList.h>
+#import <WebCore/BackForwardListImpl.h>
#import <WebCore/Cache.h>
#import <WebCore/ColorMac.h>
#import <WebCore/CSSComputedStyleDeclaration.h>
@@ -144,6 +144,7 @@
#import <WebCore/PageGroup.h>
#import <WebCore/PlatformMouseEvent.h>
#import <WebCore/ProgressTracker.h>
+#import <WebCore/RenderView.h>
#import <WebCore/RenderWidget.h>
#import <WebCore/ResourceHandle.h>
#import <WebCore/RuntimeApplicationChecks.h>
@@ -403,6 +404,7 @@ NSString *WebElementLinkLabelKey = @"WebElementLinkLabel";
NSString *WebElementLinkTargetFrameKey = @"WebElementTargetFrame";
NSString *WebElementLinkTitleKey = @"WebElementLinkTitle";
NSString *WebElementLinkURLKey = @"WebElementLinkURL";
+NSString *WebElementMediaURLKey = @"WebElementMediaURL";
NSString *WebElementSpellingToolTipKey = @"WebElementSpellingToolTip";
NSString *WebElementTitleKey = @"WebElementTitle";
NSString *WebElementLinkIsLiveKey = @"WebElementLinkIsLive";
@@ -1397,6 +1399,12 @@ static bool fastDocumentTeardownEnabled()
|| [[self preferences] usePreHTML5ParserQuirks];
}
+- (BOOL)_needsUnrestrictedGetMatchedCSSRules
+{
+ static bool needsUnrestrictedGetMatchedCSSRules = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_GET_MATCHED_CSS_RULES_RESTRICTIONS) && applicationIsSafari();
+ return needsUnrestrictedGetMatchedCSSRules;
+}
+
- (void)_preferencesChangedNotification:(NSNotification *)notification
{
WebPreferences *preferences = (WebPreferences *)[notification object];
@@ -1495,6 +1503,7 @@ static bool fastDocumentTeardownEnabled()
settings->setMemoryInfoEnabled([preferences memoryInfoEnabled]);
settings->setHyperlinkAuditingEnabled([preferences hyperlinkAuditingEnabled]);
settings->setUsePreHTML5ParserQuirks([self _needsPreHTML5ParserQuirks]);
+ settings->setCrossOriginCheckInGetMatchedCSSRulesDisabled([self _needsUnrestrictedGetMatchedCSSRules]);
// Application Cache Preferences are stored on the global cache storage manager, not in Settings.
[WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];
@@ -2617,6 +2626,24 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
SchemeRegistry::registerURLSchemeAsSecure(scheme);
}
+- (void)_scaleWebView:(float)scale
+{
+ Frame* coreFrame = [self _mainCoreFrame];
+ if (!coreFrame)
+ return;
+
+ coreFrame->scalePage(scale);
+}
+
+- (float)_viewScaleFactor
+{
+ Frame* coreFrame = [self _mainCoreFrame];
+ if (!coreFrame)
+ return 1;
+
+ return coreFrame->pageScaleFactor();
+}
+
@end
@implementation _WebSafeForwarder
@@ -2979,7 +3006,7 @@ static bool needsWebViewInitThreadWorkaround()
LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", frameName, groupName, (int)useBackForwardList);
[result _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:YES];
- [result page]->backForwardList()->setEnabled(useBackForwardList);
+ static_cast<BackForwardListImpl*>([result page]->backForwardList())->setEnabled(useBackForwardList);
result->_private->allowsUndo = allowsUndo;
if (preferences)
[result setPreferences:preferences];
@@ -3003,7 +3030,7 @@ static bool needsWebViewInitThreadWorkaround()
// Restore the subviews we set aside.
_subviews = originalSubviews;
- BOOL useBackForwardList = _private->page && _private->page->backForwardList()->enabled();
+ BOOL useBackForwardList = _private->page && static_cast<BackForwardListImpl*>(_private->page->backForwardList())->enabled();
if ([encoder allowsKeyedCoding]) {
[encoder encodeObject:[[self mainFrame] name] forKey:@"FrameName"];
[encoder encodeObject:[self groupName] forKey:@"GroupName"];
@@ -3314,16 +3341,17 @@ static bool needsWebViewInitThreadWorkaround()
{
if (!_private->page)
return nil;
- if (!_private->page->backForwardList()->enabled())
+ BackForwardListImpl* list = static_cast<BackForwardListImpl*>(_private->page->backForwardList());
+ if (!list->enabled())
return nil;
- return kit(_private->page->backForwardList());
+ return kit(list);
}
- (void)setMaintainsBackForwardList:(BOOL)flag
{
if (!_private->page)
return;
- _private->page->backForwardList()->setEnabled(flag);
+ static_cast<BackForwardListImpl*>(_private->page->backForwardList())->setEnabled(flag);
}
- (BOOL)goBack
@@ -5280,6 +5308,11 @@ static WebFrameView *containingFrameView(NSView *view)
@implementation WebView (WebFileInternal)
+static inline uint64_t roundUpToPowerOf2(uint64_t num)
+{
+ return powf(2.0, ceilf(log2f(num)));
+}
+
+ (void)_setCacheModel:(WebCacheModel)cacheModel
{
if (s_didSetCacheModel && cacheModel == s_cacheModel)
@@ -5289,9 +5322,7 @@ static WebFrameView *containingFrameView(NSView *view)
if (!nsurlCacheDirectory)
nsurlCacheDirectory = NSHomeDirectory();
- // As a fudge factor, use 1000 instead of 1024, in case the reported byte
- // count doesn't align exactly to a megabyte boundary.
- uint64_t memSize = WebMemorySize() / 1024 / 1000;
+ static uint64_t memSize = roundUpToPowerOf2(WebMemorySize() / 1024 / 1024);
unsigned long long diskFreeSize = WebVolumeFreeSize(nsurlCacheDirectory) / 1024 / 1000;
NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
@@ -5311,10 +5342,10 @@ static WebFrameView *containingFrameView(NSView *view)
pageCacheCapacity = 0;
// Object cache capacities (in bytes)
- if (memSize >= 2048)
+ if (memSize >= 4096)
+ cacheTotalCapacity = 128 * 1024 * 1024;
+ else if (memSize >= 2048)
cacheTotalCapacity = 96 * 1024 * 1024;
- else if (memSize >= 1536)
- cacheTotalCapacity = 64 * 1024 * 1024;
else if (memSize >= 1024)
cacheTotalCapacity = 32 * 1024 * 1024;
else if (memSize >= 512)
@@ -5343,10 +5374,10 @@ static WebFrameView *containingFrameView(NSView *view)
pageCacheCapacity = 0;
// Object cache capacities (in bytes)
- if (memSize >= 2048)
+ if (memSize >= 4096)
+ cacheTotalCapacity = 128 * 1024 * 1024;
+ else if (memSize >= 2048)
cacheTotalCapacity = 96 * 1024 * 1024;
- else if (memSize >= 1536)
- cacheTotalCapacity = 64 * 1024 * 1024;
else if (memSize >= 1024)
cacheTotalCapacity = 32 * 1024 * 1024;
else if (memSize >= 512)
@@ -5395,10 +5426,10 @@ static WebFrameView *containingFrameView(NSView *view)
// (Testing indicates that value / MB depends heavily on content and
// browsing pattern. Even growth above 128MB can have substantial
// value / MB for some content / browsing patterns.)
- if (memSize >= 2048)
+ if (memSize >= 4096)
+ cacheTotalCapacity = 192 * 1024 * 1024;
+ else if (memSize >= 2048)
cacheTotalCapacity = 128 * 1024 * 1024;
- else if (memSize >= 1536)
- cacheTotalCapacity = 96 * 1024 * 1024;
else if (memSize >= 1024)
cacheTotalCapacity = 64 * 1024 * 1024;
else if (memSize >= 512)
diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h
index 639c3e0..8b834ca 100644
--- a/WebKit/mac/WebView/WebViewData.h
+++ b/WebKit/mac/WebView/WebViewData.h
@@ -138,7 +138,7 @@ extern int pluginDatabaseClientCount;
BOOL shouldUpdateWhileOffscreen;
- // When this flag is set, we will not make any subviews underneath this WebView. This means no WebFrameViews and no WebHTMLViews.
+ // When this flag is unset, we will not make any subviews underneath this WebView. This means no WebFrameViews and no WebHTMLViews.
BOOL usesDocumentViews;
BOOL includesFlattenedCompositingLayersWhenDrawingToBitmap;
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index 749eeb3..b951689 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -67,6 +67,7 @@ extern NSString *_WebMainFrameDocumentKey;
extern NSString *WebElementTitleKey; // NSString of the title of the element (used by Safari)
extern NSString *WebElementSpellingToolTipKey; // NSString of a tooltip representing misspelling or bad grammar (used internally)
extern NSString *WebElementIsContentEditableKey; // NSNumber indicating whether the inner non-shared node is content editable (used internally)
+extern NSString *WebElementMediaURLKey; // NSURL of the media element
// other WebElementDictionary keys
extern NSString *WebElementLinkIsLiveKey; // NSNumber of BOOL indictating whether the link is live or not
@@ -541,6 +542,9 @@ Could be worth adding to the API.
+ (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme;
+ (void)_registerURLSchemeAsSecure:(NSString *)scheme;
+- (void)_scaleWebView:(float)scale;
+- (float)_viewScaleFactor;
+
@end
@interface WebView (WebViewPrintingPrivate)
diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp
index 261631c..68fa17a 100644
--- a/WebKit/qt/Api/qwebelement.cpp
+++ b/WebKit/qt/Api/qwebelement.cpp
@@ -26,6 +26,7 @@
#include "CSSRule.h"
#include "CSSRuleList.h"
#include "CSSStyleRule.h"
+#include "CSSStyleSelector.h"
#include "Document.h"
#include "DocumentFragment.h"
#include "FrameView.h"
@@ -852,8 +853,8 @@ QString QWebElement::styleProperty(const QString &name, StyleResolveStrategy str
// by importance and inheritance order. This include external CSS
// declarations, as well as embedded and inline style declarations.
- DOMWindow* domWindow = m_element->document()->frame()->domWindow();
- if (RefPtr<CSSRuleList> rules = domWindow->getMatchedCSSRules(m_element, "")) {
+ Document* doc = m_element->document();
+ if (RefPtr<CSSRuleList> rules = doc->styleSelector()->styleRulesForElement(m_element, /*authorOnly*/ true)) {
for (int i = rules->length(); i > 0; --i) {
CSSStyleRule* rule = static_cast<CSSStyleRule*>(rules->item(i - 1));
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index e78fb07..a598a56 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -56,6 +56,7 @@ namespace WebCore {
class WidgetPrivate;
class FrameLoaderClientQt;
class ChromeClientQt;
+ class PlatformLayerProxyQt;
}
class QWebFrameData;
class QWebHitTestResultPrivate;
@@ -231,6 +232,7 @@ private:
friend class WebCore::WidgetPrivate;
friend class WebCore::FrameLoaderClientQt;
friend class WebCore::ChromeClientQt;
+ friend class WebCore::PlatformLayerProxyQt;
QWebFramePrivate *d;
};
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 79187ab..5660bd1 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -38,6 +38,7 @@ namespace WebCore {
class FrameView;
class HTMLFrameOwnerElement;
class Scrollbar;
+ class TextureMapperContentLayer;
}
class QWebPage;
@@ -72,6 +73,9 @@ public:
, allowsScrolling(true)
, marginWidth(-1)
, marginHeight(-1)
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ , rootGraphicsLayer(0)
+#endif
, zoomTextOnly(false)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
@@ -100,6 +104,9 @@ public:
bool allowsScrolling;
int marginWidth;
int marginHeight;
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ WebCore::TextureMapperContentLayer* rootGraphicsLayer;
+#endif
bool zoomTextOnly;
};
diff --git a/WebKit/qt/Api/qwebhistory.cpp b/WebKit/qt/Api/qwebhistory.cpp
index 25d77a4..a9761de 100644
--- a/WebKit/qt/Api/qwebhistory.cpp
+++ b/WebKit/qt/Api/qwebhistory.cpp
@@ -256,8 +256,8 @@ QWebHistory::~QWebHistory()
*/
void QWebHistory::clear()
{
- //shortcut to private BackForwardList
- WebCore::BackForwardList* lst = d->lst;
+ //shortcut to private BackForwardListImpl
+ WebCore::BackForwardListImpl* lst = d->lst;
//clear visited links
WebCore::Page* page = static_cast<WebCore::BackForwardListImpl*>(lst)->page();
diff --git a/WebKit/qt/Api/qwebhistory_p.h b/WebKit/qt/Api/qwebhistory_p.h
index 1df2349..44793b9 100644
--- a/WebKit/qt/Api/qwebhistory_p.h
+++ b/WebKit/qt/Api/qwebhistory_p.h
@@ -20,7 +20,7 @@
#ifndef QWEBHISTORY_P_H
#define QWEBHISTORY_P_H
-#include "BackForwardList.h"
+#include "BackForwardListImpl.h"
#include "HistoryItem.h"
#include <QtCore/qglobal.h>
#include <QtCore/qshareddata.h>
@@ -52,7 +52,7 @@ public:
class QWebHistoryPrivate : public QSharedData {
public:
- QWebHistoryPrivate(WebCore::BackForwardList* l)
+ QWebHistoryPrivate(WebCore::BackForwardListImpl* l)
{
l->ref();
lst = l;
@@ -64,7 +64,7 @@ public:
QWebPagePrivate* page();
- WebCore::BackForwardList* lst;
+ WebCore::BackForwardListImpl* lst;
};
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 454376c..40f41c5 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -33,69 +33,71 @@
#include "qwebsettings.h"
#include "qwebkitversion.h"
-#include "Chrome.h"
-#include "ContextMenuController.h"
-#include "Frame.h"
-#include "FrameTree.h"
-#include "FrameLoader.h"
-#include "FrameLoaderClientQt.h"
-#include "FrameView.h"
-#include "FormState.h"
#include "ApplicationCacheStorage.h"
+#include "BackForwardListImpl.h"
+#include "Cache.h"
+#include "Chrome.h"
#include "ChromeClientQt.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
+#include "ContextMenuController.h"
#include "DeviceMotionClientQt.h"
#include "DeviceOrientationClientQt.h"
#include "DocumentLoader.h"
#include "DragClientQt.h"
#include "DragController.h"
#include "DragData.h"
+#include "Editor.h"
#include "EditorClientQt.h"
-#include "SchemeRegistry.h"
-#include "SecurityOrigin.h"
-#include "Settings.h"
-#include "Page.h"
-#include "Pasteboard.h"
-#include "FrameLoader.h"
+#include "FocusController.h"
+#include "FormState.h"
+#include "Frame.h"
#include "FrameLoadRequest.h"
-#include "KURL.h"
-#include "Logging.h"
+#include "FrameLoader.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClientQt.h"
+#include "FrameTree.h"
+#include "FrameView.h"
+#include "GeolocationPermissionClientQt.h"
+#include "HTMLFormElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLNames.h"
+#include "HashMap.h"
+#include "HitTestResult.h"
#include "Image.h"
#include "InspectorClientQt.h"
#include "InspectorController.h"
-#include "FocusController.h"
-#include "Editor.h"
-#include "Scrollbar.h"
+#include "InspectorServerQt.h"
+#include "KURL.h"
+#include "LocalizedStrings.h"
+#include "Logging.h"
+#include "MIMETypeRegistry.h"
+#include "NavigationAction.h"
#include "NetworkingContext.h"
+#include "NotificationPresenterClientQt.h"
+#include "Page.h"
+#include "PageClientQt.h"
+#include "PageGroup.h"
+#include "Pasteboard.h"
#include "PlatformKeyboardEvent.h"
+#include "PlatformTouchEvent.h"
#include "PlatformWheelEvent.h"
#include "PluginDatabase.h"
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
#include "ProgressTracker.h"
#include "RefPtr.h"
#include "RenderTextControl.h"
+#include "SchemeRegistry.h"
+#include "Scrollbar.h"
+#include "SecurityOrigin.h"
+#include "Settings.h"
#include "TextIterator.h"
-#include "HashMap.h"
-#include "HTMLFormElement.h"
-#include "HTMLInputElement.h"
-#include "HTMLNames.h"
-#include "HitTestResult.h"
-#include "InspectorServerQt.h"
-#include "WindowFeatures.h"
#include "WebPlatformStrategies.h"
-#include "LocalizedStrings.h"
-#include "Cache.h"
-#include "runtime/InitializeThreading.h"
-#include "PageGroup.h"
-#include "GeolocationPermissionClientQt.h"
-#include "NotificationPresenterClientQt.h"
-#include "PageClientQt.h"
-#include "PlatformTouchEvent.h"
+#include "WindowFeatures.h"
#include "WorkerThread.h"
+#include "runtime/InitializeThreading.h"
#include "wtf/Threading.h"
-#include "MIMETypeRegistry.h"
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
#include <QApplication>
#include <QBasicTimer>
@@ -311,7 +313,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
settings = new QWebSettings(page->settings());
- history.d = new QWebHistoryPrivate(page->backForwardList());
+ history.d = new QWebHistoryPrivate(static_cast<WebCore::BackForwardListImpl*>(page->backForwardList()));
memset(actions, 0, sizeof(actions));
PageGroup::setShouldTrackVisitedLinks(true);
@@ -323,6 +325,11 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
QWebPagePrivate::~QWebPagePrivate()
{
+ if (inspector && inspectorIsInternalOnly) {
+ // Since we have to delete an internal inspector,
+ // call setInspector(0) directly to prevent potential crashes
+ setInspector(0);
+ }
#ifndef QT_NO_CONTEXTMENU
delete currentContextMenu;
#endif
@@ -332,6 +339,9 @@ QWebPagePrivate::~QWebPagePrivate()
delete settings;
delete page;
+ if (inspector)
+ inspector->setPage(0);
+
#if ENABLE(NOTIFICATIONS)
NotificationPresenterClientQt::notificationPresenter()->removeClient();
#endif
@@ -1008,7 +1018,6 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
{
WebCore::Frame *frame = page->focusController()->focusedOrMainFrame();
WebCore::Editor *editor = frame->editor();
- QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, 0, 0, QVariant());
if (!editor->canEdit()) {
ev->ignore();
@@ -1016,14 +1025,9 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
}
RenderObject* renderer = 0;
- RenderTextControl* renderTextControl = 0;
-
if (frame->selection()->rootEditableElement())
renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer();
- if (renderer && renderer->isTextControl())
- renderTextControl = toRenderTextControl(renderer);
-
Vector<CompositionUnderline> underlines;
bool hasSelection = false;
@@ -1048,8 +1052,21 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
break;
}
case QInputMethodEvent::Selection: {
- selection = a;
hasSelection = true;
+ // A selection in the inputMethodEvent is always reflected in the visible text
+ if (renderer && renderer->node())
+ setSelectionRange(renderer->node(), qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length)));
+
+ if (!ev->preeditString().isEmpty()) {
+ editor->setComposition(ev->preeditString(), underlines,
+ (a.length < 0) ? a.start + a.length : a.start,
+ (a.length < 0) ? a.start : a.start + a.length);
+ } else {
+ // If we are in the middle of a composition, an empty pre-edit string and a selection of zero
+ // cancels the current composition
+ if (editor->hasComposition() && (a.start + a.length == 0))
+ editor->setComposition(QString(), underlines, 0, 0);
+ }
break;
}
}
@@ -1057,22 +1074,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
if (!ev->commitString().isEmpty())
editor->confirmComposition(ev->commitString());
- else {
- // 1. empty preedit with a selection attribute, and start/end of 0 cancels composition
- // 2. empty preedit with a selection attribute, and start/end of non-0 updates selection of current preedit text
- // 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 (hasSelection) {
- QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString();
- if (preedit.isEmpty() && selection.start + selection.length > 0)
- preedit = text;
- editor->setComposition(preedit, underlines,
- (selection.length < 0) ? selection.start + selection.length : selection.start,
- (selection.length < 0) ? selection.start : selection.start + selection.length);
- } else if (!preedit.isEmpty())
- editor->setComposition(preedit, underlines, preedit.length(), 0);
- }
+ else if (!hasSelection && !ev->preeditString().isEmpty())
+ editor->setComposition(ev->preeditString(), underlines, 0, ev->preeditString().length());
ev->accept();
}
@@ -1329,9 +1332,8 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
if (renderTextControl) {
QString text = renderTextControl->text();
RefPtr<Range> range = editor->compositionRange();
- if (range) {
+ if (range)
text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get()));
- }
return QVariant(text);
}
return QVariant();
@@ -1760,14 +1762,6 @@ QWebPage::~QWebPage()
FrameLoader *loader = d->mainFrame->d->frame->loader();
if (loader)
loader->detachFromParent();
- if (d->inspector) {
- // Since we have to delete an internal inspector,
- // call setInspector(0) directly to prevent potential crashes
- if (d->inspectorIsInternalOnly)
- d->setInspector(0);
- else
- d->inspector->setPage(0);
- }
delete d;
}
@@ -1850,7 +1844,7 @@ void QWebPage::setView(QWidget* view)
}
if (view)
- d->client = new PageClientQWidget(view);
+ d->client = new PageClientQWidget(view, this);
}
/*!
@@ -2089,8 +2083,9 @@ static void openNewWindow(const QUrl& url, WebCore::Frame* frame)
{
if (Page* oldPage = frame->page()) {
WindowFeatures features;
+ NavigationAction action;
if (Page* newPage = oldPage->chrome()->createWindow(frame,
- frameLoadRequest(url, frame), features))
+ frameLoadRequest(url, frame), features, action))
newPage->chrome()->show();
}
}
@@ -2292,6 +2287,9 @@ static QSize queryDeviceSizeForScreenContainingWidget(const QWidget* widget)
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.
+
+ An invalid instance will be returned in the case an empty size is passed to the
+ method.
*/
QWebPage::ViewportAttributes QWebPage::viewportAttributesForSize(const QSize& availableSize) const
@@ -2301,6 +2299,9 @@ QWebPage::ViewportAttributes QWebPage::viewportAttributesForSize(const QSize& av
ViewportAttributes result;
+ if (availableSize.isEmpty())
+ return result; // Returns an invalid instance.
+
int deviceWidth = getintenv("QTWEBKIT_DEVICE_WIDTH");
int deviceHeight = getintenv("QTWEBKIT_DEVICE_HEIGHT");
@@ -2823,6 +2824,7 @@ bool QWebPage::event(QEvent *ev)
#endif
case QEvent::InputMethod:
d->inputMethodEvent(static_cast<QInputMethodEvent*>(ev));
+ break;
case QEvent::ShortcutOverride:
d->shortcutOverrideEvent(static_cast<QKeyEvent*>(ev));
break;
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index c1bf664..98d6d45 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,296 @@
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] QWebPage's InputMethod event handling calls ShortcutOverride handler too
+ https://bugs.webkit.org/show_bug.cgi?id=48692
+
+ * Api/qwebpage.cpp:
+ (QWebPage::event): Add missing break statement.
+
+2010-10-29 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove RenderTextControl::setSelectionRange
+ https://bugs.webkit.org/show_bug.cgi?id=47870
+
+ Converted RenderTextControll::setSelectionRange to a global function.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::inputMethodEvent): Calls setSelectionRange.
+
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::clear):
+ * Api/qwebhistory_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ Use BackForwardListImpl.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidBecomeFrameset):
+
+2010-10-29 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix tst_QWebFrame on XVFB.
+ https://bugs.webkit.org/show_bug.cgi?id=48637
+
+ These tests relied on a window manager to activate the window.
+
+ Fixes:
+ - tst_QWebFrame::popupFocus()
+ - tst_QwebFrame::inputFieldFocus()
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-10-28 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Build fix,
+
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PlatformLayerProxyQGraphicsObject::PlatformLayerProxyQGraphicsObject):
+ (WebCore::PageClientQGraphicsWidget::~PageClientQGraphicsWidget):
+ (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):
+ * WebCoreSupport/PageClientQt.h:
+
+2010-10-28 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] QWebElement: Don't retrieve CSS rules through DOMWindow.
+ https://bugs.webkit.org/show_bug.cgi?id=48519
+
+ JavaScript is prevented from retrieving cross-domain CSS rules since r70335.
+ This patch allow QWebElement to retrive style without this limitation
+ by asking the Document directly instead of going through DOMWindow.
+
+ Fixes:
+ - tst_QWebFrame::setHtmlWithResource()
+ - tst_QWebElement::style()
+
+ * Api/qwebelement.cpp:
+ (QWebElement::styleProperty):
+
+2010-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ Make Qt viewportAttributesForSize not assert on (0, 0) size
+ https://bugs.webkit.org/show_bug.cgi?id=48524
+
+ We now return an invalid (isValid() == false) ViewportAttributes
+ instance when the supplied size is (0, 0).
+
+ * Api/qwebpage.cpp:
+ (QWebPage::viewportAttributesForSize):
+
+2010-10-27 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix tst_QWebFrame::popupFocus().
+ https://bugs.webkit.org/show_bug.cgi?id=48432
+
+ - Call setFocus() before show() to work around a but in Qt.
+ - Remove the check on combo at the end since hidePopup() leads
+ indirectly to its destruction and segfault.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::transferLoadingResourceFromPage):
+ Emtpy method.
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-10-26 Yi Shen <yi.4.shen@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Skipping popup focus test for symbian
+ https://bugs.webkit.org/show_bug.cgi?id=48324
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2010-10-26 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Unit tests: setHtml("data:text/html,...") -> load(QUrl("data:text/html,..."))
+ https://bugs.webkit.org/show_bug.cgi?id=48319
+
+ These tests were failing since the new HTML parser.
+ This patch removes the content type from the error page as well.
+
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::crashOnViewlessWebPages):
+ * tests/qwebelement/tst_qwebelement.cpp:
+ (tst_QWebElement::frame):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::loadFinished):
+ (ErrorPage::extension):
+ (tst_QWebPage::errorPageExtension):
+ (tst_QWebPage::errorPageExtensionInIFrames):
+ (tst_QWebPage::errorPageExtensionInFrameset):
+
+2010-10-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Texmap] [Qt] Texture mapper initial implementation
+ https://bugs.webkit.org/show_bug.cgi?id=47070
+
+ Glue layer (WebCoreSupport) changes to allow connecting TextureMapper to a Qt PageClient, i.e.
+ a QWebView or a QGraphicsWebView. This enables the new type, TextureMapperPlatformLayer, to be recognized both by
+ the compositor and by the page client.
+ Note that this is temporarily an opt-in, under USE(TEXTURE_MAPPER)
+
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ * Api/qwebpage.cpp:
+ (QWebPage::setView):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::attachRootGraphicsLayer):
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PlatformLayerProxyQt::PlatformLayerProxyQt):
+ (WebCore::PlatformLayerProxyQt::~PlatformLayerProxyQt):
+ (WebCore::PlatformLayerProxyQt::setSizeChanged):
+ (WebCore::PlatformLayerProxyQWidget::PlatformLayerProxyQWidget):
+ (WebCore::PlatformLayerProxyQWidget::eventFilter):
+ (WebCore::PlatformLayerProxyQWidget::setNeedsDisplay):
+ (WebCore::PlatformLayerProxyQWidget::setNeedsDisplayInRect):
+ (WebCore::PlatformLayerProxyQGraphicsObject::PlatformLayerProxyQGraphicsWidget):
+ (WebCore::PlatformLayerProxyQGraphicsObject::setNeedsDisplay):
+ (WebCore::PlatformLayerProxyQGraphicsObject::setNeedsDisplayInRect):
+ (WebCore::PageClientQWidget::setRootGraphicsLayer):
+ (WebCore::PageClientQWidget::markForSync):
+ (WebCore::PageClientQWidget::syncLayers):
+ (WebCore::PageClientQGraphicsWidget::updateCompositingScrollPosition):
+ (WebCore::PageClientQGraphicsWidget::createOrDeleteOverlay):
+ (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):
+ * WebCoreSupport/PageClientQt.h:
+ (WebCore::PageClientQWidget::PageClientQWidget):
+ (WebCore::PageClientQWidget::allowsAcceleratedCompositing):
+ (WebCore::PageClientQGraphicsWidget::PageClientQGraphicsWidget):
+
+2010-10-25 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Dump the gesture status of frame in frame load callbacks in DumpRenderTree
+ by adding a new method dumpUserGestureInFrameLoadCallbacks.
+ Now only dump the gesture status in "DidStartProvisionalLoad" callback.
+ https://bugs.webkit.org/show_bug.cgi?id=47849
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (drtPrintFrameUserGestureStatus):
+ (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents):
+ (WebCore::FrameLoaderClientQt::dispatchDidPushStateWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchDidReplaceStateWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchDidPopStateWithinPage):
+ (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * Api/qwebpage.cpp:
+ (openNewWindow):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createWindow):
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchCreatePage):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+ Add NavigationAction parameter.
+
+2010-10-22 Yi Shen <yi.4.shen@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] InspectorClientQt crashes when deleting a qwebpage which has an inspector
+ https://bugs.webkit.org/show_bug.cgi?id=48079
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPage::~QWebPage):
+
+2010-10-22 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] All widgets are rendered incorrectly when rendered through a cache
+ https://bugs.webkit.org/show_bug.cgi?id=47767
+
+ Add a new test for rendering with tiling.
+
+ * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+ (tst_QGraphicsWebView::widgetsRenderingThroughCache):
+
+2010-10-21 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Sending a QInputMethodEvent::Selection event forces the
+ Editor to go into Composition mode
+
+ Improve QWebPage handling of input method events:
+ - Selections don't trigger entering composition mode.
+ - Handle multiple selections
+
+ Also remove redundant cancellation of composition in tst_qwebpage.
+ There is no composition in progress at that point.
+
+ Finally, move infiniteLoopJS() to the end of the tst_qwebpage unit
+ tests - so you don't have to wait for it to complete when running
+ other tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39625
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::inputMethodEvent):
+ (QWebPage::inputMethodQuery):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::inputMethods):
+
2010-10-20 Luiz Agostini <luiz.agostini@openbossa.org>
Reviewed by Antonio Gomes.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 3bcc8f8..f0d3903 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -39,11 +39,12 @@
#include "FrameView.h"
#include "Geolocation.h"
#if USE(ACCELERATED_COMPOSITING)
-#include "GraphicsLayerQt.h"
+#include "GraphicsLayer.h"
#endif
#include "GeolocationPermissionClientQt.h"
#include "HitTestResult.h"
#include "Icon.h"
+#include "NavigationAction.h"
#include "NetworkingContext.h"
#include "NotImplemented.h"
#include "NotificationPresenterClientQt.h"
@@ -169,7 +170,7 @@ void ChromeClientQt::focusedNodeChanged(WebCore::Node*)
}
-Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
+Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&)
{
QWebPage* newPage = m_webPage->createWindow(features.dialog ? QWebPage::WebModalDialog : QWebPage::WebBrowserWindow);
if (!newPage)
@@ -590,7 +591,7 @@ void ChromeClientQt::cancelGeolocationPermissionRequestForFrame(Frame* frame, Ge
void ChromeClientQt::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
{
if (platformPageClient())
- platformPageClient()->setRootGraphicsLayer(graphicsLayer ? graphicsLayer->nativeLayer() : 0);
+ platformPageClient()->setRootGraphicsLayer(graphicsLayer ? graphicsLayer->platformLayer() : 0);
}
void ChromeClientQt::setNeedsOneShotDrawingSynchronization()
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 0a449f6..bbd2452 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -73,7 +73,7 @@ namespace WebCore {
virtual void focusedNodeChanged(Node*);
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&);
virtual void show();
virtual bool canRunModal();
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index 28f6810..4309e5c 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -561,6 +561,11 @@ void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
FrameLoaderClientQt::dumpFrameLoaderCallbacks = b;
}
+void DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(bool b)
+{
+ FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = b;
+}
+
void DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(bool b)
{
FrameLoaderClientQt::dumpResourceLoadCallbacks = b;
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 0e76f04..356b226 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -101,6 +101,7 @@ public:
static QString plainText(const QVariant& rng);
static void dumpFrameLoader(bool b);
+ static void dumpUserGestureInFrameLoader(bool b);
static void dumpResourceLoadCallbacks(bool b);
static void dumpResourceResponseMIMETypes(bool b);
static void dumpResourceLoadCallbacksPath(const QString& path);
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 4ebc7e1..1b57138 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -106,6 +106,13 @@ static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
}
}
+static QString drtPrintFrameUserGestureStatus(WebCore::Frame* frame)
+{
+ if (frame->loader()->isProcessingUserGesture())
+ return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("true"));
+ return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("false"));
+}
+
static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url)
{
if (_url.isEmpty() || !_url.isLocalFile())
@@ -159,6 +166,7 @@ namespace WebCore
{
bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false;
+bool FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = false;
bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false;
bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false;
bool FrameLoaderClientQt::sendRequestReturnsNull = false;
@@ -274,6 +282,9 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
vScrollbar, vLock);
}
+void FrameLoaderClientQt::dispatchDidBecomeFrameset(bool)
+{
+}
void FrameLoaderClientQt::makeRepresentation(DocumentLoader*)
{
@@ -314,7 +325,6 @@ void FrameLoaderClientQt::dispatchDidHandleOnloadEvents()
// don't need this one
if (dumpFrameLoaderCallbacks)
printf("%s - didHandleOnloadEventsForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
-
}
@@ -373,7 +383,7 @@ void FrameLoaderClientQt::dispatchDidPushStateWithinPage()
{
if (dumpFrameLoaderCallbacks)
printf("%s - dispatchDidPushStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
-
+
notImplemented();
}
@@ -381,7 +391,7 @@ void FrameLoaderClientQt::dispatchDidReplaceStateWithinPage()
{
if (dumpFrameLoaderCallbacks)
printf("%s - dispatchDidReplaceStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
-
+
notImplemented();
}
@@ -389,7 +399,7 @@ void FrameLoaderClientQt::dispatchDidPopStateWithinPage()
{
if (dumpFrameLoaderCallbacks)
printf("%s - dispatchDidPopStateWithinPage\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
-
+
notImplemented();
}
@@ -403,6 +413,9 @@ void FrameLoaderClientQt::dispatchDidStartProvisionalLoad()
if (dumpFrameLoaderCallbacks)
printf("%s - didStartProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+ if (dumpUserGestureInFrameLoaderCallbacks)
+ printf("%s - in didStartProvisionalLoadForFrame\n", qPrintable(drtPrintFrameUserGestureStatus(m_frame)));
+
if (m_webFrame)
emit m_webFrame->provisionalLoad();
}
@@ -1102,7 +1115,7 @@ void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& erro
callErrorPageExtension(error);
}
-WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage()
+WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage(const WebCore::NavigationAction&)
{
if (!m_webFrame)
return 0;
@@ -1262,6 +1275,10 @@ void FrameLoaderClientQt::didTransferChildFrameToNewDocument(Page*)
}
}
+void FrameLoaderClientQt::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
+}
+
ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& _mimeType)
{
// qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<_mimeType;
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index ec6a3b6..275b0e8 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -120,7 +120,7 @@ public:
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual WebCore::Frame* dispatchCreatePage();
+ virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WTF::String&, const WebCore::ResourceRequest&);
@@ -193,12 +193,15 @@ public:
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual bool canCachePage() const;
virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, 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);
@@ -233,6 +236,7 @@ public:
virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext();
static bool dumpFrameLoaderCallbacks;
+ static bool dumpUserGestureInFrameLoaderCallbacks;
static bool dumpResourceLoadCallbacks;
static bool dumpResourceResponseMIMETypes;
static QString dumpResourceLoadCallbacksPath;
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 9aa01a2..4d42c39 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -21,13 +21,127 @@
#include "config.h"
#include "PageClientQt.h"
+#include "texmap/TextureMapperPlatformLayer.h"
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
+#ifdef QT_OPENGL_LIB
+#include <QGLWidget>
+#endif
namespace WebCore {
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+class PlatformLayerProxyQt : public QObject, public virtual TextureMapperLayerClient {
+public:
+ PlatformLayerProxyQt(QWebFrame* frame, TextureMapperContentLayer* layer, QObject* object)
+ : QObject(object)
+ , m_frame(frame)
+ , m_layer(layer)
+ {
+ if (m_layer)
+ m_layer->setPlatformLayerClient(this);
+ m_frame->d->rootGraphicsLayer = m_layer;
+ }
+
+ virtual ~PlatformLayerProxyQt()
+ {
+ if (m_layer)
+ m_layer->setPlatformLayerClient(0);
+ if (m_frame->d)
+ m_frame->d->rootGraphicsLayer = 0;
+ }
+
+ // Since we just paint the composited tree and never create a special item for it, we don't have to handle its size changes.
+ void setSizeChanged(const IntSize&) { }
+
+private:
+ QWebFrame* m_frame;
+ TextureMapperContentLayer* m_layer;
+};
+
+class PlatformLayerProxyQWidget : public PlatformLayerProxyQt {
+public:
+ PlatformLayerProxyQWidget(QWebFrame* frame, TextureMapperContentLayer* layer, QWidget* widget)
+ : PlatformLayerProxyQt(frame, layer, widget)
+ , m_widget(widget)
+ {
+ if (m_widget)
+ m_widget->installEventFilter(this);
+ }
+
+ // We don't want a huge region-clip on the compositing layers; instead we unite the rectangles together
+ // and clear them when the paint actually occurs.
+ bool eventFilter(QObject* object, QEvent* event)
+ {
+ if (object == m_widget && event->type() == QEvent::Paint)
+ m_dirtyRect = QRect();
+ return QObject::eventFilter(object, event);
+ }
+
+ void setNeedsDisplay()
+ {
+ if (m_widget)
+ m_widget->update();
+ }
+
+ void setNeedsDisplayInRect(const IntRect& rect)
+ {
+ m_dirtyRect |= rect;
+ m_widget->update(m_dirtyRect);
+ }
+
+private:
+ QRect m_dirtyRect;
+ QWidget* m_widget;
+};
+
+class PlatformLayerProxyQGraphicsObject : public PlatformLayerProxyQt {
+public:
+ PlatformLayerProxyQGraphicsObject(QWebFrame* frame, TextureMapperContentLayer* layer, QGraphicsObject* object)
+ : PlatformLayerProxyQt(frame, layer, object)
+ , m_graphicsItem(object)
+ {
+ }
+
+ void setNeedsDisplay()
+ {
+ if (m_graphicsItem)
+ m_graphicsItem->update();
+ }
+
+ void setNeedsDisplayInRect(const IntRect& rect)
+ {
+ if (m_graphicsItem)
+ m_graphicsItem->update(QRectF(rect));
+ }
+
+private:
+ QGraphicsItem* m_graphicsItem;
+};
+
+void PageClientQWidget::setRootGraphicsLayer(TextureMapperPlatformLayer* layer)
+{
+ if (layer) {
+ platformLayerProxy = new PlatformLayerProxyQWidget(page->mainFrame(), static_cast<TextureMapperContentLayer*>(layer), view);
+ return;
+ }
+ delete platformLayerProxy;
+ platformLayerProxy = 0;
+}
+
+void PageClientQWidget::markForSync(bool scheduleSync)
+{
+ syncTimer.startOneShot(0);
+}
+
+void PageClientQWidget::syncLayers(Timer<PageClientQWidget>*)
+{
+ QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
+}
+#endif
+
void PageClientQWidget::scroll(int dx, int dy, const QRect& rectToScroll)
{
view->scroll(qreal(dx), qreal(dy), rectToScroll);
@@ -53,6 +167,13 @@ void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints)
view->setInputMethodHints(hints);
}
+PageClientQWidget::~PageClientQWidget()
+{
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ delete platformLayerProxy;
+#endif
+}
+
#ifndef QT_NO_CURSOR
QCursor PageClientQWidget::cursor() const
{
@@ -107,12 +228,16 @@ PageClientQGraphicsWidget::~PageClientQGraphicsWidget()
{
delete overlay;
#if USE(ACCELERATED_COMPOSITING)
+#if USE(TEXTURE_MAPPER)
+ delete platformLayerProxy;
+#else
if (!rootGraphicsLayer)
return;
// we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp.
rootGraphicsLayer.data()->setParentItem(0);
view->scene()->removeItem(rootGraphicsLayer.data());
#endif
+#endif
}
void PageClientQGraphicsWidget::scroll(int dx, int dy, const QRect& rectToScroll)
@@ -134,6 +259,8 @@ void PageClientQGraphicsWidget::update(const QRect& dirtyRect)
void PageClientQGraphicsWidget::createOrDeleteOverlay()
{
+ // We don't use an overlay with TextureMapper. Instead, the overlay is drawn inside QWebFrame.
+#if !USE(TEXTURE_MAPPER)
bool useOverlay = false;
if (!viewResizesToContents) {
#if USE(ACCELERATED_COMPOSITING)
@@ -154,6 +281,7 @@ void PageClientQGraphicsWidget::createOrDeleteOverlay()
overlay->deleteLater();
overlay = 0;
}
+#endif // !USE(TEXTURE_MAPPER)
}
#if USE(ACCELERATED_COMPOSITING)
@@ -165,7 +293,18 @@ void PageClientQGraphicsWidget::syncLayers()
}
}
-void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsItem* layer)
+#if USE(TEXTURE_MAPPER)
+void PageClientQGraphicsWidget::setRootGraphicsLayer(TextureMapperPlatformLayer* layer)
+{
+ if (layer) {
+ platformLayerProxy = new PlatformLayerProxyQGraphicsObject(page->mainFrame(), static_cast<TextureMapperContentLayer*>(layer), view);
+ return;
+ }
+ delete platformLayerProxy;
+ platformLayerProxy = 0;
+}
+#else
+void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsObject* layer)
{
if (rootGraphicsLayer) {
rootGraphicsLayer.data()->setParentItem(0);
@@ -173,7 +312,7 @@ void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsItem* layer)
QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
}
- rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0;
+ rootGraphicsLayer = layer;
if (layer) {
layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
@@ -182,6 +321,7 @@ void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsItem* layer)
}
createOrDeleteOverlay();
}
+#endif
void PageClientQGraphicsWidget::markForSync(bool scheduleSync)
{
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 7014fd2..924d2a7 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -41,15 +41,25 @@
#include <Settings.h>
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+#include "texmap/TextureMapperPlatformLayer.h"
+#endif
+
namespace WebCore {
class PageClientQWidget : public QWebPageClient {
public:
- PageClientQWidget(QWidget* view)
- : view(view)
+ PageClientQWidget(QWidget* newView, QWebPage* newPage)
+ : view(newView)
+ , page(newPage)
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ , syncTimer(this, &PageClientQWidget::syncLayers)
+ , platformLayerProxy(0)
+#endif
{
Q_ASSERT(view);
}
+ virtual ~PageClientQWidget();
virtual bool isQWidgetClient() const { return true; }
@@ -78,6 +88,21 @@ public:
virtual QRectF windowRect() const;
QWidget* view;
+ QWebPage* page;
+
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ virtual void setRootGraphicsLayer(TextureMapperPlatformLayer* layer);
+ virtual void markForSync(bool scheduleSync);
+ void syncLayers(Timer<PageClientQWidget>*);
+#endif
+
+ // QGraphicsWebView can render composited layers
+ virtual bool allowsAcceleratedCompositing() const { return true; }
+
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+ Timer<PageClientQWidget> syncTimer;
+ PlatformLayerProxyQt* platformLayerProxy;
+#endif
};
// the overlay is here for one reason only: to have the scroll-bars and other
@@ -116,11 +141,14 @@ class QGraphicsItemOverlay : public QGraphicsObject {
class PageClientQGraphicsWidget : public QWebPageClient {
public:
- PageClientQGraphicsWidget(QGraphicsWebView* v, QWebPage* p)
- : view(v)
- , page(p)
+ PageClientQGraphicsWidget(QGraphicsWebView* newView, QWebPage* newPage)
+ : view(newView)
+ , page(newPage)
, viewResizesToContents(false)
#if USE(ACCELERATED_COMPOSITING)
+#if USE(TEXTURE_MAPPER)
+ , platformLayerProxy(0)
+#endif
, shouldSync(false)
#endif
, overlay(0)
@@ -168,7 +196,7 @@ public:
#endif
#if USE(ACCELERATED_COMPOSITING)
- virtual void setRootGraphicsLayer(QGraphicsItem* layer);
+ virtual void setRootGraphicsLayer(PlatformLayer* layer);
virtual void markForSync(bool scheduleSync);
void syncLayers();
@@ -183,8 +211,11 @@ public:
bool viewResizesToContents;
#if USE(ACCELERATED_COMPOSITING)
+#if USE(TEXTURE_MAPPER)
+ PlatformLayerProxyQt* platformLayerProxy;
+#else
QWeakPointer<QGraphicsObject> rootGraphicsLayer;
-
+#endif
// we have to flush quite often, so we use a meta-method instead of QTimer::singleShot for putting the event in the queue
QMetaMethod syncMetaMethod;
diff --git a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index a04ff17..09a21e1 100644
--- a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -35,6 +35,7 @@ private slots:
void microFocusCoordinates();
void focusInputTypes();
void crashOnSetScaleBeforeSetUrl();
+ void widgetsRenderingThroughCache();
};
void tst_QGraphicsWebView::qgraphicswebview()
@@ -123,11 +124,11 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
// page, so we first connect the signal afterward.
connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), page, SLOT(aborting()));
- page->mainFrame()->setHtml(QString("data:text/html,"
- "<frameset cols=\"25%,75%\">"
- "<frame src=\"data:text/html,foo \">"
- "<frame src=\"data:text/html,bar\">"
- "</frameset>"));
+ page->mainFrame()->load(QUrl("data:text/html,"
+ "<frameset cols=\"25%,75%\">"
+ "<frame src=\"data:text/html,foo \">"
+ "<frame src=\"data:text/html,bar\">"
+ "</frameset>"));
QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
delete page;
@@ -140,6 +141,41 @@ void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl()
delete webView;
}
+void tst_QGraphicsWebView::widgetsRenderingThroughCache()
+{
+ // Widgets should be rendered the same way with and without
+ // intermediate cache (tiling for example).
+ // See bug https://bugs.webkit.org/show_bug.cgi?id=47767 where
+ // widget are rendered as disabled when caching is using.
+
+ QGraphicsWebView* webView = new QGraphicsWebView;
+ webView->setHtml(QLatin1String("<body style=\"background-color: white\"><input type=range></input><input type=checkbox></input><input type=radio></input><input type=file></input></body>"));
+
+ QGraphicsView view;
+ view.show();
+ QGraphicsScene* scene = new QGraphicsScene(&view);
+ view.setScene(scene);
+ scene->addItem(webView);
+ view.setGeometry(QRect(0, 0, 500, 500));
+ QWidget *const widget = &view;
+ QTest::qWaitForWindowShown(widget);
+
+ // 1. Reference without tiling.
+ webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, false);
+ QPixmap referencePixmap(view.size());
+ widget->render(&referencePixmap);
+
+ // 2. With tiling.
+ webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true);
+ QPixmap viewWithTiling(view.size());
+ widget->render(&viewWithTiling);
+ QApplication::processEvents();
+ viewWithTiling.fill();
+ widget->render(&viewWithTiling);
+
+ QCOMPARE(referencePixmap.toImage(), viewWithTiling.toImage());
+}
+
void tst_QGraphicsWebView::microFocusCoordinates()
{
QWebPage* page = new QWebPage;
diff --git a/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
index 2f1097a..9bd255f 100644
--- a/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -430,9 +430,9 @@ void tst_QWebElement::frame()
QWebElement doc = m_mainFrame->documentElement();
QVERIFY(doc.webFrame() == m_mainFrame);
- m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
- "<p>frame1\">"
- "<frame src=\"data:text/html,<p>frame2\"></frameset>"), QUrl());
+ m_mainFrame->load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "<p>frame1\">"
+ "<frame src=\"data:text/html,<p>frame2\"></frameset>"));
waitForSignal(m_page, SIGNAL(loadFinished(bool)));
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index ec8a39e..d74b631 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -602,8 +602,8 @@ private slots:
void setHtmlWithJSAlert();
void ipv6HostEncoding();
void metaData();
-#if !defined(Q_WS_MAEMO_5)
- // as maemo 5 does not use QComboBoxes to implement the popups
+#if !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN)
+ // as maemo 5 && symbian do not use QComboBoxes to implement the popups
// this test does not make sense for it.
void popupFocus();
#endif
@@ -2585,7 +2585,7 @@ void tst_QWebFrame::metaData()
QCOMPARE(metaData.value("nonexistant"), QString());
}
-#if !defined(Q_WS_MAEMO_5)
+#if !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN)
void tst_QWebFrame::popupFocus()
{
QWebView view;
@@ -2603,9 +2603,11 @@ void tst_QWebFrame::popupFocus()
" </body>"
"</html>");
view.resize(400, 100);
+ // Call setFocus before show to work around http://bugreports.qt.nokia.com/browse/QTBUG-14762
+ view.setFocus();
view.show();
QTest::qWaitForWindowShown(&view);
- view.setFocus();
+ view.activateWindow();
QTRY_VERIFY(view.hasFocus());
// open the popup by clicking. check if focus is on the popup
@@ -2618,7 +2620,7 @@ void tst_QWebFrame::popupFocus()
// hide the popup and check if focus is on the page
combo->hidePopup();
- QTRY_VERIFY(view.hasFocus() && !combo->view()->hasFocus()); // Focus should be back on the WebView
+ QTRY_VERIFY(view.hasFocus()); // Focus should be back on the WebView
}
#endif
@@ -2629,6 +2631,7 @@ void tst_QWebFrame::inputFieldFocus()
view.resize(400, 100);
view.show();
QTest::qWaitForWindowShown(&view);
+ view.activateWindow();
view.setFocus();
QTRY_VERIFY(view.hasFocus());
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 0462953..e6b5909 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -77,7 +77,6 @@ private slots:
void cleanupTestCase();
void acceptNavigationRequest();
- void infiniteLoopJS();
void geolocationRequestJS();
void loadFinished();
void acceptNavigationRequestWithNewWindow();
@@ -128,6 +127,7 @@ private slots:
void testStopScheduledPageRefresh();
void findText();
void supportedContentType();
+ void infiniteLoopJS();
private:
QWebView* m_view;
@@ -285,9 +285,9 @@ void tst_QWebPage::loadFinished()
QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted()));
QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
- m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
- "<head><meta http-equiv='refresh' content='1'></head>foo \">"
- "<frame src=\"data:text/html,bar\"></frameset>"), QUrl());
+ m_view->page()->mainFrame()->load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "<head><meta http-equiv='refresh' content='1'></head>foo \">"
+ "<frame src=\"data:text/html,bar\"></frameset>"));
QTRY_COMPARE(spyLoadFinished.count(), 1);
QTRY_VERIFY(spyLoadStarted.count() > 1);
@@ -295,8 +295,8 @@ void tst_QWebPage::loadFinished()
spyLoadFinished.clear();
- m_view->setHtml(QString("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
- "foo \"><frame src=\"data:text/html,bar\"></frameset>"), QUrl());
+ m_view->page()->mainFrame()->load(QUrl("data:text/html,<frameset cols=\"25%,75%\"><frame src=\"data:text/html,"
+ "foo \"><frame src=\"data:text/html,bar\"></frameset>"));
QTRY_COMPARE(spyLoadFinished.count(), 1);
QCOMPARE(spyLoadFinished.count(), 1);
}
@@ -1516,11 +1516,6 @@ void tst_QWebPage::inputMethods()
QString selectionValue = variant.value<QString>();
QCOMPARE(selectionValue, QString("eb"));
- //Cancel current composition first
- inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 0, 0, QVariant());
- QInputMethodEvent eventSelection2("",inputAttributes);
- page->event(&eventSelection2);
-
//Set selection with negative length
inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 6, -5, QVariant());
QInputMethodEvent eventSelection3("",inputAttributes);
@@ -1887,7 +1882,8 @@ public:
{
ErrorPageExtensionReturn* errorPage = static_cast<ErrorPageExtensionReturn*>(output);
- errorPage->content = "data:text/html,error";
+ errorPage->contentType = "text/html";
+ errorPage->content = "error";
return true;
}
};
@@ -1904,7 +1900,7 @@ void tst_QWebPage::errorPageExtension()
page->mainFrame()->setUrl(QUrl("http://non.existent/url"));
QTRY_COMPARE(spyLoadFinished.count(), 2);
- QCOMPARE(page->mainFrame()->toPlainText(), QString("data:text/html,error"));
+ QCOMPARE(page->mainFrame()->toPlainText(), QString("error"));
QCOMPARE(page->history()->count(), 2);
QCOMPARE(page->history()->currentItem().url(), QUrl("http://non.existent/url"));
QCOMPARE(page->history()->canGoBack(), true);
@@ -1931,14 +1927,15 @@ void tst_QWebPage::errorPageExtensionInIFrames()
ErrorPage* page = new ErrorPage;
m_view->setPage(page);
- m_view->setHtml(QString("data:text/html,"
- "<h1>h1</h1>"
- "<iframe src='data:text/html,<p/>p'></iframe>"
- "<iframe src='non-existent.html'></iframe>"));
+ m_view->page()->mainFrame()->load(QUrl(
+ "data:text/html,"
+ "<h1>h1</h1>"
+ "<iframe src='data:text/html,<p/>p'></iframe>"
+ "<iframe src='http://non.existent/url'></iframe>"));
QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
QTRY_COMPARE(spyLoadFinished.count(), 1);
- QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("data:text/html,error"));
+ QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("error"));
m_view->setPage(0);
}
@@ -1952,7 +1949,7 @@ void tst_QWebPage::errorPageExtensionInFrameset()
QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool)));
QTRY_COMPARE(spyLoadFinished.count(), 1);
- QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("data:text/html,error"));
+ QCOMPARE(page->mainFrame()->childFrames()[1]->toPlainText(), QString("error"));
m_view->setPage(0);
}
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 0f4c32c..fb8f19e 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,151 @@
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * WebBackForwardList.cpp:
+ (backForwardListWrappers):
+ (WebBackForwardList::WebBackForwardList):
+ (WebBackForwardList::createInstance):
+ * WebBackForwardList.h:
+ * WebView.cpp:
+ (WebView::backForwardList):
+ Use BackForwardListImpl.
+
+2010-10-29 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * WebKitPrefix.h: Touched to force a rebuild.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::dispatchDidBecomeFrameset):
+
+2010-10-26 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed build fix.
+
+ * WebView.cpp: Conditionalize includes for CFNetwork-specific
+ Cookie implementation.
+ * WebView.h: Conditionalize includes for ACCELERATED_COMPOSITION.
+ WinCairo doesn't use CoreAnimation.
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::transferLoadingResourceFromPage):
+ Empty method.
+ * WebCoreSupport/WebFrameLoaderClient.h:
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Replace _countof with WTF_ARRAY_LENGTH
+ https://bugs.webkit.org/show_bug.cgi?id=48229
+
+ * WebCoreSupport/WebContextMenuClient.cpp:
+ (isPreInspectElementTagSafari):
+ * WebView.cpp:
+ (WebView::interpretKeyEvent):
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Build fix.
+
+ * Interfaces/WebKit.idl: Touched.
+
+2010-10-24 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Expose HitTestResult::absoluteMediaURL() via WebKit API
+ https://bugs.webkit.org/show_bug.cgi?id=48219
+
+ * Interfaces/IWebView.idl: Added WebElementMediaURLKey.
+ * WebElementPropertyBag.cpp:
+ (WebElementPropertyBag::Read): Map WebElementMediaURLKey to absoluteMediaURL().
+
+2010-10-22 Andy Estes <aestes@apple.com>
+
+ Fix the Windows build.
+
+ * WebCookieManagerCFNet.cpp: Rename CookieStorageWin.h to CookieStorageCFNet.h.
+ * WebView.cpp: Ditto.
+
+2010-10-22 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ Windows client needs updating when live iframe element is moved between pages
+ https://bugs.webkit.org/show_bug.cgi?id=46915
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::didTransferChildFrameToNewDocument):
+ Update WebView in WebFrame to match that of the current page.
+ * WebFrame.cpp:
+ (WebFrame::setWebView):
+ Added.
+ * WebFrame.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Fix windows build.
+
+ * WebCoreSupport/WebChromeClient.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::createWindow):
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::dispatchCreatePage):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+ Add NavigationAction parameter.
+
+2010-10-21 MORITA Hajime <morrita@google.com>
+
+ Unreviewed, touched it to fix the build.
+
+ * Interfaces/WebKit.idl:
+
+2010-10-21 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ [Win][DRT] should have LayoutTestController.hasSpellingMarker()
+ https://bugs.webkit.org/show_bug.cgi?id=47885
+
+ Added IWebFramePrivate::hasSpellingMarker() and impelmented it for
+ LayoutTestController.
+
+ * Interfaces/IWebFramePrivate.idl:
+ * WebFrame.cpp:
+ (WebFrame::hasSpellingMarker):
+ * WebFrame.h:
+
2010-10-20 Dumitru Daniliuc <dumi@chromium.org>
Reviewed by David Levin.
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index 190681c..279cbbf 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -117,4 +117,6 @@ interface IWebFramePrivate : IUnknown
HRESULT resumeAnimations();
HRESULT loadPlainTextString([in] BSTR string, [in] BSTR url);
+
+ HRESULT hasSpellingMarker([in] UINT from, [in] UINT length, [out, retval] BOOL* result);
}
diff --git a/WebKit/win/Interfaces/IWebView.idl b/WebKit/win/Interfaces/IWebView.idl
index e3ec98a..6c414f8 100644
--- a/WebKit/win/Interfaces/IWebView.idl
+++ b/WebKit/win/Interfaces/IWebView.idl
@@ -82,6 +82,7 @@ const LPCOLESTR WebElementImageKey = L"WebElementImageKey";
const LPCOLESTR WebElementImageRectKey = L"WebElementImageRectKey";
const LPCOLESTR WebElementImageURLKey = L"WebElementImageURLKey";
const LPCOLESTR WebElementIsSelectedKey = L"WebElementIsSelectedKey";
+const LPCOLESTR WebElementMediaURLKey = L"WebElementMediaURLKey";
const LPCOLESTR WebElementSpellingToolTipKey = L"WebElementSpellingToolTipKey";
const LPCOLESTR WebElementTitleKey = L"WebElementTitleKey";
const LPCOLESTR WebElementLinkURLKey = L"WebElementLinkURLKey";
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index 470b052..e936af6 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -22,7 +22,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.
*/
-
+
cpp_quote("/*")
cpp_quote(" * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.")
cpp_quote(" *")
@@ -300,4 +300,3 @@ library WebKit
[default] interface IWebUserContentURLPattern;
}
}
-
diff --git a/WebKit/win/WebBackForwardList.cpp b/WebKit/win/WebBackForwardList.cpp
index e8c2930..2faaf7e 100644
--- a/WebKit/win/WebBackForwardList.cpp
+++ b/WebKit/win/WebBackForwardList.cpp
@@ -32,7 +32,7 @@
#include "WebKit.h"
#include "WebPreferences.h"
-#include <WebCore/BackForwardList.h>
+#include <WebCore/BackForwardListImpl.h>
#include <WebCore/HistoryItem.h>
using std::min;
@@ -40,13 +40,15 @@ using namespace WebCore;
// WebBackForwardList ----------------------------------------------------------------
-static HashMap<BackForwardList*, WebBackForwardList*>& backForwardListWrappers()
+// FIXME: Instead of this we could just create a class derived from BackForwardListImpl
+// with a pointer to a WebBackForwardList in it.
+static HashMap<BackForwardListImpl*, WebBackForwardList*>& backForwardListWrappers()
{
- static HashMap<BackForwardList*, WebBackForwardList*> staticBackForwardListWrappers;
+ static HashMap<BackForwardListImpl*, WebBackForwardList*> staticBackForwardListWrappers;
return staticBackForwardListWrappers;
}
-WebBackForwardList::WebBackForwardList(PassRefPtr<BackForwardList> backForwardList)
+WebBackForwardList::WebBackForwardList(PassRefPtr<BackForwardListImpl> backForwardList)
: m_refCount(0)
, m_backForwardList(backForwardList)
{
@@ -68,7 +70,7 @@ WebBackForwardList::~WebBackForwardList()
gClassNameCount.remove("WebBackForwardList");
}
-WebBackForwardList* WebBackForwardList::createInstance(PassRefPtr<BackForwardList> backForwardList)
+WebBackForwardList* WebBackForwardList::createInstance(PassRefPtr<BackForwardListImpl> backForwardList)
{
WebBackForwardList* instance;
diff --git a/WebKit/win/WebBackForwardList.h b/WebKit/win/WebBackForwardList.h
index 9375193..aebfa15 100644
--- a/WebKit/win/WebBackForwardList.h
+++ b/WebKit/win/WebBackForwardList.h
@@ -34,15 +34,15 @@
#include <WTF/RefPtr.h>
namespace WebCore {
- class BackForwardList;
+ class BackForwardListImpl;
}
class WebBackForwardList : public IWebBackForwardList, IWebBackForwardListPrivate
{
public:
- static WebBackForwardList* createInstance(PassRefPtr<WebCore::BackForwardList>);
+ static WebBackForwardList* createInstance(PassRefPtr<WebCore::BackForwardListImpl>);
protected:
- WebBackForwardList(PassRefPtr<WebCore::BackForwardList>);
+ WebBackForwardList(PassRefPtr<WebCore::BackForwardListImpl>);
~WebBackForwardList();
public:
@@ -109,7 +109,7 @@ public:
protected:
ULONG m_refCount;
- RefPtr<WebCore::BackForwardList> m_backForwardList;
+ RefPtr<WebCore::BackForwardListImpl> m_backForwardList;
};
#endif
diff --git a/WebKit/win/WebCookieManagerCFNet.cpp b/WebKit/win/WebCookieManagerCFNet.cpp
index 415a679..c2ef493 100644
--- a/WebKit/win/WebCookieManagerCFNet.cpp
+++ b/WebKit/win/WebCookieManagerCFNet.cpp
@@ -28,7 +28,7 @@
#include "WebCookieManager.h"
#include <CFNetwork/CFHTTPCookiesPriv.h>
-#include <WebCore/CookieStorageWin.h>
+#include <WebCore/CookieStorageCFNet.h>
using namespace WebCore;
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index 7a025a7..b1332ed 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -38,7 +38,6 @@
#include "WebDesktopNotificationsDelegate.h"
#include "WebSecurityOrigin.h"
#include "WebView.h"
-#pragma warning(push, 0)
#include <WebCore/BString.h>
#include <WebCore/Console.h>
#include <WebCore/ContextMenu.h>
@@ -48,23 +47,23 @@
#include <WebCore/FrameLoadRequest.h>
#include <WebCore/FrameView.h>
#include <WebCore/Geolocation.h>
-#if USE(ACCELERATED_COMPOSITING)
-#include <WebCore/GraphicsLayer.h>
-#endif
#include <WebCore/HTMLNames.h>
#include <WebCore/Icon.h>
#include <WebCore/LocalWindowsContext.h>
#include <WebCore/LocalizedStrings.h>
+#include <WebCore/NavigationAction.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/Page.h>
#include <WebCore/SecurityOrigin.h>
#include <WebCore/PopupMenuWin.h>
#include <WebCore/SearchPopupMenuWin.h>
#include <WebCore/WindowFeatures.h>
-#pragma warning(pop)
-
#include <tchar.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include <WebCore/GraphicsLayer.h>
+#endif
+
using namespace WebCore;
// When you call GetOpenFileName, if the size of the buffer is too small,
@@ -195,7 +194,7 @@ static COMPtr<IPropertyBag> createWindowFeaturesPropertyBag(const WindowFeatures
return COMPtr<IPropertyBag>(AdoptCOM, COMPropertyBag<COMVariant>::adopt(map));
}
-Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features)
+Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)
{
COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h
index 5a796eb..5167c06 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -58,7 +58,7 @@ public:
virtual void focusedNodeChanged(WebCore::Node*);
- virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
+ virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
virtual void show();
virtual bool canRunModal();
diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
index ab1f79e..24178f2 100644
--- a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
@@ -60,7 +60,7 @@ static bool isPreInspectElementTagSafari(IWebUIDelegate* uiDelegate)
return false;
TCHAR modulePath[MAX_PATH];
- DWORD length = ::GetModuleFileName(0, modulePath, _countof(modulePath));
+ DWORD length = ::GetModuleFileName(0, modulePath, WTF_ARRAY_LENGTH(modulePath));
if (!length)
return false;
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index ffc41b2..6591347 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -426,7 +426,7 @@ void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout()
frameLoadDelegatePrivate->didFirstVisuallyNonEmptyLayoutInFrame(webView, m_webFrame);
}
-Frame* WebFrameLoaderClient::dispatchCreatePage()
+Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction&)
{
WebView* webView = m_webFrame->webView();
@@ -714,6 +714,10 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
core(m_webFrame)->createView(IntRect(rect).size(), backgroundColor, transparent, IntSize(), false);
}
+void WebFrameLoaderClient::dispatchDidBecomeFrameset(bool)
+{
+}
+
bool WebFrameLoaderClient::canCachePage() const
{
return true;
@@ -730,6 +734,15 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page*)
{
+ Frame* coreFrame = core(m_webFrame);
+ ASSERT(coreFrame);
+ WebView* webView = kit(coreFrame->page());
+ if (m_webFrame->webView() != webView)
+ m_webFrame->setWebView(webView);
+}
+
+void WebFrameLoaderClient::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
}
PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer)
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index 7ec344c..981daec 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -78,7 +78,7 @@ public:
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual WebCore::Frame* dispatchCreatePage();
+ virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*);
@@ -108,11 +108,14 @@ public:
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual bool canCachePage() const;
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(WebCore::Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, 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/WebElementPropertyBag.cpp b/WebKit/win/WebElementPropertyBag.cpp
index e68b92e..e68360c 100644
--- a/WebKit/win/WebElementPropertyBag.cpp
+++ b/WebKit/win/WebElementPropertyBag.cpp
@@ -159,7 +159,10 @@ HRESULT STDMETHODCALLTYPE WebElementPropertyBag::Read(LPCOLESTR pszPropName, VAR
else
V_BOOL(pVar) = VARIANT_FALSE;
return S_OK;
- } else if (isEqual(WebElementSpellingToolTipKey, key)) {
+ }
+ if (isEqual(WebElementMediaURLKey, key))
+ return convertStringToVariant(pVar, m_result->absoluteMediaURL().string());
+ if (isEqual(WebElementSpellingToolTipKey, key)) {
TextDirection dir;
return convertStringToVariant(pVar, m_result->spellingToolTip(dir));
} else if (isEqual(WebElementTitleKey, key)) {
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 8dfe8bb..9db6a2a 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1019,6 +1019,18 @@ HRESULT STDMETHODCALLTYPE WebFrame::unused2()
return E_NOTIMPL;
}
+HRESULT STDMETHODCALLTYPE WebFrame::hasSpellingMarker(
+ /* [in] */ UINT from,
+ /* [in] */ UINT length,
+ /* [retval][out] */ BOOL* result)
+{
+ Frame* coreFrame = core(this);
+ if (!coreFrame)
+ return E_FAIL;
+ *result = coreFrame->editor()->selectionStartHasSpellingMarkerFor(from, length);
+ return S_OK;
+}
+
// IWebDocumentText -----------------------------------------------------------
HRESULT STDMETHODCALLTYPE WebFrame::supportsTextEncoding(
@@ -2574,6 +2586,11 @@ WebView* WebFrame::webView() const
return d->webView;
}
+void WebFrame::setWebView(WebView* webView)
+{
+ d->webView = webView;
+}
+
COMPtr<IAccessible> WebFrame::accessible() const
{
Frame* coreFrame = core(this);
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 147daa8..bdc28ab 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -273,6 +273,11 @@ public:
virtual HRESULT STDMETHODCALLTYPE layerTreeAsText(BSTR*);
+ virtual HRESULT STDMETHODCALLTYPE hasSpellingMarker(
+ /* [in] */ UINT from,
+ /* [in] */ UINT length,
+ /* [retval][out] */ BOOL *result);
+
// IWebDocumentText
virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding(
/* [retval][out] */ BOOL* result);
@@ -371,6 +376,7 @@ public:
WebCore::KURL url() const;
WebView* webView() const;
+ void setWebView(WebView*);
COMPtr<IAccessible> accessible() const;
diff --git a/WebKit/win/WebKitPrefix.h b/WebKit/win/WebKitPrefix.h
index 9b2fc85..5c2001f 100644
--- a/WebKit/win/WebKitPrefix.h
+++ b/WebKit/win/WebKitPrefix.h
@@ -34,7 +34,7 @@
#define WINVER 0x0500
#endif
-// If we don't define these, they get defined in windef.h.
+// If we don't define these, they get defined in windef.h.
// We want to use std::min and std::max.
#ifndef max
#define max max
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index b57e06a..fb62809 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -67,13 +67,12 @@
#include <WebCore/AXObjectCache.h>
#include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/BString.h>
-#include <WebCore/BackForwardList.h>
+#include <WebCore/BackForwardListImpl.h>
#include <WebCore/BitmapInfo.h>
#include <WebCore/Cache.h>
#include <WebCore/Chrome.h>
#include <WebCore/ContextMenu.h>
#include <WebCore/ContextMenuController.h>
-#include <WebCore/CookieStorageWin.h>
#include <WebCore/Cursor.h>
#include <WebCore/Document.h>
#include <WebCore/DragController.h>
@@ -148,6 +147,7 @@
#if USE(CFNETWORK)
#include <CFNetwork/CFURLCachePriv.h>
#include <CFNetwork/CFURLProtocolPriv.h>
+#include <WebCore/CookieStorageCFNet.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
#endif
@@ -1833,10 +1833,10 @@ const char* WebView::interpretKeyEvent(const KeyboardEvent* evt)
keyDownCommandsMap = new HashMap<int, const char*>;
keyPressCommandsMap = new HashMap<int, const char*>;
- for (unsigned i = 0; i < _countof(keyDownEntries); i++)
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i)
keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
- for (unsigned i = 0; i < _countof(keyPressEntries); i++)
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i)
keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
}
@@ -2870,13 +2870,14 @@ HRESULT STDMETHODCALLTYPE WebView::focusedFrame(
return webFrame->QueryInterface(IID_IWebFrame, (void**) frame);
}
+
HRESULT STDMETHODCALLTYPE WebView::backForwardList(
/* [out][retval] */ IWebBackForwardList** list)
{
if (!m_useBackForwardList)
return E_FAIL;
- *list = WebBackForwardList::createInstance(m_page->backForwardList());
+ *list = WebBackForwardList::createInstance(static_cast<WebCore::BackForwardListImpl*>(m_page->backForwardList()));
return S_OK;
}
diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h
index 61eb946..424b03a 100644
--- a/WebKit/win/WebView.h
+++ b/WebKit/win/WebView.h
@@ -35,12 +35,15 @@
#include <WebCore/RefCountedGDIHandle.h>
#include <WebCore/SuspendableTimer.h>
#include <WebCore/WindowMessageListener.h>
-#include <WebCore/WKCACFLayer.h>
-#include <WebCore/WKCACFLayerRenderer.h>
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include <WebCore/WKCACFLayer.h>
+#include <WebCore/WKCACFLayerRenderer.h>
+#endif
+
class FullscreenVideoController;
class WebBackForwardList;
class WebFrame;
diff --git a/WebKit/wince/ChangeLog b/WebKit/wince/ChangeLog
index 8d99b5c..bbf5d59 100644
--- a/WebKit/wince/ChangeLog
+++ b/WebKit/wince/ChangeLog
@@ -1,3 +1,68 @@
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebCoreSupport/FrameLoaderClientWinCE.h:
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+ (WebKit::FrameLoaderClientWinCE::dispatchDidBecomeFrameset):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+ (WebKit::FrameLoaderClientWinCE::transferLoadingResourceFromPage):
+ Empty method.
+ * WebCoreSupport/FrameLoaderClientWinCE.h:
+
+2010-10-25 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Replace _countof with WTF_ARRAY_LENGTH
+ https://bugs.webkit.org/show_bug.cgi?id=48229
+
+ * WebCoreSupport/EditorClientWinCE.cpp:
+ (WebKit::EditorClientWinCE::interpretKeyEvent):
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebCoreSupport/ChromeClientWinCE.cpp:
+ (WebKit::ChromeClientWinCE::createWindow):
+ * WebCoreSupport/ChromeClientWinCE.h:
+ * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+ (WebKit::FrameLoaderClientWinCE::dispatchCreatePage):
+ * WebCoreSupport/FrameLoaderClientWinCE.h:
+ Add NavigationAction parameter.
+
+2010-10-22 Patrick Gansterer <paroga@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ [WINCE] Implement EditorClient::handleKeyboardEvent
+ https://bugs.webkit.org/show_bug.cgi?id=48118
+
+ Copy the implementation from the EFL port.
+
+ * WebCoreSupport/EditorClientWinCE.cpp:
+ (WebKit::EditorClientWinCE::interpretKeyEvent):
+ (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
+ (WebKit::EditorClientWinCE::handleKeyboardEvent):
+ * WebCoreSupport/EditorClientWinCE.h:
+
2010-10-15 Nikolas Zimmermann <nzimmermann@rim.com>
Reviewed by Dirk Schulze.
diff --git a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
index 468d86c..c99635a 100644
--- a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
@@ -28,6 +28,7 @@
#include "FileChooser.h"
#include "Icon.h"
#include "NotImplemented.h"
+#include "NavigationAction.h"
#include "PopupMenuWin.h"
#include "SearchPopupMenuWin.h"
#include "WebView.h"
@@ -83,7 +84,7 @@ void ChromeClientWinCE::unfocus()
notImplemented();
}
-Page* ChromeClientWinCE::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&)
+Page* ChromeClientWinCE::createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&)
{
notImplemented();
return 0;
diff --git a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
index be9f643..3818ce0 100644
--- a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
@@ -56,7 +56,7 @@ public:
// 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 WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
virtual void show();
virtual bool canRunModal();
diff --git a/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp b/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
index a806cf9..7dee562 100644
--- a/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
@@ -1,32 +1,35 @@
/*
- * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * 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 library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * THIS 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.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "EditorClientWinCE.h"
#include "EditCommand.h"
+#include "Frame.h"
+#include "KeyboardEvent.h"
#include "NotImplemented.h"
+#include "PlatformKeyboardEvent.h"
+#include "Settings.h"
using namespace WebCore;
@@ -217,9 +220,191 @@ void EditorClientWinCE::toggleGrammarChecking()
notImplemented();
}
+static const unsigned CtrlKey = 1 << 0;
+static const unsigned AltKey = 1 << 1;
+static const unsigned ShiftKey = 1 << 2;
+
+struct KeyDownEntry {
+ unsigned virtualKey;
+ unsigned modifiers;
+ const char* name;
+};
+
+struct KeyPressEntry {
+ unsigned charCode;
+ unsigned modifiers;
+ const char* name;
+};
+
+static const KeyDownEntry keyDownEntries[] = {
+ { VK_LEFT, 0, "MoveLeft" },
+ { VK_LEFT, ShiftKey, "MoveLeftAndModifySelection" },
+ { VK_LEFT, CtrlKey, "MoveWordLeft" },
+ { VK_LEFT, CtrlKey | ShiftKey, "MoveWordLeftAndModifySelection" },
+ { VK_RIGHT, 0, "MoveRight" },
+ { VK_RIGHT, ShiftKey, "MoveRightAndModifySelection" },
+ { VK_RIGHT, CtrlKey, "MoveWordRight" },
+ { VK_RIGHT, CtrlKey | ShiftKey, "MoveWordRightAndModifySelection" },
+ { VK_UP, 0, "MoveUp" },
+ { VK_UP, ShiftKey, "MoveUpAndModifySelection" },
+ { VK_PRIOR, ShiftKey, "MovePageUpAndModifySelection" },
+ { VK_DOWN, 0, "MoveDown" },
+ { VK_DOWN, ShiftKey, "MoveDownAndModifySelection" },
+ { VK_NEXT, ShiftKey, "MovePageDownAndModifySelection" },
+ { VK_PRIOR, 0, "MovePageUp" },
+ { VK_NEXT, 0, "MovePageDown" },
+ { VK_HOME, 0, "MoveToBeginningOfLine" },
+ { VK_HOME, ShiftKey, "MoveToBeginningOfLineAndModifySelection" },
+ { VK_HOME, CtrlKey, "MoveToBeginningOfDocument" },
+ { VK_HOME, CtrlKey | ShiftKey, "MoveToBeginningOfDocumentAndModifySelection" },
+
+ { VK_END, 0, "MoveToEndOfLine" },
+ { VK_END, ShiftKey, "MoveToEndOfLineAndModifySelection" },
+ { VK_END, CtrlKey, "MoveToEndOfDocument" },
+ { VK_END, CtrlKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection" },
+
+ { VK_BACK, 0, "DeleteBackward" },
+ { VK_BACK, ShiftKey, "DeleteBackward" },
+ { VK_DELETE, 0, "DeleteForward" },
+ { VK_BACK, CtrlKey, "DeleteWordBackward" },
+ { VK_DELETE, CtrlKey, "DeleteWordForward" },
+
+ { 'B', CtrlKey, "ToggleBold" },
+ { 'I', CtrlKey, "ToggleItalic" },
+
+ { VK_ESCAPE, 0, "Cancel" },
+ { VK_TAB, 0, "InsertTab" },
+ { VK_TAB, ShiftKey, "InsertBacktab" },
+ { VK_RETURN, 0, "InsertNewline" },
+ { VK_RETURN, CtrlKey, "InsertNewline" },
+ { VK_RETURN, AltKey, "InsertNewline" },
+ { VK_RETURN, AltKey | ShiftKey, "InsertNewline" },
+
+ // It's not quite clear whether clipboard shortcuts and Undo/Redo should be handled
+ // in the application or in WebKit. We chose WebKit for now.
+ { 'C', CtrlKey, "Copy" },
+ { 'V', CtrlKey, "Paste" },
+ { 'X', CtrlKey, "Cut" },
+ { 'A', CtrlKey, "SelectAll" },
+ { VK_INSERT, CtrlKey, "Copy" },
+ { VK_DELETE, ShiftKey, "Cut" },
+ { VK_INSERT, ShiftKey, "Paste" },
+ { 'Z', CtrlKey, "Undo" },
+ { 'Z', CtrlKey | ShiftKey, "Redo" }
+};
+
+static const KeyPressEntry keyPressEntries[] = {
+ { '\t', 0, "InsertTab" },
+ { '\t', ShiftKey, "InsertBacktab" },
+ { '\r', 0, "InsertNewline" },
+ { '\r', CtrlKey, "InsertNewline" },
+ { '\r', AltKey, "InsertNewline" },
+ { '\r', AltKey | ShiftKey, "InsertNewline" }
+};
+
+const char* EditorClientWinCE::interpretKeyEvent(const KeyboardEvent* event)
+{
+ ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent);
+
+ static HashMap<int, const char*>* keyDownCommandsMap = 0;
+ static HashMap<int, const char*>* keyPressCommandsMap = 0;
+
+ if (!keyDownCommandsMap) {
+ keyDownCommandsMap = new HashMap<int, const char*>;
+ keyPressCommandsMap = new HashMap<int, const char*>;
+
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i)
+ keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
+
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i)
+ keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
+ }
+
+ unsigned modifiers = 0;
+ if (event->shiftKey())
+ modifiers |= ShiftKey;
+ if (event->altKey())
+ modifiers |= AltKey;
+ if (event->ctrlKey())
+ modifiers |= CtrlKey;
+
+ if (event->type() == eventNames().keydownEvent) {
+ int mapKey = modifiers << 16 | event->keyCode();
+ return mapKey ? keyDownCommandsMap->get(mapKey) : 0;
+ }
+
+ int mapKey = modifiers << 16 | event->charCode();
+ return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
+}
+
+bool EditorClientWinCE::handleEditingKeyboardEvent(KeyboardEvent* event)
+{
+ Node* node = event->target()->toNode();
+ ASSERT(node);
+ Frame* frame = node->document()->frame();
+ ASSERT(frame);
+
+ const PlatformKeyboardEvent* keyEvent = event->keyEvent();
+ if (!keyEvent)
+ return false;
+
+ bool caretBrowsing = frame->settings()->caretBrowsingEnabled();
+ if (caretBrowsing) {
+ switch (keyEvent->windowsVirtualKeyCode()) {
+ case VK_LEFT:
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionLeft,
+ keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
+ true);
+ return true;
+ case VK_RIGHT:
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionRight,
+ keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity,
+ true);
+ return true;
+ case VK_UP:
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionBackward,
+ keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity,
+ true);
+ return true;
+ case VK_DOWN:
+ frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove,
+ SelectionController::DirectionForward,
+ keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity,
+ true);
+ return true;
+ }
+ }
+
+ Editor::Command command = frame->editor()->command(interpretKeyEvent(event));
+
+ if (keyEvent->type() == PlatformKeyboardEvent::RawKeyDown) {
+ // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated,
+ // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated
+ // (e.g. Tab that inserts a Tab character, or Enter).
+ return !command.isTextInsertion() && command.execute(event);
+ }
+
+ if (command.execute(event))
+ return true;
+
+ // Don't insert null or control characters as they can result in unexpected behaviour
+ if (event->charCode() < ' ')
+ return false;
+
+ // Don't insert anything if a modifier is pressed
+ if (keyEvent->ctrlKey() || keyEvent->altKey())
+ return false;
+
+ return frame->editor()->insertText(event->keyEvent()->text(), event);
+}
+
void EditorClientWinCE::handleKeyboardEvent(KeyboardEvent* event)
{
- notImplemented();
+ if (handleEditingKeyboardEvent(event))
+ event->setDefaultHandled();
}
void EditorClientWinCE::handleInputMethodKeydown(KeyboardEvent* event)
diff --git a/WebKit/wince/WebCoreSupport/EditorClientWinCE.h b/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
index 0ad0a19..be85b3f 100644
--- a/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/EditorClientWinCE.h
@@ -76,6 +76,8 @@ public:
virtual void undo();
virtual void redo();
+ virtual const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
+ virtual bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
virtual void handleKeyboardEvent(WebCore::KeyboardEvent*);
virtual void handleInputMethodKeydown(WebCore::KeyboardEvent*);
diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
index e841ab9..0b95213 100644
--- a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
+++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
@@ -165,6 +165,10 @@ void FrameLoaderClientWinCE::didTransferChildFrameToNewDocument(Page*)
{
}
+void FrameLoaderClientWinCE::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
+}
+
void FrameLoaderClientWinCE::redirectDataToPlugin(Widget* pluginWidget)
{
ASSERT(!m_pluginView);
@@ -557,7 +561,7 @@ bool FrameLoaderClientWinCE::canCachePage() const
return true;
}
-Frame* FrameLoaderClientWinCE::dispatchCreatePage()
+Frame* FrameLoaderClientWinCE::dispatchCreatePage(const NavigationAction&)
{
notImplemented();
return 0;
@@ -626,6 +630,10 @@ void FrameLoaderClientWinCE::transitionToCommittedForNewPage()
m_frame->ownerRenderer()->setWidget(frameView);
}
+void FrameLoaderClientWinCE::dispatchDidBecomeFrameset(bool)
+{
+}
+
PassRefPtr<WebCore::FrameNetworkingContext> FrameLoaderClientWinCE::createNetworkingContext()
{
return FrameNetworkingContextWinCE::create(m_frame, userAgent(KURL()));
diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
index b64efed..46b3a19 100644
--- a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
+++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
@@ -85,7 +85,7 @@ public:
virtual void dispatchDidFirstLayout();
virtual void dispatchDidFirstVisuallyNonEmptyLayout();
- virtual WebCore::Frame* dispatchCreatePage();
+ virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchShow();
virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WTF::String& MIMEType, const WebCore::ResourceRequest&);
@@ -109,6 +109,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(WebCore::Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, 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);
@@ -174,6 +175,8 @@ public:
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual bool canCachePage() const;
virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index b7ec1f6..123b839 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,54 @@
+2010-10-29 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring
+ https://bugs.webkit.org/show_bug.cgi?id=48574
+
+ * WebFrame.cpp:
+ (wxWebFrame::CanGoBack): Use canGoBackOrForward.
+ (wxWebFrame::CanGoForward): Ditto.
+
+2010-10-29 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48576
+ Let WebKit2 client know when a frame is a frameset
+
+ Added a blank implementation of the new FrameLoaderClient method.
+
+ * WebKitSupport/FrameLoaderClientWx.h:
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchDidBecomeFrameset):
+
+2010-10-26 Jenn Braithwaite <jennb@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Resource tracking failure when trying to move a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=44713
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::transferLoadingResourceFromPage):
+ Empty method.
+ * WebKitSupport/FrameLoaderClientWx.h:
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * WebKitSupport/ChromeClientWx.cpp:
+ (WebCore::ChromeClientWx::createWindow):
+ * WebKitSupport/ChromeClientWx.h:
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::dispatchCreatePage):
+ * WebKitSupport/FrameLoaderClientWx.h:
+ Add NavigationAction parameter.
+
2010-10-13 Gavin Barraclough <barraclough@apple.com>
Reviewed by Oliver Hunt.
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index 1c2eebd..1d5f03a 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "BackForwardList.h"
+
#include "Document.h"
#include "Editor.h"
#include "Element.h"
@@ -318,16 +318,16 @@ bool wxWebFrame::GoForward()
bool wxWebFrame::CanGoBack()
{
- if (m_impl->frame && m_impl->frame->page() && m_impl->frame->page()->backForwardList())
- return m_impl->frame->page()->backForwardList()->backItem() != NULL;
+ if (m_impl->frame && m_impl->frame->page())
+ return m_impl->frame->page()->canGoBackOrForward(-1);
return false;
}
bool wxWebFrame::CanGoForward()
{
- if (m_impl->frame && m_impl->frame->page() && m_impl->frame->page()->backForwardList())
- return m_impl->frame->page()->backForwardList()->forwardItem() != NULL;
+ if (m_impl->frame && m_impl->frame->page())
+ return m_impl->frame->page()->canGoBackOrForward(1);
return false;
}
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index 11c5643..97b98cf 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -37,6 +37,7 @@
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "Icon.h"
+#include "NavigationAction.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "SecurityOrigin.h"
@@ -136,7 +137,7 @@ void ChromeClientWx::focusedNodeChanged(Node*)
{
}
-Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
+Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&)
{
Page* myPage = 0;
wxWebViewNewWindowEvent wkEvent(m_webView);
diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h
index 5b60446..755beb7 100644
--- a/WebKit/wx/WebKitSupport/ChromeClientWx.h
+++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -57,7 +57,7 @@ public:
virtual void focusedNodeChanged(Node*);
- virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&);
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&);
virtual Page* createModalDialog(Frame*, const FrameLoadRequest&);
virtual void show();
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index 7963ef9..8748a98 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -766,7 +766,7 @@ void FrameLoaderClientWx::dispatchDidFailLoad(const ResourceError&)
notImplemented();
}
-Frame* FrameLoaderClientWx::dispatchCreatePage()
+Frame* FrameLoaderClientWx::dispatchCreatePage(const NavigationAction&)
{
notImplemented();
return false;
@@ -863,6 +863,10 @@ void FrameLoaderClientWx::didTransferChildFrameToNewDocument(Page*)
{
}
+void FrameLoaderClientWx::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
+{
+}
+
ObjectContentType FrameLoaderClientWx::objectContentType(const KURL& url, const String& mimeType)
{
notImplemented();
@@ -962,6 +966,10 @@ void FrameLoaderClientWx::transitionToCommittedForNewPage()
m_frame->createView(size, backgroundColor, transparent, IntSize(), false);
}
+void FrameLoaderClientWx::dispatchDidBecomeFrameset(bool)
+{
+}
+
bool FrameLoaderClientWx::shouldUsePluginDocument(const String &mimeType) const
{
// NOTE: Plugin Documents are used for viewing PDFs, etc. inline, and should
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
index 9c260fe..cb34b0f 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
@@ -152,6 +152,8 @@ namespace WebCore {
virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
virtual void transitionToCommittedForNewPage();
+ virtual void dispatchDidBecomeFrameset(bool);
+
virtual void updateGlobalHistory();
virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
@@ -190,7 +192,7 @@ namespace WebCore {
virtual void dispatchDidFailProvisionalLoad(const ResourceError&);
virtual void dispatchDidFailLoad(const ResourceError&);
- virtual Frame* dispatchCreatePage();
+ virtual Frame* dispatchCreatePage(const WebCore::NavigationAction&);
virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String&, const ResourceRequest&);
virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&);
virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>);
@@ -204,6 +206,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(Page*);
+ virtual void transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, 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/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index e15958d..b5d248f 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,87 @@
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Roben and David Kilzer.
+
+ Fix and cleanup of build systems
+ https://bugs.webkit.org/show_bug.cgi?id=48342
+
+ Remove unnecessary ENABLE_SANDBOX.
+ Add missing features to converge to FeatureDefines.xcconfig.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
+2010-10-28 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Added UniCharProvider-based ways to create a CTTypeSetter and a CTLine, to be used in an
+ upcoming ComplexTextController patch.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
+2010-10-28 Ivan Krstić <ike@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Remove unused experimental proxied panel interface.
+ <rdar://problem/7237059>
+
+ * WebKitSystemInterface.h:
+
+2010-10-27 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Find indicators do not bounce
+ https://bugs.webkit.org/show_bug.cgi?id=48490
+ <rdar://problem/8564276>
+
+ Add bounce animation context functions.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+
+2010-10-26 Adam Roben <aroben@apple.com>
+
+ Fix duplicate vsprops name
+
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops: Renamed to
+ "FeatureDefinesCairo" to match the filename.
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Windows build fix.
+
+ * win/lib/WebKitSystemInterface.lib:
+ * win/lib/WebKitSystemInterface_debug.lib:
+
+2010-10-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48083
+ <rdar://problem/8489082> Need WebKit2 API for private browsing (48083)
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+ * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+ * win/lib/WebKitSystemInterface.lib:
+ * win/lib/WebKitSystemInterface_debug.lib:
+ Updated WebKitSystemInterface with necessary methods.
+
+2010-10-22 Adam Roben <aroben@apple.com>
+
+ Turn on ENABLE_3D_RENDERING on all Windows builds
+
+ Reviewed by Sam Weinig.
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+
2010-10-20 Adam Roben <aroben@apple.com>
Windows build fix
diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h
index b67906d..7ec07fb 100644
--- a/WebKitLibraries/WebKitSystemInterface.h
+++ b/WebKitLibraries/WebKitSystemInterface.h
@@ -60,6 +60,8 @@ void WKDisableCGDeferredUpdates(void);
Class WKNSURLProtocolClassForRequest(NSURLRequest *request);
void WKSetNSURLRequestShouldContentSniff(NSMutableURLRequest *request, BOOL shouldContentSniff);
+void WKSetCookieStoragePrivateBrowsingEnabled(BOOL enabled);
+
unsigned WKGetNSAutoreleasePoolCount(void);
void WKAdvanceDefaultButtonPulseAnimation(NSButtonCell *button);
@@ -152,6 +154,11 @@ ATSLayoutRecord *WKGetGlyphVectorFirstRecord(WKGlyphVectorRef glyphVector);
size_t WKGetGlyphVectorRecordSize(WKGlyphVectorRef glyphVector);
#endif
+CTLineRef WKCreateCTLineWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+CTTypesetterRef WKCreateCTTypesetterWithUniCharProviderAndOptions(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
+#endif
+
#ifndef __LP64__
NSEvent *WKCreateNSEventWithCarbonEvent(EventRef eventRef);
NSEvent *WKCreateNSEventWithCarbonMouseMoveEvent(EventRef inEvent, NSWindow *window);
@@ -288,6 +295,12 @@ uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
+typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef;
+
+WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window);
+void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context);
+void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress);
+
#if defined(__x86_64__)
#import <mach/mig.h>
@@ -316,7 +329,6 @@ void WKWindowSetScaledFrame(NSWindow *window, NSRect scaleFrame, NSRect nonScale
#endif
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-NSMutableArray *WKNoteOpenPanelFiles(NSArray *paths);
void WKSyncSurfaceToView(NSView *view);
#endif
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
index 87e9b2d..979989a 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
index 7ac0fcb..5bc2b65 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
Binary files differ
diff --git a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
index a87cfb6..52aac61 100644
--- a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
+++ b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
@@ -85,6 +85,7 @@ CFDictionaryRef wkGetSSLCertificateInfo(CFURLResponseRef);
void* wkGetSSLPeerCertificateData(CFDictionaryRef);
void* wkGetSSLCertificateChainContext(CFDictionaryRef);
CFHTTPCookieStorageRef wkGetDefaultHTTPCookieStorage();
+CFHTTPCookieStorageRef wkCreatePrivateHTTPCookieStorage();
void wkSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool);
CFStringRef wkCopyFoundationCacheDirectory();
void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef);
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface.lib b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
index 6e2018b..1938e9d 100644
--- a/WebKitLibraries/win/lib/WebKitSystemInterface.lib
+++ b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
Binary files differ
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
index b9f1433..fe4a228 100644
--- a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
+++ b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
Binary files differ
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 17b5da4..addcae2 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_PROGRESS_TAG);$(ENABLE_RUBY);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -18,6 +18,11 @@
/>
<UserMacro
Name="ENABLE_3D_RENDERING"
+ Value="ENABLE_3D_RENDERING"
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
+ Name="ENABLE_ACCELERATED_2D_CANVAS"
Value=""
PerformEnvironmentSet="true"
/>
@@ -82,6 +87,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_FULLSCREEN_API"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_GEOLOCATION"
Value="ENABLE_GEOLOCATION"
PerformEnvironmentSet="true"
@@ -112,11 +122,21 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_LINK_PREFETCH"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_MATHML"
Value="ENABLE_MATHML"
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_METER_TAG"
+ Value="ENABLE_METER_TAG"
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_NOTIFICATIONS"
Value=""
PerformEnvironmentSet="true"
@@ -127,13 +147,13 @@
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_RUBY"
- Value="ENABLE_RUBY"
+ Name="ENABLE_PROGRESS_TAG"
+ Value=""
PerformEnvironmentSet="true"
/>
<UserMacro
- Name="ENABLE_SANDBOX"
- Value="ENABLE_SANDBOX"
+ Name="ENABLE_RUBY"
+ Value="ENABLE_RUBY"
PerformEnvironmentSet="true"
/>
<UserMacro
@@ -182,6 +202,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_WEB_AUDIO"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_WEB_SOCKETS"
Value="ENABLE_WEB_SOCKETS"
PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index 1aa406a..f9ffafc 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -5,11 +5,11 @@
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
- Name="FeatureDefines"
+ Name="FeatureDefinesCairo"
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_PROGRESS_TAG);$(ENABLE_RUBY);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -22,6 +22,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_ACCELERATED_2D_CANVAS"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_BLOB"
Value=""
PerformEnvironmentSet="true"
@@ -82,6 +87,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_FULLSCREEN_API"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_GEOLOCATION"
Value=""
PerformEnvironmentSet="true"
@@ -112,11 +122,21 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_LINK_PREFETCH"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_MATHML"
Value=""
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_METER_TAG"
+ Value="ENABLE_METER_TAG"
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_NOTIFICATIONS"
Value=""
PerformEnvironmentSet="true"
@@ -127,6 +147,16 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_PROGRESS_TAG"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
+ Name="ENABLE_RUBY"
+ Value="ENABLE_RUBY"
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_SHARED_WORKERS"
Value="ENABLE_SHARED_WORKERS"
PerformEnvironmentSet="true"
@@ -172,6 +202,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_WEB_AUDIO"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_WEB_SOCKETS"
Value="ENABLE_WEB_SOCKETS"
PerformEnvironmentSet="true"
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index 91a13e7..71c20f0 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -110,8 +110,8 @@
"platform": "win", "configuration": "debug", "architectures": ["i386"],
"slavenames": ["apple-windows-4", "apple-windows-6", "test-slave"]
},
- { "name": "Windows Debug (WebKit2 Tests)", "type": "TestWebKit2", "builddir": "win-debug-tests-wk2",
- "platform": "win", "configuration": "debug", "architectures": ["i386"],
+ { "name": "Windows Release (WebKit2 Tests)", "type": "TestWebKit2", "builddir": "win-release-tests-wk2",
+ "platform": "win", "configuration": "release", "architectures": ["i386"],
"slavenames": ["apple-windows-7", "test-slave"]
},
{
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index 47af8d2..5c44525 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -251,6 +251,7 @@ class NewRunWebKitTests(RunWebKitTests):
"--verbose", "--results-directory", "layout-test-results",
"--builder-name", WithProperties("%(buildername)s"),
"--build-number", WithProperties("%(buildnumber)s"),
+ "--master-name", "webkit.org",
"--test-results-server", "test-results.appspot.com",
WithProperties("--%(configuration)s"), "--use-drt"]
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index d138f3d..1c7d1bf 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,2085 @@
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtTestBrowser: Add keyboard shortcut to toggle full screen (F11)
+ https://bugs.webkit.org/show_bug.cgi?id=48695
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
+
+2010-10-29 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtTestBrowser: Fix uninitialized read in FpsTimer
+ https://bugs.webkit.org/show_bug.cgi?id=48675
+
+ FpsTimer::m_timer was never initialized and passed to QObject::killTimer()
+ on startup with in -graphicsbased mode.
+
+ * QtTestBrowser/fpstimer.cpp:
+ (FpsTimer::FpsTimer):
+ (FpsTimer::numFrames):
+ (FpsTimer::stop):
+ (FpsTimer::timerEvent):
+ * QtTestBrowser/fpstimer.h:
+
+2010-10-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ new-run-webkit-tests: change TestResults to be serializable
+
+ In preparation for changing new-run-webkit-tests from
+ multithreaded to multiprocess, we need to make sure the data
+ going between the threads is easily serialized over a socket.
+
+ This change adds serialization/pickling for the TestResults and
+ TestFailure objects (using cPickle).
+
+ The TestFailure objects included a "has_wdiff" flag for Text
+ results, but the flag wasn't being used, so I've removed it,
+ simplifying the state to basically a set of enum objects with
+ associated methods.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48616
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_results.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py:Added.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-10-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ new-run-webkit-tests: need to provide separate dashboard results for GPU tests
+ https://bugs.webkit.org/show_bug.cgi?id=48687
+
+ Modify the steps to upload the JSON files to the dashboards so
+ that the GPU tests don't conflict with the regular tests on a
+ port. We do this by modifying the --builder-name parameter to
+ append " - GPU", which should cause the app to treat the results
+ as a completely new builder. This is a little non-obvious, but
+ keeps us from having to restructure the app.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-29 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] add debug logging to help diagnose flakiness dashboard issues
+ https://bugs.webkit.org/show_bug.cgi?id=48657
+
+ The appengine app thinks it's getting empty files uploaded. Add some logging
+ to see if new-run-webkit-tests agrees.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-29 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ [Chromium/DRT] Add master-name flag to new-run-webkit-tests.
+ https://bugs.webkit.org/show_bug.cgi?id=48649
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added flag.
+
+2010-10-29 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ Enable popup window in GtkLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=48335
+
+ The GtkLauncher application does not support opening new window when
+ a link with "target=_blank" is clicked or similar call to
+ window.open(). Instead, GtkLauncher does nothing which breaks
+ navigation of some websites.
+
+ * GtkLauncher/main.c:
+ (activate_uri_entry_cb):
+ (update_title):
+ (link_hover_cb):
+ (notify_title_cb):
+ (notify_load_status_cb):
+ (notify_progress_cb):
+ (destroy_cb):
+ (go_back_cb):
+ (go_forward_cb):
+ (create_web_view_cb):
+ (web_view_ready_cb):
+ (close_web_view_cb):
+ (create_browser):
+ (create_statusbar):
+ (create_toolbar):
+ (create_window):
+ (main):
+
+2010-10-29 Adam Roben <aroben@apple.com>
+
+ Teach check-webkit-style about WebKit2's idiosyncracies
+
+ Fixes <http://webkit.org/b/48638> Style bot complains about a number
+ of WebKit2 conventions
+
+ Reviewed by Anders Carlsson.
+
+ * Scripts/webkitpy/style/checker.py: Excluded some rules for various
+ WebKit2-related files. Also updated the excluded rules for
+ WebKitAPITest to match the current code.
+
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Roben and David Kilzer.
+
+ Fix and cleanup of build systems
+ https://bugs.webkit.org/show_bug.cgi?id=48342
+
+ * Scripts/build-webkit:
+ - Remove unnecessary ENABLE_SANDBOX option.
+ - Add ENABLE_FULLSCREEN_API option.
+
+2010-10-28 Adam Roben <aroben@apple.com>
+
+ Switch the Windows WebKit2 bot to the Release configuration
+
+ We only have one machine testing WebKit2 on Windows right now, and
+ Debug is just too slow for it to keep up.
+
+ Fixes (hopefully!) <http://webkit.org/b/48615> Windows WebKit2 bot is
+ always way behind
+
+ Reviewed by Jon Honeycutt.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ (LayoutTestController::pageSizeAndMarginsInPixels):
+
+2010-10-28 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] add a result-small.json file for the test dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=48547
+
+ Output both a results.json file and a results-small.json file.
+ The dashboard will load results-small.json by default so it loads faster.
+
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
+ Added a bunch of sys.path hackery. Unforunately, this uses hardcoded
+ paths. That obviously needs to be fixed, but at least this way it
+ clearly documents what paths are necessary.
+
+2010-10-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch upload calls changed_files more often than it should
+ https://bugs.webkit.org/show_bug.cgi?id=48567
+
+ Passing changed_files around everywhere isn't a very elegant solution
+ but it's the one we have for the moment. I think keeping an explicit
+ cache on Checkout (or making StepState() a real class) is a better
+ long-term option.
+
+ Previously bug_id_for_this_commit was calling changed_files and the
+ result was never getting cached on the state. Now we're explicitly
+ caching the result on the state and passing that to the bug_id_for_this_commit call.
+
+ I looked into building unit tests for this. Doing so would require
+ using a real Checkout object with a MockSCM and overriding the appropriate
+ calls on SCM to count how often we're stating the file system.
+ That's a useful set of tests to build for a separate change.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-10-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make suggest-reviewers slightly faster
+ https://bugs.webkit.org/show_bug.cgi?id=48562
+
+ Add @memoized to one more common call.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+
+2010-10-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch suggest-reviewers -g 260550a6e30b7bf34f16bdb4a5396cf26264fc1c is still very slow
+ https://bugs.webkit.org/show_bug.cgi?id=48536
+
+ This patch makes it about 40 seconds faster, but it still
+ takes 1:40. This will require more refinement.
+
+ The suggested reviewers list appears to be the same.
+
+ I think the next step may be to have it stop the search after
+ 5 reviewers are found. We never want to suggest 30 people.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Using --remove-empty to theoretically stop lookups past
+ when a file is removed. I'm not entirely clear that the option
+ does what it says it does. Example:
+ git log --pretty=format:%H -5 --remove-empty -- /Projects/WebKit/WebCore/platform/wx/SearchPopupMenuWx.h
+ returns only one commit
+ vs.
+ git log --pretty=format:%H -5 -- /Projects/WebKit/WebCore/platform/wx/SearchPopupMenuWx.h
+ which returns 5. I was not aware that wx files were ever removed from the repository?
+
+2010-10-28 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Chromium] Support FileSystem in chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=47643
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::openFileSystem): Added.
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost::openFileSystem): Added.
+
+2010-10-28 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WKURLRefs should be allowed to be null
+ <rdar://problem/8575621>
+ https://bugs.webkit.org/show_bug.cgi?id=48535
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+ (TestWebKitAPI::didStartProvisionalLoadForFrame):
+ (TestWebKitAPI::didCommitLoadForFrame):
+ (TestWebKitAPI::didFinishLoadForFrame):
+ Test that URLs are null pointers when unset.
+
+2010-10-28 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
+
+ Add support for querying information about selected children to DRT, including:
+ selectedChildAtIndex
+ selectedChildrenCount
+ setSelectedChild
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (selectedChildAtIndexCallback):
+ (setSelectedChildCallback):
+ (selectedChildrenCountCallback):
+ (AccessibilityUIElement::setSelectedChild):
+ (AccessibilityUIElement::selectedChildrenCount):
+ (AccessibilityUIElement::selectedChildAtIndex):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::selectedChildAtIndex):
+ (AccessibilityUIElement::selectedChildrenCount):
+ (AccessibilityUIElement::setSelectedChild):
+
+2010-10-27 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add WebKit2 API for window feature getter/setters
+ <rdar://problem/8590373>
+ https://bugs.webkit.org/show_bug.cgi?id=48496
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-10-28 Søren Gjesse <sgjesse@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Added support for the DumpRenderTree flags --multiple-loads and --js-flags to the Python test runner.
+ https://bugs.webkit.org/show_bug.cgi?id=48236
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-28 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] WebKitWebFrame's load-status is not properly notified to the tests
+ https://bugs.webkit.org/show_bug.cgi?id=48048
+
+ DRT now listens to WebKitWebFrame load-status signals for each
+ created frame instead of the load-status signal of the
+ WebKitWebView that only notifies about changes in the main frame.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadFinished):
+ (webFrameLoadStatusNotified):
+ (frameCreatedCallback):
+ (createWebView):
+ (main):
+
+2010-10-28 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] fix textInputController.{selectedRange,markedRange}
+ https://bugs.webkit.org/show_bug.cgi?id=48487
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::markedRange): Return arrays of ints, rather than a string
+ (TextInputController::selectedRange): Ditto.
+
+2010-10-27 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] add a master-name flag to new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=48488
+
+ The test results server now allows adding a master name to
+ the uploaded files. This lets us distinguish bots that have
+ the same name, but are on different masters.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-28 Adam Roben <aroben@apple.com>
+
+ Don't append a newline to the test output if the frame has no document
+ element in WebKitTestRunner
+
+ Fixes <http://webkit.org/b/48526> Extra trailing newline when running
+ plugins/document-open.html in WebKitTestRunner
+
+ Reviewed by Anders Carlsson.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::toJS): Added. Turns a UTF-8 C string into a JSStringRef.
+ (WTR::hasDocumentElement): Added. Uses the JSC API to figure out
+ whether the frame has a document element.
+ (WTR::dumpFrameText): Match DRT by bailing (rather than appending an
+ empty string and a newline) if the frame has no document element.
+
+2010-10-28 Adam Roben <aroben@apple.com>
+
+ Skip npn-invalidate-rect-invalidates-window.html on headless XP
+ machines
+
+ TestNetscapePlugIn never receives a WM_PAINT message on headless XP
+ machines, so this test times out. Fixing the test is covered by
+ <http://webkit.org/b/48333>.
+
+ * Scripts/old-run-webkit-tests: Skip
+ npn-invalidate-rect-invalidates-window.html on Windows if accelerated
+ compositing support is disabled, which likely means we're on a headless
+ XP machine.
+
+2010-10-28 Kimmo Kinnunen <kimmok@iki.fi>
+
+ Adding myself as a committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-10-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch suggest-reviewers -g 260550a6e30b7bf34f16bdb4a5396cf26264fc1c is very slow
+ https://bugs.webkit.org/show_bug.cgi?id=48500
+
+ This doesn't fix the problem, but it makes things slightly better.
+ Each git svn find-rev call takes about .25 seconds on my desktop.
+ This patch uses a new memoized class to avoid those calls when possible.
+
+ The real slowness is still git log on some files, like:
+ git log --pretty=format:%H -5 -- /Projects/WebKit/WebCore/platform/wx/SearchPopupMenuWx.h
+ I'm not yet sure how to make the pathological git logs better.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/memoized.py: Added.
+ * Scripts/webkitpy/common/memoized_unittest.py: Added.
+
+2010-10-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ EWS bots should not use --quiet when running build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48482
+
+ --quiet is only correct when the sub-process does the error reporting.
+ In the case of _can_build() the parent process is reporting the error.
+ We'd like the full build log at queues.webkit.org so someone can look
+ at the log and understand why the EWS is failing to build trunk.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-10-27 Brian Weinstein <bweinstein@apple.com>
+
+ More Windows build fixage. Rename a variable that was named string.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::hasPrefix):
+
+2010-10-27 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Make the test results server store which master the bot is on
+ https://bugs.webkit.org/show_bug.cgi?id=48478
+
+ The chromium bots recently changed so that there are multiple slaves with
+ the same name on different masters. Up till now, the test results server
+ assumed slave names were unique. Adds a master field to the file in order
+ to distinguish.
+
+ Also, for files that currently lack a master or testtype, set them appropriately.
+
+ * TestResultServer/handlers/testfilehandler.py:
+ * TestResultServer/index.yaml:
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/testfile.py:
+ * TestResultServer/templates/showfilelist.html:
+ * TestResultServer/templates/uploadform.html:
+
+2010-10-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42322
+ rdar://problem/8193631
+
+ WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42333
+ rdar://problem/8193643
+
+ * WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
+ Renamed the product to WebKitTestRunnerInjectedBundle to avoid
+ name conflicts in the build directory.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpBackForwardList and clearBackForwardList.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle): Removed initialization of m_mainPage.
+ (WTR::InjectedBundle::didCreatePage): Removed unneeded underscore.
+ (WTR::InjectedBundle::willDestroyPage): Ditto.
+ (WTR::InjectedBundle::didReceiveMessage): Ditto.
+ (WTR::InjectedBundle::initialize): Ditto.
+ (WTR::InjectedBundle::didCreatePage): Changed code to use m_pages
+ instead of m_mainPage and m_otherPages.
+ (WTR::InjectedBundle::willDestroyPage): Ditto.
+ (WTR::InjectedBundle::page): Ditto.
+ (WTR::InjectedBundle::beginTesting): Ditto.
+ (WTR::InjectedBundle::done): Ditto.
+ (WTR::InjectedBundle::closeOtherPages): Ditto.
+ (WTR::InjectedBundle::dumpBackForwardListsForAllPages): Added.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Changed
+ page function to longer be inline, and pageCount function
+ to use m_pages. Added dumpBackForwardListsForAllPages, and
+ removed some underscores. Replaced m_mainPage and m_otherPageas
+ with m_pages.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::adoptWK): Added.
+ (WTR::hasPrefix): Added.
+ (WTR::InjectedBundlePage::reset): Added code to set up
+ m_previousTestBackForwardListItem.
+ (WTR::InjectedBundlePage::dump): Added code to call
+ dumpBackForwardListsForAllPages.
+ (WTR::compareByTargetName): Added.
+ (WTR::dumpBackForwardListItem): Added.
+ (WTR::InjectedBundlePage::dumpBackForwardList): Added.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added
+ dumpBackForwardList and m_previousTestBackForwardListItem.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize
+ m_shouldDumpBackForwardListsForAllWindows to false.
+ (WTR::LayoutTestController::clearBackForwardList): Added.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ Added dumpBackForwardList, clearBackForwardList,
+ shouldDumpBackForwardListsForAllWindows, and
+ m_shouldDumpBackForwardListsForAllWindows.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Set up
+ didReceiveSynchronousMessageFromInjectedBundle.
+ (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
+ Added.
+ * WebKitTestRunner/TestController.h: Ditto.
+
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+ Added.
+ * WebKitTestRunner/TestInvocation.h: Ditto.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ Renamed bundle to WebKitTestRunnerInjectedBundle (see above).
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::initializeInjectedBundlePath): Ditto.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Chris Marrin.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48279
+
+ * Scripts/build-webkit:
+
+2010-10-27 Eric Seidel <eric@webkit.org>
+
+ Unreviewed.
+
+ build-webkit should collect Visual Studio Express logs and display them
+ https://bugs.webkit.org/show_bug.cgi?id=39199
+
+ It turns out my previous patch wasn't actually working on the win-ews
+ machine. So I've fixed my mistakes from before.
+
+ * Scripts/build-webkit:
+ - Windows VSE builds change the CWD while building. Why? Who knows.
+ * Scripts/print-vse-failure-logs:
+ - windows VSE builds don't use Debug/Release as I expected, so I've
+ moved off of --configuration to --top-level and added the /obj
+ optimization while I was there.
+
+2010-10-27 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r70674.
+ http://trac.webkit.org/changeset/70674
+ https://bugs.webkit.org/show_bug.cgi?id=48053
+
+ Broke Chromium Windows build.
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-25 Tony Chang <tony@chromium.org>
+
+ Reviewed by Anders Carlsson.
+
+ compile TestNetscapePlugIn on chromium linux
+ https://bugs.webkit.org/show_bug.cgi?id=48274
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NP_Initialize): On Linux, plugin funcs are set in initialize.
+ (NPP_New): Mark the plugin as windowless.
+ (NPP_GetValue): Handle mime type values.
+ (NP_GetMIMEDescription):
+ (NP_GetValue):
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h: define TRUE and FALSE, which are in webkit's npapi.h.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h: Pull in npapi.h to get TRUE/FALSE (matches webkit's npfunctions.h)
+
+2010-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Remove contentSizeChanged callbacks as it is no longer
+ part of the public UIClient.
+
+ Make WKPageContentsSizeChangedCallback be a private API
+ https://bugs.webkit.org/show_bug.cgi?id=48409
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Ojan Vafai.
+
+ Make http locking default in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=48053
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Tony Chang.
+
+ [NRWT] Fix http lock on Windows platform
+ https://bugs.webkit.org/show_bug.cgi?id=48321
+
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
+
+2010-10-27 Satish Sampath <satish@chromium.org>
+
+ Unreviewed, rolling out r70665.
+ http://trac.webkit.org/changeset/70665
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ Need to address Alexey's review comments.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+
+2010-10-27 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ (LayoutTestController::pageSizeAndMarginsInPixels):
+
+2010-10-27 Adam Roben <aroben@apple.com>
+
+ Reset TestNetscapePlugIn's NPP_GetValue pointer when
+ NullNPPGetValuePointer finishes running
+
+ Fixes <http://webkit.org/b/48435> REGRESSION (r70655): Many plugins
+ tests are failing on Qt
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPP_Destroy):
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+ Added a do-nothing NPP_Destroy implementation.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp:
+ (NullNPPGetValuePointer::NullNPPGetValuePointer): Save the original
+ NPP_GetValue pointer in m_originalNPPGetValuePointer so we can restore
+ it later.
+ (NullNPPGetValuePointer::NPP_Destroy): Added. Restores the original
+ NPP_GetValue pointer so it can be used in other tests.
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_Destroy):
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_destroy_instance):
+ Call through to the PluginTest when NPP_Destroy is called.
+
+2010-10-26 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Adam Roben.
+
+ WebKit2 shouldn't try to send an empty user agent
+ https://bugs.webkit.org/show_bug.cgi?id=48397
+
+ Add a test that when we set our custom user agent to an empty string, we don't send
+ an empty user agent.
+
+ * TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp: Added.
+ (TestWebKitAPI::didRunJavaScript): Make sure that the result of navigator.userAgent isn't empty.
+ (TestWebKitAPI::TEST): Set our custom user agent to the empty string, and run navigator.userAgent.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add the new file.
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Ditto.
+
+2010-10-27 Adam Roben <aroben@apple.com>
+
+ Check in file I forgot in r70653
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (NP_Initialize): Save the NPPluginFuncs struct the browser passed to us
+ so we can be naughty and modify it later.
+
+2010-10-27 Adam Roben <aroben@apple.com>
+
+ Test that WebKit doesn't crash if the plugin passes 0 for its
+ NPP_GetValue pointer
+
+ Test for <http://webkit.org/b/48433> Crash in
+ NetscapePlugin::shouldLoadSrcURL when using Shockwave Director 10.3 in
+ WebKit2 on Windows
+
+ Reviewed by Eric Carlson.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * GNUmakefile.am:
+ Added NullNPPGetValuePointer.cpp.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ Set up a place to store the NPPluginFuncs struct the browser passed to us.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp: Added.
+ (NullNPPGetValuePointer::NullNPPGetValuePointer): Null out the
+ NPP_GetValue pointer we passed to the browser to simulate a plugin that
+ doesn't implement NPP_GetValue.
+ (NullNPPGetValuePointer::NPP_GetValue): Print an error message. If this
+ function is called, it means that WebKit has changed in a way that
+ makes this test invalid.
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NP_GetEntryPoints): Save the NPPluginFuncs struct the browser passed
+ to us so we can be naughty and modify it later.
+
+2010-10-27 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by Andreas Kling.
+
+ Remove references to ancient QGVLauncher and QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=48430
+
+ QtTestBrowser substitutes both and has checks enabled.
+
+ * Scripts/webkitpy/style/checker.py: remove references
+ * Scripts/webkitpy/style/checker_unittest.py: ditto
+
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Ojan Vafai.
+
+ [NRWT] Don't use image hash when it's no need in single test mode.
+ https://bugs.webkit.org/show_bug.cgi?id=48326
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+
+2010-10-27 David Kilzer <ddkilzer@apple.com>
+
+ Fix leak of CFMutableDictionaryRef in createXMLStringFromWebArchiveData()
+
+ Reviewed by Adam Roben.
+
+ Follow-up fix for: <https://bugs.webkit.org/show_bug.cgi?id=48278>
+
+ * DumpRenderTree/cf/WebArchiveDumpSupport.cpp:
+ (createXMLStringFromWebArchiveData): Use RetainPtr<> to fix a
+ leak introduced in r70613.
+
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [NRWT] Add platform specific baseline search paths for Qt port
+ https://bugs.webkit.org/show_bug.cgi?id=48428
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+
+2010-10-27 Adam Roben <aroben@apple.com>
+
+ Catch exceptions when checking if we're inside a git working directory
+
+ Fixes <http://webkit.org/b/48420> REGRESSION (r70562): test-webkitpy
+ fails on systems without git installed
+
+ Reviewed by Anders Carlsson.
+
+ * Scripts/webkitpy/common/net/credentials.py:
+ (Credentials._credentials_from_git): Put the call to
+ Git.in_working_directory inside the try/except since it, too, attempts
+ to execute git and thus will throw on systems that don't have git
+ installed.
+
+2010-10-27 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by David Kilzer.
+
+ Convert DumpRenderTree webarchive code to CoreFoundation
+ https://bugs.webkit.org/show_bug.cgi?id=48278
+
+ CFPropertyListCreateWithData and CFPropertyListCreateData are only available in 10.6+.
+ Replace CFPropertyListCreateWithData by a combination of CFReadStreamCreateWithBytesNoCopy and CFPropertyListCreateFromStream.
+ Replace CFPropertyListCreateData by CFPropertyListCreateXMLData.
+
+ These changes are wrapped in BUILDING_ON_LEOPARD, as the methods are deprecated on 10.6+.
+
+ * DumpRenderTree/cf/WebArchiveDumpSupport.cpp:
+ (createXMLStringFromWebArchiveData):
+
+2010-10-26 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Martin Robinson.
+
+ Remove the absolute path used to include DumpRenderTreeSupportGtk.h from LayoutTestController.h
+
+ It turns out this is rather unneeded since WebKitTools/GNUMakefile.am has WebKit/gtk/ in its include
+ path, and then we can just do #include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+
+2010-10-26 David Kilzer <ddkilzer@apple.com>
+
+ Rename WebArchiveDumpSupport.mm to WebArchiveDumpSupport.cpp
+
+ Reviewed by Adam Roben.
+
+ Part 4 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Updated for file moves and renames.
+ * DumpRenderTree/cf/WebArchiveDumpSupport.cpp: Renamed from DumpRenderTree/mac/WebArchiveDumpSupport.mm.
+ * DumpRenderTree/cf/WebArchiveDumpSupport.h: Renamed from DumpRenderTree/mac/WebArchiveDumpSupport.h.
+
+2010-10-26 David Kilzer <ddkilzer@apple.com>
+
+ Convert WebArchiveDumpSupport.mm from NS objects to CF types
+
+ Reviewed by Adam Roben.
+
+ Part 3 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
+
+ In order to share WebArchive code between the Mac and Windows
+ ports, the code in WebArchiveDumpSupport.mm was converted from
+ Cocoa to C++ using CoreFoundation (CF) types.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dump): Renamed serializeWebArchiveToXML() to
+ createXMLStringFromWebArchiveData() and added HardAutorelease()
+ to prevent leaks.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h:
+ (createXMLStringFromWebArchiveData): Renamed from
+ serializeWebArchiveToXML(). Changed to use CF types.
+ (createCFURLResponseFromResponseData): Renamed from
+ unarchiveNSURLResponseFromResponseData(). Changed to use CF
+ types for its parameter and return type.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm: Replaced use of
+ NS objects with CF types. It will be renamed to *.cpp in a
+ future commit.
+ (convertMIMEType): Changed to use case-insensitive string
+ comparisons.
+ (convertWebResourceDataToString):
+ (normalizeHTTPResponseHeaderFields):
+ (normalizeWebResourceURL):
+ (convertWebResourceResponseToDictionary):
+ (compareResourceURLs):
+ (createXMLStringFromWebArchiveData):
+ * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm:
+ (createCFURLResponseFromResponseData): Renamed from
+ unarchiveNSURLResponseFromResponseData(). Changed to use CF
+ types for its parameter and return type.
+
+2010-10-26 David Kilzer <ddkilzer@apple.com>
+
+ Extract use of NSKeyedUnarchiver from WebArchiveDumpSupport.mm
+
+ Reviewed by Adam Roben.
+
+ Part 2 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
+
+ There is no equivalent to NSKeyedUnarchiver in CoreFoundation,
+ so extract it into a platform-specific source file.
+
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h:
+ (unarchiveNSURLResponseFromResponseData): Added declaration.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm:
+ (convertWebResourceResponseToDictionary): Extracted code to
+ unarchiveNSURLResponseFromResponseData() in
+ WebArchiveDumpSupportMac.mm. Updated logic to return early if
+ nil is returned from unarchiveNSURLResponseFromResponseData().
+ * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm:
+ (unarchiveNSURLResponseFromResponseData): Added. Extracted
+ code from convertWebResourceResponseToDictionary() in
+ WebArchiveDumpSupport.mm.
+
+2010-10-26 David Kilzer <ddkilzer@apple.com>
+
+ Extract call to -[WebHTMLRepresentation supportedNonImageMIMETypes] from WebArchiveDumpSupport.mm
+
+ Reviewed by Adam Roben.
+
+ Part 1 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
+
+ The call to -[WebHTMLRepresentation supportedNonImageMIMETypes]
+ is not cross-platform between Mac and Windows, so extract it
+ into a platform-specific source file.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added
+ WebArchiveDumpSupportMac.mm to the project.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h:
+ (supportedNonImageMIMETypes): Added declaration.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm:
+ (convertWebResourceDataToString): Replaced call to
+ -[WebHTMLRepresentation supportedNonImageMIMETypes] with
+ supportedNonImageMIMETypes().
+ * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm: Added.
+ (supportedNonImageMIMETypes): Added. Extracted from
+ WebArchiveDumpSupport.mm.
+
+2010-10-26 Antonio Gomes <agomes@rim.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Implement DumpRenderTreeSupportGtk (similarly to DumpRenderTreeSupportQt idea)
+ https://bugs.webkit.org/show_bug.cgi?id=48199
+
+ Implements support to WebKitTabToLinksPreferenceKey through LayoutTestController::overridePreference.
+ The corresponding DumpRenderTreeSupportGtk method is called in the DRT context only.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ (createWebView):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::overridePreference):
+
+2010-10-26 Ariya Hidayat <ariya@sencha.com>
+
+ Unreviewed, change the order of my emails for bugzilla autocompletion.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-10-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ build-webkit should collect Visual Studio Express logs and display them
+ https://bugs.webkit.org/show_bug.cgi?id=39199
+
+ * Scripts/build-webkit:
+ * Scripts/print-vse-failure-logs: Added.
+ * Scripts/webkitdirs.pm:
+
+2010-10-26 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48224> build-webkit: add support for --meter-tag switch
+
+ Reviewed by Csaba Osztrogonác.
+
+ * Scripts/build-webkit: Added support for --meter-tag switch.
+ It should have been added with r60820.
+
+2010-10-26 Ademar de Souza Reis Jr. <ademar.reis@openbossa.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ check-webkit-style fails on operator+=, operator-=, ... methods
+ https://bugs.webkit.org/show_bug.cgi?id=48258
+
+ * Scripts/webkitpy/style/checkers/cpp.py: Added exceptions
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added unit-tests
+
+2010-10-26 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ remove DEFER support from new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=48387
+
+ DEFER was needed when we were trying to ship Chrome beta.
+ Now it's just extra complication.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
+
+2010-10-26 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Adding import with_statement to fix python 2.5.
+
+ Teach webkit-patch how to read credentials from the environment
+ https://bugs.webkit.org/show_bug.cgi?id=48275
+
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ - import with_statement to fix python 2.5.
+
+2010-10-26 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48375
+ <rdar://problem/8392724> Need delegate calls in PageLoaderClient to indicate if we have
+ loaded insecure content
+
+ Updated for WebKit2 changes.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didDisplayInsecureContentForFrame):
+ (didRunInsecureContentForFrame):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::didDisplayInsecureContentForFrame):
+ (WTR::InjectedBundlePage::didRunInsecureContentForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+
+2010-10-26 Adam Roben <aroben@apple.com>
+
+ Clear up confusion between "3D rendering" and "accelerated compositing"
+
+ WebKit has no software-based 3D rendering implementation, so 3D
+ rendering can only be enabled when accelerated compositing is. But DRT
+ was falsely reporting that 3D rendering was available on machines that
+ don't support accelerated compositing, leading to much confusion.
+
+ Reviewed by Darin Adler.
+
+ Fixes <http://webkit.org/b/48370> REGRESSION (r70540): Many
+ transforms/3d tests are failing on the XP bots
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main): When ENABLE(3D_RENDERING) is turned on, only report that 3D
+ rendering is available when acclerated compositing is also available.
+
+ * Scripts/old-run-webkit-tests: Skip tests that use the
+ -webkit-transform-3d media query when 3D rendering is disabled,
+ rather than when accelerated compositing is disabled.
+
+2010-10-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ Remove rietveld code now that it's unused
+ https://bugs.webkit.org/show_bug.cgi?id=48359
+
+ Was cool that we added this support, but now that it's
+ not used it makes little sense to keep it around.
+ We can always restore this code from SVN if we need it.
+
+ * Scripts/webkitpy/common/config/__init__.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/common/net/rietveld.py: Removed.
+ * Scripts/webkitpy/common/net/rietveld_unittest.py: Removed.
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py: Removed.
+
+2010-10-26 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ pageDidScroll callback should be on the UI process client rather than (or in addition to) the web process client
+ https://bugs.webkit.org/show_bug.cgi?id=48366
+ <rdar://problem/8595202>
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-10-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ Teach webkit-patch how to read credentials from the environment
+ https://bugs.webkit.org/show_bug.cgi?id=48275
+
+ This makes it possible for svn users to have their bugzilla credentials
+ stored in their environment instead of typing them every time.
+
+ We need this for making it easy to run the win-ews bot (which currently
+ uses svn instead of git).
+
+ * Scripts/webkitpy/common/net/credentials.py:
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+
+2010-10-26 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Kent Tamura.
+
+ Input Method inserts conversion candidates unexpectedly
+ https://bugs.webkit.org/show_bug.cgi?id=46868
+
+ Adds setComposition() to TextInputController to make DRT emulate
+ an input method behavior.
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+ (TextInputController::setComposition): Added.
+ * DumpRenderTree/chromium/TextInputController.h:
+
+2010-10-26 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Support layoutTestController.layerTreeAsText in WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=42145
+
+ Implement layerTreeAsText() in WebKitTestRunner.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::layerTreeAsText):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+
+2010-10-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch rollout produces incorrect patch when using svn move
+ https://bugs.webkit.org/show_bug.cgi?id=48244
+
+ We need to flush our caches when we modify the working copy.
+
+ * Scripts/webkitpy/tool/steps/revertrevision.py:
+
+2010-10-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue flaky test message can list the same author more than once
+ https://bugs.webkit.org/show_bug.cgi?id=48268
+
+ tonikitoo reported to me over IRC this morning that he's seen
+ the commit-queue report flaky tests with author lists like:
+ "adam, adam and adam", suggesting we're not uniquing authors
+ before writing the message.
+
+ I fixed the uniquing and added a bunch more unit testing.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-10-26 Adam Roben <aroben@apple.com>
+
+ Pull in the FeatureDefines*.vsprops files when building DRT
+
+ This ensures that various ENABLE() macros will get set correctly.
+ (Prior to r70320 we were picking up the ENABLE(3D_RENDERING) flag
+ through wtf/Platform.h.)
+
+ Fixes <http://webkit.org/b/48343> REGRESSION (r70320): DumpRenderTree
+ says 3D_RENDERING is disabled even when it is enabled
+
+ Reviewed by Ada Chan.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Added
+ FeaturesDefines*.vsprops to all configurations.
+
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Touched to force a rebuild.
+
+2010-10-26 Søren Gjesse <sgjesse@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Added options --multiple-loads and --js-flags to chromium DumpRenderTree. The option --multiple-loads=X
+ is used to have DumpRenderTree load each test it runs X times. To be able to have more fine-grained control
+ of how the JavaScript engine behaves for each load the flag --js-flags can specify a list of flag-sets like this
+
+ --js-flags="--xxx,--noxxx --yyy,--noyyy"
+
+ First load will run with --xxx, the second with --yyy and the third without any (the 'no' prefix is handled by
+ V8 to turn off the flag).
+
+ The changes to the Python test runner will be in a separate change.
+
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (runTest):
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::runFileTest):
+ (TestShell::testFinished):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::loadCount):
+ (TestShell::setLoadCount):
+ (TestShell::javaScriptFlagsForLoad):
+ (TestShell::setJavaScriptFlags):
+ (TestShell::setDumpWhenFinished):
+
+2010-10-26 Adam Roben <aroben@apple.com>
+
+ Skip more tests that depend on accelerated compositing when accelerated
+ compositing is disabled
+
+ Fixes <http://webkit.org/b/48329> Some tests fail when accelerated
+ compositing is disabled
+
+ Reviewed by John Sullivan.
+
+ * Scripts/old-run-webkit-tests: Added more tests to skip when
+ accelerated compositing is disable. The tests all have output that
+ changes depending on whether accelerated compositing is enabled.
+
+2010-10-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch should clean up svn locks when passed --force-clean
+ https://bugs.webkit.org/show_bug.cgi?id=48269
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+
+2010-10-25 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Add a pageDidScroll BundleUIClient callback
+ https://bugs.webkit.org/show_bug.cgi?id=48260
+ <rdar://problem/8531159>
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+
+2010-10-25 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Dump the gesture status of frame in frame load callbacks in DumpRenderTree
+ by adding a new method dumpUserGestureInFrameLoadCallbacks.
+ Now only dump the gesture status in "DidStartProvisionalLoad" callback.
+ https://bugs.webkit.org/show_bug.cgi?id=47849
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpUserGestureInFrameLoadCallbacksCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
+ (LayoutTestController::setDumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::shouldDumpUserGestureInFrameLoadCallbacks):
+ (LayoutTestController::setShouldDumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::shouldDumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didStartProvisionalLoad):
+ (WebViewHost::printFrameUserGestureStatus):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[WebFrame _drt_printFrameUserGestureStatus]):
+ (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]):
+ (-[FrameLoadDelegate webView:didCommitLoadForFrame:]):
+ (-[FrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
+ (-[FrameLoadDelegate webView:didFinishLoadForFrame:]):
+ (-[FrameLoadDelegate webView:didFailLoadWithError:forFrame:]):
+ (-[FrameLoadDelegate webView:windowScriptObjectAvailable:]):
+ (-[FrameLoadDelegate webView:didReceiveTitle:forFrame:]):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70442.
+ http://trac.webkit.org/changeset/70442
+ https://bugs.webkit.org/show_bug.cgi?id=48248
+
+ http locking doesn't work on Windows (Requested by Ossy on
+ #webkit).
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-25 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Ojan Vafai.
+
+ Make http locking default in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=48053
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-25 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48185> build-webkit: add support for --progress-tag switch
+ (Re-landing r70413 after Qt minimal buildfix: r70440.)
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Scripts/build-webkit: Added support for --progress-tag switch.
+ It should have been added with r57051.
+
+2010-10-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ webkit-patch upload fails when the patch removes a file
+ https://bugs.webkit.org/show_bug.cgi?id=48187
+
+ We need to use "--" to separate file names from the rest of the
+ command.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+
+2010-10-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70413.
+ http://trac.webkit.org/changeset/70413
+ https://bugs.webkit.org/show_bug.cgi?id=48210
+
+ It broke Qt minimal build (Requested by Ossy on #webkit).
+
+ * Scripts/build-webkit:
+
+2010-10-24 Yi Shen <yi.4.shen@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt][QtTestBrowser] Toggle use of QGraphicsView messes up the menu
+ https://bugs.webkit.org/show_bug.cgi?id=48141
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::toggleWebView):
+
+2010-10-24 Daniel Bates <dbates@rim.com>
+
+ Reviewed by David Kilzer.
+
+ Fix Perl uninitialized warnings in VCSUtils::svnStatus()
+ and VCSUtils::removeEOL().
+ https://bugs.webkit.org/show_bug.cgi?id=48196
+
+ VCSUtils::svnStatus() concatenates the output of svn status with
+ a new line character and svn status may return no output (say for
+ a file that has not been added, deleted, or modified). We should
+ only concatenate the output of svn status if there is some.
+
+ Also, VCSUtils::removeEOL() should ensure that its argument
+ is initialized before performing a string substitution.
+
+ * Scripts/VCSUtils.pm:
+ - Modified removeEOL() to return "" if its argument is undefined.
+ - Exported removeEOL() so that it can be tested.
+ * Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl: Added.
+
+2010-10-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48185> build-webkit: add support for --progress-tag switch
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * Scripts/build-webkit: Added support for --progress-tag switch.
+ It should have been added with r57051.
+
+2010-10-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48184> build-webkit: reformat support variables for better maintainability
+
+ Reviewed by Daniel Bates.
+
+ * Scripts/build-webkit: Alphabetized the @features array based
+ on the name of the feature. Reformatted the list of support
+ variables so that they match the order of @features, and so that
+ each has its own line. This makes it easy to add new variables
+ in the correct order.
+
+2010-10-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ EWS never removes invalid patch ids
+ https://bugs.webkit.org/show_bug.cgi?id=48173
+
+ This is just sticking another finger in the dam.
+ However this adds more unit testing which will help
+ us make sure we're always releasing patches once we
+ redesign the release_patch API and call these from
+ a more central place.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Added the ability to request invalid patches.
+ Log a warning message to make sure we don't ever have
+ tests use invalid patch fetches by mistake.
+
+2010-10-23 Dan Bernstein <mitz@apple.com>
+
+ Build fix. Add stub implementations for required NSDraggingInfo methods.
+
+ * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
+ (-[DumpRenderTreeDraggingInfo draggingFormation]):
+ (-[DumpRenderTreeDraggingInfo setDraggingFormation:]):
+ (-[DumpRenderTreeDraggingInfo animatesToDestination]):
+ (-[DumpRenderTreeDraggingInfo setAnimatesToDestination:]):
+ (-[DumpRenderTreeDraggingInfo numberOfValidItemsForDrop]):
+ (-[DumpRenderTreeDraggingInfo setNumberOfValidItemsForDrop:]):
+ (-[DumpRenderTreeDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
+
+2010-10-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48186> Remove unneeded WebHTMLRepresentationInternal.h header
+
+ Reviewed by Sam Weinig.
+
+ The only method defined in WebHTMLRepresentationInternal.h is
+ also defined in WebHTMLRepresentation.h, so use that instead.
+
+ * DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h: Removed.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm: Switched to use
+ WebHTMLRepresentation.h.
+
+2010-10-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70367.
+ http://trac.webkit.org/changeset/70367
+ https://bugs.webkit.org/show_bug.cgi?id=48176
+
+ It made 8-10 tests crash on Qt bot (Requested by Ossy on
+ #webkit).
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setCustomPolicyDelegateCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/mac/PolicyDelegate.h:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ (-[PolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
+ (-[PolicyDelegate setPermissive:]):
+ (-[PolicyDelegate setControllerToNotifyDone:]):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+
+2010-10-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ EWS never releases patches which fail to apply
+ https://bugs.webkit.org/show_bug.cgi?id=48171
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-10-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed.
+
+ Make the EWS queues restart themselves more often.
+ This matches the commit-queue.
+
+ * EWSTools/start-queue.sh:
+
+2010-10-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should not pass --quiet to subcommands now that the parent command does the reporting
+ https://bugs.webkit.org/show_bug.cgi?id=48165
+
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-10-22 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Adding myself as a committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-10-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Barth and Darin Adler.
+
+ Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48014
+ <rdar://problem/8202716>
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setCustomPolicyDelegateCallback):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
+
+ * DumpRenderTree/mac/PolicyDelegate.h:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ (-[PolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
+ If _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond is true, call [listener ignore] after one second.
+
+ (-[PolicyDelegate setCallIgnoreInDecidePolicyForMIMETypeAfterOneSecond:]):
+ Update _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Rename the InjectedBundle for TestWebKitAPI to InjectedBundleTestWebKitAPI.bundle
+
+ * TestWebKitAPI/Configurations/InjectedBundle.xcconfig:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+ (TestWebKitAPI::Util::createInjectedBundlePath):
+
+2010-10-22 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ test-webkitpy fails when passed -v (or any other option)
+
+ Fix port/base_unittest to pass an explicit list of arguments
+ rather than accidentally picking up sys.argv.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48071
+
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+
+2010-10-22 Brian Weinstein <bweinstein@apple.com>
+
+ Windows build fix. Update the createNewPage callback to account for the new
+ arguments.
+
+ * MiniBrowser/win/BrowserView.cpp:
+ (createNewPage):
+
+2010-10-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (createNewPage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ Update for new signature for the WKPageCreateNewPageCallback.
+
+2010-10-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Just adding a test case.
+
+ The style-queue was not recognizing new patches. It turns
+ out I had fixed this in an earlier change, but just not
+ deployed to queues.webkit.org. As part of investigating why it
+ was broken, I wrote a test for my previous change which I'm now landing.
+
+ * QueueStatusServer/model/queues_unittest.py:
+
+2010-10-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ EWS does not need to process obsolete patches
+ https://bugs.webkit.org/show_bug.cgi?id=48093
+
+ This was an easy change, but to test it I had to pipe
+ real Attachment objects into the queue testing system.
+ Doing so revealed a whole bunch of bugs in our unit tests,
+ which I fixed as part of this patch.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ - This is the actual code change. This will not reduce the
+ backlog in the EWS queues much, but it will make rejections
+ much quicker for obsolete patches or closed bugs.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ - Test my new code.
+ - Used a real attachment object and got rid of MockPatch
+ - Shared code between the mac-ews and cr-mac-ews tests.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ - Can't use MockPatch anymore.
+ - Removing MockPatch found more bugs here!
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ - MockBugzilla should not be a "Mock" object. Right now tool.bugs()
+ is allowed, but wrong. Making it not a Mock will make tool.bugs() correctly fail.
+
+2010-10-22 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70301.
+ http://trac.webkit.org/changeset/70301
+ https://bugs.webkit.org/show_bug.cgi?id=48126
+
+ "Lang attribute layout tests failing" (Requested by satish on
+ #webkit).
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+
+2010-10-22 Leandro Gracia Gil <leandrogracia@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+
+2010-10-21 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ [Win][DRT] should have LayoutTestController.hasSpellingMarker()
+ https://bugs.webkit.org/show_bug.cgi?id=47885
+
+ - Implemented LayoutTestController.hasSpellingMarker(),
+ - Added fake spellcheck implementation.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/win/EditingDelegate.cpp:
+ (indexOfFirstWordCharacter):
+ (wordLength):
+ (EditingDelegate::checkSpellingOfString):
+ * DumpRenderTree/win/EditingDelegate.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::hasSpellingMarker):
+
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
+
+ Unreviewed. Re-enable test that was mistakenly disabled by r67974.
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
+
+ Unreviewed fix for rebaseline-chromium-webkit-tests.
+
+ Port.diff_image no longer has a tolerance parameter. Also, use
+ get_option('tolerance') which is safer if the options object doesn't
+ define a tolerance attribute (it doesn't for the one used in
+ rebaseline_chromium_webkit_tests).
+
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add support for --tolerance in NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=47959
+
+ Add support for the --tolerance flag in NRWT. The Port.diff_image
+ signature shouldn't need a tolerance parameter (it's not set per test),
+ just have ports that use it (currently only WebKitPort) read it from
+ the options object.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-10-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add --suggest-reviewers option to upload to auto-suggest reviewers for your patch
+ https://bugs.webkit.org/show_bug.cgi?id=48088
+
+ This is a first-pass. Works, but we'll eventually
+ turn this on by default, refine the suggestion algorithm
+ and possibly move it to a different place in the upload step order.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+
+2010-10-21 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [GTK] Segfault while testing accessibility/iframe-bastardization.html
+ https://bugs.webkit.org/show_bug.cgi?id=30123
+
+ Check m_element before actually using it to get the parent.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::parentElement): Add an extra check to
+ make sure m_element points to a valid value before actually using
+ it to get the parent. Also, assert ATK_IS_OBJECT(m_element).
+
+2010-10-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Crash evaluating JavaScript string that throws an exception
+ https://bugs.webkit.org/show_bug.cgi?id=48092
+ <rdar://problem/8487657>
+
+ Add a test that evaluates a JavaScript string that throws an exception and check that
+ the callback is called.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp: Added.
+ (TestWebKitAPI::didRunJavaScript):
+ (TestWebKitAPI::WebKit2_EvaluateJavaScript):
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj:
+
+2010-10-21 Adam Roben <aroben@apple.com>
+
+ Test that the plugin's HWND is invalidated when NPN_InvalidateRect is
+ called
+
+ Test for <http://webkit.org/b/48086> <rdar://problem/8482944>
+ Silverlight doesn't repaint in WebKit2
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPN_InvalidateRect): Added. Calls through to the browser.
+ (executeScript): Added. Asks the browser to evaluate the script.
+
+ (PluginTest::waitUntilDone):
+ (PluginTest::notifyDone):
+ Added. Calls through to layoutTestController.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added
+ * NPN_InvalidateRect and waitUntilDone/notifyDone.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp: Added.
+ (TemporaryWindowMover::moveSucceeded):
+ (TemporaryWindowMover::TemporaryWindowMover):
+ (TemporaryWindowMover::~TemporaryWindowMover):
+ This class moves a window on-screen and shows it, then moves it back and hides it.
+
+ (NPNInvalidateRectInvalidatesWindow::NPNInvalidateRectInvalidatesWindow):
+ Initialize our members.
+ (NPNInvalidateRectInvalidatesWindow::~NPNInvalidateRectInvalidatesWindow):
+ Delete our window mover if it hasn't been deleted already.
+ (NPNInvalidateRectInvalidatesWindow::NPP_SetWindow): Subclass the
+ plugin HWND and move the test harness window on screen.
+ (NPNInvalidateRectInvalidatesWindow::wndProc): Call through to onPaint
+ when we get a WM_PAINT message.
+ (NPNInvalidateRectInvalidatesWindow::onPaint): Do the test and tell
+ LayoutTestController we're done.
+ (NPNInvalidateRectInvalidatesWindow::testInvalidateRect): Validate
+ ourselves, invalidate our lower-right quadrant via NPN_InvalidateRect,
+ then check that our HWND's invalid region is the rect that we
+ invalidated.
+
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * Added NPNInvalidateRectInvalidatesWindow.
+
+2010-10-21 Daniel Bates <dbates@rim.com>
+
+ Add Git-support to do-file-rename
+ https://bugs.webkit.org/show_bug.cgi?id=48015
+
+ Fix tools. Export function scmMoveOrRenameFile so that it can be called from
+ do-file-rename and do-webcore-rename. I inadvertently left this out of the patch.
+
+ * Scripts/VCSUtils.pm:
+
+2010-10-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ mac-ews is not properly releasing patches
+ https://bugs.webkit.org/show_bug.cgi?id=48076
+
+ mac-ews overrides process_work_item, so it was not calling
+ release_work_item like the default process_work_item would.
+ To fix this I made all the status-reporting methods just
+ release the patch. I expect we'll iterate on this design further.
+
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-10-18 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] mathml flaky tests after adding SystemFonts to the theme
+ https://bugs.webkit.org/show_bug.cgi?id=47727
+
+ The Fontconfig setup in the GTK+ now specifically checks for and
+ loads the STIX fonts for MathML tests.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Add hooks for loading the STIX fonts specifically.
+
+2010-10-20 Adam Roben <aroben@apple.com>
+
+ Test that the UI client gets notified when WKView receives a WM_CLOSE
+ message
+
+ Test for <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
+ Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
+ close its parent window
+
+ Reviewed by Jon Honeycutt.
+
+ * TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: Added.
+ (TestWebKitAPI::close): Record that this function was called.
+ (TestWebKitAPI::WebKit2_WMCloseCallsUIClientClose): Create a WKView,
+ send it a WM_CLOSE message, and test that the UI client's close
+ callback got called. Note that this will hang if the bug is
+ reintroduced; <http://webkit.org/b/48043> covers making TestWebKitAPI
+ able to handle hangs.
+
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added the new test.
+
+2010-10-20 Adam Roben <aroben@apple.com>
+
+ Make prepare-ChangeLog much faster when using git
+
+ This change also seems to make it detect renames better in some cases.
+
+ Fixes <http://webkit.org/b/48040> prepare-ChangeLog is slow when using
+ git
+
+ Reviewed by David Kilzer.
+
+ * Scripts/prepare-ChangeLog:
+ (statusCommand):
+ (createPatchCommand):
+ Use "-M -C" instead of "-C -C -M" to tell git-diff to detect renames
+ and copies. The two "-C"s were making it read many more files than were
+ necessary.
+
+2010-10-21 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Null frame passed when running alert from UserScript run at document start
+ <rdar://problem/8573809>
+ https://bugs.webkit.org/show_bug.cgi?id=48036
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/InjectedBundleController.cpp:
+ (TestWebKitAPI::InjectedBundleController::didReceiveMessage):
+ (TestWebKitAPI::InjectedBundleController::initializeTestNamed):
+ * TestWebKitAPI/InjectedBundleController.h:
+ * TestWebKitAPI/InjectedBundleTest.h:
+ (TestWebKitAPI::InjectedBundleTest::initialize):
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: Added.
+ (TestWebKitAPI::runJavaScriptAlert):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp: Added.
+ (TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::DocumentStartUserScriptAlertCrashTest):
+ (TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::initialize):
+ Add test for invoking an alert during a UserScript run at document start.
+
+2010-10-21 Andreas Kling <kling@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ TestNetscapePlugIn: Actually call NPP_SetWindow on Unix
+
+ We were just returning NPERR_NO_ERROR previously.
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_set_window):
+
+2010-10-21 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48051> Move macros from DumpRenderTreeMac.h to config.h
+
+ Reviewed by Adam Roben.
+
+ * DumpRenderTree/config.h: Moved macros to here...
+ * DumpRenderTree/mac/DumpRenderTreeMac.h: ...from here.
+ Addresses a FIXME comment from r28419.
+
+2010-10-21 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/48047> Fix warnings found by check-Xcode-source-file-types
+
+ Reviewed by Adam Roben.
+
+ Fixes the following warnings:
+
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'PixelDumpSupport.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'LayoutTestController.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'WorkQueue.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'cg/PixelDumpSupportCG.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'GCController.cpp'.
+ 5 issues found for WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Removed explicit file type for *.cpp files above to make them
+ match other C++ source files. This exposed the fact that
+ DumpRenderTreeMac.h was not safe to include in C++ source, which
+ caused PixelDumpSupport.cpp and PixelDumpSupportCG.cpp to fail
+ to build.
+ * DumpRenderTree/PixelDumpSupport.cpp: Adjusted header order.
+ * DumpRenderTree/mac/DumpRenderTreeMac.h: Made safe to include
+ in C++ source files. Included CoreFoundation/CoreFoundation.h
+ to make sure all CF types were defined. Removed CFStringRef
+ typedef.
+
+2010-10-21 Adam Roben <aroben@apple.com>
+
+ Attempt to fix plugins/pass-different-npp-struct.html on GTK.
+
+ See <http://webkit.org/b/47690>.
+
+ * GNUmakefile.am: Added PassDifferentNPPStruct.cpp.
+
+2010-10-21 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Csaba Osztrogonác.
+
+ [NRWT] Set ImageDiff path on Qt port
+ https://bugs.webkit.org/show_bug.cgi?id=48052
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+
+2010-10-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't CC authors of flaky tests
+ https://bugs.webkit.org/show_bug.cgi?id=48038
+
+ Some authors found this too annoying. We'll look for another way to
+ close the flaky test loop.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-10-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should run run-webkit-tests with --no-new-test-results
+ https://bugs.webkit.org/show_bug.cgi?id=47998
+
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+
+2010-10-21 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Ojan Vafai.
+
+ [NRWT] Get child process number from an environment variable
+ https://bugs.webkit.org/show_bug.cgi?id=47981
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
2010-10-20 David Kilzer <ddkilzer@apple.com>
<http://webkit.org/b/47754> New script to verify explicit source file types in Xcode project files
@@ -30,8 +2112,8 @@
Reviewed by Adam Roben.
- https://bugs.webkit.org/show_bug.cgi?id=48027
Add ability to test injected bundle API using TestWebKitAPI
+ https://bugs.webkit.org/show_bug.cgi?id=48027
* TestWebKitAPI/InjectedBundleController.cpp: Added.
* TestWebKitAPI/InjectedBundleController.h: Added.
@@ -218,7 +2300,7 @@
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::setMockSpeechInputResult):
-2010-10-19 Leandro Gracia Gil <leandrogracia@google.com>
+2010-10-20 Leandro Gracia Gil <leandrogracia@google.com>
Reviewed by Jeremy Orlow.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 52d238d..87be335 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -204,6 +204,15 @@ static JSValueRef childAtIndexCallback(JSContextRef context, JSObjectRef functio
return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->getChildAtIndex(indexNumber));
}
+static JSValueRef selectedChildAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int indexNumber = -1;
+ if (argumentCount == 1)
+ indexNumber = JSValueToNumber(context, arguments[0], exception);
+
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->selectedChildAtIndex(indexNumber));
+}
+
static JSValueRef linkedUIElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int indexNumber = -1;
@@ -260,6 +269,17 @@ static JSValueRef isEqualCallback(JSContextRef context, JSObjectRef function, JS
return JSValueMakeBoolean(context, toAXElement(thisObject)->isEqual(toAXElement(otherElement)));
}
+static JSValueRef setSelectedChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ JSObjectRef element = 0;
+ if (argumentCount == 1)
+ element = JSValueToObject(context, arguments[0], exception);
+
+ toAXElement(thisObject)->setSelectedChild(toAXElement(element));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef elementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int x = 0;
@@ -695,6 +715,11 @@ static JSValueRef speakCallback(JSContextRef context, JSObjectRef thisObject, JS
return JSValueMakeString(context, speakString.get());
}
+static JSValueRef selectedChildrenCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ return JSValueMakeNumber(context, toAXElement(thisObject)->selectedChildrenCount());
+}
+
static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
@@ -757,6 +782,9 @@ static JSValueRef removeNotificationListenerCallback(JSContextRef context, JSObj
#if !PLATFORM(MAC)
JSStringRef AccessibilityUIElement::speak() { return 0; }
JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
+unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
+AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
#endif
#if !SUPPORTS_AX_TEXTMARKERS
@@ -860,6 +888,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "speak", speakCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedChildrenCount", selectedChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0, 0 }
};
@@ -920,6 +949,8 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "accessibilityElementForTextMarker", accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedChildAtIndex", selectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 9311dfd..3120e65 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -130,9 +130,14 @@ public:
JSStringRef selectedTextRange();
bool isEnabled();
bool isRequired() const;
+
bool isSelected() const;
bool isSelectable() const;
bool isMultiSelectable() const;
+ void setSelectedChild(AccessibilityUIElement*) const;
+ unsigned selectedChildrenCount() const;
+ AccessibilityUIElement selectedChildAtIndex(unsigned) const;
+
bool isExpanded() const;
bool isChecked() const;
bool isVisible() const;
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
index 51d8e7f..bf0aebf 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
@@ -48,7 +48,8 @@
29CFBA2E12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */; };
3713EDE2115BE19300705720 /* ColorBits-A.png in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 3713EDDF115BE16F00705720 /* ColorBits-A.png */; };
3713EDE3115BE19300705720 /* ColorBits.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 3713EDE0115BE16F00705720 /* ColorBits.ttf */; };
- 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.mm */; };
+ 440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */; };
+ 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */; };
4437730F125CBC4D00AAE02C /* WebArchiveDumpSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */; };
5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; };
5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; };
@@ -131,6 +132,7 @@
BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */; };
BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF6C64F0C98E9C000AC063E /* GCController.cpp */; };
C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */; };
+ C0EC3C9C12787F0500939164 /* NullNPPGetValuePointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */; };
E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */; };
E1B7816711AF31C3007E1BC2 /* MockGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */; };
/* End PBXBuildFile section */
@@ -223,11 +225,12 @@
375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher700.ttf; path = fonts/WebKitWeightWatcher700.ttf; sourceTree = "<group>"; };
375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher800.ttf; path = fonts/WebKitWeightWatcher800.ttf; sourceTree = "<group>"; };
375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher900.ttf; path = fonts/WebKitWeightWatcher900.ttf; sourceTree = "<group>"; };
- 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebArchiveDumpSupport.h; path = mac/WebArchiveDumpSupport.h; sourceTree = "<group>"; };
- 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebArchiveDumpSupport.mm; path = mac/WebArchiveDumpSupport.mm; sourceTree = "<group>"; };
+ 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebArchiveDumpSupportMac.mm; path = mac/WebArchiveDumpSupportMac.mm; sourceTree = "<group>"; };
+ 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebArchiveDumpSupport.h; path = cf/WebArchiveDumpSupport.h; sourceTree = "<group>"; };
+ 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebArchiveDumpSupport.cpp; path = cf/WebArchiveDumpSupport.cpp; sourceTree = "<group>"; };
5185F69E10714A57007AA393 /* HistoryDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryDelegate.h; path = mac/HistoryDelegate.h; sourceTree = "<group>"; };
5185F69F10714A57007AA393 /* HistoryDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = HistoryDelegate.mm; path = mac/HistoryDelegate.mm; sourceTree = "<group>"; };
- 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
+ 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
933BF5A90F93FA5C000F0441 /* PlainTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlainTextController.h; path = mac/PlainTextController.h; sourceTree = "<group>"; };
933BF5AA0F93FA5C000F0441 /* PlainTextController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlainTextController.mm; path = mac/PlainTextController.mm; sourceTree = "<group>"; };
@@ -247,14 +250,14 @@
AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
B5A7526708AF4A4A00138E45 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; };
B5A752A108AF5D1F00138E45 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
- BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = LayoutTestController.cpp; sourceTree = "<group>"; };
+ BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; };
BC0131D90C9772010087317D /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; };
BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityUIElement.h; sourceTree = "<group>"; };
BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityUIElement.cpp; sourceTree = "<group>"; };
BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementMac.mm; path = mac/AccessibilityUIElementMac.mm; sourceTree = "<group>"; };
BC4741290D038A4C0072B006 /* JavaScriptThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptThreading.h; sourceTree = "<group>"; };
BC4741400D038A570072B006 /* JavaScriptThreadingPthreads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaScriptThreadingPthreads.cpp; path = pthreads/JavaScriptThreadingPthreads.cpp; sourceTree = "<group>"; };
- BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WorkQueue.cpp; sourceTree = "<group>"; };
+ BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueue.cpp; sourceTree = "<group>"; };
BC9D90220C97472E0099A4A3 /* WorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueue.h; sourceTree = "<group>"; };
BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueueItem.h; sourceTree = "<group>"; };
BCA18B210C9B014B00114369 /* GCControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = GCControllerMac.mm; path = mac/GCControllerMac.mm; sourceTree = "<group>"; };
@@ -293,7 +296,7 @@
BCB282F40CFA7450007E533E /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = DebugRelease.xcconfig; path = mac/Configurations/DebugRelease.xcconfig; sourceTree = "<group>"; };
BCB283D80CFA7AFD007E533E /* ImageDiff.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = ImageDiff.xcconfig; path = mac/Configurations/ImageDiff.xcconfig; sourceTree = "<group>"; };
BCB283DE0CFA7C20007E533E /* TestNetscapePlugIn.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = TestNetscapePlugIn.xcconfig; path = mac/Configurations/TestNetscapePlugIn.xcconfig; sourceTree = "<group>"; };
- BCB284880CFA8202007E533E /* PixelDumpSupportCG.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; name = PixelDumpSupportCG.cpp; path = cg/PixelDumpSupportCG.cpp; sourceTree = "<group>"; };
+ BCB284880CFA8202007E533E /* PixelDumpSupportCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PixelDumpSupportCG.cpp; path = cg/PixelDumpSupportCG.cpp; sourceTree = "<group>"; };
BCB284890CFA8202007E533E /* PixelDumpSupportCG.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PixelDumpSupportCG.h; path = cg/PixelDumpSupportCG.h; sourceTree = "<group>"; };
BCB2848A0CFA820F007E533E /* PixelDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PixelDumpSupport.h; sourceTree = "<group>"; };
BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PixelDumpSupportMac.mm; path = mac/PixelDumpSupportMac.mm; sourceTree = "<group>"; };
@@ -302,8 +305,9 @@
BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityController.h; sourceTree = "<group>"; };
BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; };
BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerMac.mm; path = mac/AccessibilityControllerMac.mm; sourceTree = "<group>"; };
- BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = GCController.cpp; sourceTree = "<group>"; };
+ BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; };
C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PassDifferentNPPStruct.cpp; sourceTree = "<group>"; };
+ C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NullNPPGetValuePointer.cpp; sourceTree = "<group>"; };
E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockGeolocationProvider.h; path = mac/MockGeolocationProvider.h; sourceTree = "<group>"; };
E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockGeolocationProvider.mm; path = mac/MockGeolocationProvider.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -365,7 +369,8 @@
A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */,
A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */,
44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */,
- 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.mm */,
+ 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */,
+ 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */,
BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */,
BC9D90220C97472E0099A4A3 /* WorkQueue.h */,
BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */,
@@ -459,6 +464,7 @@
1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */,
1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */,
+ C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */,
C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */,
1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */,
);
@@ -697,7 +703,14 @@
isa = PBXProject;
buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 08FB7794FE84155DC02AAC07 /* DumpRenderTree */;
productRefGroup = 9340995508540CAF007F3BC8 /* Products */;
projectDirPath = "";
@@ -737,6 +750,7 @@
1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */,
1A24BAA9120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp in Sources */,
C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */,
+ C0EC3C9C12787F0500939164 /* NullNPPGetValuePointer.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -775,7 +789,8 @@
BCA18B680C9B08C200114369 /* ResourceLoadDelegate.mm in Sources */,
BCA18B490C9B02C400114369 /* TextInputController.m in Sources */,
BCA18B6A0C9B08C200114369 /* UIDelegate.mm in Sources */,
- 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.mm in Sources */,
+ 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */,
+ 440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */,
BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */,
BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */,
5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */,
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index b5cc874..9619389 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -51,6 +51,7 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
, m_dumpDatabaseCallbacks(false)
, m_dumpEditingCallbacks(false)
, m_dumpFrameLoadCallbacks(false)
+ , m_dumpUserGestureInFrameLoadCallbacks(false)
, m_dumpHistoryDelegateCallbacks(false)
, m_dumpResourceLoadCallbacks(false)
, m_dumpResourceResponseMIMETypes(false)
@@ -167,6 +168,13 @@ static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectR
return JSValueMakeUndefined(context);
}
+static JSValueRef dumpUserGestureInFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setDumpUserGestureInFrameLoadCallbacks(true);
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef dumpResourceLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -1070,14 +1078,17 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject
static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- if (argumentCount < 1)
+ if (argumentCount < 2)
return JSValueMakeUndefined(context);
JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
+ JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->setMockSpeechInputResult(result.get());
+ controller->setMockSpeechInputResult(result.get(), language.get());
return JSValueMakeUndefined(context);
}
@@ -1889,6 +1900,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "dumpDatabaseCallbacks", dumpDatabaseCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "dumpUserGestureInFrameLoadCallbacks", dumpUserGestureInFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpResourceResponseMIMETypes", dumpResourceResponseMIMETypesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpSelectionRect", dumpSelectionRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 689e114..b61860b 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -94,7 +94,7 @@ public:
void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
void setMockGeolocationError(int code, JSStringRef message);
void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
- void setMockSpeechInputResult(JSStringRef result);
+ void setMockSpeechInputResult(JSStringRef result, JSStringRef language);
void setPersistentUserStyleSheetLocation(JSStringRef path);
void setPluginsEnabled(bool flag);
void setPopupBlockingEnabled(bool flag);
@@ -154,6 +154,9 @@ public:
bool dumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; }
+
+ bool dumpUserGestureInFrameLoadCallbacks() const { return m_dumpUserGestureInFrameLoadCallbacks; }
+ void setDumpUserGestureInFrameLoadCallbacks(bool dumpUserGestureInFrameLoadCallbacks) { m_dumpUserGestureInFrameLoadCallbacks = dumpUserGestureInFrameLoadCallbacks; }
bool dumpHistoryDelegateCallbacks() const { return m_dumpHistoryDelegateCallbacks; }
void setDumpHistoryDelegateCallbacks(bool dumpHistoryDelegateCallbacks) { m_dumpHistoryDelegateCallbacks = dumpHistoryDelegateCallbacks; }
@@ -311,6 +314,7 @@ private:
bool m_dumpDatabaseCallbacks;
bool m_dumpEditingCallbacks;
bool m_dumpFrameLoadCallbacks;
+ bool m_dumpUserGestureInFrameLoadCallbacks;
bool m_dumpHistoryDelegateCallbacks;
bool m_dumpResourceLoadCallbacks;
bool m_dumpResourceResponseMIMETypes;
diff --git a/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp b/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp
index b5a5146..352eaaa 100644
--- a/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp
+++ b/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp
@@ -27,9 +27,10 @@
*/
#include "config.h"
+#include "PixelDumpSupport.h"
+
#include "DumpRenderTree.h"
#include "LayoutTestController.h"
-#include "PixelDumpSupport.h"
#include <cstdio>
#include <wtf/Assertions.h>
#include <wtf/RefPtr.h>
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
index 1df1c76..db73a9d 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
@@ -103,6 +103,7 @@ static NPObject* pluginAllocate(NPP npp, NPClass*);
static void pluginDeallocate(NPObject*);
NPNetscapeFuncs* browser;
+NPPluginFuncs* pluginFunctions;
static NPClass pluginClass = {
NP_CLASS_STRUCT_VERSION,
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
index 6c30578..99d5bf6 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
@@ -38,6 +38,7 @@
class PluginTest;
extern NPNetscapeFuncs *browser;
+extern NPPluginFuncs* pluginFunctions;
typedef struct {
NPObject header;
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
index d435a2e..e41e6e5 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
@@ -26,6 +26,7 @@
#include "PluginTest.h"
#include <assert.h>
+#include <string.h>
using namespace std;
extern NPNetscapeFuncs *browser;
@@ -49,6 +50,11 @@ PluginTest::~PluginTest()
{
}
+NPError PluginTest::NPP_Destroy(NPSavedData**)
+{
+ return NPERR_NO_ERROR;
+}
+
NPError PluginTest::NPP_DestroyStream(NPStream *stream, NPReason reason)
{
return NPERR_NO_ERROR;
@@ -65,6 +71,11 @@ NPError PluginTest::NPP_SetWindow(NPP, NPWindow*)
return NPERR_NO_ERROR;
}
+void PluginTest::NPN_InvalidateRect(NPRect* invalidRect)
+{
+ browser->invalidaterect(m_npp, invalidRect);
+}
+
NPIdentifier PluginTest::NPN_GetStringIdentifier(const NPUTF8 *name)
{
return browser->getstringidentifier(name);
@@ -90,6 +101,30 @@ bool PluginTest::NPN_RemoveProperty(NPObject* npObject, NPIdentifier propertyNam
return browser->removeproperty(m_npp, npObject, propertyName);
}
+static void executeScript(NPP npp, const char* script)
+{
+ NPObject* windowScriptObject;
+ browser->getvalue(npp, NPNVWindowNPObject, &windowScriptObject);
+
+ NPString npScript;
+ npScript.UTF8Characters = script;
+ npScript.UTF8Length = strlen(script);
+
+ NPVariant browserResult;
+ browser->evaluate(npp, windowScriptObject, &npScript, &browserResult);
+ browser->releasevariantvalue(&browserResult);
+}
+
+void PluginTest::waitUntilDone()
+{
+ executeScript(m_npp, "layoutTestController.waitUntilDone()");
+}
+
+void PluginTest::notifyDone()
+{
+ executeScript(m_npp, "layoutTestController.notifyDone()");
+}
+
void PluginTest::registerCreateTestFunction(const string& identifier, CreateTestFunction createTestFunction)
{
assert(!createTestFunctions().count(identifier));
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
index cbc7934..0497764 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
@@ -55,11 +55,13 @@ public:
virtual ~PluginTest();
// NPP functions.
+ virtual NPError NPP_Destroy(NPSavedData**);
virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
virtual NPError NPP_GetValue(NPPVariable, void* value);
virtual NPError NPP_SetWindow(NPP, NPWindow*);
// NPN functions.
+ void NPN_InvalidateRect(NPRect* invalidRect);
NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name);
NPIdentifier NPN_GetIntIdentifier(int32_t intid);
NPError NPN_GetValue(NPNVariable, void* value);
@@ -88,6 +90,9 @@ protected:
const std::string& identifier() const { return m_identifier; }
+ void waitUntilDone();
+ void notifyDone();
+
// NPObject helper template.
template<typename T> struct Object : NPObject {
public:
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp
new file mode 100644
index 0000000..9e4e976
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp
@@ -0,0 +1,70 @@
+/*
+ * 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;
+
+// Passing null for our NPP_GetValue function pointer should not crash.
+
+class NullNPPGetValuePointer : public PluginTest {
+public:
+ NullNPPGetValuePointer(NPP, const string& identifier);
+
+private:
+ virtual NPError NPP_Destroy(NPSavedData**);
+ virtual NPError NPP_GetValue(NPPVariable, void* value);
+
+ NPP_GetValueProcPtr m_originalNPPGetValuePointer;
+};
+
+static PluginTest::Register<NullNPPGetValuePointer> registrar("null-npp-getvalue-pointer");
+
+NullNPPGetValuePointer::NullNPPGetValuePointer(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_originalNPPGetValuePointer(pluginFunctions->getvalue)
+{
+ // Be sneaky and null out the getvalue pointer the browser is holding. This simulates a plugin
+ // that doesn't implement NPP_GetValue (like Shockwave Director 10.3 on Windows). Note that if
+ // WebKit copies the NPPluginFuncs struct this technique will have no effect and WebKit will
+ // call into our NPP_GetValue implementation.
+ pluginFunctions->getvalue = 0;
+}
+
+NPError NullNPPGetValuePointer::NPP_Destroy(NPSavedData**)
+{
+ // Set the NPP_GetValue pointer back the way it was before we mucked with it so we don't mess
+ // up future uses of the plugin module.
+ pluginFunctions->getvalue = m_originalNPPGetValuePointer;
+ return NPERR_NO_ERROR;
+}
+
+NPError NullNPPGetValuePointer::NPP_GetValue(NPPVariable, void*)
+{
+ pluginLog(m_npp, "NPP_GetValue was called but should not have been. Maybe WebKit copied the NPPluginFuncs struct, which would invalidate this test.");
+ return NPERR_GENERIC_ERROR;
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp
new file mode 100644
index 0000000..90ea54d
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp
@@ -0,0 +1,203 @@
+/*
+ * 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;
+
+// NPN_InvalidateRect should invalidate the plugin's HWND.
+
+static const wchar_t instancePointerProperty[] = L"org.webkit.TestNetscapePlugin.NPNInvalidateRectInvalidatesWindow.InstancePointer";
+
+class TemporaryWindowMover {
+public:
+ TemporaryWindowMover(HWND);
+ ~TemporaryWindowMover();
+
+ bool moveSucceeded() const { return m_moveSucceeded; }
+
+private:
+ static const UINT standardSetWindowPosFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER;
+ bool m_moveSucceeded;
+ HWND m_window;
+ RECT m_savedWindowRect;
+};
+
+TemporaryWindowMover::TemporaryWindowMover(HWND window)
+ : m_window(window)
+{
+ m_moveSucceeded = false;
+
+ if (!::GetWindowRect(m_window, &m_savedWindowRect))
+ return;
+
+ if (!::SetWindowPos(m_window, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | standardSetWindowPosFlags))
+ return;
+
+ m_moveSucceeded = true;
+};
+
+TemporaryWindowMover::~TemporaryWindowMover()
+{
+ if (!m_moveSucceeded)
+ return;
+
+ ::SetWindowPos(m_window, 0, m_savedWindowRect.left, m_savedWindowRect.top, 0, 0, SWP_HIDEWINDOW | standardSetWindowPosFlags);
+}
+
+class NPNInvalidateRectInvalidatesWindow : public PluginTest {
+public:
+ NPNInvalidateRectInvalidatesWindow(NPP, const string& identifier);
+ ~NPNInvalidateRectInvalidatesWindow();
+
+private:
+ static LRESULT CALLBACK wndProc(HWND, UINT message, WPARAM, LPARAM);
+
+ void onPaint();
+ void testInvalidateRect();
+
+ virtual NPError NPP_SetWindow(NPP, NPWindow*);
+
+ HWND m_window;
+ WNDPROC m_originalWndProc;
+ TemporaryWindowMover* m_windowMover;
+};
+
+NPNInvalidateRectInvalidatesWindow::NPNInvalidateRectInvalidatesWindow(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_window(0)
+ , m_originalWndProc(0)
+ , m_windowMover(0)
+{
+}
+
+NPNInvalidateRectInvalidatesWindow::~NPNInvalidateRectInvalidatesWindow()
+{
+ delete m_windowMover;
+}
+
+NPError NPNInvalidateRectInvalidatesWindow::NPP_SetWindow(NPP instance, NPWindow* window)
+{
+ HWND newWindow = reinterpret_cast<HWND>(window->window);
+ if (newWindow == m_window)
+ return NPERR_NO_ERROR;
+
+ if (m_window) {
+ ::RemovePropW(m_window, instancePointerProperty);
+ ::SetWindowLongPtr(m_window, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(m_originalWndProc));
+ m_originalWndProc = 0;
+ }
+
+ m_window = newWindow;
+ if (!m_window)
+ return NPERR_NO_ERROR;
+
+ m_originalWndProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(m_window, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(wndProc)));
+ ::SetPropW(m_window, instancePointerProperty, this);
+
+ // The test harness's window (the one that contains the WebView) is off-screen and hidden.
+ // We need to move it on-screen and make it visible in order for the plugin's window to
+ // accumulate an update region when the DWM is disabled.
+
+ HWND testHarnessWindow = ::GetAncestor(m_window, GA_ROOT);
+ if (!testHarnessWindow) {
+ pluginLog(instance, "Failed to get test harness window");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ m_windowMover = new TemporaryWindowMover(testHarnessWindow);
+ if (!m_windowMover->moveSucceeded()) {
+ pluginLog(instance, "Failed to move test harness window on-screen");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ // Wait until we receive a WM_PAINT message to ensure that the window is on-screen before we do
+ // the NPN_InvalidateRect test.
+ waitUntilDone();
+ return NPERR_NO_ERROR;
+}
+
+LRESULT NPNInvalidateRectInvalidatesWindow::wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ NPNInvalidateRectInvalidatesWindow* instance = reinterpret_cast<NPNInvalidateRectInvalidatesWindow*>(::GetPropW(hwnd, instancePointerProperty));
+
+ if (message == WM_PAINT)
+ instance->onPaint();
+
+ return ::CallWindowProcW(instance->m_originalWndProc, hwnd, message, wParam, lParam);
+}
+
+void NPNInvalidateRectInvalidatesWindow::onPaint()
+{
+ testInvalidateRect();
+ notifyDone();
+ delete m_windowMover;
+ m_windowMover = 0;
+}
+
+void NPNInvalidateRectInvalidatesWindow::testInvalidateRect()
+{
+ RECT clientRect;
+ if (!::GetClientRect(m_window, &clientRect)) {
+ pluginLog(m_npp, "::GetClientRect failed");
+ return;
+ }
+
+ if (::IsRectEmpty(&clientRect)) {
+ pluginLog(m_npp, "Plugin's HWND has not been sized when NPP_SetWindow is called");
+ return;
+ }
+
+ // Clear the invalid region.
+ if (!::ValidateRect(m_window, 0)) {
+ pluginLog(m_npp, "::ValidateRect failed");
+ return;
+ }
+
+ // Invalidate our lower-right quadrant.
+ NPRect rectToInvalidate;
+ rectToInvalidate.left = (clientRect.right - clientRect.left) / 2;
+ rectToInvalidate.top = (clientRect.bottom - clientRect.top) / 2;
+ rectToInvalidate.right = clientRect.right;
+ rectToInvalidate.bottom = clientRect.bottom;
+ NPN_InvalidateRect(&rectToInvalidate);
+
+ RECT invalidRect;
+ if (!::GetUpdateRect(m_window, &invalidRect, FALSE)) {
+ pluginLog(m_npp, "::GetUpdateRect failed");
+ return;
+ }
+
+ if (invalidRect.left != rectToInvalidate.left || invalidRect.top != rectToInvalidate.top || invalidRect.right != rectToInvalidate.right || invalidRect.bottom != rectToInvalidate.bottom) {
+ pluginLog(m_npp, "Expected invalid rect {left=%u, top=%u, right=%u, bottom=%u}, but got {left=%d, top=%d, right=%d, bottom=%d}", rectToInvalidate.left, rectToInvalidate.top, rectToInvalidate.right, rectToInvalidate.bottom, invalidRect.left, invalidRect.top, invalidRect.right, invalidRect.bottom);
+ return;
+ }
+
+ pluginLog(m_npp, "Plugin's HWND has been invalidated as expected");
+}
+
+static PluginTest::Register<NPNInvalidateRectInvalidatesWindow> registrar("npn-invalidate-rect-invalidates-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
index e240c42..e5246c4 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
@@ -26,6 +26,7 @@
#include "PluginObject.h"
#include "PluginTest.h"
+#include <cstdlib>
#include <string>
#if !defined(NP_NO_CARBON) && defined(QD_HEADERS_ARE_PRIVATE) && QD_HEADERS_ARE_PRIVATE
@@ -54,9 +55,17 @@ static inline int strcasecmp(const char* s1, const char* s2)
#define STDCALL
#endif
+extern "C" {
+NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
+}
+
// Entry points
extern "C"
-NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs)
+NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs
+#ifdef XP_UNIX
+ , NPPluginFuncs *pluginFuncs
+#endif
+ )
{
initializeWasCalled = true;
@@ -67,7 +76,12 @@ NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs)
#endif
browser = browserFuncs;
+
+#ifdef XP_UNIX
+ return NP_GetEntryPoints(pluginFuncs);
+#else
return NPERR_NO_ERROR;
+#endif
}
extern "C"
@@ -81,6 +95,8 @@ NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
CRASH();
#endif
+ pluginFunctions = pluginFuncs;
+
pluginFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
pluginFuncs->size = sizeof(pluginFuncs);
pluginFuncs->newp = NPP_New;
@@ -246,7 +262,12 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc
obj->pluginTest = PluginTest::create(instance, testIdentifier);
+#ifdef XP_UNIX
+ // On Unix, plugins only get events if they are windowless.
+ return browser->setvalue(instance, NPPVpluginWindowBool, 0);
+#else
return NPERR_NO_ERROR;
+#endif
}
NPError NPP_Destroy(NPP instance, NPSavedData **save)
@@ -281,6 +302,8 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save)
CFRelease(obj->coreAnimationLayer);
#endif
+ obj->pluginTest->NPP_Destroy(save);
+
browser->releaseobject(&obj->header);
}
return NPERR_NO_ERROR;
@@ -574,6 +597,17 @@ void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyD
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
+#ifdef XP_UNIX
+ if (variable == NPPVpluginNameString) {
+ *((char **)value) = const_cast<char*>("WebKit Test PlugIn");
+ return NPERR_NO_ERROR;
+ }
+ if (variable == NPPVpluginDescriptionString) {
+ *((char **)value) = const_cast<char*>("Simple Netscape plug-in that handles test content for WebKit");
+ return NPERR_NO_ERROR;
+ }
+#endif
+
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
// First, check if the PluginTest object supports getting this value.
@@ -598,7 +632,7 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
return NPERR_NO_ERROR;
}
#endif
-
+
return NPERR_GENERIC_ERROR;
}
@@ -614,3 +648,17 @@ NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
return NPERR_GENERIC_ERROR;
}
}
+
+#ifdef XP_UNIX
+extern "C"
+const char* NP_GetMIMEDescription(void)
+{
+ return "application/x-webkit-test-netscape:testnetscape:test netscape content";
+}
+
+extern "C"
+NPError NP_GetValue(NPP instance, NPPVariable variable, void* value)
+{
+ return NPP_GetValue(instance, variable, value);
+}
+#endif
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
index cdd7729..74042bc 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -383,6 +383,10 @@
>
</File>
<File
+ RelativePath="..\Tests\NullNPPGetValuePointer.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\PassDifferentNPPStruct.cpp"
>
</File>
@@ -398,6 +402,10 @@
>
</File>
<File
+ RelativePath="..\Tests\win\NPNInvalidateRectInvalidatesWindow.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
>
</File>
diff --git a/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp
new file mode 100644
index 0000000..4d77454
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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.
+ */
+
+#import "WebArchiveDumpSupport.h"
+
+#import <CoreFoundation/CoreFoundation.h>
+#import <CFNetwork/CFNetwork.h>
+#import <wtf/RetainPtr.h>
+
+extern "C" {
+
+CFURLRef CFURLResponseGetURL(CFURLResponseRef response);
+CFStringRef CFURLResponseGetMIMEType(CFURLResponseRef response);
+CFStringRef CFURLResponseGetTextEncodingName(CFURLResponseRef response);
+SInt64 CFURLResponseGetExpectedContentLength(CFURLResponseRef response);
+CFHTTPMessageRef CFURLResponseGetHTTPResponse(CFURLResponseRef response);
+
+CFTypeID CFURLResponseGetTypeID(void);
+
+}
+
+static void convertMIMEType(CFMutableStringRef mimeType)
+{
+#ifdef BUILDING_ON_LEOPARD
+ // Workaround for <rdar://problem/5539824> on Leopard
+ if (CFStringCompare(mimeType, CFSTR("text/xml"), kCFCompareAnchored | kCFCompareCaseInsensitive) == kCFCompareEqualTo)
+ CFStringReplaceAll(mimeType, CFSTR("application/xml"));
+#endif
+ // Workaround for <rdar://problem/6234318> with Dashcode 2.0
+ if (CFStringCompare(mimeType, CFSTR("application/x-javascript"), kCFCompareAnchored | kCFCompareCaseInsensitive) == kCFCompareEqualTo)
+ CFStringReplaceAll(mimeType, CFSTR("text/javascript"));
+}
+
+static void convertWebResourceDataToString(CFMutableDictionaryRef resource)
+{
+ CFMutableStringRef mimeType = (CFMutableStringRef)CFDictionaryGetValue(resource, CFSTR("WebResourceMIMEType"));
+ CFStringLowercase(mimeType, CFLocaleGetSystem());
+ convertMIMEType(mimeType);
+
+ CFArrayRef supportedMIMETypes = supportedNonImageMIMETypes();
+ if (CFStringHasPrefix(mimeType, CFSTR("text/")) || CFArrayContainsValue(supportedMIMETypes, CFRangeMake(0, CFArrayGetCount(supportedMIMETypes)), mimeType)) {
+ CFStringRef textEncodingName = static_cast<CFStringRef>(CFDictionaryGetValue(resource, CFSTR("WebResourceTextEncodingName")));
+ CFStringEncoding stringEncoding;
+ if (textEncodingName && CFStringGetLength(textEncodingName))
+ stringEncoding = CFStringConvertIANACharSetNameToEncoding(textEncodingName);
+ else
+ stringEncoding = kCFStringEncodingUTF8;
+
+ CFDataRef data = static_cast<CFDataRef>(CFDictionaryGetValue(resource, CFSTR("WebResourceData")));
+ RetainPtr<CFStringRef> dataAsString(AdoptCF, CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, data, stringEncoding));
+ if (dataAsString)
+ CFDictionarySetValue(resource, CFSTR("WebResourceData"), dataAsString.get());
+ }
+}
+
+static void normalizeHTTPResponseHeaderFields(CFMutableDictionaryRef fields)
+{
+ // Normalize headers
+ if (CFDictionaryContainsKey(fields, CFSTR("Date")))
+ CFDictionarySetValue(fields, CFSTR("Date"), CFSTR("Sun, 16 Nov 2008 17:00:00 GMT"));
+ if (CFDictionaryContainsKey(fields, CFSTR("Last-Modified")))
+ CFDictionarySetValue(fields, CFSTR("Last-Modified"), CFSTR("Sun, 16 Nov 2008 16:55:00 GMT"));
+ if (CFDictionaryContainsKey(fields, CFSTR("Etag")))
+ CFDictionarySetValue(fields, CFSTR("Etag"), CFSTR("\"301925-21-45c7d72d3e780\""));
+ if (CFDictionaryContainsKey(fields, CFSTR("Server")))
+ CFDictionarySetValue(fields, CFSTR("Server"), CFSTR("Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l PHP/5.2.6"));
+
+ // Remove headers
+ CFDictionaryRemoveValue(fields, CFSTR("Connection"));
+ CFDictionaryRemoveValue(fields, CFSTR("Keep-Alive"));
+}
+
+static void normalizeWebResourceURL(CFMutableStringRef webResourceURL)
+{
+ static CFIndex fileUrlLength = CFStringGetLength(CFSTR("file://"));
+ CFRange layoutTestsWebArchivePathRange = CFStringFind(webResourceURL, CFSTR("/LayoutTests/"), kCFCompareBackwards);
+ if (layoutTestsWebArchivePathRange.location == kCFNotFound)
+ return;
+ CFRange currentWorkingDirectoryRange = CFRangeMake(fileUrlLength, layoutTestsWebArchivePathRange.location - fileUrlLength);
+ CFStringReplace(webResourceURL, currentWorkingDirectoryRange, CFSTR(""));
+}
+
+static void convertWebResourceResponseToDictionary(CFMutableDictionaryRef propertyList)
+{
+ CFDataRef responseData = static_cast<CFDataRef>(CFDictionaryGetValue(propertyList, CFSTR("WebResourceResponse"))); // WebResourceResponseKey in WebResource.m
+ if (CFGetTypeID(responseData) != CFDataGetTypeID())
+ return;
+
+ RetainPtr<CFURLResponseRef> response(AdoptCF, createCFURLResponseFromResponseData(responseData));
+ if (!response)
+ return;
+
+ RetainPtr<CFMutableDictionaryRef> responseDictionary(AdoptCF, CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+ RetainPtr<CFMutableStringRef> urlString(AdoptCF, CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFURLGetString(CFURLResponseGetURL(response.get()))));
+ normalizeWebResourceURL(urlString.get());
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("URL"), urlString.get());
+
+ RetainPtr<CFMutableStringRef> mimeTypeString(AdoptCF, CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFURLResponseGetMIMEType(response.get())));
+ convertMIMEType(mimeTypeString.get());
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("MIMEType"), mimeTypeString.get());
+
+ CFStringRef textEncodingName = CFURLResponseGetTextEncodingName(response.get());
+ if (textEncodingName)
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("textEncodingName"), textEncodingName);
+
+ SInt64 expectedContentLength = CFURLResponseGetExpectedContentLength(response.get());
+ RetainPtr<CFNumberRef> expectedContentLengthNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &expectedContentLength));
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("expectedContentLength"), expectedContentLengthNumber.get());
+
+ if (CFHTTPMessageRef httpMessage = CFURLResponseGetHTTPResponse(response.get())) {
+ RetainPtr<CFDictionaryRef> allHeaders(AdoptCF, CFHTTPMessageCopyAllHeaderFields(httpMessage));
+ RetainPtr<CFMutableDictionaryRef> allHeaderFields(AdoptCF, CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, allHeaders.get()));
+ normalizeHTTPResponseHeaderFields(allHeaderFields.get());
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("allHeaderFields"), allHeaderFields.get());
+
+ CFIndex statusCode = CFHTTPMessageGetResponseStatusCode(httpMessage);
+ RetainPtr<CFNumberRef> statusCodeNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &statusCode));
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("statusCode"), statusCodeNumber.get());
+ }
+
+ CFDictionarySetValue(propertyList, CFSTR("WebResourceResponse"), responseDictionary.get());
+}
+
+static CFComparisonResult compareResourceURLs(const void *val1, const void *val2, void *context)
+{
+ CFStringRef url1 = static_cast<CFStringRef>(CFDictionaryGetValue(static_cast<CFDictionaryRef>(val1), CFSTR("WebResourceURL")));
+ CFStringRef url2 = static_cast<CFStringRef>(CFDictionaryGetValue(static_cast<CFDictionaryRef>(val2), CFSTR("WebResourceURL")));
+
+ return CFStringCompare(url1, url2, kCFCompareAnchored);
+}
+
+CFStringRef createXMLStringFromWebArchiveData(CFDataRef webArchiveData)
+{
+ CFErrorRef error = 0;
+ CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0;
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+ CFIndex bytesCount = CFDataGetLength(webArchiveData);
+ RetainPtr<CFReadStreamRef> readStream(AdoptCF, CFReadStreamCreateWithBytesNoCopy(kCFAllocatorDefault, CFDataGetBytePtr(webArchiveData), bytesCount, kCFAllocatorNull));
+ CFReadStreamOpen(readStream.get());
+ RetainPtr<CFMutableDictionaryRef> propertyList(AdoptCF, (CFMutableDictionaryRef)CFPropertyListCreateFromStream(kCFAllocatorDefault, readStream.get(), bytesCount, kCFPropertyListMutableContainersAndLeaves, &format, 0));
+ CFReadStreamClose(readStream.get());
+#else
+ RetainPtr<CFMutableDictionaryRef> propertyList(AdoptCF, (CFMutableDictionaryRef)CFPropertyListCreateWithData(kCFAllocatorDefault, webArchiveData, kCFPropertyListMutableContainersAndLeaves, &format, &error));
+#endif
+
+ if (!propertyList) {
+ if (error)
+ return CFErrorCopyDescription(error);
+ return static_cast<CFStringRef>(CFRetain(CFSTR("An unknown error occurred converting data to property list.")));
+ }
+
+ RetainPtr<CFMutableArrayRef> resources(AdoptCF, CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
+ CFArrayAppendValue(resources.get(), propertyList.get());
+
+ while (CFArrayGetCount(resources.get())) {
+ RetainPtr<CFMutableDictionaryRef> resourcePropertyList = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(resources.get(), 0);
+ CFArrayRemoveValueAtIndex(resources.get(), 0);
+
+ CFMutableDictionaryRef mainResource = (CFMutableDictionaryRef)CFDictionaryGetValue(resourcePropertyList.get(), CFSTR("WebMainResource"));
+ normalizeWebResourceURL((CFMutableStringRef)CFDictionaryGetValue(mainResource, CFSTR("WebResourceURL")));
+ convertWebResourceDataToString(mainResource);
+
+ // Add subframeArchives to list for processing
+ CFMutableArrayRef subframeArchives = (CFMutableArrayRef)CFDictionaryGetValue(resourcePropertyList.get(), CFSTR("WebSubframeArchives")); // WebSubframeArchivesKey in WebArchive.m
+ if (subframeArchives)
+ CFArrayAppendArray(resources.get(), subframeArchives, CFRangeMake(0, CFArrayGetCount(subframeArchives)));
+
+ CFMutableArrayRef subresources = (CFMutableArrayRef)CFDictionaryGetValue(resourcePropertyList.get(), CFSTR("WebSubresources")); // WebSubresourcesKey in WebArchive.m
+ if (!subresources)
+ continue;
+
+ CFIndex subresourcesCount = CFArrayGetCount(subresources);
+ for (CFIndex i = 0; i < subresourcesCount; ++i) {
+ CFMutableDictionaryRef subresourcePropertyList = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(subresources, i);
+ normalizeWebResourceURL((CFMutableStringRef)CFDictionaryGetValue(subresourcePropertyList, CFSTR("WebResourceURL")));
+ convertWebResourceResponseToDictionary(subresourcePropertyList);
+ convertWebResourceDataToString(subresourcePropertyList);
+ }
+
+ // Sort the subresources so they're always in a predictable order for the dump
+ CFArraySortValues(subresources, CFRangeMake(0, CFArrayGetCount(subresources)), compareResourceURLs, 0);
+ }
+
+ error = 0;
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+ RetainPtr<CFDataRef> xmlData(AdoptCF, CFPropertyListCreateXMLData(kCFAllocatorDefault, propertyList.get()));
+#else
+ RetainPtr<CFDataRef> xmlData(AdoptCF, CFPropertyListCreateData(kCFAllocatorDefault, propertyList.get(), kCFPropertyListXMLFormat_v1_0, 0, &error));
+#endif
+
+ if (!xmlData) {
+ if (error)
+ return CFErrorCopyDescription(error);
+ return static_cast<CFStringRef>(CFRetain(CFSTR("An unknown error occurred converting property list to data.")));
+ }
+
+ RetainPtr<CFStringRef> xmlString(AdoptCF, CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, xmlData.get(), kCFStringEncodingUTF8));
+ RetainPtr<CFMutableStringRef> string(AdoptCF, CFStringCreateMutableCopy(kCFAllocatorDefault, 0, xmlString.get()));
+
+ // Replace "Apple Computer" with "Apple" in the DTD declaration.
+ CFStringFindAndReplace(string.get(), CFSTR("-//Apple Computer//"), CFSTR("-//Apple//"), CFRangeMake(0, CFStringGetLength(string.get())), 0);
+
+ return string.releaseRef();
+}
diff --git a/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.h b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h
index 8654dd5..08d9c45 100644
--- a/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.h
+++ b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h
@@ -26,9 +26,16 @@
#ifndef WebArchiveDumpSupport_h
#define WebArchiveDumpSupport_h
-@class NSString;
-@class WebArchive;
+#include <CoreFoundation/CoreFoundation.h>
-NSString *serializeWebArchiveToXML(WebArchive *webArchive);
+typedef struct _CFURLResponse* CFURLResponseRef;
+
+CFStringRef createXMLStringFromWebArchiveData(CFDataRef webArchiveData);
+
+#pragma mark -
+#pragma mark Platform-specific methods
+
+CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData);
+CFArrayRef supportedNonImageMIMETypes();
#endif /* WebArchiveDumpSupport_h */
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
index 72c0c3c..3bbba98 100644
--- a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -32,6 +32,7 @@
#include "TestShell.h"
#include "webkit/support/webkit_support.h"
+#include <v8/include/v8.h>
#include <wtf/Vector.h>
using namespace std;
@@ -51,6 +52,9 @@ static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-d
static const char optionEnableAcceleratedCompositing[] = "--enable-accelerated-compositing";
static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas";
+static const char optionMultipleLoads[] = "--multiple-loads=";
+static const char optionJavaScriptFlags[] = "--js-flags=";
+
static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
{
int oldTimeoutMsec = shell.layoutTestTimeout();
@@ -78,8 +82,14 @@ static void runTest(TestShell& shell, TestParams& params, const string& testName
}
params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL);
webkit_support::SetCurrentDirectoryForFileURL(params.testUrl);
- shell.resetTestController();
- shell.runFileTest(params);
+ for (int i = 0; i < shell.loadCount(); i++) {
+ string javaScriptFlags = shell.javaScriptFlagsForLoad(i);
+ v8::V8::SetFlagsFromString(javaScriptFlags.data(), static_cast<int>(javaScriptFlags.size()));
+ bool isLastLoad = (i == (shell.loadCount() - 1));
+ shell.setDumpWhenFinished(isLastLoad);
+ shell.resetTestController();
+ shell.runFileTest(params);
+ }
shell.setLayoutTestTimeout(oldTimeoutMsec);
}
@@ -96,6 +106,8 @@ int main(int argc, char* argv[])
bool startupDialog = false;
bool acceleratedCompositingEnabled = false;
bool accelerated2DCanvasEnabled = false;
+ int loadCount = 1;
+ string javaScriptFlags;
for (int i = 1; i < argc; ++i) {
string argument(argv[i]);
if (argument == "-")
@@ -120,7 +132,12 @@ int main(int argc, char* argv[])
acceleratedCompositingEnabled = true;
else if (argument == optionEnableAccelerated2DCanvas)
accelerated2DCanvasEnabled = true;
- else if (argument.size() && argument[0] == '-')
+ else if (!argument.find(optionMultipleLoads)) {
+ string multipleLoadsStr = argument.substr(strlen(optionMultipleLoads));
+ loadCount = atoi(multipleLoadsStr.c_str());
+ } else if (!argument.find(optionJavaScriptFlags)) {
+ javaScriptFlags = argument.substr(strlen(optionJavaScriptFlags));
+ } else if (argument.size() && argument[0] == '-')
fprintf(stderr, "Unknown option: %s\n", argv[i]);
else
tests.append(argument);
@@ -129,6 +146,30 @@ int main(int argc, char* argv[])
fprintf(stderr, "--pixel-tests with --test-shell requires a file name.\n");
return EXIT_FAILURE;
}
+ if (loadCount < 1) {
+ fprintf(stderr, "--multiple-loads requires a positive numeric argument.\n");
+ return EXIT_FAILURE;
+ }
+
+ // The test runner might send a quoted string which needs to be unquoted before further processing.
+ if (javaScriptFlags.length() > 1 && javaScriptFlags[0] == '"' && javaScriptFlags[javaScriptFlags.length() - 1] == '"')
+ javaScriptFlags = javaScriptFlags.substr(1, javaScriptFlags.length() - 2);
+ // Split the JavaScript flags into a list.
+ Vector<string> flagsList;
+ size_t start = 0;
+ while (true) {
+ size_t commaPos = javaScriptFlags.find_first_of(',', start);
+ string flags;
+ if (commaPos == string::npos)
+ flags = javaScriptFlags.substr(start, javaScriptFlags.length() - start);
+ else {
+ flags = javaScriptFlags.substr(start, commaPos - start);
+ start = commaPos + 1;
+ }
+ flagsList.append(flags);
+ if (commaPos == string::npos)
+ break;
+ }
if (startupDialog)
openStartupDialog();
@@ -138,6 +179,8 @@ int main(int argc, char* argv[])
shell.setAllowExternalPages(allowExternalPages);
shell.setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled);
+ shell.setLoadCount(loadCount);
+ shell.setJavaScriptFlags(flagsList);
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 82fd085..d713b04 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -94,6 +94,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
+ bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks);
bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
@@ -288,6 +289,12 @@ void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVar
result->setNull();
}
+void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpUserGestureInFrameLoadCallbacks = true;
+ result->setNull();
+}
+
void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
{
m_dumpResourceLoadCallbacks = true;
@@ -522,6 +529,7 @@ void LayoutTestController::reset()
m_dumpAsText = false;
m_dumpEditingCallbacks = false;
m_dumpFrameLoadCallbacks = false;
+ m_dumpUserGestureInFrameLoadCallbacks = false;
m_dumpResourceLoadCallbacks = false;
m_dumpResourceResponseMIMETypes = false;
m_dumpBackForwardList = false;
@@ -1526,10 +1534,10 @@ void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVaria
void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
- if (arguments.size() < 1 || !arguments[0].isString())
+ if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())
return;
- m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]));
+ m_speechInputControllerMock->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));
}
WebKit::WebSpeechInputController* LayoutTestController::speechInputController(WebKit::WebSpeechInputListener* listener)
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index ae1a7a2..fc16827 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -88,6 +88,11 @@ public:
// ignores any that may be present.
void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
+ // This function sets a flag that tells the test_shell to print a line of
+ // user gesture status text for some frame load callbacks. It takes no
+ // arguments, and ignores any that may be present.
+ void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
+
// This function sets a flag that tells the test_shell to print out a text
// representation of the back/forward list. It ignores all arguments.
void dumpBackForwardList(const CppArgumentList&, CppVariant*);
@@ -340,6 +345,8 @@ public:
bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
+ bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; }
+ void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; }
bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
void setShouldDumpResourceResponseMIMETypes(bool value) { m_dumpResourceResponseMIMETypes = value; }
bool shouldDumpResourceResponseMIMETypes() {return m_dumpResourceResponseMIMETypes; }
@@ -460,6 +467,10 @@ private:
// load callback.
bool m_dumpFrameLoadCallbacks;
+ // If true, the test_shell will output a line of the user gesture status
+ // text for some frame load callbacks.
+ bool m_dumpUserGestureInFrameLoadCallbacks;
+
// If true, the test_shell will output a descriptive line for each resource
// load callback.
bool m_dumpResourceLoadCallbacks;
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h
index 49f72a6..9fa3fff 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h
@@ -1 +1,9 @@
#include "bindings/npapi.h"
+
+// These are defined in WebCore/brdige/npapi.h and we need them on Linux/Win.
+#ifndef FALSE
+#define FALSE (0)
+#endif
+#ifndef TRUE
+#define TRUE (1)
+#endif
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h
index 61588ca..59ae666 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h
@@ -1,3 +1,4 @@
+#include "npapi.h"
#include "bindings/npfunctions.h"
// Non-standard event types can be passed to HandleEvent.
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
index 0b27c78..9bb0192 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -86,9 +86,12 @@ TestShell::TestShell(bool testShellMode)
, m_allowExternalPages(false)
, m_acceleratedCompositingEnabled(false)
, m_accelerated2dCanvasEnabled(false)
+ , m_loadCount(1)
+ , m_dumpWhenFinished(true)
{
WebRuntimeFeatures::enableGeolocation(true);
WebRuntimeFeatures::enableIndexedDatabase(true);
+ WebRuntimeFeatures::enableFileSystem(true);
m_accessibilityController.set(new AccessibilityController(this));
m_layoutTestController.set(new LayoutTestController(this));
m_eventSender.set(new EventSender(this));
@@ -181,7 +184,8 @@ void TestShell::runFileTest(const TestParams& params)
if (inspectorTestMode)
showDevTools();
- m_printer->handleTestHeader(testUrl.c_str());
+ if (m_dumpWhenFinished)
+ m_printer->handleTestHeader(testUrl.c_str());
loadURL(m_params.testUrl);
m_testIsPreparing = false;
@@ -270,7 +274,8 @@ void TestShell::testFinished()
if (!m_testIsPending)
return;
m_testIsPending = false;
- dump();
+ if (m_dumpWhenFinished)
+ dump();
webkit_support::QuitMessageLoop();
}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index a15d9ec..ca06812 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -67,7 +67,7 @@ struct TestParams {
bool dumpPixels;
bool printSeparators;
WebKit::WebURL testUrl;
- // Resultant image file name. Reqruired only if the test_shell mode.
+ // Resultant image file name. Required only if the test_shell mode.
std::string pixelFileName;
std::string pixelHash;
@@ -109,6 +109,7 @@ public:
void setFocus(WebKit::WebWidget*, bool enable);
bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
+ bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); }
bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); }
void setIsLoading(bool flag) { m_isLoading = flag; }
@@ -136,6 +137,20 @@ public:
int layoutTestTimeoutForWatchDog() { return layoutTestTimeout() + 1000; }
void setLayoutTestTimeout(int timeout) { m_timeout = timeout; }
+ // Number of times to load each URL.
+ int loadCount() { return m_loadCount; }
+ void setLoadCount(int loadCount) { m_loadCount = loadCount; }
+
+ // The JavaScript flags are specified as a vector of strings. Each element of the vector is full flags string
+ // which can contain multiple flags (e.g. "--xxx --yyy"). With multiple load testing it is possible to specify
+ // separate sets of flags to each load.
+ std::string javaScriptFlagsForLoad(size_t load) { return (load >= 0 && load < m_javaScriptFlags.size()) ? m_javaScriptFlags[load] : ""; }
+ void setJavaScriptFlags(Vector<std::string> javaScriptFlags) { m_javaScriptFlags = javaScriptFlags; }
+
+ // Set whether to dump when the loaded page has finished processing. This is used with multiple load
+ // testing where we only want to have the output from the last load.
+ void setDumpWhenFinished(bool dumpWhenFinished) { m_dumpWhenFinished = dumpWhenFinished; }
+
WebViewHost* createWebView();
WebViewHost* createNewWindow(const WebKit::WebURL&);
void closeWindow(WebViewHost*);
@@ -182,6 +197,10 @@ private:
bool m_acceleratedCompositingEnabled;
bool m_accelerated2dCanvasEnabled;
WebPreferences m_prefs;
+ int m_loadCount;
+ Vector<std::string> m_javaScriptFlags;
+ bool m_dumpWhenFinished;
+
// List of all windows in this process.
// The main window should be put into windowList[0].
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
index 7af4e9f..3603840 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -33,15 +33,16 @@
#include "TestShell.h"
#include "WebBindings.h"
+#include "WebCompositionUnderline.h"
#include "WebFrame.h"
#include "WebRange.h"
#include "WebString.h"
+#include "WebVector.h"
#include "WebView.h"
#include <wtf/StringExtras.h>
#include <string>
using namespace WebKit;
-using namespace std;
TestShell* TextInputController::testShell = 0;
@@ -66,6 +67,7 @@ TextInputController::TextInputController(TestShell* shell)
bindMethod("substringFromRange", &TextInputController::substringFromRange);
bindMethod("unmarkText", &TextInputController::unmarkText);
bindMethod("validAttributesForMarkedText", &TextInputController::validAttributesForMarkedText);
+ bindMethod("setComposition", &TextInputController::setComposition);
}
WebFrame* TextInputController::getMainFrame()
@@ -167,9 +169,10 @@ void TextInputController::markedRange(const CppArgumentList&, CppVariant* result
return;
WebRange range = mainFrame->markedRange();
- char buffer[30];
- snprintf(buffer, 30, "%d,%d", range.startOffset(), range.endOffset());
- result->set(string(buffer));
+ Vector<int> intArray(2);
+ intArray[0] = range.startOffset();
+ intArray[1] = range.endOffset();
+ result->set(WebBindings::makeIntArray(intArray));
}
void TextInputController::selectedRange(const CppArgumentList&, CppVariant* result)
@@ -181,9 +184,10 @@ void TextInputController::selectedRange(const CppArgumentList&, CppVariant* resu
return;
WebRange range = mainFrame->selectionRange();
- char buffer[30];
- snprintf(buffer, 30, "%d,%d", range.startOffset(), range.endOffset());
- result->set(string(buffer));
+ Vector<int> intArray(2);
+ intArray[0] = range.startOffset();
+ intArray[1] = range.endOffset();
+ result->set(WebBindings::makeIntArray(intArray));
}
void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result)
@@ -232,3 +236,27 @@ void TextInputController::makeAttributedString(const CppArgumentList&, CppVarian
// FIXME: Implement this.
result->setNull();
}
+
+void TextInputController::setComposition(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebView* view = getMainFrame() ? getMainFrame()->view() : 0;
+ if (!view)
+ return;
+
+ if (arguments.size() < 1)
+ return;
+
+ // Sends a keydown event with key code = 0xE5 to emulate input method behavior.
+ WebKeyboardEvent keyDown;
+ keyDown.type = WebInputEvent::RawKeyDown;
+ keyDown.modifiers = 0;
+ keyDown.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY
+ keyDown.setKeyIdentifierFromWindowsKeyCode();
+ view->handleInputEvent(keyDown);
+
+ WebVector<WebCompositionUnderline> underlines;
+ WebString text(WebString::fromUTF8(arguments[0].toString()));
+ view->setComposition(text, underlines, 0, text.length());
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.h b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
index 9896be5..3a3907f 100644
--- a/WebKitTools/DumpRenderTree/chromium/TextInputController.h
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
@@ -61,6 +61,7 @@ public:
void characterIndexForPoint(const CppArgumentList&, CppVariant*);
void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
void makeAttributedString(const CppArgumentList&, CppVariant*);
+ void setComposition(const CppArgumentList&, CppVariant*);
private:
// Returns the test shell's main WebFrame.
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index ab8dbf0..847e7dc 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -813,6 +813,8 @@ void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
{
+ if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())
+ printFrameUserGestureStatus(frame, " - in didStartProvisionalLoadForFrame\n");
if (m_shell->shouldDumpFrameLoadCallbacks()) {
printFrameDescription(frame);
fputs(" - didStartProvisionalLoadForFrame\n", stdout);
@@ -1051,6 +1053,11 @@ bool WebViewHost::allowScript(WebFrame*, bool enabledPerSettings)
return enabledPerSettings;
}
+void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks)
+{
+ webkit_support::OpenFileSystem(frame, type, size, create, callbacks);
+}
+
// Public functions -----------------------------------------------------------
WebViewHost::WebViewHost(TestShell* shell)
@@ -1305,6 +1312,12 @@ void WebViewHost::printFrameDescription(WebFrame* webframe)
printf("frame \"%s\"", name8.c_str());
}
+void WebViewHost::printFrameUserGestureStatus(WebFrame* webframe, const char* msg)
+{
+ bool isUserGesture = webframe->isProcessingUserGesture();
+ printf("Frame with user gesture \"%s\"%s", isUserGesture ? "true" : "false", msg);
+}
+
void WebViewHost::printResourceDescription(unsigned identifier)
{
ResourceMap::iterator it = m_resourceIdentifierMap.find(identifier);
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index 429d3ab..1380ebd 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -192,6 +192,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual void didDisplayInsecureContent(WebKit::WebFrame*);
virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&);
virtual bool allowScript(WebKit::WebFrame*, bool enabledPerSettings);
+ virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
private:
LayoutTestController* layoutTestController() const;
@@ -220,6 +221,9 @@ private:
// Dumping a frame to the console.
void printFrameDescription(WebKit::WebFrame*);
+ // Dumping the user gesture status to the console.
+ void printFrameUserGestureStatus(WebKit::WebFrame*, const char*);
+
bool hasWindow() const { return m_hasWindow; }
void resetScrollRect();
void discardBackingStore();
diff --git a/WebKitTools/DumpRenderTree/config.h b/WebKitTools/DumpRenderTree/config.h
index 33dee6d..55e2dc1 100644
--- a/WebKitTools/DumpRenderTree/config.h
+++ b/WebKitTools/DumpRenderTree/config.h
@@ -40,6 +40,18 @@
#define WEBKIT_EXPORTDATA
#endif
+#if PLATFORM(MAC)
+#define WTF_PLATFORM_CF 1
+
+#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+#define BUILDING_ON_TIGER 1
+#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#define BUILDING_ON_LEOPARD 1
+#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+#define BUILDING_ON_SNOW_LEOPARD 1
+#endif
+#endif // PLATFORM(MAC)
+
#if PLATFORM(WIN)
#define WTF_PLATFORM_CF 1
#if defined(WIN_CAIRO)
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index d39ff1e..8493f1a 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -174,9 +174,12 @@ AccessibilityUIElement AccessibilityUIElement::titleUIElement()
AccessibilityUIElement AccessibilityUIElement::parentElement()
{
- ASSERT(m_element);
- AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element));
+ if (!m_element)
+ return 0;
+ ASSERT(ATK_IS_OBJECT(m_element));
+
+ AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element));
return parent ? AccessibilityUIElement(parent) : 0;
}
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index e115683..1c851d7 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -38,6 +38,7 @@
#include "GOwnPtr.h"
#include "LayoutTestController.h"
#include "PixelDumpSupport.h"
+#include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
#include <JavaScriptCore/JavaScript.h>
@@ -199,6 +200,16 @@ static void initializeFonts(const char* testURL = 0)
"/usr/share/fonts/dejavu/DejaVuSans.ttf", },
{ "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf",
"/usr/share/fonts/dejavu/DejaVuSerif.ttf", },
+
+ // MathML tests require the STIX fonts.
+ { "/usr/share/fonts/opentype/stix/STIXGeneral.otf",
+ "/usr/share/fonts/stix/STIXGeneral.otf" },
+ { "/usr/share/fonts/opentype/stix/STIXGeneralBolIta.otf",
+ "/usr/share/fonts/stix/STIXGeneralBolIta.otf" },
+ { "/usr/share/fonts/opentype/stix/STIXGeneralBol.otf",
+ "/usr/share/fonts/stix/STIXGeneralBol.otf" },
+ { "/usr/share/fonts/opentype/stix/STIXGeneralItalic.otf",
+ "/usr/share/fonts/stix/STIXGeneralItalic.otf" }
};
// TODO: Some tests use Lucida. We should load these as well, once it becomes
@@ -433,6 +444,8 @@ static void resetDefaultsToConsistentValues()
#endif
setlocale(LC_ALL, "");
+
+ DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(true);
}
static bool useLongRunningServerMode(int argc, char *argv[])
@@ -714,24 +727,8 @@ static char* getFrameNameSuitableForTestResult(WebKitWebView* view, WebKitWebFra
return frameName;
}
-static void webViewLoadCommitted(WebKitWebView* view, WebKitWebFrame* frame, void*)
-{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
- char* frameName = getFrameNameSuitableForTestResult(view, frame);
- printf("%s - didCommitLoadForFrame\n", frameName);
- g_free(frameName);
- }
-}
-
-
static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
{
- if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
- char* frameName = getFrameNameSuitableForTestResult(view, frame);
- printf("%s - didFinishLoadForFrame\n", frameName);
- g_free(frameName);
- }
-
if (frame != topLoadingFrame)
return;
@@ -967,23 +964,43 @@ static WebKitWebView* webInspectorInspectWebView(WebKitWebInspector*, gpointer d
return WEBKIT_WEB_VIEW(webView);
}
-static void webViewLoadStatusNotified(WebKitWebView* view, gpointer user_data)
+static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data)
{
- WebKitLoadStatus loadStatus = webkit_web_view_get_load_status(view);
+ WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame);
if (gLayoutTestController->dumpFrameLoadCallbacks()) {
- if (loadStatus == WEBKIT_LOAD_PROVISIONAL) {
- char* frameName = getFrameNameSuitableForTestResult(view, mainFrame);
- printf("%s - didStartProvisionalLoadForFrame\n", frameName);
- g_free(frameName);
+ GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
+
+ switch (loadStatus) {
+ case WEBKIT_LOAD_PROVISIONAL:
+ if (!done)
+ printf("%s - didStartProvisionalLoadForFrame\n", frameName.get());
+ break;
+ case WEBKIT_LOAD_COMMITTED:
+ if (!done)
+ printf("%s - didCommitLoadForFrame\n", frameName.get());
+ break;
+ case WEBKIT_LOAD_FINISHED:
+ if (frame != topLoadingFrame || !done)
+ printf("%s - didFinishLoadForFrame\n", frameName.get());
+ break;
+ default:
+ break;
}
}
}
+static void frameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* webFrame, gpointer user_data)
+{
+ g_signal_connect(webFrame, "notify::load-status", G_CALLBACK(webFrameLoadStatusNotified), NULL);
+}
+
static WebKitWebView* createWebView()
{
WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ DumpRenderTreeSupportGtk::setDumpRenderTreeModeEnabled(true);
+
// From bug 11756: Use a frame group name for all WebViews created by
// DumpRenderTree to allow testing of cross-page frame lookup.
webkit_web_view_set_group_name(view, "org.webkit.gtk.DumpRenderTree");
@@ -991,7 +1008,6 @@ static WebKitWebView* createWebView()
g_object_connect(G_OBJECT(view),
"signal::load-started", webViewLoadStarted, 0,
"signal::load-finished", webViewLoadFinished, 0,
- "signal::load-committed", webViewLoadCommitted, 0,
"signal::window-object-cleared", webViewWindowObjectCleared, 0,
"signal::console-message", webViewConsoleMessage, 0,
"signal::script-alert", webViewScriptAlert, 0,
@@ -1009,13 +1025,10 @@ static WebKitWebView* createWebView()
"signal::drag-begin", dragBeginCallback, 0,
"signal::drag-end", dragEndCallback, 0,
"signal::drag-failed", dragFailedCallback, 0,
+ "signal::frame-created", frameCreatedCallback, 0,
NULL);
- g_signal_connect(view,
- "notify::load-status", G_CALLBACK(webViewLoadStatusNotified),
- NULL);
-
WebKitWebInspector* inspector = webkit_web_view_get_inspector(view);
g_object_connect(G_OBJECT(inspector),
"signal::inspect-web-view", webInspectorInspectWebView, 0,
@@ -1028,6 +1041,10 @@ static WebKitWebView* createWebView()
webkit_web_view_set_settings(view, settings);
}
+ // frame-created is not issued for main frame. That's why we must do this here
+ WebKitWebFrame* frame = webkit_web_view_get_main_frame(view);
+ g_signal_connect(frame, "notify::load-status", G_CALLBACK(webFrameLoadStatusNotified), NULL);
+
return view;
}
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 181ef9f..688b3f8 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -34,6 +34,7 @@
#include "LayoutTestController.h"
#include "DumpRenderTree.h"
+#include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
#include <JavaScriptCore/JSRetainPtr.h>
@@ -500,7 +501,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
@@ -683,10 +684,13 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value
else if (g_str_equal(originalName.get(), "WebKitUsesPageCachePreferenceKey"))
propertyName = "enable-page-cache";
else if (g_str_equal(originalName.get(), "WebKitPluginsEnabled"))
- propertyName = "enable-plugins";
+ propertyName = "enable-plugins";
else if (g_str_equal(originalName.get(), "WebKitHyperlinkAuditingEnabled"))
- propertyName = "enable-hyperlink-auditing";
- else {
+ propertyName = "enable-hyperlink-auditing";
+ else if (g_str_equal(originalName.get(), "WebKitTabToLinksPreferenceKey")) {
+ DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(!g_ascii_strcasecmp(valueAsString.get(), "true") || !g_ascii_strcasecmp(valueAsString.get(), "1"));
+ return;
+ } else {
fprintf(stderr, "LayoutTestController::overridePreference tried to override "
"unknown preference '%s'.\n", originalName.get());
return;
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index 2ca5755..e27ee0e 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -381,6 +381,26 @@ AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned inde
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned index) const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* array = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];
+ if (index < [array count])
+ return [array objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+unsigned AccessibilityUIElement::selectedChildrenCount() const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ return [m_element accessibilityArrayAttributeCount:NSAccessibilitySelectedChildrenAttribute];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
BEGIN_AX_OBJC_EXCEPTIONS
@@ -1103,6 +1123,14 @@ void AccessibilityUIElement::press()
END_AX_OBJC_EXCEPTIONS
}
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* array = [NSArray arrayWithObject:element->platformUIElement()];
+ [m_element accessibilitySetValue:array forAttribute:NSAccessibilitySelectedChildrenAttribute];
+ END_AX_OBJC_EXCEPTIONS
+}
+
JSStringRef AccessibilityUIElement::accessibilityValue() const
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index 68765f6..efdf54a 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -54,6 +54,7 @@
#import "WorkQueueItem.h"
#import <Carbon/Carbon.h>
#import <CoreFoundation/CoreFoundation.h>
+#import <WebCore/FoundationExtras.h>
#import <WebKit/DOMElement.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMRange.h>
@@ -920,11 +921,11 @@ void dump()
resultMimeType = @"application/pdf";
} else if (gLayoutTestController->dumpDOMAsWebArchive()) {
WebArchive *webArchive = [[mainFrame DOMDocument] webArchive];
- resultString = serializeWebArchiveToXML(webArchive);
+ resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data]));
resultMimeType = @"application/x-webarchive";
} else if (gLayoutTestController->dumpSourceAsWebArchive()) {
WebArchive *webArchive = [[mainFrame dataSource] webArchive];
- resultString = serializeWebArchiveToXML(webArchive);
+ resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data]));
resultMimeType = @"application/x-webarchive";
} else {
sizeWebViewForCurrentTest();
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm
index 02280a1..8eded66 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm
@@ -105,5 +105,42 @@
return nil;
}
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+- (NSDraggingFormation)draggingFormation
+{
+ return NSDraggingFormationDefault;
+}
+
+- (void)setDraggingFormation:(NSDraggingFormation)formation
+{
+ // Ignored.
+}
+
+- (BOOL)animatesToDestination
+{
+ return NO;
+}
+
+- (void)setAnimatesToDestination:(BOOL)flag
+{
+ // Ignored.
+}
+
+- (NSInteger)numberOfValidItemsForDrop
+{
+ return 1;
+}
+
+- (void)setNumberOfValidItemsForDrop:(NSInteger)number
+{
+ // Ignored.
+}
+
+- (void)enumerateDraggingItemsWithOptions:(NSEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block
+{
+ // Ignored.
+}
+#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+
@end
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h
index 5c93ee9..36c5eac 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h
@@ -29,25 +29,23 @@
#ifndef DumpRenderTreeMac_h
#define DumpRenderTreeMac_h
-// FIXME: we should add a config.h file for DumpRenderTree.
-#define WTF_PLATFORM_CF 1
-
-#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-#define BUILDING_ON_TIGER 1
-#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
-#define BUILDING_ON_LEOPARD 1
-#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-#define BUILDING_ON_SNOW_LEOPARD 1
-#endif
+#include <CoreFoundation/CoreFoundation.h>
+#ifdef __OBJC__
@class DumpRenderTreeDraggingInfo;
@class NavigationController;
@class PolicyDelegate;
@class WebFrame;
@class WebScriptWorld;
@class WebView;
-
-typedef const struct __CFString* CFStringRef;
+#else
+class DumpRenderTreeDraggingInfo;
+class NavigationController;
+class PolicyDelegate;
+class WebFrame;
+class WebScriptWorld;
+class WebView;
+#endif
extern CFMutableArrayRef openWindowsRef;
extern CFMutableSetRef disallowedURLs;
diff --git a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
index 963eae7..a36982c 100644
--- a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
@@ -50,6 +50,7 @@
#import <WebKit/WebNSURLExtras.h>
#import <WebKit/WebScriptWorld.h>
#import <WebKit/WebSecurityOriginPrivate.h>
+#import <WebKit/WebViewPrivate.h>
#import <wtf/Assertions.h>
@interface NSURL (DRTExtras)
@@ -89,6 +90,12 @@
return @"frame (anonymous)";
}
}
+
+- (NSString *)_drt_printFrameUserGestureStatus
+{
+ BOOL isUserGesture = [[self webView] _isProcessingUserGesture];
+ return [NSString stringWithFormat:@"Frame with user gesture \"%@\"", isUserGesture ? @"true" : @"false"];
+}
@end
@implementation FrameLoadDelegate
@@ -146,7 +153,12 @@
NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
+ if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) {
+ NSString *string = [NSString stringWithFormat:@"%@ - in didStartProvisionalLoadForFrame", [frame _drt_printFrameUserGestureStatus]];
+ printf ("%s\n", [string UTF8String]);
+ }
+
ASSERT([frame provisionalDataSource]);
// Make sure we only set this once per test. If it gets cleared, and then set again, we might
// end up doing two dumps for one test.
@@ -166,7 +178,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didCommitLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
ASSERT(![frame provisionalDataSource]);
ASSERT([frame dataSource]);
@@ -190,7 +202,7 @@
ASSERT_NOT_REACHED();
return;
}
-
+
ASSERT([frame provisionalDataSource]);
[self webView:sender locationChangeDone:error forDataSource:[frame provisionalDataSource]];
}
@@ -204,7 +216,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
// FIXME: This call to displayIfNeeded can be removed when <rdar://problem/5092361> is fixed.
// After that is fixed, we will reenable painting after WebCore is done loading the document,
// and this call will no longer be needed.
@@ -220,7 +232,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadWithError", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
ASSERT(![frame provisionalDataSource]);
ASSERT([frame dataSource]);
@@ -233,7 +245,7 @@
NSString *string = [NSString stringWithFormat:@"?? - windowScriptObjectAvailable"];
printf ("%s\n", [string UTF8String]);
}
-
+
ASSERT_NOT_REACHED();
}
@@ -314,7 +326,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveTitle: %@", [frame _drt_descriptionSuitableForTestResult], title];
printf ("%s\n", [string UTF8String]);
}
-
+
if (gLayoutTestController->dumpTitleChanges())
printf("TITLE CHANGED: %s\n", [title UTF8String]);
}
diff --git a/WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h b/WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h
deleted file mode 100644
index b3d421d..0000000
--- a/WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../../WebKit/mac/WebView/WebHTMLRepresentationInternal.h"
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index c5d5a90..150b6f9 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -371,7 +371,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
[[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
}
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.mm b/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.mm
deleted file mode 100644
index 7c52c6a..0000000
--- a/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupport.mm
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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.
- */
-
-#import "WebArchiveDumpSupport.h"
-
-#import <Foundation/Foundation.h>
-#import <WebKit/WebArchive.h>
-#import <WebKit/WebHTMLRepresentationInternal.h>
-
-static void convertMIMEType(NSMutableString *mimeType)
-{
-#ifdef BUILDING_ON_LEOPARD
- // Workaround for <rdar://problem/5539824> on Leopard
- if ([mimeType isEqualToString:@"text/xml"])
- [mimeType setString:@"application/xml"];
-#endif
- // Workaround for <rdar://problem/6234318> with Dashcode 2.0
- if ([mimeType isEqualToString:@"application/x-javascript"])
- [mimeType setString:@"text/javascript"];
-}
-
-static void convertWebResourceDataToString(NSMutableDictionary *resource)
-{
- NSMutableString *mimeType = [resource objectForKey:@"WebResourceMIMEType"];
- convertMIMEType(mimeType);
-
- if ([mimeType hasPrefix:@"text/"] || [[WebHTMLRepresentation supportedNonImageMIMETypes] containsObject:mimeType]) {
- NSString *textEncodingName = [resource objectForKey:@"WebResourceTextEncodingName"];
- NSStringEncoding stringEncoding;
- if ([textEncodingName length] > 0)
- stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)textEncodingName));
- else
- stringEncoding = NSUTF8StringEncoding;
-
- NSData *data = [resource objectForKey:@"WebResourceData"];
- NSString *dataAsString = [[NSString alloc] initWithData:data encoding:stringEncoding];
- if (dataAsString)
- [resource setObject:dataAsString forKey:@"WebResourceData"];
- [dataAsString release];
- }
-}
-
-static void normalizeHTTPResponseHeaderFields(NSMutableDictionary *fields)
-{
- // Normalize headers
- if ([fields objectForKey:@"Date"])
- [fields setObject:@"Sun, 16 Nov 2008 17:00:00 GMT" forKey:@"Date"];
- if ([fields objectForKey:@"Last-Modified"])
- [fields setObject:@"Sun, 16 Nov 2008 16:55:00 GMT" forKey:@"Last-Modified"];
- if ([fields objectForKey:@"Etag"])
- [fields setObject:@"\"301925-21-45c7d72d3e780\"" forKey:@"Etag"];
- if ([fields objectForKey:@"Server"])
- [fields setObject:@"Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l PHP/5.2.6" forKey:@"Server"];
-
- // Remove headers
- if ([fields objectForKey:@"Connection"])
- [fields removeObjectForKey:@"Connection"];
- if ([fields objectForKey:@"Keep-Alive"])
- [fields removeObjectForKey:@"Keep-Alive"];
-}
-
-static void normalizeWebResourceURL(NSMutableString *webResourceURL)
-{
- static int fileUrlLength = [(NSString *)@"file://" length];
- NSRange layoutTestsWebArchivePathRange = [webResourceURL rangeOfString:@"/LayoutTests/" options:NSBackwardsSearch];
- if (layoutTestsWebArchivePathRange.location == NSNotFound)
- return;
- NSRange currentWorkingDirectoryRange = NSMakeRange(fileUrlLength, layoutTestsWebArchivePathRange.location - fileUrlLength);
- [webResourceURL replaceCharactersInRange:currentWorkingDirectoryRange withString:@""];
-}
-
-static void convertWebResourceResponseToDictionary(NSMutableDictionary *propertyList)
-{
- NSURLResponse *response = nil;
- NSData *responseData = [propertyList objectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
- if ([responseData isKindOfClass:[NSData class]]) {
- // Decode NSURLResponse
- NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:responseData];
- response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
- [unarchiver finishDecoding];
- [unarchiver release];
- }
-
- NSMutableDictionary *responseDictionary = [[NSMutableDictionary alloc] init];
-
- NSMutableString *urlString = [[[response URL] description] mutableCopy];
- normalizeWebResourceURL(urlString);
- [responseDictionary setObject:urlString forKey:@"URL"];
- [urlString release];
-
- NSMutableString *mimeTypeString = [[response MIMEType] mutableCopy];
- convertMIMEType(mimeTypeString);
- [responseDictionary setObject:mimeTypeString forKey:@"MIMEType"];
- [mimeTypeString release];
-
- NSString *textEncodingName = [response textEncodingName];
- if (textEncodingName)
- [responseDictionary setObject:textEncodingName forKey:@"textEncodingName"];
- [responseDictionary setObject:[NSNumber numberWithLongLong:[response expectedContentLength]] forKey:@"expectedContentLength"];
-
- if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
- NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
-
- NSMutableDictionary *allHeaderFields = [[httpResponse allHeaderFields] mutableCopy];
- normalizeHTTPResponseHeaderFields(allHeaderFields);
- [responseDictionary setObject:allHeaderFields forKey:@"allHeaderFields"];
- [allHeaderFields release];
-
- [responseDictionary setObject:[NSNumber numberWithInt:[httpResponse statusCode]] forKey:@"statusCode"];
- }
-
- [propertyList setObject:responseDictionary forKey:@"WebResourceResponse"];
- [responseDictionary release];
-}
-
-static NSInteger compareResourceURLs(id resource1, id resource2, void *context)
-{
- NSString *url1 = [resource1 objectForKey:@"WebResourceURL"];
- NSString *url2 = [resource2 objectForKey:@"WebResourceURL"];
-
- return [url1 compare:url2];
-}
-
-NSString *serializeWebArchiveToXML(WebArchive *webArchive)
-{
- NSString *errorString;
- NSMutableDictionary *propertyList = [NSPropertyListSerialization propertyListFromData:[webArchive data]
- mutabilityOption:NSPropertyListMutableContainersAndLeaves
- format:NULL
- errorDescription:&errorString];
- if (!propertyList)
- return errorString;
-
- NSMutableArray *resources = [NSMutableArray arrayWithCapacity:1];
- [resources addObject:propertyList];
-
- while ([resources count]) {
- NSMutableDictionary *resourcePropertyList = [resources objectAtIndex:0];
- [resources removeObjectAtIndex:0];
-
- NSMutableDictionary *mainResource = [resourcePropertyList objectForKey:@"WebMainResource"];
- normalizeWebResourceURL([mainResource objectForKey:@"WebResourceURL"]);
- convertWebResourceDataToString(mainResource);
-
- // Add subframeArchives to list for processing
- NSMutableArray *subframeArchives = [resourcePropertyList objectForKey:@"WebSubframeArchives"]; // WebSubframeArchivesKey in WebArchive.m
- if (subframeArchives)
- [resources addObjectsFromArray:subframeArchives];
-
- NSMutableArray *subresources = [resourcePropertyList objectForKey:@"WebSubresources"]; // WebSubresourcesKey in WebArchive.m
- NSEnumerator *enumerator = [subresources objectEnumerator];
- NSMutableDictionary *subresourcePropertyList;
- while ((subresourcePropertyList = [enumerator nextObject])) {
- normalizeWebResourceURL([subresourcePropertyList objectForKey:@"WebResourceURL"]);
- convertWebResourceResponseToDictionary(subresourcePropertyList);
- convertWebResourceDataToString(subresourcePropertyList);
- }
-
- // Sort the subresources so they're always in a predictable order for the dump
- if (NSArray *sortedSubresources = [subresources sortedArrayUsingFunction:compareResourceURLs context:nil])
- [resourcePropertyList setObject:sortedSubresources forKey:@"WebSubresources"];
- }
-
- NSData *xmlData = [NSPropertyListSerialization dataFromPropertyList:propertyList
- format:NSPropertyListXMLFormat_v1_0
- errorDescription:&errorString];
- if (!xmlData)
- return errorString;
-
- NSMutableString *string = [[[NSMutableString alloc] initWithData:xmlData encoding:NSUTF8StringEncoding] autorelease];
-
- // Replace "Apple Computer" with "Apple" in the DTD declaration.
- NSRange range = [string rangeOfString:@"-//Apple Computer//"];
- if (range.location != NSNotFound)
- [string replaceCharactersInRange:range withString:@"-//Apple//"];
-
- return string;
-}
diff --git a/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm b/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm
new file mode 100644
index 0000000..c273087
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm
@@ -0,0 +1,76 @@
+/*
+ * 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 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.
+ */
+
+#import "WebArchiveDumpSupport.h"
+
+#import <CFNetwork/CFHTTPMessage.h>
+#import <Foundation/Foundation.h>
+#import <WebKit/WebHTMLRepresentation.h>
+#import <wtf/RetainPtr.h>
+
+extern "C" {
+
+enum CFURLCacheStoragePolicy {
+ kCFURLCacheStorageAllowed = 0,
+ kCFURLCacheStorageAllowedInMemoryOnly = 1,
+ kCFURLCacheStorageNotAllowed = 2
+};
+typedef enum CFURLCacheStoragePolicy CFURLCacheStoragePolicy;
+
+extern const CFStringRef kCFHTTPVersion1_1;
+
+CFURLResponseRef CFURLResponseCreate(CFAllocatorRef alloc, CFURLRef URL, CFStringRef mimeType, SInt64 expectedContentLength, CFStringRef textEncodingName, CFURLCacheStoragePolicy recommendedPolicy);
+CFURLResponseRef CFURLResponseCreateWithHTTPResponse(CFAllocatorRef alloc, CFURLRef URL, CFHTTPMessageRef httpResponse, CFURLCacheStoragePolicy recommendedPolicy);
+void CFURLResponseSetExpectedContentLength(CFURLResponseRef response, SInt64 length);
+void CFURLResponseSetMIMEType(CFURLResponseRef response, CFStringRef mimeType);
+
+}
+
+CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData)
+{
+ // Decode NSURLResponse
+ RetainPtr<NSKeyedUnarchiver> unarchiver(AdoptNS, [[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]);
+ NSURLResponse *response = [unarchiver.get() decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+ [unarchiver.get() finishDecoding];
+
+ if (![response isKindOfClass:[NSHTTPURLResponse class]])
+ return CFURLResponseCreate(kCFAllocatorDefault, (CFURLRef)[response URL], (CFStringRef)[response MIMEType], [response expectedContentLength], (CFStringRef)[response textEncodingName], kCFURLCacheStorageAllowed);
+
+ NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
+
+ // NSURLResponse is not toll-free bridged to CFURLResponse.
+ RetainPtr<CFHTTPMessageRef> httpMessage(AdoptCF, CFHTTPMessageCreateResponse(kCFAllocatorDefault, [httpResponse statusCode], 0, kCFHTTPVersion1_1));
+
+ NSDictionary *headerFields = [httpResponse allHeaderFields];
+ for (NSString *headerField in [headerFields keyEnumerator])
+ CFHTTPMessageSetHeaderFieldValue(httpMessage.get(), (CFStringRef)headerField, (CFStringRef)[headerFields objectForKey:headerField]);
+
+ return CFURLResponseCreateWithHTTPResponse(kCFAllocatorDefault, (CFURLRef)[response URL], httpMessage.get(), kCFURLCacheStorageAllowed);
+}
+
+CFArrayRef supportedNonImageMIMETypes()
+{
+ return (CFArrayRef)[WebHTMLRepresentation supportedNonImageMIMETypes];
+}
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index d36a074..f99ec4f 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -73,6 +73,7 @@ void LayoutTestController::reset()
DumpRenderTreeSupportQt::dumpEditingCallbacks(false);
DumpRenderTreeSupportQt::dumpFrameLoader(false);
+ DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false);
DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false);
DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false);
DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(true);
@@ -246,6 +247,11 @@ void LayoutTestController::dumpFrameLoadCallbacks()
DumpRenderTreeSupportQt::dumpFrameLoader(true);
}
+void LayoutTestController::dumpUserGestureInFrameLoadCallbacks()
+{
+ DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true);
+}
+
void LayoutTestController::dumpResourceLoadCallbacks()
{
DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(true);
@@ -759,7 +765,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo
DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
}
-void LayoutTestController::setMockSpeechInputResult(const QString& result)
+void LayoutTestController::setMockSpeechInputResult(const QString& result, const QString& language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 3684946..11d72e4 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -106,6 +106,7 @@ public slots:
void handleErrorPages() { m_handleErrorPages = true; }
void dumpEditingCallbacks();
void dumpFrameLoadCallbacks();
+ void dumpUserGestureInFrameLoadCallbacks();
void dumpResourceLoadCallbacks();
void dumpResourceResponseMIMETypes();
void dumpHistoryCallbacks();
@@ -215,7 +216,7 @@ public slots:
bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
bool geolocationPermission() const { return m_geolocationPermission; }
- void setMockSpeechInputResult(const QString& result);
+ void setMockSpeechInputResult(const QString& result, const QString& language);
// Empty stub method to keep parity with object model exposed by global LayoutTestController.
void abortModal() {}
diff --git a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
index 740ebb8..b958025 100644
--- a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
+++ b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
@@ -31,6 +31,7 @@ SOURCES = PluginObject.cpp \
Tests/DocumentOpenInDestroyStream.cpp \
Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
Tests/NPRuntimeRemoveProperty.cpp \
+ Tests/NullNPPGetValuePointer.cpp \
Tests/PassDifferentNPPStruct.cpp \
Tests/PluginScriptableNPObjectInvokeDefault.cpp
diff --git a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
index 8c4e98d..14bb8ef 100644
--- a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
+++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
@@ -105,7 +105,7 @@ webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/,
}
static NPError
-webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** /*save*/)
+webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** save)
{
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
if (obj) {
@@ -129,6 +129,8 @@ webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** /*save*/)
if (obj->onSetWindow)
free(obj->onSetWindow);
+ obj->pluginTest->NPP_Destroy(save);
+
browser->releaseobject(&obj->header);
}
@@ -157,7 +159,7 @@ webkit_test_plugin_set_window(NPP instance, NPWindow *window)
}
- return NPERR_NO_ERROR;
+ return obj->pluginTest->NPP_SetWindow(instance, window);
}
static void executeScript(const PluginObject* obj, const char* script)
@@ -386,6 +388,7 @@ NP_Initialize (NPNetscapeFuncs *aMozillaVTable, NPPluginFuncs *aPluginVTable)
return NPERR_INVALID_FUNCTABLE_ERROR;
browser = aMozillaVTable;
+ pluginFunctions = aPluginVTable;
aPluginVTable->size = sizeof (NPPluginFuncs);
aPluginVTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index 67e5d4b..5138562 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -1302,15 +1302,19 @@ int main(int argc, char* argv[])
standardPreferences->setJavaScriptEnabled(TRUE);
standardPreferences->setDefaultFontSize(16);
standardPreferences->setAcceleratedCompositingEnabled(true);
+ standardPreferences->setContinuousSpellCheckingEnabled(TRUE);
if (printSupportedFeatures) {
BOOL acceleratedCompositingAvailable;
standardPreferences->acceleratedCompositingEnabled(&acceleratedCompositingAvailable);
- BOOL threeDRenderingAvailable =
+
#if ENABLE(3D_RENDERING)
- true;
+ // In theory, we could have a software-based 3D rendering implementation that we use when
+ // hardware-acceleration is not available. But we don't have any such software
+ // implementation, so 3D rendering is only available when hardware-acceleration is.
+ BOOL threeDRenderingAvailable = acceleratedCompositingAvailable;
#else
- false;
+ BOOL threeDRenderingAvailable = FALSE;
#endif
printf("SupportedFeatures:%s %s\n", acceleratedCompositingAvailable ? "AcceleratedCompositing" : "", threeDRenderingAvailable ? "3DRendering" : "");
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
index 1cba86a..2f4908f 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
CharacterSet="1"
>
<Tool
@@ -91,7 +91,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
@@ -165,7 +165,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"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
CharacterSet="1"
>
<Tool
@@ -237,7 +237,7 @@
<Configuration
Name="Debug_Cairo|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops"
CharacterSet="1"
>
<Tool
@@ -310,7 +310,7 @@
<Configuration
Name="Release_Cairo|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
@@ -384,7 +384,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"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops"
CharacterSet="1"
>
<Tool
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
index e3497c9..27edaa6 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
@@ -12,7 +12,7 @@
* 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.
+ * 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
diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
index 32c02bd..71859cb 100644
--- a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
@@ -353,3 +353,72 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection(
}
return S_OK;
}
+
+static int indexOfFirstWordCharacter(const TCHAR* text)
+{
+ const TCHAR* cursor = text;
+ while (*cursor && !isalpha(*cursor))
+ ++cursor;
+ return *cursor ? (cursor - text) : -1;
+};
+
+static int wordLength(const TCHAR* text)
+{
+ const TCHAR* cursor = text;
+ while (*cursor && isalpha(*cursor))
+ ++cursor;
+ return cursor - text;
+};
+
+HRESULT STDMETHODCALLTYPE EditingDelegate::checkSpellingOfString(
+ /* [in] */ IWebView* view,
+ /* [in] */ LPCTSTR text,
+ /* [in] */ int length,
+ /* [out] */ int* misspellingLocation,
+ /* [out] */ int* misspellingLength)
+{
+ static const TCHAR* misspelledWords[] = {
+ // These words are known misspelled words in webkit tests.
+ // If there are other misspelled words in webkit tests, please add them in
+ // this array.
+ TEXT("foo"),
+ TEXT("Foo"),
+ TEXT("baz"),
+ TEXT("fo"),
+ TEXT("LibertyF"),
+ TEXT("chello"),
+ TEXT("xxxtestxxx"),
+ TEXT("XXxxx"),
+ TEXT("Textx"),
+ TEXT("blockquoted"),
+ TEXT("asd"),
+ TEXT("Lorem"),
+ TEXT("Nunc"),
+ TEXT("Curabitur"),
+ TEXT("eu"),
+ TEXT("adlj"),
+ TEXT("adaasj"),
+ TEXT("sdklj"),
+ TEXT("jlkds"),
+ TEXT("jsaada"),
+ TEXT("jlda"),
+ TEXT("zz"),
+ TEXT("contentEditable"),
+ 0,
+ };
+
+ wstring textString(text, length);
+ int wordStart = indexOfFirstWordCharacter(textString.c_str());
+ if (-1 == wordStart)
+ return S_OK;
+ wstring word = textString.substr(wordStart, wordLength(textString.c_str() + wordStart));
+ for (size_t i = 0; misspelledWords[i]; ++i) {
+ if (word == misspelledWords[i]) {
+ *misspellingLocation = wordStart;
+ *misspellingLength = word.size();
+ break;
+ }
+ }
+
+ return S_OK;
+}
diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.h b/WebKitTools/DumpRenderTree/win/EditingDelegate.h
index 6dba675..7b7f418 100644
--- a/WebKitTools/DumpRenderTree/win/EditingDelegate.h
+++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.h
@@ -127,7 +127,7 @@ public:
/* [in] */ LPCTSTR text,
/* [in] */ int length,
/* [out] */ int *misspellingLocation,
- /* [out] */ int *misspellingLength) { return E_NOTIMPL; }
+ /* [out] */ int *misspellingLength);
virtual HRESULT STDMETHODCALLTYPE checkGrammarOfString(
/* [in] */ IWebView *view,
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index d2140d1..d7c41e0 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -405,7 +405,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
@@ -1391,8 +1391,13 @@ void LayoutTestController::abortModal()
{
}
-bool LayoutTestController::hasSpellingMarker(int, int)
+bool LayoutTestController::hasSpellingMarker(int from, int length)
{
- // FIXME: Implement this.
- return false;
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return false;
+ BOOL ret = FALSE;
+ if (FAILED(framePrivate->hasSpellingMarker(from, length, &ret)))
+ return false;
+ return ret;
}
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index eefc587..32614c1 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -320,7 +320,7 @@ void LayoutTestController::setGeolocationPermission(bool allow)
setGeolocationPermissionCommon(allow);
}
-void LayoutTestController::setMockSpeechInputResult(JSStringRef result)
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
{
// FIXME: Implement for speech input layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=39485.
@@ -528,4 +528,3 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pa
// FIXME: Implement
return 0;
}
-
diff --git a/WebKitTools/EWSTools/start-queue.sh b/WebKitTools/EWSTools/start-queue.sh
index 1e0403f..7835e74 100755
--- a/WebKitTools/EWSTools/start-queue.sh
+++ b/WebKitTools/EWSTools/start-queue.sh
@@ -33,5 +33,5 @@ do
git reset --hard
git clean -f
git svn rebase
- ./WebKitTools/Scripts/webkit-patch $1 --no-confirm --exit-after-iteration 100
+ ./WebKitTools/Scripts/webkit-patch $1 --no-confirm --exit-after-iteration 10
done
diff --git a/WebKitTools/GNUmakefile.am b/WebKitTools/GNUmakefile.am
index 5257ece..2700869 100644
--- a/WebKitTools/GNUmakefile.am
+++ b/WebKitTools/GNUmakefile.am
@@ -169,6 +169,8 @@ TestNetscapePlugin_libtestnetscapeplugin_la_SOURCES = \
WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp \
WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp \
WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp \
WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h \
diff --git a/WebKitTools/GtkLauncher/main.c b/WebKitTools/GtkLauncher/main.c
index 17ed40f..4abee08 100644
--- a/WebKitTools/GtkLauncher/main.c
+++ b/WebKitTools/GtkLauncher/main.c
@@ -27,26 +27,24 @@
#include <gtk/gtk.h>
#include <webkit/webkit.h>
-static GtkWidget* main_window;
-static GtkWidget* uri_entry;
-static GtkStatusbar* main_statusbar;
-static WebKitWebView* web_view;
-static gchar* main_title;
-static gdouble load_progress;
-static guint status_context_id;
+static gint window_count = 0;
+
+static GtkWidget* create_window (WebKitWebView** out_web_view);
static void
activate_uri_entry_cb (GtkWidget* entry, gpointer data)
{
+ WebKitWebView *web_view = g_object_get_data (G_OBJECT (entry), "web-view");
const gchar* uri = gtk_entry_get_text (GTK_ENTRY (entry));
g_assert (uri);
webkit_web_view_load_uri (web_view, uri);
}
static void
-update_title (GtkWindow* window)
+update_title (GtkWindow* window, WebKitWebView* web_view)
{
- GString* string = g_string_new (main_title);
+ GString *string = g_string_new (webkit_web_view_get_title(web_view));
+ gdouble load_progress = webkit_web_view_get_progress (web_view) * 100;
g_string_append (string, " - WebKit Launcher");
if (load_progress < 100)
g_string_append_printf (string, " (%f%%)", load_progress);
@@ -56,25 +54,24 @@ update_title (GtkWindow* window)
}
static void
-link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data)
+link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, GtkStatusbar* statusbar)
{
+ guint status_context_id =
+ GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (statusbar), "link-hover-context"));
/* underflow is allowed */
- gtk_statusbar_pop (main_statusbar, status_context_id);
+ gtk_statusbar_pop (statusbar, status_context_id);
if (link)
- gtk_statusbar_push (main_statusbar, status_context_id, link);
+ gtk_statusbar_push (statusbar, status_context_id, link);
}
static void
-notify_title_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
+notify_title_cb (WebKitWebView* web_view, GParamSpec* pspec, GtkWidget* window)
{
- if (main_title)
- g_free (main_title);
- main_title = g_strdup (webkit_web_view_get_title(web_view));
- update_title (GTK_WINDOW (main_window));
+ update_title (GTK_WINDOW (window), web_view);
}
static void
-notify_load_status_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
+notify_load_status_cb (WebKitWebView* web_view, GParamSpec* pspec, GtkWidget* uri_entry)
{
if (webkit_web_view_get_load_status (web_view) == WEBKIT_LOAD_COMMITTED) {
WebKitWebFrame* frame = webkit_web_view_get_main_frame (web_view);
@@ -85,43 +82,68 @@ notify_load_status_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data
}
static void
-notify_progress_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
+notify_progress_cb (WebKitWebView* web_view, GParamSpec* pspec, GtkWidget* window)
{
- load_progress = webkit_web_view_get_progress (web_view) * 100;
- update_title (GTK_WINDOW (main_window));
+ update_title (GTK_WINDOW (window), web_view);
}
static void
-destroy_cb (GtkWidget* widget, gpointer data)
+destroy_cb (GtkWidget* widget, GtkWidget* window)
{
- gtk_main_quit ();
+ if (g_atomic_int_dec_and_test (&window_count))
+ gtk_main_quit ();
}
static void
-go_back_cb (GtkWidget* widget, gpointer data)
+go_back_cb (GtkWidget* widget, WebKitWebView* web_view)
{
webkit_web_view_go_back (web_view);
}
static void
-go_forward_cb (GtkWidget* widget, gpointer data)
+go_forward_cb (GtkWidget* widget, WebKitWebView* web_view)
{
webkit_web_view_go_forward (web_view);
}
+static WebKitWebView*
+create_web_view_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, GtkWidget* window)
+{
+ WebKitWebView *new_web_view;
+ create_window (&new_web_view);
+ return new_web_view;
+}
+
+static gboolean
+web_view_ready_cb (WebKitWebView* web_view, GtkWidget* window)
+{
+ gtk_widget_grab_focus (GTK_WIDGET (web_view));
+ gtk_widget_show_all (window);
+ return FALSE;
+}
+
+static gboolean
+close_web_view_cb (WebKitWebView* web_view, GtkWidget* window)
+{
+ gtk_widget_destroy (window);
+ return TRUE;
+}
+
static GtkWidget*
-create_browser ()
+create_browser (GtkWidget* window, GtkWidget* uri_entry, GtkWidget* statusbar, WebKitWebView* web_view)
{
GtkWidget* scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ());
gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (web_view));
- g_signal_connect (web_view, "notify::title", G_CALLBACK (notify_title_cb), web_view);
- g_signal_connect (web_view, "notify::load-status", G_CALLBACK (notify_load_status_cb), web_view);
- g_signal_connect (web_view, "notify::progress", G_CALLBACK (notify_progress_cb), web_view);
- g_signal_connect (web_view, "hovering-over-link", G_CALLBACK (link_hover_cb), web_view);
+ g_signal_connect (web_view, "notify::title", G_CALLBACK (notify_title_cb), window);
+ g_signal_connect (web_view, "notify::load-status", G_CALLBACK (notify_load_status_cb), uri_entry);
+ g_signal_connect (web_view, "notify::progress", G_CALLBACK (notify_progress_cb), window);
+ g_signal_connect (web_view, "hovering-over-link", G_CALLBACK (link_hover_cb), statusbar);
+ g_signal_connect (web_view, "create-web-view", G_CALLBACK (create_web_view_cb), window);
+ g_signal_connect (web_view, "web-view-ready", G_CALLBACK (web_view_ready_cb), window);
+ g_signal_connect (web_view, "close-web-view", G_CALLBACK (close_web_view_cb), window);
return scrolled_window;
}
@@ -129,14 +151,16 @@ create_browser ()
static GtkWidget*
create_statusbar ()
{
- main_statusbar = GTK_STATUSBAR (gtk_statusbar_new ());
- status_context_id = gtk_statusbar_get_context_id (main_statusbar, "Link Hover");
+ GtkStatusbar *statusbar = GTK_STATUSBAR (gtk_statusbar_new ());
+ guint status_context_id = gtk_statusbar_get_context_id (statusbar, "Link Hover");
+ g_object_set_data (G_OBJECT (statusbar), "link-hover-context",
+ GUINT_TO_POINTER(status_context_id));
- return (GtkWidget*)main_statusbar;
+ return GTK_WIDGET (statusbar);
}
static GtkWidget*
-create_toolbar ()
+create_toolbar (GtkWidget* uri_entry, WebKitWebView* web_view)
{
GtkWidget* toolbar = gtk_toolbar_new ();
@@ -151,23 +175,23 @@ create_toolbar ()
/* the back button */
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
- g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_back_cb), NULL);
+ g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_back_cb), web_view);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
/* The forward button */
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
- g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_forward_cb), NULL);
+ g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_forward_cb), web_view);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
/* The URL entry */
item = gtk_tool_item_new ();
gtk_tool_item_set_expand (item, TRUE);
- uri_entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (item), uri_entry);
g_signal_connect (G_OBJECT (uri_entry), "activate", G_CALLBACK (activate_uri_entry_cb), NULL);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
/* The go button */
+ g_object_set_data (G_OBJECT (uri_entry), "web-view", web_view);
item = gtk_tool_button_new_from_stock (GTK_STOCK_OK);
g_signal_connect_swapped (G_OBJECT (item), "clicked", G_CALLBACK (activate_uri_entry_cb), (gpointer)uri_entry);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
@@ -176,13 +200,36 @@ create_toolbar ()
}
static GtkWidget*
-create_window ()
+create_window (WebKitWebView** out_web_view)
{
- GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ WebKitWebView *web_view;
+ GtkWidget *vbox;
+ GtkWidget *window;
+ GtkWidget *uri_entry;
+ GtkWidget *statusbar;
+
+ g_atomic_int_inc (&window_count);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
gtk_widget_set_name (window, "GtkLauncher");
+
+ web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ());
+ uri_entry = gtk_entry_new ();
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ statusbar = create_statusbar (web_view);
+ gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (uri_entry, web_view), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), create_browser (window, uri_entry, statusbar, web_view), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
+
+ gtk_container_add (GTK_CONTAINER (window), vbox);
+
g_signal_connect (window, "destroy", G_CALLBACK (destroy_cb), NULL);
+ if (out_web_view)
+ *out_web_view = web_view;
+
return window;
}
@@ -201,17 +248,14 @@ static gchar* filenameToURL(const char* filename)
int
main (int argc, char* argv[])
{
+ WebKitWebView *web_view;
+ GtkWidget *main_window;
+
gtk_init (&argc, &argv);
if (!g_thread_supported ())
g_thread_init (NULL);
- GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), create_browser (), TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), create_statusbar (), FALSE, FALSE, 0);
-
- main_window = create_window ();
- gtk_container_add (GTK_CONTAINER (main_window), vbox);
+ main_window = create_window (&web_view);
gchar *uri = (gchar*) (argc > 1 ? argv[1] : "http://www.google.com/");
gchar *fileURL = filenameToURL(uri);
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index 6fad41a..4f2b63f 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -305,6 +305,16 @@ static void didRemoveFrameFromHierarchy(WKPageRef page, WKFrameRef frame, WKType
LOG(@"didRemoveFrameFromHierarchy");
}
+static void didDisplayInsecureContentForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didDisplayInsecureContentForFrame");
+}
+
+static void didRunInsecureContentForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didRunInsecureContentForFrame");
+}
+
static void didStartProgress(WKPageRef page, const void *clientInfo)
{
[(BrowserWindowController *)clientInfo didStartProgress];
@@ -361,7 +371,7 @@ static void decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLR
#pragma mark UI Client Callbacks
-static WKPageRef createNewPage(WKPageRef page, const void* clientInfo)
+static WKPageRef createNewPage(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton button, const void* clientInfo)
{
LOG(@"createNewPage");
BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:WKPageGetPageNamespace(page)];
@@ -479,11 +489,6 @@ static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers,
LOG(@"mouseDidMoveOverElement");
}
-static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
-{
- LOG(@"contentsSizeChanged");
-}
-
static WKRect getWindowFrame(WKPageRef page, const void* clientInfo)
{
NSRect rect = [[(BrowserWindowController *)clientInfo window] frame];
@@ -547,6 +552,8 @@ static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKF
didFirstLayoutForFrame,
didFirstVisuallyNonEmptyLayoutForFrame,
didRemoveFrameFromHierarchy,
+ didDisplayInsecureContentForFrame,
+ didRunInsecureContentForFrame,
didStartProgress,
didChangeProgress,
didFinishProgress,
@@ -577,12 +584,20 @@ static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKF
runJavaScriptPrompt,
setStatusText,
mouseDidMoveOverElement,
- contentsSizeChanged,
0, /* didNotHandleKeyEvent */
+ 0, /* toolbarsAreVisible */
+ 0, /* setToolbarsAreVisible */
+ 0, /* menuBarIsVisible */
+ 0, /* setMenuBarIsVisible */
+ 0, /* statusBarIsVisible */
+ 0, /* setStatusBarIsVisible */
+ 0, /* isResizable */
+ 0, /* setIsResizable */
getWindowFrame,
setWindowFrame,
runBeforeUnloadConfirmPanel,
- 0 /* didDraw */
+ 0, /* didDraw */
+ 0 /* pageDidScroll */
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
index 76848fa..b182740 100644
--- a/WebKitTools/MiniBrowser/win/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -39,7 +39,7 @@ BrowserView::BrowserView()
// UI Client Callbacks
-static WKPageRef createNewPage(WKPageRef page, const void* clientInfo)
+static WKPageRef createNewPage(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void* clientInfo)
{
BrowserWindow* browserWindow = BrowserWindow::create();
browserWindow->createWindow(0, 0, 800, 600);
@@ -78,10 +78,6 @@ static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers,
{
}
-static void contentsSizeChanged(WKPageRef page, int width, int height, WKFrameRef frame, const void *clientInfo)
-{
-}
-
void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
{
assert(!m_webView);
@@ -109,8 +105,20 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
runJavaScriptPrompt,
setStatusText,
mouseDidMoveOverElement,
- contentsSizeChanged,
- 0 /* didNotHandleKeyEvent */
+ 0, /* didNotHandleKeyEvent */
+ 0, /* toolbarsAreVisible */
+ 0, /* setToolbarsAreVisible */
+ 0, /* menuBarIsVisible */
+ 0, /* setMenuBarIsVisible */
+ 0, /* statusBarIsVisible */
+ 0, /* setStatusBarIsVisible */
+ 0, /* isResizable */
+ 0, /* setIsResizable */
+ 0, /* getWindowFrame */
+ 0, /* setWindowFrame */
+ 0, /* runBeforeUnloadConfirmPanel */
+ 0, /* didDraw */
+ 0 /* pageDidScroll */
};
WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
diff --git a/WebKitTools/QtTestBrowser/fpstimer.cpp b/WebKitTools/QtTestBrowser/fpstimer.cpp
index 3b72cef..eae3d9c 100644
--- a/WebKitTools/QtTestBrowser/fpstimer.cpp
+++ b/WebKitTools/QtTestBrowser/fpstimer.cpp
@@ -37,11 +37,12 @@
#define FPS_MEASURE_INTERVAL 1000 / 60
FpsTimer::FpsTimer(QObject* parent)
- : QObject(parent)
+ : QObject(parent)
+ , m_timer(0)
{
}
-int FpsTimer::numFrames(int spanMillis)
+int FpsTimer::numFrames(int spanMillis) const
{
const QTime now = QTime::currentTime();
@@ -63,13 +64,15 @@ void FpsTimer::start()
void FpsTimer::stop()
{
+ if (!m_timer)
+ return;
killTimer(m_timer);
m_frames.clear();
}
void FpsTimer::timerEvent(QTimerEvent* event)
{
- if (event->timerId() != m_timer)
+ if (event->timerId() != m_timer)
return;
m_frames.append(QTime::currentTime());
if (m_frames.length() > MAX_FRAMES_SAVED)
diff --git a/WebKitTools/QtTestBrowser/fpstimer.h b/WebKitTools/QtTestBrowser/fpstimer.h
index accecd2..eed1198 100644
--- a/WebKitTools/QtTestBrowser/fpstimer.h
+++ b/WebKitTools/QtTestBrowser/fpstimer.h
@@ -37,7 +37,7 @@ class FpsTimer : public QObject {
public:
FpsTimer(QObject* parent = 0);
- int numFrames(int spanMillis = 1000);
+ int numFrames(int spanMillis = 1000) const;
public Q_SLOTS:
void start();
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
index df29f11..e5e49be 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -70,28 +70,14 @@ void LauncherWindow::init()
resize(800, 600);
#endif
- initializeView();
-
- connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
- connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
- connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
- this, SLOT(showLinkHover(const QString&, const QString&)));
- connect(this, SIGNAL(enteredFullScreenMode(bool)), this, SLOT(toggleFullScreenMode(bool)));
-
- applyPrefs();
-
m_inspector = new WebInspector(splitter);
#ifndef QT_NO_PROPERTIES
if (!m_windowOptions.inspectorUrl.isEmpty())
m_inspector->setProperty("_q_inspectorUrl", m_windowOptions.inspectorUrl);
#endif
- m_inspector->setPage(page());
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;
@@ -100,6 +86,8 @@ void LauncherWindow::init()
}
grabZoomKeys(true);
+
+ initializeView();
}
void LauncherWindow::initializeView()
@@ -132,10 +120,24 @@ void LauncherWindow::initializeView()
m_view = view;
}
+ m_touchMocking = false;
+
+ connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
+ connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
+ connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
+ this, SLOT(showLinkHover(const QString&, const QString&)));
+ connect(this, SIGNAL(enteredFullScreenMode(bool)), this, SLOT(toggleFullScreenMode(bool)));
+
+ applyPrefs();
+
+ m_inspector->setPage(page());
+ m_inspector->hide();
+
+ if (m_windowOptions.remoteInspectorPort)
+ page()->setProperty("_q_webInspectorServerPort", m_windowOptions.remoteInspectorPort);
+
if (url.isValid())
page()->mainFrame()->load(url);
-
- m_touchMocking = false;
}
void LauncherWindow::applyPrefs()
@@ -213,6 +215,7 @@ void LauncherWindow::createChrome()
QMenu* windowMenu = menuBar()->addMenu("&Window");
QAction* toggleFullScreen = windowMenu->addAction("Toggle FullScreen", this, SIGNAL(enteredFullScreenMode(bool)));
+ toggleFullScreen->setShortcut(Qt::Key_F11);
toggleFullScreen->setCheckable(true);
toggleFullScreen->setChecked(false);
// When exit fullscreen mode by clicking on the exit area (bottom right corner) we must
@@ -672,6 +675,8 @@ void LauncherWindow::toggleWebView(bool graphicsBased)
{
m_windowOptions.useGraphicsView = graphicsBased;
initializeView();
+ menuBar()->clear();
+ createChrome();
}
void LauncherWindow::toggleAcceleratedCompositing(bool toggle)
diff --git a/WebKitTools/QueueStatusServer/model/queues_unittest.py b/WebKitTools/QueueStatusServer/model/queues_unittest.py
index 33070a8..cfa7fcd 100644
--- a/WebKitTools/QueueStatusServer/model/queues_unittest.py
+++ b/WebKitTools/QueueStatusServer/model/queues_unittest.py
@@ -68,6 +68,13 @@ class QueueTest(unittest.TestCase):
self._assert_name_with_underscores("chromium-ews", "chromium_ews")
self._assert_name_with_underscores("commit-queue", "commit_queue")
+ def test_style_queue_is_ews(self):
+ # For now we treat the style-queue as an EWS since most users would
+ # describe it as such. If is_ews() ever needs to mean "builds the patch"
+ # or similar, then we will need to adjust all callers.
+ self.assertTrue(Queue("style-queue").is_ews())
+ self.assertTrue("style-queue" in map(Queue.name, Queue.all_ews()))
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm
index 8d7e766..faed7ed 100644
--- a/WebKitTools/Scripts/VCSUtils.pm
+++ b/WebKitTools/Scripts/VCSUtils.pm
@@ -68,7 +68,9 @@ BEGIN {
&parsePatch
&pathRelativeToSVNRepositoryRootForPath
&prepareParsedPatch
+ &removeEOL
&runPatchCommand
+ &scmMoveOrRenameFile
&scmToggleExecutableBit
&setChangeLogDateAndReviewer
&svnRevisionForDirectory
@@ -412,6 +414,7 @@ sub canonicalizePath($)
sub removeEOL($)
{
my ($line) = @_;
+ return "" unless $line;
$line =~ s/[\r\n]+$//g;
return $line;
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index e7f9d1f..da336fe 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2005, 2006 Apple Inc. All rights reserved.
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2010 moiji-mobile.com All rights reserved.
#
@@ -57,27 +57,69 @@ my $prefixPath;
my $makeArgs;
my $startTime = time();
-my ($linkPrefetchSupport, $accelerated2dCanvasSupport, $threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $clientBasedGeolocationSupport, $databaseSupport, $datagridSupport, $datalistSupport,
- $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $imageResizerSupport, $indexedDatabaseSupport, $inputSpeechSupport,
- $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $systemMallocSupport, $sandboxSupport, $sharedWorkersSupport,
- $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
- $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $webTimingSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
- $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSupport, $tiledBackingStoreSupport,
- $fileWriterSupport, $fileSystemSupport, $directoryUploadSupport, $deviceOrientationSupport);
+my (
+ $threeDCanvasSupport,
+ $threeDRenderingSupport,
+ $accelerated2dCanvasSupport,
+ $blobSupport,
+ $channelMessagingSupport,
+ $clientBasedGeolocationSupport,
+ $coverageSupport,
+ $databaseSupport,
+ $datagridSupport,
+ $datalistSupport,
+ $deviceOrientationSupport,
+ $directoryUploadSupport,
+ $domStorageSupport,
+ $eventsourceSupport,
+ $fileSystemSupport,
+ $filtersSupport,
+ $fullscreenAPISupport,
+ $geolocationSupport,
+ $iconDatabaseSupport,
+ $imageResizerSupport,
+ $indexedDatabaseSupport,
+ $inputSpeechSupport,
+ $javaScriptDebuggerSupport,
+ $linkPrefetchSupport,
+ $mathmlSupport,
+ $meterTagSupport,
+ $notificationsSupport,
+ $offlineWebApplicationSupport,
+ $progressTagSupport,
+ $rubySupport,
+ $sharedWorkersSupport,
+ $svgSupport,
+ $svgAnimationSupport,
+ $svgAsImageSupport,
+ $svgDOMObjCBindingsSupport,
+ $svgFontsSupport,
+ $svgForeignObjectSupport,
+ $svgUseSupport,
+ $systemMallocSupport,
+ $tiledBackingStoreSupport,
+ $videoSupport,
+ $wcssSupport,
+ $webAudioSupport,
+ $webSocketsSupport,
+ $webTimingSupport,
+ $wmlSupport,
+ $workersSupport,
+ $xhtmlmpSupport,
+ $xpathSupport,
+ $xsltSupport,
+);
my @features = (
- { option => "link-prefetch", desc => "Toggle pre fetching support",
- define => "ENABLE_LINK_PREFETCH", default => 0, value => \$linkPrefetchSupport },
-
- { option => "accelerated-2d-canvas", desc => "Toggle accelerated 2D canvas support",
- define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2dCanvasSupport },
-
{ option => "3d-canvas", desc => "Toggle 3D canvas support",
define => "ENABLE_3D_CANVAS", default => (isAppleMacWebKit() && !isTiger() && !isLeopard()), value => \$threeDCanvasSupport },
{ option => "3d-rendering", desc => "Toggle 3D rendering support",
define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() && !isTiger()), value => \$threeDRenderingSupport },
+ { option => "accelerated-2d-canvas", desc => "Toggle accelerated 2D canvas support",
+ define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2dCanvasSupport },
+
{ option => "blob", desc => "Toggle Blob support",
define => "ENABLE_BLOB", default => (isAppleMacWebKit()), value => \$blobSupport },
@@ -95,10 +137,13 @@ my @features = (
{ option => "datagrid", desc => "Toggle Datagrid Support",
define => "ENABLE_DATAGRID", default => 0, value => \$datagridSupport },
-
+
{ option => "datalist", desc => "Toggle HTML5 datalist support",
define => "ENABLE_DATALIST", default => 1, value => \$datalistSupport },
-
+
+ { option => "device-orientation", desc => "Toggle DeviceOrientation support",
+ define => "ENABLE_DEVICE_ORIENTATION", default => 0, value => \$deviceOrientationSupport },
+
{ option => "directory-upload", desc => "Toogle Directory upload support",
define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport },
@@ -108,15 +153,21 @@ my @features = (
{ option => "eventsource", desc => "Toggle server-sent events support",
define => "ENABLE_EVENTSOURCE", default => 1, value => \$eventsourceSupport },
+ { option => "file-system", desc => "Toggle FileSystem support",
+ define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport },
+
{ option => "filters", desc => "Toggle Filters support",
define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl()), value => \$filtersSupport },
+ { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
+ define => "ENABLE_FULLSCREEN_API", default => isAppleMacWebKit(), value => \$fullscreenAPISupport },
+
{ option => "geolocation", desc => "Toggle Geolocation support",
define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk()), value => \$geolocationSupport },
{ option => "icon-database", desc => "Toggle Icon database support",
define => "ENABLE_ICONDATABASE", default => 1, value => \$iconDatabaseSupport },
-
+
{ option => "image-resizer", desc => "Toggle Image Resizer API support",
define => "ENABLE_IMAGE_RESIZER", default => 0, value => \$imageResizerSupport },
@@ -129,24 +180,30 @@ my @features = (
{ option => "javascript-debugger", desc => "Toggle JavaScript Debugger/Profiler support",
define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javaScriptDebuggerSupport },
+ { option => "link-prefetch", desc => "Toggle pre fetching support",
+ define => "ENABLE_LINK_PREFETCH", default => 0, value => \$linkPrefetchSupport },
+
{ option => "mathml", desc => "Toggle MathML support",
define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
+ { option => "meter-tag", desc => "Meter Tag support",
+ define => "ENABLE_METER_TAG", default => !isGtk() && !isAppleWinWebKit(), value => \$meterTagSupport },
+
{ option => "notifications", desc => "Toggle Desktop Notifications Support",
define => "ENABLE_NOTIFICATIONS", default => 0, value => \$notificationsSupport },
{ option => "offline-web-applications", desc => "Toggle Offline Web Application Support",
define => "ENABLE_OFFLINE_WEB_APPLICATIONS", default => 1, value => \$offlineWebApplicationSupport },
+ { option => "progress-tag", desc => "Progress Tag support",
+ define => "ENABLE_PROGRESS_TAG", default => 1, value => \$progressTagSupport },
+
{ option => "ruby", desc => "Toggle HTML5 Ruby support",
define => "ENABLE_RUBY", default => 1, value => \$rubySupport },
{ option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
- { option => "sandbox", desc => "Toggle HTML5 Sandboxed iframe support",
- define => "ENABLE_SANDBOX", default => 1, value => \$sandboxSupport },
-
{ option => "shared-workers", desc => "Toggle SharedWorkers support",
define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$sharedWorkersSupport },
@@ -177,6 +234,12 @@ my @features = (
{ option => "video", desc => "Toggle Video support",
define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk()), value => \$videoSupport },
+ { option => "wcss", desc => "Toggle WCSS support",
+ define => "ENABLE_WCSS", default => 0, value => \$wcssSupport },
+
+ { option => "web-audio", desc => "Toggle Web Audio support",
+ define => "ENABLE_WEB_AUDIO", default => 0, value=> \$webAudioSupport },
+
{ option => "web-sockets", desc => "Toggle Web Sockets support",
define => "ENABLE_WEB_SOCKETS", default => 1, value=> \$webSocketsSupport },
@@ -186,26 +249,17 @@ my @features = (
{ option => "wml", desc => "Toggle WML support",
define => "ENABLE_WML", default => 0, value => \$wmlSupport },
- { option => "xhtmlmp", desc => "Toggle XHTML-MP support",
- define => "ENABLE_XHTMLMP", default => 0, value => \$xhtmlmpSupport },
-
- { option => "wcss", desc => "Toggle WCSS support",
- define => "ENABLE_WCSS", default => 0, value => \$wcssSupport },
-
{ option => "workers", desc => "Toggle Web Workers support",
define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$workersSupport },
+ { option => "xhtmlmp", desc => "Toggle XHTML-MP support",
+ define => "ENABLE_XHTMLMP", default => 0, value => \$xhtmlmpSupport },
+
{ option => "xpath", desc => "Toggle XPath support",
define => "ENABLE_XPATH", default => 1, value => \$xpathSupport },
{ option => "xslt", desc => "Toggle XSLT support",
define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
-
- { option => "file-system", desc => "Toggle FileSystem support",
- define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport },
-
- { option => "device-orientation", desc => "Toggle DeviceOrientation support",
- define => "ENABLE_DEVICE_ORIENTATION", default => 0, value => \$deviceOrientationSupport },
);
# Update defaults from Qt's project file
@@ -473,18 +527,24 @@ for my $dir (@projects) {
$result = buildVisualStudioProject("win/WebKit.vcproj/WebKit.sln", $clean);
}
}
+ # Various build* calls above may change the CWD.
+ chdirWebKit();
if (exitStatus($result)) {
+ my $scriptDir = relativeScriptsDir();
+ if (usingVisualStudioExpress()) {
+ # Visual Studio Express is so lame it can't stdout build failures.
+ # So we find its logs and dump them to the console ourselves.
+ system(File::Spec->catfile($scriptDir, "print-vse-failure-logs"));
+ }
if (isAppleWinWebKit()) {
print "\n\n===== BUILD FAILED ======\n\n";
- my $scriptDir = relativeScriptsDir();
print "Please ensure you have run $scriptDir/update-webkit to install dependencies.\n\n";
my $baseProductDir = baseProductDir();
print "You can view build errors by checking the BuildLog.htm files located at:\n$baseProductDir/obj/<project>/<config>.\n";
}
exit exitStatus($result);
}
- chdirWebKit();
}
# Don't report the "WebKit is now built" message after a clean operation.
diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests
index a468b4d..e40b3ad 100755
--- a/WebKitTools/Scripts/old-run-webkit-tests
+++ b/WebKitTools/Scripts/old-run-webkit-tests
@@ -527,11 +527,37 @@ if (isCygwin()) {
if (!$hasAcceleratedCompositing) {
$ignoredDirectories{'compositing'} = 1;
+
+ # This test has slightly different floating-point rounding when accelerated
+ # compositing is enabled.
+ $ignoredFiles{'svg/custom/use-on-symbol-inside-pattern.svg'} = 1;
+
+ if (isAppleWebKit()) {
+ # In Apple's ports, the default controls for <video> contain a "full
+ # screen" button only if accelerated compositing is enabled.
+ $ignoredFiles{'media/controls-after-reload.html'} = 1;
+ $ignoredFiles{'media/controls-drag-timebar.html'} = 1;
+ $ignoredFiles{'media/controls-strict.html'} = 1;
+ $ignoredFiles{'media/controls-styling.html'} = 1;
+ $ignoredFiles{'media/video-controls-rendering.html'} = 1;
+ $ignoredFiles{'media/video-display-toggle.html'} = 1;
+ $ignoredFiles{'media/video-no-audio.html'} = 1;
+ }
+
+ # Here we're using !$hasAcceleratedCompositing as a proxy for "is a headless XP machine" (like
+ # our test slaves). Headless XP machines can neither support accelerated compositing nor pass
+ # this test, so skipping the test here is expedient, if a little sloppy. See
+ # <http://webkit.org/b/48333>.
+ $ignoredFiles{'platform/win/plugins/npn-invalidate-rect-invalidates-window.html'} = 1 if isAppleWinWebKit();
}
if (!$has3DRendering) {
$ignoredDirectories{'animations/3d'} = 1;
$ignoredDirectories{'transforms/3d'} = 1;
+
+ # These tests use the -webkit-transform-3d media query.
+ $ignoredFiles{'fast/media/mq-transform-02.html'} = 1;
+ $ignoredFiles{'fast/media/mq-transform-03.html'} = 1;
}
if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index 608c9ce..ad84e4f 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -1302,7 +1302,7 @@ sub statusCommand(@)
if ($isSVN) {
$command = "$SVN stat $filesString";
} elsif ($isGit) {
- $command = "$GIT diff -r --name-status -C -C -M " . diffFromToString();
+ $command = "$GIT diff -r --name-status -M -C " . diffFromToString();
$command .= " -- $filesString" unless $gitCommit;
}
@@ -1317,7 +1317,7 @@ sub createPatchCommand($)
if ($isSVN) {
$command = "'$FindBin::Bin/svn-create-patch' $changedFilesString";
} elsif ($isGit) {
- $command = "$GIT diff -C -C -M " . diffFromToString();
+ $command = "$GIT diff -M -C " . diffFromToString();
$command .= " -- $changedFilesString" unless $gitCommit;
}
diff --git a/WebKitTools/Scripts/print-vse-failure-logs b/WebKitTools/Scripts/print-vse-failure-logs
new file mode 100755
index 0000000..cec806e
--- /dev/null
+++ b/WebKitTools/Scripts/print-vse-failure-logs
@@ -0,0 +1,80 @@
+#!/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.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# This is a very simple script designed to crawl the build directory
+# for visual studio express build logs and print them to stdout.
+
+from __future__ import with_statement
+
+import codecs
+import os.path
+import os
+
+from webkitpy.common.system.executive import Executive
+
+
+# This is just enough to make the win-ews bot useable. Others who
+# actually use Windows should feel encouraged to improve this class,
+# including just printing the text instead of the raw html.
+class PrintVisualStudioExpressLogs(object):
+ def __init__(self):
+ self._executive = Executive()
+
+ def _find_buildlogs(self, build_directory):
+ build_log_paths = []
+ for dirpath, dirnames, filenames in os.walk(build_directory):
+ for file_name in filenames:
+ if file_name == "BuildLog.htm":
+ file_path = os.path.join(dirpath, file_name)
+ build_log_paths.append(file_path)
+ return build_log_paths
+
+ def _obj_directory(self):
+ scripts_directory = os.path.dirname(__file__)
+ build_directory_script_path = os.path.join(scripts_directory, "webkit-build-directory")
+ # FIXME: ports/webkit.py should provide the build directory in a nice API.
+ # NOTE: The windows VSE build does not seem to use different directories
+ # for Debug and Release.
+ build_directory = self._executive.run_command([build_directory_script_path, "--top-level"]).rstrip()
+ return os.path.join(build_directory, "obj")
+
+ def main(self):
+ obj_directory = self._obj_directory()
+ build_log_paths = self._find_buildlogs(obj_directory)
+
+ print "Found %s Visual Studio Express Build Logs:\n%s" % (len(build_log_paths), "\n".join(build_log_paths))
+
+ for build_log_path in build_log_paths:
+ print "%s:\n" % build_log_path
+ with codecs.open(build_log_path, "r", "utf-16") as build_log:
+ print build_log.read()
+
+
+if __name__ == '__main__':
+ PrintVisualStudioExpressLogs().main()
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index fa85667..2c1d8da 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -1186,6 +1186,12 @@ sub buildXCodeProject($$@)
return system "xcodebuild", "-project", "$project.xcodeproj", @extraOptions;
}
+sub usingVisualStudioExpress()
+{
+ determineConfigurationForVisualStudio();
+ return $willUseVCExpressWhenBuilding;
+}
+
sub buildVisualStudioProject
{
my ($project, $clean) = @_;
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl
new file mode 100644
index 0000000..8bd8e90
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+#
+# 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 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 Research In Motion Limited nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Unit tests of VCSUtils::removeEOL().
+
+use Test::Simple tests => 5;
+use VCSUtils;
+
+my $title;
+
+# New test
+$title = "removeEOL: Undefined argument.";
+ok(removeEOL(undef) eq "");
+
+# New test
+$title = "removeEOL: Line with Windows line ending.";
+ok(removeEOL("This line ends with a Windows line ending.\r\n") eq "This line ends with a Windows line ending.");
+
+# New test
+$title = "removeEOL: Line with Unix line ending.";
+ok(removeEOL("This line ends with a Unix line ending.\n") eq "This line ends with a Unix line ending.");
+
+# New test
+$title = "removeEOL: Line with Mac line ending.";
+ok(removeEOL("This line ends with a Mac line ending.\r") eq "This line ends with a Mac line ending.");
+
+# New test
+$title = "removeEOL: Line with a mix of line endings.";
+ok(removeEOL("This line contains a mix of line endings.\r\n\r\n\r\r\n\n\n\n") eq "This line contains a mix of line endings.");
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py b/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
index ef65bee..597dcbd 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
@@ -1 +1,3 @@
# Required for Python to search this directory for module files
+
+from api import Checkout
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/api.py b/WebKitTools/Scripts/webkitpy/common/checkout/api.py
index 72cad8d..dbe1e84 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/api.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/api.py
@@ -32,6 +32,7 @@ import StringIO
from webkitpy.common.checkout.changelog import ChangeLog
from webkitpy.common.checkout.commitinfo import CommitInfo
from webkitpy.common.checkout.scm import CommitMessage
+from webkitpy.common.memoized import memoized
from webkitpy.common.net.bugzilla import parse_bug_id
from webkitpy.common.system.executive import Executive, run_command, ScriptError
from webkitpy.common.system.deprecated_logging import log
@@ -59,6 +60,7 @@ class Checkout(object):
changed_files = self._scm.changed_files_for_revision(revision)
return [self._latest_entry_for_changelog_at_revision(path, revision) for path in changed_files if self._is_path_to_changelog(path)]
+ @memoized
def commit_info_for_revision(self, revision):
committer_email = self._scm.committer_email_for_revision(revision)
changelog_entries = self.changelog_entries_for_revision(revision)
@@ -98,8 +100,8 @@ class Checkout(object):
def modified_non_changelogs(self, git_commit, changed_files=None):
return self._modified_files_matching_predicate(git_commit, lambda path: not self._is_path_to_changelog(path), changed_files=changed_files)
- def commit_message_for_this_commit(self, git_commit):
- changelog_paths = self.modified_changelogs(git_commit)
+ def commit_message_for_this_commit(self, git_commit, changed_files=None):
+ changelog_paths = self.modified_changelogs(git_commit, changed_files)
if not len(changelog_paths):
raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
"All changes require a ChangeLog. See:\n"
@@ -120,16 +122,16 @@ class Checkout(object):
revisions = set(sum(map(self._scm.revisions_changing_file, paths), []))
return set(map(self.commit_info_for_revision, revisions))
- def suggested_reviewers(self, git_commit):
- changed_files = self.modified_non_changelogs(git_commit)
+ def suggested_reviewers(self, git_commit, changed_files=None):
+ changed_files = self.modified_non_changelogs(git_commit, changed_files)
commit_infos = self.recent_commit_infos_for_files(changed_files)
reviewers = [commit_info.reviewer() for commit_info in commit_infos if commit_info.reviewer()]
reviewers.extend([commit_info.author() for commit_info in commit_infos if commit_info.author() and commit_info.author().can_review])
return sorted(set(reviewers))
- def bug_id_for_this_commit(self, git_commit):
+ def bug_id_for_this_commit(self, git_commit, changed_files=None):
try:
- return parse_bug_id(self.commit_message_for_this_commit(git_commit).message())
+ return parse_bug_id(self.commit_message_for_this_commit(git_commit, changed_files).message())
except ScriptError, e:
pass # We might not have ChangeLogs.
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
index d7bd95e..1f97abd 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
@@ -114,7 +114,7 @@ class CommitMessageForThisCommitTest(unittest.TestCase):
# ChangeLog is difficult to mock at current.
def test_commit_message_for_this_commit(self):
checkout = Checkout(None)
- checkout.modified_changelogs = lambda git_commit: ["ChangeLog1", "ChangeLog2"]
+ checkout.modified_changelogs = lambda git_commit, changed_files=None: ["ChangeLog1", "ChangeLog2"]
output = OutputCapture()
expected_stderr = "Parsing ChangeLog: ChangeLog1\nParsing ChangeLog: ChangeLog2\n"
commit_message = output.assert_outputs(self, checkout.commit_message_for_this_commit,
@@ -163,7 +163,7 @@ class CheckoutTest(unittest.TestCase):
def test_bug_id_for_this_commit(self):
scm = Mock()
checkout = Checkout(scm)
- checkout.commit_message_for_this_commit = lambda git_commit: CommitMessage(ChangeLogEntry(_changelog1entry1).contents().splitlines())
+ checkout.commit_message_for_this_commit = lambda git_commit, changed_files=None: CommitMessage(ChangeLogEntry(_changelog1entry1).contents().splitlines())
self.assertEqual(checkout.bug_id_for_this_commit(git_commit=None), 36629)
def test_modified_changelogs(self):
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
index 4bd9ed6..9b602c3 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
@@ -36,6 +36,7 @@ import shutil
from webkitpy.common.system.executive import Executive, run_command, ScriptError
from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.common.memoized import memoized
def find_checkout_root():
@@ -319,7 +320,6 @@ class SVN(SCM):
def __init__(self, cwd):
SCM.__init__(self, cwd)
- self.cached_version = None
self._bogus_dir = None
@staticmethod
@@ -369,16 +369,20 @@ class SVN(SCM):
find_output = self.run(find_args, cwd=home_directory, error_handler=Executive.ignore_error).rstrip()
return find_output and os.path.isfile(os.path.join(home_directory, find_output))
+ @memoized
def svn_version(self):
- if not self.cached_version:
- self.cached_version = self.run(['svn', '--version', '--quiet'])
-
- return self.cached_version
+ return self.run(['svn', '--version', '--quiet'])
def working_directory_is_clean(self):
return self.run(["svn", "diff"], cwd=self.checkout_root, decode_output=False) == ""
def clean_working_directory(self):
+ # Make sure there are no locks lying around from a previously aborted svn invocation.
+ # This is slightly dangerous, as it's possible the user is running another svn process
+ # on this checkout at the same time. However, it's much more likely that we're running
+ # under windows and svn just sucks (or the user interrupted svn and it failed to clean up).
+ self.run(["svn", "cleanup"], cwd=self.checkout_root)
+
# svn revert -R is not as awesome as git reset --hard.
# It will leave added files around, causing later svn update
# calls to fail on the bots. We make this mirror git reset --hard
@@ -432,6 +436,7 @@ class SVN(SCM):
def revisions_changing_file(self, path, limit=5):
revisions = []
+ # svn log will exit(1) (and thus self.run will raise) if the path does not exist.
log_command = ['svn', 'log', '--quiet', '--limit=%s' % limit, path]
for line in self.run(log_command, cwd=self.checkout_root).splitlines():
match = re.search('^r(?P<revision>\d+) ', line)
@@ -565,6 +570,7 @@ class SVN(SCM):
dir, base = os.path.split(path)
return self.run(['svn', 'pget', pname, base], cwd=dir).encode('utf-8').rstrip("\n")
+
# All git-specific logic should go here.
class Git(SCM):
def __init__(self, cwd):
@@ -667,7 +673,8 @@ class Git(SCM):
return self._changes_files_for_commit(commit_id)
def revisions_changing_file(self, path, limit=5):
- commit_ids = self.run(["git", "log", "--pretty=format:%H", "-%s" % limit, path]).splitlines()
+ # git rev-list head --remove-empty --limit=5 -- path would be equivalent.
+ commit_ids = self.run(["git", "log", "--remove-empty", "--pretty=format:%H", "-%s" % limit, "--", path]).splitlines()
return filter(lambda revision: revision, map(self.svn_revision_from_git_commit, commit_ids))
def conflicted_files(self):
@@ -696,21 +703,29 @@ class Git(SCM):
# FIXME: This should probably use cwd=self.checkout_root
return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"] + changed_files, decode_output=False)
- @classmethod
- def git_commit_from_svn_revision(cls, revision):
- # FIXME: This should probably use cwd=self.checkout_root
- git_commit = run_command(['git', 'svn', 'find-rev', 'r%s' % revision]).rstrip()
- # git svn find-rev always exits 0, even when the revision is not found.
- if not git_commit:
- raise ScriptError(message='Failed to find git commit for revision %s, your checkout likely needs an update.' % revision)
- return git_commit
+ def _run_git_svn_find_rev(self, arg):
+ # git svn find-rev always exits 0, even when the revision or commit is not found.
+ return self.run(['git', 'svn', 'find-rev', arg], cwd=self.checkout_root).rstrip()
- def svn_revision_from_git_commit(self, commit_id):
+ def _string_to_int_or_none(self, string):
try:
- return int(self.run(['git', 'svn', 'find-rev', commit_id]).rstrip())
+ return int(string)
except ValueError, e:
return None
+ @memoized
+ def git_commit_from_svn_revision(self, svn_revision):
+ git_commit = self._run_git_svn_find_rev('r%s' % svn_revision)
+ if not git_commit:
+ # FIXME: Alternatively we could offer to update the checkout? Or return None?
+ raise ScriptError(message='Failed to find git commit for revision %s, your checkout likely needs an update.' % svn_revision)
+ return git_commit
+
+ @memoized
+ def svn_revision_from_git_commit(self, git_commit):
+ svn_revision = self._run_git_svn_find_rev(git_commit)
+ return self._string_to_int_or_none(svn_revision)
+
def contents_at_revision(self, path, revision):
"""Returns a byte array (str()) containing the contents
of path @ revision in the repository."""
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
index 4aa5279..8af9ad5 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
@@ -760,6 +760,15 @@ Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
self.do_test_diff_for_file()
self.assertFalse(os.path.exists(self.bogus_dir))
+ def test_svn_lock(self):
+ svn_root_lock_path = ".svn/lock"
+ write_into_file_at_path(svn_root_lock_path, "", "utf-8")
+ # webkit-patch uses a Checkout object and runs update-webkit, just use svn update here.
+ self.assertRaises(ScriptError, run_command, ['svn', 'update'])
+ self.scm.clean_working_directory()
+ self.assertFalse(os.path.exists(svn_root_lock_path))
+ run_command(['svn', 'update']) # Should succeed and not raise.
+
class GitTest(SCMTest):
diff --git a/WebKitTools/Scripts/webkitpy/common/config/__init__.py b/WebKitTools/Scripts/webkitpy/common/config/__init__.py
index 62d129e..ef65bee 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/__init__.py
@@ -1,6 +1 @@
# Required for Python to search this directory for module files
-
-import re
-
-codereview_server_host = "wkrietveld.appspot.com"
-codereview_server_url = "https://%s/" % codereview_server_host
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index f768cf9..71d764c 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -137,6 +137,7 @@ committers_unable_to_review = [
Committer("Keishi Hattori", "keishi@webkit.org", "keishi"),
Committer("Kelly Norton", "knorton@google.com"),
Committer("Kent Hansen", "kent.hansen@nokia.com", "khansen"),
+ Committer("Kimmo Kinnunen", ["kimmo.t.kinnunen@nokia.com", "kimmok@iki.fi", "ktkinnun@webkit.org"], "kimmok"),
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"),
@@ -146,6 +147,7 @@ committers_unable_to_review = [
Committer("Luiz Agostini", ["luiz@webkit.org", "luiz.agostini@openbossa.org"], "lca"),
Committer("Mads Ager", "ager@chromium.org"),
Committer("Marcus Voltis Bulach", "bulach@chromium.org"),
+ Committer("Mario Sanchez Prada", ["msanchez@igalia.com", "mario@webkit.org"]),
Committer("Matt Delaney", "mdelaney@apple.com"),
Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]),
Committer("Matt Perry", "mpcomplete@chromium.org"),
@@ -213,7 +215,7 @@ reviewers_list = [
Reviewer("Andreas Kling", ["kling@webkit.org", "andreas.kling@nokia.com"], "kling"),
Reviewer("Antonio Gomes", ["tonikitoo@webkit.org", "agomes@rim.com"], "tonikitoo"),
Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com", "antti.j.koivisto@nokia.com"], "anttik"),
- Reviewer("Ariya Hidayat", ["ariya@sencha.com", "ariya.hidayat@gmail.com", "ariya@webkit.org"], "ariya"),
+ Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@sencha.com", "ariya@webkit.org"], "ariya"),
Reviewer("Beth Dakin", "bdakin@apple.com", "dethbakin"),
Reviewer("Brady Eidson", "beidson@apple.com", "bradee-oh"),
Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]),
diff --git a/WebKitTools/Scripts/webkitpy/common/memoized.py b/WebKitTools/Scripts/webkitpy/common/memoized.py
new file mode 100644
index 0000000..dc844a5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/memoized.py
@@ -0,0 +1,55 @@
+# 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.
+
+# Python does not (yet) seem to provide automatic memoization. So we've
+# written a small decorator to do so.
+
+import functools
+
+
+class memoized(object):
+ def __init__(self, function):
+ self._function = function
+ self._results_cache = {}
+
+ def __call__(self, *args):
+ try:
+ return self._results_cache[args]
+ except KeyError:
+ # If we didn't find the args in our cache, call and save the results.
+ result = self._function(*args)
+ self._results_cache[args] = result
+ return result
+ # FIXME: We may need to handle TypeError here in the case
+ # that "args" is not a valid dictionary key.
+
+ # Use python "descriptor" protocol __get__ to appear
+ # invisible during property access.
+ def __get__(self, instance, owner):
+ # Return a function partial with obj already bound as self.
+ return functools.partial(self.__call__, instance)
diff --git a/WebKitTools/Scripts/webkitpy/common/memoized_unittest.py b/WebKitTools/Scripts/webkitpy/common/memoized_unittest.py
new file mode 100644
index 0000000..dd7c793
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/memoized_unittest.py
@@ -0,0 +1,65 @@
+# 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 unittest
+
+from webkitpy.common.memoized import memoized
+
+
+class _TestObject(object):
+ def __init__(self):
+ self.callCount = 0
+
+ @memoized
+ def memoized_add(self, argument):
+ """testing docstring"""
+ self.callCount += 1
+ if argument is None:
+ return None # Avoid the TypeError from None + 1
+ return argument + 1
+
+
+class MemoizedTest(unittest.TestCase):
+ def test_caching(self):
+ test = _TestObject()
+ test.callCount = 0
+ self.assertEqual(test.memoized_add(1), 2)
+ self.assertEqual(test.callCount, 1)
+ self.assertEqual(test.memoized_add(1), 2)
+ self.assertEqual(test.callCount, 1)
+
+ # Validate that callCount is working as expected.
+ self.assertEqual(test.memoized_add(2), 3)
+ self.assertEqual(test.callCount, 2)
+
+ def test_tearoff(self):
+ test = _TestObject()
+ # Make sure that get()/tear-offs work:
+ tearoff = test.memoized_add
+ self.assertEqual(tearoff(4), 5)
+ self.assertEqual(test.callCount, 1)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
index 94519a7..1cc8e2e 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
@@ -113,9 +113,6 @@ class Attachment(object):
def commit_queue(self):
return self._attachment_dictionary.get("commit-queue")
- def in_rietveld(self):
- return self._attachment_dictionary.get("in-rietveld")
-
def url(self):
# FIXME: This should just return
# self._bugzilla().attachment_url_for_id(self.id()). scm_unittest.py
@@ -221,9 +218,6 @@ class Bug(object):
# a valid committer.
return filter(lambda patch: patch.committer(), patches)
- def in_rietveld_queue_patches(self):
- return [patch for patch in self.patches() if patch.in_rietveld() == None]
-
# A container for all of the logic for making and parsing buzilla queries.
class BugzillaQueries(object):
@@ -287,16 +281,6 @@ class BugzillaQueries(object):
return sum([self._fetch_bug(bug_id).commit_queued_patches()
for bug_id in self.fetch_bug_ids_from_commit_queue()], [])
- def fetch_first_patch_from_rietveld_queue(self):
- # rietveld-queue processes all patches that don't have in-rietveld set.
- query_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=notsubstring&value0-0-0=in-rietveld&field0-1-0=attachments.ispatch&type0-1-0=equals&value0-1-0=1&order=Last+Changed&field0-2-0=attachments.isobsolete&type0-2-0=equals&value0-2-0=0"
- bugs = self._fetch_bug_ids_advanced_query(query_url)
- if not len(bugs):
- return None
-
- patches = self._fetch_bug(bugs[0]).in_rietveld_queue_patches()
- return patches[0] if len(patches) else None
-
def _fetch_bug_ids_from_review_queue(self):
review_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review?"
return self._fetch_bug_ids_advanced_query(review_queue_url)
@@ -502,8 +486,6 @@ class Bugzilla(object):
self._parse_attachment_flag(
element, 'review', attachment, 'reviewer_email')
self._parse_attachment_flag(
- element, 'in-rietveld', attachment, 'rietveld_uploader_email')
- self._parse_attachment_flag(
element, 'commit-queue', attachment, 'committer_email')
return attachment
@@ -591,11 +573,12 @@ class Bugzilla(object):
self.authenticated = True
return
+ credentials = Credentials(self.bug_server_host, git_prefix="bugzilla")
+
attempts = 0
while not self.authenticated:
attempts += 1
- (username, password) = Credentials(
- self.bug_server_host, git_prefix="bugzilla").read_credentials()
+ username, password = credentials.read_credentials()
log("Logging in as %s..." % username)
self.browser.open(self.bug_server_url +
@@ -766,8 +749,6 @@ class Bugzilla(object):
return self.browser.find_control(type='select', nr=0)
elif flag_name == "commit-queue":
return self.browser.find_control(type='select', nr=1)
- elif flag_name == "in-rietveld":
- return self.browser.find_control(type='select', nr=2)
raise Exception("Don't know how to find flag named \"%s\"" % flag_name)
def clear_attachment_flags(self,
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
index 3a454d6..df1fcf6 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py
@@ -83,11 +83,6 @@ class BugzillaTest(unittest.TestCase):
status="+"
setter="two@test.com"
/>
- <flag name="in-rietveld"
- id="17933"
- status="+"
- setter="three@test.com"
- />
</attachment>
'''
_expected_example_attachment_parsing = {
@@ -103,8 +98,6 @@ class BugzillaTest(unittest.TestCase):
'reviewer_email' : 'one@test.com',
'commit-queue' : '+',
'committer_email' : 'two@test.com',
- 'in-rietveld': '+',
- 'rietveld_uploader_email': 'three@test.com',
'attacher_email' : 'christian.plesner.hansen@gmail.com',
}
diff --git a/WebKitTools/Scripts/webkitpy/common/net/credentials.py b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
index 1c3e6c0..30480b3 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/credentials.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
@@ -48,6 +48,7 @@ except ImportError:
class Credentials(object):
+ _environ_prefix = "webkit_bugzilla_"
def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd(),
keyring=keyring):
@@ -58,8 +59,17 @@ class Credentials(object):
self._keyring = keyring
def _credentials_from_git(self):
- return [Git.read_git_config(self.git_prefix + "username"),
- Git.read_git_config(self.git_prefix + "password")]
+ try:
+ if not Git.in_working_directory(self.cwd):
+ return (None, None)
+ return (Git.read_git_config(self.git_prefix + "username"),
+ Git.read_git_config(self.git_prefix + "password"))
+ except OSError, e:
+ # Catch and ignore OSError exceptions such as "no such file
+ # or directory" (OSError errno 2), which imply that the Git
+ # command cannot be found/is not installed.
+ pass
+ return (None, None)
def _keychain_value_with_label(self, label, source_text):
match = re.search("%s\"(?P<value>.+)\"" % label,
@@ -110,21 +120,28 @@ class Credentials(object):
else:
return [None, None]
- def read_credentials(self):
- username = None
- password = None
+ def _read_environ(self, key):
+ environ_key = self._environ_prefix + key
+ return os.environ.get(environ_key.upper())
- try:
- if Git.in_working_directory(self.cwd):
- (username, password) = self._credentials_from_git()
- except OSError, e:
- # Catch and ignore OSError exceptions such as "no such file
- # or directory" (OSError errno 2), which imply that the Git
- # command cannot be found/is not installed.
- pass
+ def _credentials_from_environment(self):
+ return (self._read_environ("username"), self._read_environ("password"))
+
+ def _offer_to_store_credentials_in_keyring(self, username, password):
+ if not self._keyring:
+ return
+ if not User().confirm("Store password in system keyring?", User.DEFAULT_NO):
+ return
+ self._keyring.set_password(self.host, username, password)
+ def read_credentials(self):
+ username, password = self._credentials_from_environment()
+ # FIXME: We don't currently support pulling the username from one
+ # source and the password from a separate source.
+ if not username or not password:
+ username, password = self._credentials_from_git()
if not username or not password:
- (username, password) = self._credentials_from_keychain(username)
+ username, password = self._credentials_from_keychain(username)
if username and not password and self._keyring:
password = self._keyring.get_password(self.host, username)
@@ -132,13 +149,7 @@ class Credentials(object):
if not username:
username = User.prompt("%s login: " % self.host)
if not password:
- password = getpass.getpass("%s password for %s: " % (self.host,
- username))
+ password = getpass.getpass("%s password for %s: " % (self.host, username))
+ self._offer_to_store_credentials_in_keyring(username, password)
- 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]
+ return (username, password)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
index d30291b..6f2d909 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
@@ -26,6 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from __future__ import with_statement
+
import os
import tempfile
import unittest
@@ -34,6 +36,21 @@ from webkitpy.common.system.executive import Executive
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.thirdparty.mock import Mock
+
+# FIXME: Other unit tests probably want this class.
+class _TemporaryDirectory(object):
+ def __init__(self, **kwargs):
+ self._kwargs = kwargs
+ self._directory_path = None
+
+ def __enter__(self):
+ self._directory_path = tempfile.mkdtemp(**self._kwargs)
+ return self._directory_path
+
+ def __exit__(self, type, value, traceback):
+ os.rmdir(self._directory_path)
+
+
class CredentialsTest(unittest.TestCase):
example_security_output = """keychain: "/Users/test/Library/Keychains/login.keychain"
class: "inet"
@@ -101,40 +118,59 @@ password: "SECRETSAUCE"
self._assert_security_call()
self._assert_security_call(username="foo")
+ def test_credentials_from_environment(self):
+ executive_mock = Mock()
+ credentials = Credentials("example.com", executive=executive_mock)
+
+ saved_environ = os.environ.copy()
+ os.environ['WEBKIT_BUGZILLA_USERNAME'] = "foo"
+ os.environ['WEBKIT_BUGZILLA_PASSWORD'] = "bar"
+ username, password = credentials._credentials_from_environment()
+ self.assertEquals(username, "foo")
+ self.assertEquals(password, "bar")
+ os.environ = saved_environ
+
def test_read_credentials_without_git_repo(self):
+ # FIXME: This should share more code with test_keyring_without_git_repo
class FakeCredentials(Credentials):
def _is_mac_os_x(self):
return True
+
def _credentials_from_keychain(self, username):
- return ["test@webkit.org", "SECRETSAUCE"]
+ return ("test@webkit.org", "SECRETSAUCE")
+
+ def _credentials_from_environment(self):
+ return (None, None)
+
+ with _TemporaryDirectory(suffix="not_a_git_repo") as temp_dir_path:
+ credentials = FakeCredentials("bugs.webkit.org", cwd=temp_dir_path)
+ # FIXME: Using read_credentials here seems too broad as higher-priority
+ # credential source could be affected by the user's environment.
+ self.assertEqual(credentials.read_credentials(), ("test@webkit.org", "SECRETSAUCE"))
- temp_dir_path = tempfile.mkdtemp(suffix="not_a_git_repo")
- credentials = FakeCredentials("bugs.webkit.org", cwd=temp_dir_path)
- self.assertEqual(credentials.read_credentials(), ["test@webkit.org", "SECRETSAUCE"])
- os.rmdir(temp_dir_path)
def test_keyring_without_git_repo(self):
+ # FIXME: This should share more code with test_read_credentials_without_git_repo
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)
+ def _credentials_from_environment(self):
+ return (None, None)
+
+ with _TemporaryDirectory(suffix="not_a_git_repo") as temp_dir_path:
+ credentials = FakeCredentials("fake.hostname", cwd=temp_dir_path, keyring=MockKeyring())
+ # FIXME: Using read_credentials here seems too broad as higher-priority
+ # credential source could be affected by the user's environment.
+ self.assertEqual(credentials.read_credentials(), ("test@webkit.org", "NOMNOMNOM"))
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/rietveld.py b/WebKitTools/Scripts/webkitpy/common/net/rietveld.py
deleted file mode 100644
index b9a0821..0000000
--- a/WebKitTools/Scripts/webkitpy/common/net/rietveld.py
+++ /dev/null
@@ -1,79 +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.
-
-import logging
-import os
-import re
-import stat
-
-import webkitpy.common.config as config
-from webkitpy.common.system.deprecated_logging import log
-from webkitpy.common.system.executive import ScriptError
-import webkitpy.thirdparty.autoinstalled.rietveld.upload as upload
-
-
-class Rietveld(object):
- def __init__(self, executive, dryrun=False):
- self.dryrun = dryrun
- self._executive = executive
-
- def url_for_issue(self, codereview_issue):
- if not codereview_issue:
- return None
- return "%s%s" % (config.codereview_server_url, codereview_issue)
-
- def post(self, diff, patch_id, codereview_issue, message=None, cc=None):
- if not message:
- raise ScriptError("Rietveld requires a message.")
-
- # Rietveld has a 100 character limit on message length.
- if len(message) > 100:
- message = message[:100]
-
- args = [
- # First argument is empty string to mimic sys.argv.
- "",
- "--assume_yes",
- "--server=%s" % config.codereview_server_host,
- "--message=%s" % message,
- "--webkit_patch_id=%s" % patch_id,
- ]
- if codereview_issue:
- args.append("--issue=%s" % codereview_issue)
- if cc:
- args.append("--cc=%s" % cc)
-
- if self.dryrun:
- log("Would have run %s" % args)
- return
-
- # Use RealMain instead of calling upload from the commandline so that
- # we can pass in the diff ourselves. Otherwise, upload will just use
- # git diff for git checkouts, which doesn't respect --git-commit.
- issue, patchset = upload.RealMain(args, data=diff)
- return issue
diff --git a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
index 3d03dcd..64dd77b 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
@@ -127,7 +127,7 @@ class StatusServer:
self._browser.submit()
def release_work_item(self, queue_name, patch):
- _log.debug("Releasing work item %s from %s" % (patch.id(), queue_name))
+ _log.info("Releasing work item %s from %s" % (patch.id(), queue_name))
return NetworkTransaction(convert_404_to_None=True).run(lambda: self._post_release_work_item(queue_name, patch))
def update_work_items(self, queue_name, work_items):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
index e0fd1b6..3e3ba0b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
@@ -51,6 +51,7 @@ import time
import traceback
import test_failures
+import test_results
_log = logging.getLogger("webkitpy.layout_tests.layout_package."
"dump_render_tree_thread")
@@ -133,8 +134,8 @@ def _process_output(port, options, test_info, test_types, test_args,
time.time() - start_diff_time)
total_time_for_all_diffs = time.time() - start_diff_time
- return TestResult(test_info.filename, failures, test_run_time,
- total_time_for_all_diffs, time_for_diffs)
+ return test_results.TestResult(test_info.filename, failures, test_run_time,
+ total_time_for_all_diffs, time_for_diffs)
def _pad_timeout(timeout):
@@ -152,16 +153,11 @@ def _milliseconds_to_seconds(msecs):
return float(msecs) / 1000.0
-class TestResult(object):
-
- def __init__(self, filename, failures, test_run_time,
- total_time_for_all_diffs, time_for_diffs):
- self.failures = failures
- self.filename = filename
- self.test_run_time = test_run_time
- self.time_for_diffs = time_for_diffs
- self.total_time_for_all_diffs = total_time_for_all_diffs
- self.type = test_failures.determine_result_type(failures)
+def _image_hash(test_info, test_args, options):
+ """Returns the image hash of the test if it's needed, otherwise None."""
+ if (test_args.new_baseline or test_args.reset_results or not options.pixel_tests):
+ return None
+ return test_info.image_hash()
class SingleTestThread(threading.Thread):
@@ -196,10 +192,11 @@ class SingleTestThread(threading.Thread):
self._driver = self._port.create_driver(self._test_args.png_path,
self._options)
self._driver.start()
+ image_hash = _image_hash(test_info, self._test_args, self._options)
start = time.time()
crash, timeout, actual_checksum, output, error = \
self._driver.run_test(test_info.uri.strip(), test_info.timeout,
- test_info.image_hash())
+ image_hash)
end = time.time()
self._test_result = _process_output(self._port, self._options,
test_info, self._test_types, self._test_args,
@@ -256,8 +253,8 @@ class TestShellThread(WatchableThread):
options: command line options argument from optparse
filename_list_queue: A thread safe Queue class that contains lists
of tuples of (filename, uri) pairs.
- result_queue: A thread safe Queue class that will contain tuples of
- (test, failure lists) for the test results.
+ result_queue: A thread safe Queue class that will contain
+ serialized TestResult objects.
test_types: A list of TestType objects to run the test output
against.
test_args: A TestArguments object to pass to each TestType.
@@ -441,7 +438,7 @@ class TestShellThread(WatchableThread):
else:
_log.debug("%s %s passed" % (self.getName(),
self._port.relative_test_filename(filename)))
- self._result_queue.put(result)
+ self._result_queue.put(result.dumps())
if batch_size > 0 and batch_count > batch_size:
# Bounce the shell and reset count.
@@ -497,9 +494,8 @@ class TestShellThread(WatchableThread):
failures = []
_log.error('Cannot get results of test: %s' %
test_info.filename)
- result = TestResult(test_info.filename, failures=[],
- test_run_time=0, total_time_for_all_diffs=0,
- time_for_diffs=0)
+ result = test_results.TestResult(test_info.filename, failures=[],
+ test_run_time=0, total_time_for_all_diffs=0, time_for_diffs=0)
return result
@@ -509,20 +505,14 @@ class TestShellThread(WatchableThread):
Args:
test_info: Object containing the test filename, uri and timeout
- Returns:
- A list of TestFailure objects describing the error.
-
+ Returns: a TestResult object.
"""
self._ensure_dump_render_tree_is_running()
# The pixel_hash is used to avoid doing an image dump if the
# checksums match, so it should be set to a blank value if we
# are generating a new baseline. (Otherwise, an image from a
# previous run will be copied into the baseline.)
- image_hash = test_info.image_hash()
- if (image_hash and
- (self._test_args.new_baseline or self._test_args.reset_results or
- not self._options.pixel_tests)):
- image_hash = ""
+ image_hash = _image_hash(test_info, self._test_args, self._options)
start = time.time()
thread_timeout = _milliseconds_to_seconds(
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
index c6c3066..1cf88ef 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
@@ -42,7 +42,6 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
# Additional JSON fields.
WONTFIX = "wontfixCounts"
- DEFERRED = "deferredCounts"
# Note that we omit test_expectations.FAIL from this list because
# it should never show up (it's a legacy input expectation, never
@@ -167,9 +166,6 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
len(self._expectations.get_tests_with_timeline(
test_expectations.NOW)), self.ALL_FIXABLE_COUNT)
self._insert_item_into_raw_list(results_for_builder,
- self._get_failure_summary_entry(test_expectations.DEFER),
- self.DEFERRED)
- self._insert_item_into_raw_list(results_for_builder,
self._get_failure_summary_entry(test_expectations.WONTFIX),
self.WONTFIX)
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 0344aa7..9a0f4ee 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
@@ -40,7 +40,7 @@ from webkitpy.common import array_stream
from webkitpy.common.system import logtesting
from webkitpy.layout_tests import port
from webkitpy.layout_tests.layout_package import printing
-from webkitpy.layout_tests.layout_package import dump_render_tree_thread
+from webkitpy.layout_tests.layout_package import test_results
from webkitpy.layout_tests.layout_package import test_expectations
from webkitpy.layout_tests.layout_package import test_failures
from webkitpy.layout_tests import run_webkit_tests
@@ -141,9 +141,9 @@ class Testprinter(unittest.TestCase):
elif result_type == test_expectations.CRASH:
failures = [test_failures.FailureCrash()]
path = os.path.join(self._port.layout_tests_dir(), test)
- return dump_render_tree_thread.TestResult(path, failures, run_time,
- total_time_for_all_diffs=0,
- time_for_diffs=0)
+ return test_results.TestResult(path, failures, run_time,
+ total_time_for_all_diffs=0,
+ time_for_diffs=0)
def get_result_summary(self, tests, expectations_str):
test_paths = [os.path.join(self._port.layout_tests_dir(), test) for
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 508a6ad..67873a8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -43,7 +43,7 @@ _log = logging.getLogger("webkitpy.layout_tests.layout_package."
# Test expectation and modifier constants.
(PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, TIMEOUT, CRASH, SKIP, WONTFIX,
- DEFER, SLOW, REBASELINE, MISSING, FLAKY, NOW, NONE) = range(16)
+ SLOW, REBASELINE, MISSING, FLAKY, NOW, NONE) = range(15)
# Test expectation file update action constants
(NO_CHANGE, REMOVE_TEST, REMOVE_PLATFORM, ADD_PLATFORMS_EXCEPT_THIS) = range(4)
@@ -228,12 +228,11 @@ class TestExpectationsFile:
DEBUG : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
LINUX DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
- DEFER LINUX WIN : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
+ LINUX WIN : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
SKIP: Doesn't run the test.
SLOW: The test takes a long time to run, but does not timeout indefinitely.
WONTFIX: For tests that we never intend to pass on a given platform.
- DEFER: Test does not count in our statistics for the current release.
DEBUG: Expectations apply only to the debug build.
RELEASE: Expectations apply only to release build.
LINUX/WIN/WIN-XP/WIN-VISTA/WIN-7/MAC: Expectations apply only to these
@@ -241,7 +240,6 @@ class TestExpectationsFile:
Notes:
-A test cannot be both SLOW and TIMEOUT
- -A test cannot be both DEFER and WONTFIX
-A test should only be one of IMAGE, TEXT, IMAGE+TEXT, or FAIL. FAIL is
a migratory state that currently means either IMAGE, TEXT, or
IMAGE+TEXT. Once we have finished migrating the expectations, we will
@@ -249,7 +247,7 @@ class TestExpectationsFile:
identifier.
-A test can be included twice, but not via the same path.
-If a test is included twice, then the more precise path wins.
- -CRASH tests cannot be DEFER or WONTFIX
+ -CRASH tests cannot be WONTFIX
"""
EXPECTATIONS = {'pass': PASS,
@@ -282,14 +280,12 @@ class TestExpectationsFile:
MODIFIERS = {'skip': SKIP,
'wontfix': WONTFIX,
- 'defer': DEFER,
'slow': SLOW,
'rebaseline': REBASELINE,
'none': NONE}
TIMELINES = {'wontfix': WONTFIX,
- 'now': NOW,
- 'defer': DEFER}
+ 'now': NOW}
RESULT_TYPES = {'skip': SKIP,
'pass': PASS,
@@ -621,10 +617,6 @@ class TestExpectationsFile:
if not self._is_debug_mode and 'release' not in options:
return False
- if 'wontfix' in options and 'defer' in options:
- self._add_error(lineno, 'Test cannot be both DEFER and WONTFIX.',
- test_and_expectations)
-
if self._is_lint_mode and 'rebaseline' in options:
self._add_error(lineno,
'REBASELINE should only be used for running rebaseline.py. '
@@ -773,8 +765,6 @@ class TestExpectationsFile:
if 'wontfix' in modifiers:
self._timeline_to_tests[WONTFIX].add(test)
- elif 'defer' in modifiers:
- self._timeline_to_tests[DEFER].add(test)
else:
self._timeline_to_tests[NOW].add(test)
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 2e1b6ec..55eaf99 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
@@ -134,17 +134,12 @@ class TestExpectationsTest(Base):
self.get_test('failures/expected/text.html')),
set([TEXT, CRASH]))
- def test_defer(self):
- self.parse_exp('BUGX DEFER : failures/expected/text.html = TEXT')
- self.assertEqual(self._exp.get_options(
- self.get_test('failures/expected/text.html')), ['bugx', 'defer'])
-
def test_precedence(self):
# This tests handling precedence of specific lines over directories
# and tests expectations covering entire directories.
exp_str = """
BUGX : failures/expected/text.html = TEXT
-BUGX DEFER : failures/expected = IMAGE
+BUGX WONTFIX : failures/expected = IMAGE
"""
self.parse_exp(exp_str)
self.assert_exp('failures/expected/text.html', TEXT)
@@ -227,11 +222,6 @@ BUGX DEFER : failures/expected = IMAGE
self.assertRaises(SyntaxError, self.parse_exp,
'BUG_TEST SLOW : failures/expected/timeout.html = TIMEOUT')
- def test_semantic_wontfix_defer(self):
- # A test cannot be WONTFIX and DEFER.
- self.assertRaises(SyntaxError, self.parse_exp,
- 'BUG_TEST WONTFIX DEFER : failures/expected/text.html = TEXT')
-
def test_semantic_rebaseline(self):
# Can't lint a file w/ 'REBASELINE' in it.
self.assertRaises(SyntaxError, self.parse_exp,
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
index 340d075..6d55761 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
@@ -32,6 +32,8 @@
import os
import test_expectations
+import cPickle
+
def determine_result_type(failure_list):
"""Takes a set of test_failures and returns which result type best fits
@@ -71,10 +73,25 @@ class TestFailure(object):
"""Abstract base class that defines the failure interface."""
@staticmethod
+ def loads(s):
+ """Creates a TestFailure object from the specified string."""
+ return cPickle.loads(s)
+
+ @staticmethod
def message():
"""Returns a string describing the failure in more detail."""
raise NotImplementedError
+ def __eq__(self, other):
+ return self.__class__.__name__ == other.__class__.__name__
+
+ def __ne__(self, other):
+ return self.__class__.__name__ != other.__class__.__name__
+
+ def dumps(self):
+ """Returns the string/JSON representation of a TestFailure."""
+ return cPickle.dumps(self)
+
def result_html_output(self, filename):
"""Returns an HTML string to be included on the results.html page."""
raise NotImplementedError
@@ -112,7 +129,7 @@ class FailureWithType(TestFailure):
TestFailure.__init__(self)
# Filename suffixes used by ResultHtmlOutput.
- OUT_FILENAMES = []
+ OUT_FILENAMES = ()
def output_links(self, filename, out_names):
"""Returns a string holding all applicable output file links.
@@ -128,6 +145,10 @@ class FailureWithType(TestFailure):
# FIXME: Seems like a bad idea to separate the display name data
# from the path data by hard-coding the display name here
# and passing in the path information via out_names.
+ #
+ # FIXME: Also, we don't know for sure that these files exist,
+ # and we shouldn't be creating links to files that don't exist
+ # (for example, if we don't actually have wdiff output).
links = ['']
uris = [self.relative_output_filename(filename, fn) for
fn in out_names]
@@ -170,7 +191,7 @@ class FailureCrash(TestFailure):
return "Test shell crashed"
def result_html_output(self, filename):
- # TODO(tc): create a link to the minidump file
+ # FIXME: create a link to the minidump file
stack = self.relative_output_filename(filename, "-stack.txt")
return "<strong>%s</strong> <a href=%s>stack</a>" % (self.message(),
stack)
@@ -181,7 +202,7 @@ class FailureCrash(TestFailure):
class FailureMissingResult(FailureWithType):
"""Expected result was missing."""
- OUT_FILENAMES = ["-actual.txt"]
+ OUT_FILENAMES = ("-actual.txt",)
@staticmethod
def message():
@@ -196,14 +217,8 @@ class FailureTextMismatch(FailureWithType):
"""Text diff output failed."""
# Filename suffixes used by ResultHtmlOutput.
# FIXME: Why don't we use the constants from TestTypeBase here?
- OUT_FILENAMES = ["-actual.txt", "-expected.txt", "-diff.txt"]
- OUT_FILENAMES_WDIFF = ["-actual.txt", "-expected.txt", "-diff.txt",
- "-wdiff.html", "-pretty-diff.html"]
-
- def __init__(self, has_wdiff):
- FailureWithType.__init__(self)
- if has_wdiff:
- self.OUT_FILENAMES = self.OUT_FILENAMES_WDIFF
+ OUT_FILENAMES = ("-actual.txt", "-expected.txt", "-diff.txt",
+ "-wdiff.html", "-pretty-diff.html")
@staticmethod
def message():
@@ -214,7 +229,6 @@ class FailureMissingImageHash(FailureWithType):
"""Actual result hash was missing."""
# Chrome doesn't know to display a .checksum file as text, so don't bother
# putting in a link to the actual result.
- OUT_FILENAMES = []
@staticmethod
def message():
@@ -226,7 +240,7 @@ class FailureMissingImageHash(FailureWithType):
class FailureMissingImage(FailureWithType):
"""Actual result image was missing."""
- OUT_FILENAMES = ["-actual.png"]
+ OUT_FILENAMES = ("-actual.png",)
@staticmethod
def message():
@@ -239,7 +253,7 @@ class FailureMissingImage(FailureWithType):
class FailureImageHashMismatch(FailureWithType):
"""Image hashes didn't match."""
- OUT_FILENAMES = ["-actual.png", "-expected.png", "-diff.png"]
+ OUT_FILENAMES = ("-actual.png", "-expected.png", "-diff.png")
@staticmethod
def message():
@@ -252,7 +266,6 @@ class FailureImageHashIncorrect(FailureWithType):
"""Actual result hash is incorrect."""
# Chrome doesn't know to display a .checksum file as text, so don't bother
# putting in a link to the actual result.
- OUT_FILENAMES = []
@staticmethod
def message():
@@ -260,3 +273,10 @@ class FailureImageHashIncorrect(FailureWithType):
def result_html_output(self, filename):
return "<strong>%s</strong>" % self.message()
+
+# Convenient collection of all failure classes for anything that might
+# need to enumerate over them all.
+ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult,
+ FailureTextMismatch, FailureMissingImageHash,
+ FailureMissingImage, FailureImageHashMismatch,
+ FailureImageHashIncorrect)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
index 92fe276..3e3528d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
@@ -28,13 +28,26 @@
""""Tests code paths not covered by the regular unit tests."""
-from webkitpy.layout_tests.layout_package.test_failures import *
import unittest
+from webkitpy.layout_tests.layout_package.test_failures import *
+
+
class Test(unittest.TestCase):
def assertResultHtml(self, failure_obj):
self.assertNotEqual(failure_obj.result_html_output('foo'), None)
+ def assert_loads(self, cls):
+ failure_obj = cls()
+ s = failure_obj.dumps()
+ new_failure_obj = TestFailure.loads(s)
+ self.assertTrue(isinstance(new_failure_obj, cls))
+
+ self.assertEqual(failure_obj, new_failure_obj)
+
+ # Also test that != is implemented.
+ self.assertFalse(failure_obj != new_failure_obj)
+
def test_crash(self):
self.assertResultHtml(FailureCrash())
@@ -63,6 +76,9 @@ class Test(unittest.TestCase):
self.assertRaises(NotImplementedError, failure_obj.result_html_output,
"foo.txt")
+ def test_loads(self):
+ for c in ALL_FAILURE_CLASSES:
+ self.assert_loads(c)
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
new file mode 100644
index 0000000..2417fb7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
@@ -0,0 +1,61 @@
+# 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 cPickle
+
+import test_failures
+
+
+class TestResult(object):
+ """Data object containing the results of a single test."""
+
+ @staticmethod
+ def loads(str):
+ return cPickle.loads(str)
+
+ def __init__(self, filename, failures, test_run_time,
+ total_time_for_all_diffs, time_for_diffs):
+ self.failures = failures
+ self.filename = filename
+ self.test_run_time = test_run_time
+ self.time_for_diffs = time_for_diffs
+ self.total_time_for_all_diffs = total_time_for_all_diffs
+ self.type = test_failures.determine_result_type(failures)
+
+ def __eq__(self, other):
+ return (self.filename == other.filename and
+ self.failures == other.failures and
+ self.test_run_time == other.test_run_time and
+ self.time_for_diffs == other.time_for_diffs and
+ self.total_time_for_all_diffs == other.total_time_for_all_diffs)
+
+ def __ne__(self, other):
+ return not (self == other)
+
+ def dumps(self):
+ return cPickle.dumps(self)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/rietveld_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
index 9c5a29e..5921666 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/rietveld_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 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,12 +28,25 @@
import unittest
-from webkitpy.common.net.rietveld import Rietveld
-from webkitpy.thirdparty.mock import Mock
+from test_results import TestResult
-class RietveldTest(unittest.TestCase):
- def test_url_for_issue(self):
- rietveld = Rietveld(Mock())
- self.assertEqual(rietveld.url_for_issue(34223),
- "https://wkrietveld.appspot.com/34223")
+class Test(unittest.TestCase):
+ def test_loads(self):
+ result = TestResult(filename='foo',
+ failures=[],
+ test_run_time=1.1,
+ total_time_for_all_diffs=0.5,
+ time_for_diffs=0.5)
+ s = result.dumps()
+ new_result = TestResult.loads(s)
+ self.assertTrue(isinstance(new_result, TestResult))
+
+ self.assertEqual(new_result, result)
+
+ # Also check that != is implemented.
+ self.assertFalse(new_result != result)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index 93f8808..ee868e8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -250,7 +250,7 @@ class PortTest(unittest.TestCase):
abspath_to_uri(test_file))
def test_get_option__set(self):
- options, args = optparse.OptionParser().parse_args()
+ options, args = optparse.OptionParser().parse_args([])
options.foo = 'bar'
port = base.Port(options=options)
self.assertEqual(port.get_option('foo'), 'bar')
@@ -269,7 +269,7 @@ class PortTest(unittest.TestCase):
self.assertEqual(port.get_option('foo'), 'bar')
def test_set_option_default__set(self):
- options, args = optparse.OptionParser().parse_args()
+ options, args = optparse.OptionParser().parse_args([])
options.foo = 'bar'
port = base.Port(options=options)
# This call should have no effect.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 4d17b51..f93f9a8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -135,7 +135,7 @@ class ChromiumPort(base.Port):
override_step, logging)
def diff_image(self, expected_contents, actual_contents,
- diff_filename=None, tolerance=0):
+ diff_filename=None):
executable = self._path_to_image_diff()
tempdir = tempfile.mkdtemp()
@@ -385,6 +385,12 @@ class ChromiumDriver(base.Driver):
if self._port.get_option('gp_fault_error_box'):
driver_args.append('--gp-fault-error-box')
+ if self._options.js_flags is not None:
+ driver_args.append('--js-flags="' + self._options.js_flags + '"')
+
+ if self._options.multiple_loads is not None and self._options.multiple_loads > 0:
+ driver_args.append('--multiple-loads=' + str(self._options.multiple_loads))
+
if self._port.get_option('accelerated_compositing'):
driver_args.append('--enable-accelerated-compositing')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
index 95c716e..5d28fae 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
@@ -69,6 +69,8 @@ def _set_gpu_options(options):
options.accelerated_compositing = True
if options.accelerated_2d_canvas is None:
options.accelerated_2d_canvas = True
+ if options.builder_name is not None:
+ options.builder_name = options.builder_name + ' - GPU'
def _gpu_overrides(port):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
index 7a13b1c..88524fc 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
@@ -44,10 +44,12 @@ class ChromiumGpuTest(unittest.TestCase):
def assertOverridesWorked(self, port_name):
# test that we got the right port
mock_options = mocktool.MockOptions(accelerated_compositing=None,
- accelerated_2d_canvas=None)
+ accelerated_2d_canvas=None,
+ builder_name='foo')
port = chromium_gpu.get(port_name=port_name, options=mock_options)
self.assertTrue(port._options.accelerated_compositing)
self.assertTrue(port._options.accelerated_2d_canvas)
+ self.assertEqual(port._options.builder_name, 'foo - GPU')
# we use startswith() instead of Equal to gloss over platform versions.
self.assertTrue(port.name().startswith(port_name))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
index cb45430..92a31fb 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
@@ -121,7 +121,7 @@ class ChromiumPortTest(unittest.TestCase):
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"""
+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
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
index 81db32c..36f3c6b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
@@ -51,7 +51,7 @@ class ChromiumWinTest(unittest.TestCase):
def test_setup_environ_for_server(self):
port = chromium_win.ChromiumWinPort()
- port._executive = mocktool.MockExecute(True)
+ port._executive = mocktool.MockExecutive(should_log=True)
port.path_from_chromium_base = self._mock_path_from_chromium_base
output = outputcapture.OutputCapture()
orig_environ = os.environ.copy()
@@ -63,7 +63,7 @@ class ChromiumWinTest(unittest.TestCase):
sys.platform = "win32"
port = chromium_win.ChromiumWinPort(
options=ChromiumWinTest.RegisterCygwinOption())
- port._executive = mocktool.MockExecute(True)
+ port._executive = mocktool.MockExecutive(should_log=True)
port.path_from_chromium_base = self._mock_path_from_chromium_base
setup_mount = self._mock_path_from_chromium_base("third_party",
"cygwin",
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
index 73200a0..b2615a3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
@@ -71,13 +71,15 @@ class HttpLock(object):
return self._extract_lock_number(lock_list[-1]) + 1
def _check_pid(self, current_pid):
- """Return True if pid is alive, otherwise return False."""
- try:
- os.kill(current_pid, 0)
- except OSError:
- return False
- else:
- return True
+ """Return True if pid is alive, otherwise return False.
+ FIXME: os.kill() doesn't work on Windows for checking if
+ a pid is alive, so always return True"""
+ if sys.platform in ('darwin', 'linux2'):
+ try:
+ os.kill(current_pid, 0)
+ except OSError:
+ return False
+ return True
def _curent_lock_pid(self):
"""Return with the current lock pid. If the lock is not valid
@@ -89,9 +91,7 @@ class HttpLock(object):
current_lock_file = open(lock_list[0], 'r')
current_pid = current_lock_file.readline()
current_lock_file.close()
- if not (current_pid and
- sys.platform in ('darwin', 'linux2') and
- self._check_pid(int(current_pid))):
+ if not (current_pid and self._check_pid(int(current_pid))):
os.unlink(lock_list[0])
return
except IOError, OSError:
@@ -104,9 +104,7 @@ class HttpLock(object):
numbers are sequential."""
while(True):
try:
- sequential_guard_lock = os.open(self._guard_lock_file,
- os.O_CREAT | os.O_NONBLOCK | os.O_EXCL)
-
+ sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_EXCL)
self._process_lock_file_name = (self._lock_file_path_prefix +
str(self._next_lock_number()))
lock_file = open(self._process_lock_file_name, 'w')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
index 4c8fa0a..af94acc 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
@@ -31,6 +31,7 @@
import logging
import os
import signal
+import sys
import webkit
@@ -46,6 +47,17 @@ class QtPort(WebKitPort):
kwargs.setdefault('port_name', 'qt')
WebKitPort.__init__(self, **kwargs)
+ def baseline_search_path(self):
+ port_names = []
+ if sys.platform == 'linux2':
+ port_names.append("qt-linux")
+ elif sys.platform in ('win32', 'cygwin'):
+ port_names.append("qt-win")
+ elif sys.platform == 'darwin':
+ port_names.append("qt-mac")
+ port_names.append("qt")
+ return map(self._webkit_baseline_path, port_names)
+
def _tests_for_other_platforms(self):
# FIXME: This list could be dynamic based on platform name and
# pushed into base.Port.
@@ -92,6 +104,9 @@ class QtPort(WebKitPort):
def _path_to_driver(self):
return self._build_path('bin/DumpRenderTree')
+ def _path_to_image_diff(self):
+ return self._build_path('bin/ImageDiff')
+
def _path_to_webcore_library(self):
return self._build_path('lib/libQtWebKit.so')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index 3691c5a..ff4086c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -137,7 +137,7 @@ class TestPort(base.Port):
return True
def diff_image(self, expected_contents, actual_contents,
- diff_filename=None, tolerance=0):
+ diff_filename=None):
diffed = actual_contents != expected_contents
if diffed and diff_filename:
with codecs.open(diff_filename, "w", "utf-8") as diff_fh:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
index c940f1e..0d0d3e0 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -122,22 +122,25 @@ class WebKitPort(base.Port):
return True
def diff_image(self, expected_contents, actual_contents,
- diff_filename=None, tolerance=0.1):
+ diff_filename=None):
"""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."""
- # FIXME: either expose the tolerance argument as a command-line
- # parameter, or make it go away and always use exact matches.
-
# Handle the case where the test didn't actually generate an image.
if not actual_contents:
return True
- sp = self._diff_image_request(expected_contents, actual_contents,
- tolerance)
+ sp = self._diff_image_request(expected_contents, actual_contents)
return self._diff_image_reply(sp, diff_filename)
- def _diff_image_request(self, expected_contents, actual_contents, tolerance):
+ def _diff_image_request(self, expected_contents, actual_contents):
+ # FIXME: use self.get_option('tolerance') and
+ # self.set_option_default('tolerance', 0.1) once that behaves correctly
+ # with default values.
+ if self.get_option('tolerance') is not None:
+ tolerance = self.get_option('tolerance')
+ else:
+ tolerance = 0.1
command = [self._path_to_image_diff(), '--tolerance', str(tolerance)]
sp = server_process.ServerProcess(self, 'ImageDiff', command)
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 a47370d..434058e 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
@@ -496,7 +496,7 @@ class Rebaseliner(object):
"""
if is_image:
- return self._port.diff_image(output1, output2, None, 0)
+ return self._port.diff_image(output1, output2, None)
else:
return self._port.compare_text(output1, output2)
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 ef33a47..8db31a6 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
@@ -110,7 +110,6 @@ class TestRebaseliner(unittest.TestCase):
is_image=False))
def test_diff_baselines_png(self):
- return
rebaseliner = self.make_rebaseliner()
image = rebaseliner._port.expected_image(
os.path.join(rebaseliner._port.layout_tests_dir(),
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 9cc7895..704180c 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -69,6 +69,7 @@ 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_results
from layout_package import test_results_uploader
from test_types import image_diff
from test_types import text_diff
@@ -457,7 +458,7 @@ class TestRunner:
# subtracted out of self._test_files, above), but we stub out the
# results here so the statistics can remain accurate.
for test in skip_chunk:
- result = dump_render_tree_thread.TestResult(test,
+ result = test_results.TestResult(test,
failures=[], test_run_time=0, total_time_for_all_diffs=0,
time_for_diffs=0)
result.type = test_expectations.SKIP
@@ -852,7 +853,7 @@ class TestRunner:
"""Update the summary and print results with any completed tests."""
while True:
try:
- result = self._result_queue.get_nowait()
+ result = test_results.TestResult.loads(self._result_queue.get_nowait())
except Queue.Empty:
return
@@ -950,7 +951,12 @@ class TestRunner:
_log.info("Uploading JSON files for builder: %s",
self._options.builder_name)
- attrs = [("builder", self._options.builder_name)]
+ attrs = [("builder", self._options.builder_name), ("testtype", "layout-tests")]
+ # FIXME: master_name should be required if test_results_server is set.
+ # Throw an error if master_name isn't set.
+ if self._options.master_name:
+ attrs.append(("master", self._options.master_name))
+
json_files = ["expectations.json"]
if self._options.upload_full_results:
json_files.append("results.json")
@@ -960,6 +966,13 @@ class TestRunner:
files = [(file, os.path.join(self._options.results_directory, file))
for file in json_files]
+ # FIXME: Remove this. This is temporary debug logging.
+ if self._options.builder_name.startswith("Webkit Linux"):
+ for filename in files:
+ _log.debug(filename[1])
+ with codecs.open(filename[1], "r") as results_file:
+ _log.debug("%s:\n%s" % (filename[0], results_file.read()))
+
uploader = test_results_uploader.TestResultsUploader(
self._options.test_results_server)
try:
@@ -1011,16 +1024,13 @@ class TestRunner:
tests = self._expectations.get_tests_with_result_type(result_type)
now = result_summary.tests_by_timeline[test_expectations.NOW]
wontfix = result_summary.tests_by_timeline[test_expectations.WONTFIX]
- defer = result_summary.tests_by_timeline[test_expectations.DEFER]
# We use a fancy format string in order to print the data out in a
# nicely-aligned table.
- fmtstr = ("Expect: %%5d %%-8s (%%%dd now, %%%dd defer, %%%dd wontfix)"
- % (self._num_digits(now), self._num_digits(defer),
- self._num_digits(wontfix)))
+ fmtstr = ("Expect: %%5d %%-8s (%%%dd now, %%%dd wontfix)"
+ % (self._num_digits(now), self._num_digits(wontfix)))
self._printer.print_expected(fmtstr %
- (len(tests), result_type_str, len(tests & now),
- len(tests & defer), len(tests & wontfix)))
+ (len(tests), result_type_str, len(tests & now), len(tests & wontfix)))
def _num_digits(self, num):
"""Returns the number of digits needed to represent the length of a
@@ -1241,12 +1251,7 @@ class TestRunner:
(passed, total, pct_passed))
self._printer.print_actual("")
self._print_result_summary_entry(result_summary,
- test_expectations.NOW, "Tests to be fixed for the current release")
-
- self._printer.print_actual("")
- self._print_result_summary_entry(result_summary,
- test_expectations.DEFER,
- "Tests we'll fix in the future if they fail (DEFER)")
+ test_expectations.NOW, "Tests to be fixed")
self._printer.print_actual("")
self._print_result_summary_entry(result_summary,
@@ -1301,7 +1306,8 @@ class TestRunner:
page += u"<p><a href='%s'>%s</a><br />\n" % (test_url, test_name)
test_failures = failures.get(test_file, [])
for failure in test_failures:
- page += u"&nbsp;&nbsp;%s<br/>" % failure.result_html_output(test_name)
+ page += (u"&nbsp;&nbsp;%s<br/>" %
+ failure.result_html_output(test_name))
page += "</p>\n"
page += "</body></html>\n"
return page
@@ -1436,7 +1442,8 @@ def _set_up_derived_options(port_obj, options):
if not options.child_processes:
# FIXME: Investigate perf/flakiness impact of using cpu_count + 1.
- options.child_processes = str(port_obj.default_child_processes())
+ options.child_processes = os.environ.get("WEBKIT_TEST_CHILD_PROCESSES",
+ str(port_obj.default_child_processes()))
if not options.configuration:
options.configuration = port_obj.default_configuration()
@@ -1515,6 +1522,10 @@ def parse_args(args=None):
default=False, help="create a dialog on DumpRenderTree startup"),
optparse.make_option("--gp-fault-error-box", action="store_true",
default=False, help="enable Windows GP fault error box"),
+ optparse.make_option("--multiple-loads",
+ type="int", help="turn on multiple loads of each test"),
+ optparse.make_option("--js-flags",
+ type="string", help="JavaScript flags to pass to tests"),
optparse.make_option("--nocheck-sys-deps", action="store_true",
default=False,
help="Don't check the system dependencies (themes)"),
@@ -1561,8 +1572,9 @@ def parse_args(args=None):
dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"),
optparse.make_option("--no-pixel-tests", action="store_false",
dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"),
- # old-run-webkit-tests allows a specific tolerance: --tolerance t
- # Ignore image differences less than this percentage (default: 0.1)
+ optparse.make_option("--tolerance",
+ help="Ignore image differences less than this percentage (some "
+ "ports may ignore this option)", type="float"),
optparse.make_option("--results-directory",
default="layout-test-results",
help="Output results directory source dir, relative to Debug or "
@@ -1686,6 +1698,7 @@ def parse_args(args=None):
# FIXME: Move these into json_results_generator.py
results_json_options = [
+ optparse.make_option("--master-name", help="The name of the buildbot master."),
optparse.make_option("--builder-name", default="DUMMY_BUILDER_NAME",
help=("The name of the builder shown on the waterfall running "
"this script e.g. WebKit.")),
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 a716cec..0f09ffa 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -48,6 +48,7 @@ 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
+from webkitpy.layout_tests.port.test import TestPort
from webkitpy.thirdparty.mock import Mock
@@ -260,6 +261,31 @@ class MainTest(unittest.TestCase):
tests_included=True)
self.assertEqual(user.url, '/tmp/foo/results.html')
+ def test_tolerance(self):
+ class ImageDiffTestPort(TestPort):
+ def diff_image(self, expected_contents, actual_contents,
+ diff_filename=None):
+ self.tolerance_used_for_diff_image = self._options.tolerance
+ return True
+
+ def get_port_for_run(args):
+ options, parsed_args = run_webkit_tests.parse_args(args)
+ test_port = ImageDiffTestPort(options=options, user=MockUser())
+ passing_run(args=args, port_obj=test_port, tests_included=True)
+ return test_port
+
+ base_args = ['--pixel-tests', 'failures/expected/*']
+
+ # If we pass in an explicit tolerance argument, then that will be used.
+ test_port = get_port_for_run(base_args + ['--tolerance', '.1'])
+ self.assertEqual(0.1, test_port.tolerance_used_for_diff_image)
+ test_port = get_port_for_run(base_args + ['--tolerance', '0'])
+ self.assertEqual(0, test_port.tolerance_used_for_diff_image)
+
+ # Otherwise the port's default tolerance behavior (including ignoring it)
+ # should be used.
+ test_port = get_port_for_run(base_args)
+ self.assertEqual(None, test_port.tolerance_used_for_diff_image)
def _mocked_open(original_open, file_list):
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 b1f621e..4c32f0d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
@@ -89,6 +89,6 @@ class TestTextDiff(test_type_base.TestTypeBase):
if expected == '':
failures.append(test_failures.FailureMissingResult())
else:
- failures.append(test_failures.FailureTextMismatch(True))
+ failures.append(test_failures.FailureTextMismatch())
return failures
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index e0c956f..11e3e33 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -116,9 +116,9 @@ _PATH_RULES_SPECIFIER = [
# API and therefore do not follow the same header including
# discipline as WebCore.
(["WebKitTools/WebKitAPITest/",
- "WebKit/qt/QGVLauncher/"],
+ "WebKitTools/TestWebKitAPI/"],
["-build/include",
- "-readability/streams"]),
+ "-readability/naming"]),
([# The EFL APIs use EFL naming style, which includes
# both lower-cased and camel-cased, underscore-sparated
# values.
@@ -148,6 +148,24 @@ _PATH_RULES_SPECIFIER = [
"/JavaScriptCore/assembler/"],
["-readability/naming"]),
+ # WebKit2 rules:
+ # WebKit2 doesn't use config.h, and certain directories have other
+ # idiosyncracies.
+ ([# NPAPI has function names with underscores.
+ "WebKit2/WebProcess/Plugins/Netscape"],
+ ["-build/include_order",
+ "-readability/naming"]),
+ ([# The WebKit2 C API has names with underscores and whitespace-aligned
+ # struct members.
+ "WebKit2/UIProcess/API/C/",
+ "WebKit2/WebProcess/InjectedBundle/API/c/"],
+ ["-build/include_order",
+ "-readability/naming",
+ "-whitespace/declaration"]),
+ ([# Nothing in WebKit2 uses config.h.
+ "WebKit2/"],
+ ["-build/include_order"]),
+
# For third-party Python code, keep only the following checks--
#
# No tabs: to avoid having to set the SVN allow-tabs property.
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index 5254275..43d24fe 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -213,11 +213,6 @@ class GlobalVariablesTest(unittest.TestCase):
"build/include")
assertNoCheck("WebKitTools/WebKitAPITest/main.cpp",
"build/include")
- assertNoCheck("WebKit/qt/QGVLauncher/main.cpp",
- "build/include")
- assertNoCheck("WebKit/qt/QGVLauncher/main.cpp",
- "readability/streams")
-
assertCheck("random_path.cpp",
"readability/naming")
assertNoCheck("WebKit/gtk/webkit/webkit.h",
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index 7c1cb3e..cd9e6ae 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -1293,7 +1293,7 @@ def check_spacing(file_extension, clean_lines, line_number, error):
line = clean_lines.elided[line_number] # get rid of comments and strings
# Don't try to do spacing checks for operator methods
- line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line)
+ line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>|\+=|-=|\*=|/=|%=|&=|\|=|^=|<<=|>>=)\(', 'operator\(', line)
# Don't try to do spacing checks for #include or #import statements at
# minimum because it messes up checks for spacing around /
if match(r'\s*#\s*(?:include|import)', line):
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 071ce50..6d5c24b 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -1313,6 +1313,19 @@ class CppStyleTest(CppStyleTestBase):
self.assert_multi_line_lint('#include "config.h"\n#import <foo/bar.h>\n',
'')
+ def test_operator_methods(self):
+ self.assert_lint('String operator+(const String&, const String&);', '')
+ self.assert_lint('bool operator==(const String&, const String&);', '')
+ self.assert_lint('String& operator-=(const String&, const String&);', '')
+ self.assert_lint('String& operator+=(const String&, const String&);', '')
+ self.assert_lint('String& operator*=(const String&, const String&);', '')
+ self.assert_lint('String& operator%=(const String&, const String&);', '')
+ self.assert_lint('String& operator&=(const String&, const String&);', '')
+ self.assert_lint('String& operator<<=(const String&, const String&);', '')
+ self.assert_lint('String& operator>>=(const String&, const String&);', '')
+ self.assert_lint('String& operator|=(const String&, const String&);', '')
+ self.assert_lint('String& operator^=(const String&, const String&);', '')
+
def test_spacing_before_last_semicolon(self):
self.assert_lint('call_function() ;',
'Extra space before last semicolon. If this should be an '
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
index 747b8b4..31f0b40 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -111,7 +111,7 @@ class TestExpectationsTestCase(unittest.TestCase):
["BUG1234 DEBUG MAC : passes/text.html = TIMEOUT PASS"],
"")
self.assert_lines_lint(
- ["SLOW DEFER BUG1234 : passes/text.html = PASS"],
+ ["SLOW BUG1234 : passes/text.html = PASS"],
"")
self.assert_lines_lint(
["WONTFIX SKIP : passes/text.html = TIMEOUT"],
@@ -126,10 +126,6 @@ class TestExpectationsTestCase(unittest.TestCase):
["SKIP : passes/text.html = PASS"],
"Test lacks BUG modifier. "
"passes/text.html [test/expectations] [2]")
- self.assert_lines_lint(
- ["WONTFIX DEFER : passes/text.html = PASS"],
- "Test cannot be both DEFER and WONTFIX. "
- "passes/text.html [test/expectations] [5]")
def test_expectation_errors(self):
self.assert_lines_lint(
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
index 7eac1cb..c2249c2 100644
--- a/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
@@ -77,12 +77,6 @@ installer.install(url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.
installer.install(url="http://www.adambarth.com/webkit/eliza",
target_name="eliza.py")
-rietveld_dir = os.path.join(autoinstalled_dir, "rietveld")
-installer = AutoInstaller(target_dir=rietveld_dir)
-installer.install(url="http://webkit-rietveld.googlecode.com/svn/trunk/upload_v26/upload.py",
- target_name="upload.py")
-
-
# Since irclib and ircbot are two top-level packages, we need to import
# them separately. We group them into an irc package for better
# organization purposes.
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
index 02e203c..ea12702 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
@@ -85,7 +85,6 @@ class CommitQueueTask(object):
"apply-attachment",
"--force-clean",
"--non-interactive",
- "--quiet",
self._patch.id(),
],
"Applied patch",
@@ -97,7 +96,6 @@ class CommitQueueTask(object):
"--no-clean",
"--no-update",
"--build-style=both",
- "--quiet",
],
"Built patch",
"Patch does not build")
@@ -108,7 +106,6 @@ class CommitQueueTask(object):
"--force-clean",
"--no-update",
"--build-style=both",
- "--quiet",
],
"Able to build without patch",
"Unable to build without patch")
@@ -120,7 +117,6 @@ class CommitQueueTask(object):
"--no-update",
# Notice that we don't pass --build, which means we won't build!
"--test",
- "--quiet",
"--non-interactive",
],
"Passed tests",
@@ -133,7 +129,6 @@ class CommitQueueTask(object):
"--no-update",
"--build",
"--test",
- "--quiet",
"--non-interactive",
],
"Able to pass tests without patch",
@@ -146,11 +141,11 @@ class CommitQueueTask(object):
return results.failing_tests()
def _land(self):
+ # Unclear if this should pass --quiet or not. If --parent-command always does the reporting, then it should.
return self._run_command([
"land-attachment",
"--force-clean",
"--ignore-builders",
- "--quiet",
"--non-interactive",
"--parent-command=commit-queue",
self._patch.id(),
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
index 6fa0667..15a4a6b 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
@@ -75,13 +75,13 @@ class CommitQueueTaskTest(unittest.TestCase):
def test_success_case(self):
commit_queue = MockCommitQueue([])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_passed: success_message='Built patch' patch='197'
-run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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]
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
command_passed: success_message='Landed patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr)
@@ -90,7 +90,7 @@ command_passed: success_message='Landed patch' patch='197'
commit_queue = MockCommitQueue([
ScriptError("MOCK apply failure"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 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)
@@ -100,11 +100,11 @@ command_failed: failure_message='Patch does not apply' script_error='MOCK apply
None,
ScriptError("MOCK build failure"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
-run_webkit_patch: ['build', '--force-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--force-clean', '--no-update', '--build-style=both']
command_passed: success_message='Able to build without patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr, ScriptError)
@@ -115,11 +115,11 @@ command_passed: success_message='Able to build without patch' patch='197'
ScriptError("MOCK build failure"),
ScriptError("MOCK clean build failure"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
-run_webkit_patch: ['build', '--force-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--force-clean', '--no-update', '--build-style=both']
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)
@@ -130,16 +130,16 @@ command_failed: failure_message='Unable to build without patch' script_error='MO
None,
ScriptError("MOCK tests failure"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_passed: success_message='Built patch' patch='197'
-run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
command_passed: success_message='Passed tests' patch='197'
report_flaky_tests: patch='197' flaky_tests='None'
-run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
command_passed: success_message='Landed patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr)
@@ -151,15 +151,15 @@ command_passed: success_message='Landed patch' patch='197'
ScriptError("MOCK test failure"),
ScriptError("MOCK test failure again"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_passed: success_message='Built patch' patch='197'
-run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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']
+run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--non-interactive']
command_passed: success_message='Able to pass tests without patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr, ScriptError)
@@ -172,15 +172,15 @@ command_passed: success_message='Able to pass tests without patch' patch='197'
ScriptError("MOCK test failure again"),
ScriptError("MOCK clean test failure"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_passed: success_message='Built patch' patch='197'
-run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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']
+run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--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)
@@ -192,13 +192,13 @@ command_failed: failure_message='Unable to pass tests without patch (tree is red
None,
ScriptError("MOCK land failure"),
])
- expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
command_passed: success_message='Applied patch' patch='197'
-run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
command_passed: success_message='Built patch' patch='197'
-run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--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]
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--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/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
index ed5c604..541c9c4 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
@@ -106,8 +106,10 @@ land will NOT build and run the tests before committing, but you can use the --b
If a bug id is provided, or one can be found in the ChangeLog land will update the bug after committing."""
def _prepare_state(self, options, args, tool):
+ changed_files = self._tool.scm().changed_files(options.git_commit)
return {
- "bug_id": (args and args[0]) or tool.checkout().bug_id_for_this_commit(options.git_commit),
+ "changed_files": changed_files,
+ "bug_id": (args and args[0]) or tool.checkout().bug_id_for_this_commit(options.git_commit, changed_files),
}
@@ -221,18 +223,6 @@ class BuildAndTestAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsM
]
-class PostAttachmentToRietveld(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
- name = "post-attachment-to-rietveld"
- help_text = "Uploads a bugzilla attachment to rietveld"
- arguments_names = "ATTACHMENTID"
- main_steps = [
- steps.CleanWorkingDirectory,
- steps.Update,
- steps.ApplyPatch,
- steps.PostCodeReview,
- ]
-
-
class AbstractPatchApplyingCommand(AbstractPatchSequencingCommand):
prepare_steps = [
steps.EnsureLocalCommitIfNeeded,
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
index 6af1f64..bfca139 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
@@ -118,10 +118,6 @@ class DownloadCommandsTest(CommandsTest):
expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nBuilding WebKit\n"
self.assert_execute_outputs(BuildAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)
- def test_post_attachment_to_rietveld(self):
- expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nMOCK: Uploading patch to rietveld\nMOCK setting flag 'in-rietveld' to '+' on attachment '197' with comment 'None' and additional comment 'None'\n"
- self.assert_execute_outputs(PostAttachmentToRietveld(), [197], options=self._default_options(), expected_stderr=expected_stderr)
-
def test_land_attachment(self):
# FIXME: This expected result is imperfect, notice how it's seeing the same patch as still there after it thought it would have cleared the flags.
expected_stderr = """Processing 1 patch from 1 bug.
@@ -186,5 +182,6 @@ where ATTACHMENT_ID is the ID of this attachment.
def test_rollout(self):
expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\nMOCK: user.open_url: file://...\nBuilding WebKit\n"
- self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+ expected_stdout = "Was that diff correct?\n"
+ self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stdout=expected_stdout, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
index 5ec468e..3b53d1a 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
@@ -50,8 +50,7 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue):
self.port.flag(),
"--build-style=%s" % self._build_style,
"--force-clean",
- "--no-update",
- "--quiet"])
+ "--no-update"])
return True
except ScriptError, e:
failure_log = self._log_from_script_error_for_upload(e)
@@ -81,6 +80,14 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue):
raise
def review_patch(self, patch):
+ if patch.is_obsolete():
+ self._did_error(patch, "%s does not process obsolete patches." % self.name)
+ return False
+
+ if patch.bug().is_closed():
+ self._did_error(patch, "%s does not process patches on closed bugs." % self.name)
+ return False
+
if not self._build(patch, first_run=True):
if not self._can_build():
return False
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
index c400f81..830e11c 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -29,15 +29,54 @@
import os
from webkitpy.thirdparty.mock import Mock
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.bot.queueengine import QueueEngine
from webkitpy.tool.commands.earlywarningsystem import *
from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.mocktool import MockTool, MockOptions
+
+
+class AbstractEarlyWarningSystemTest(QueuesTest):
+ def test_can_build(self):
+ # Needed to define port_name, used in AbstractEarlyWarningSystem.__init__
+ class TestEWS(AbstractEarlyWarningSystem):
+ port_name = "win" # Needs to be a port which port/factory understands.
+
+ queue = TestEWS()
+ queue.bind_to_tool(MockTool(log_executive=True))
+ queue._options = MockOptions(port=None)
+ expected_stderr = "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--port=win', '--build-style=release', '--force-clean', '--no-update']\n"
+ OutputCapture().assert_outputs(self, queue._can_build, [], expected_stderr=expected_stderr)
+
+ def mock_run_webkit_patch(args):
+ raise ScriptError("MOCK script error")
+
+ queue.run_webkit_patch = mock_run_webkit_patch
+ expected_stderr = "MOCK: update_status: None Unable to perform a build\n"
+ OutputCapture().assert_outputs(self, queue._can_build, [], expected_stderr=expected_stderr)
+
+ # FIXME: This belongs on an AbstractReviewQueueTest object in queues_unittest.py
+ def test_subprocess_handled_error(self):
+ queue = AbstractReviewQueue()
+ queue.bind_to_tool(MockTool())
+
+ def mock_review_patch(patch):
+ raise ScriptError('MOCK script error', exit_code=QueueEngine.handled_error_code)
+
+ queue.review_patch = mock_review_patch
+ mock_patch = queue._tool.bugs.fetch_attachment(197)
+ expected_stderr = "MOCK: release_work_item: None 197\n"
+ OutputCapture().assert_outputs(self, queue.process_work_item, [mock_patch], expected_stderr=expected_stderr, expected_exception=ScriptError)
+
class EarlyWarningSytemTest(QueuesTest):
def test_failed_builds(self):
ews = ChromiumLinuxEWS()
+ ews.bind_to_tool(MockTool())
ews._build = lambda patch, first_run=False: False
ews._can_build = lambda: True
- ews.review_patch(Mock())
+ mock_patch = ews._tool.bugs.fetch_attachment(197)
+ ews.review_patch(mock_patch)
def _default_expected_stderr(self, ews):
string_replacemnts = {
@@ -46,20 +85,29 @@ class EarlyWarningSytemTest(QueuesTest):
"watchers": ews.watchers,
}
expected_stderr = {
- "begin_work_queue": self._default_begin_work_queue_stderr(ews.name, os.getcwd()), # FIXME: Use of os.getcwd() is wrong, should be scm.checkout_root
+ "begin_work_queue": self._default_begin_work_queue_stderr(ews.name, ews._tool.scm().checkout_root),
"handle_unexpected_error": "Mock error message\n",
"next_work_item": "",
"process_work_item": "MOCK: update_status: %(name)s Pass\nMOCK: release_work_item: %(name)s 197\n" % string_replacemnts,
- "handle_script_error": "MOCK: update_status: %(name)s ScriptError error message\nMOCK bug comment: bug_id=142, cc=%(watchers)s\n--- Begin comment ---\nAttachment 197 did not build on %(port)s:\nBuild output: http://dummy_url\n--- End comment ---\n\n" % string_replacemnts,
+ "handle_script_error": "MOCK: update_status: %(name)s ScriptError error message\nMOCK bug comment: bug_id=42, cc=%(watchers)s\n--- Begin comment ---\nAttachment 197 did not build on %(port)s:\nBuild output: http://dummy_url\n--- End comment ---\n\n" % string_replacemnts,
}
return expected_stderr
def _test_ews(self, ews):
+ ews.bind_to_tool(MockTool())
expected_exceptions = {
"handle_script_error": SystemExit,
}
self.assert_queue_outputs(ews, expected_stderr=self._default_expected_stderr(ews), expected_exceptions=expected_exceptions)
+ def _test_committer_only_ews(self, ews):
+ ews.bind_to_tool(MockTool())
+ expected_stderr = self._default_expected_stderr(ews)
+ string_replacemnts = {"name": ews.name}
+ expected_stderr["process_work_item"] = "MOCK: update_status: %(name)s Error: %(name)s cannot process patches from non-committers :(\nMOCK: release_work_item: %(name)s 197\n" % string_replacemnts
+ expected_exceptions = {"handle_script_error": SystemExit}
+ self.assert_queue_outputs(ews, expected_stderr=expected_stderr, expected_exceptions=expected_exceptions)
+
# FIXME: If all EWSes are going to output the same text, we
# could test them all in one method with a for loop over an array.
def test_chromium_linux_ews(self):
@@ -78,19 +126,7 @@ class EarlyWarningSytemTest(QueuesTest):
self._test_ews(EflEWS())
def test_mac_ews(self):
- ews = MacEWS()
- expected_stderr = self._default_expected_stderr(ews)
- expected_stderr["process_work_item"] = "MOCK: update_status: mac-ews Error: mac-ews cannot process patches from non-committers :(\n"
- expected_exceptions = {
- "handle_script_error": SystemExit,
- }
- self.assert_queue_outputs(ews, expected_stderr=expected_stderr, expected_exceptions=expected_exceptions)
+ self._test_committer_only_ews(MacEWS())
def test_chromium_mac_ews(self):
- ews = ChromiumMacEWS()
- expected_stderr = self._default_expected_stderr(ews)
- expected_stderr["process_work_item"] = "MOCK: update_status: cr-mac-ews Error: cr-mac-ews cannot process patches from non-committers :(\n"
- expected_exceptions = {
- "handle_script_error": SystemExit,
- }
- self.assert_queue_outputs(ews, expected_stderr=expected_stderr, expected_exceptions=expected_exceptions)
+ self._test_committer_only_ews(ChromiumMacEWS())
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index 7b3002a..6b4213b 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -38,7 +38,7 @@ from datetime import datetime
from optparse import make_option
from StringIO import StringIO
-from webkitpy.common.net.bugzilla import CommitterValidator
+from webkitpy.common.net.bugzilla import CommitterValidator, Attachment
from webkitpy.common.net.layouttestresults import path_for_layout_test, LayoutTestResults
from webkitpy.common.net.statusserver import StatusServer
from webkitpy.common.system.executive import ScriptError
@@ -47,7 +47,7 @@ from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
from webkitpy.tool.bot.commitqueuetask import CommitQueueTask, CommitQueueTaskDelegate
from webkitpy.tool.bot.feeders import CommitQueueFeeder, EWSFeeder
from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
-from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.grammar import pluralize, join_with_separators
from webkitpy.tool.multicommandtool import Command, TryAgain
@@ -87,6 +87,11 @@ class AbstractQueue(Command, QueueEngineDelegate):
if self._options.port:
webkit_patch_args += ["--port=%s" % self._options.port]
webkit_patch_args.extend(args)
+ # FIXME: There is probably no reason to use run_and_throw_if_fail anymore.
+ # run_and_throw_if_fail was invented to support tee'd output
+ # (where we write both to a log file and to the console at once),
+ # but the queues don't need live-progress, a dump-of-output at the
+ # end should be sufficient.
return self._tool.executive.run_and_throw_if_fail(webkit_patch_args)
def _log_directory(self):
@@ -196,24 +201,40 @@ class AbstractPatchQueue(AbstractQueue):
def _update_status(self, message, patch=None, results_file=None):
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)
+ def _next_patch(self):
+ patch_id = self._tool.status_server.next_work_item(self.name)
+ if not patch_id:
+ return None
+ patch = self._tool.bugs.fetch_attachment(patch_id)
+ if not patch:
+ # FIXME: Using a fake patch because release_work_item has the wrong API.
+ # We also don't really need to release the lock (although that's fine),
+ # mostly we just need to remove this bogus patch from our queue.
+ # If for some reason bugzilla is just down, then it will be re-fed later.
+ patch = Attachment({'id': patch_id}, None)
+ self._release_work_item(patch)
+ return None
+ return patch
def _release_work_item(self, patch):
self._tool.status_server.release_work_item(self.name, patch)
def _did_pass(self, patch):
self._update_status(self._pass_status, patch)
+ self._release_work_item(patch)
def _did_fail(self, patch):
self._update_status(self._fail_status, patch)
+ self._release_work_item(patch)
def _did_retry(self, patch):
self._update_status(self._retry_status, patch)
+ self._release_work_item(patch)
def _did_error(self, patch, reason):
message = "%s: %s" % (self._error_status, reason)
self._update_status(message, patch)
+ self._release_work_item(patch)
def work_item_log_path(self, patch):
return os.path.join(self._log_directory(), "%s.log" % patch.bug_id())
@@ -229,10 +250,7 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
self.committer_validator = CommitterValidator(self._tool.bugs)
def next_work_item(self):
- patch_id = self._fetch_next_work_item()
- if not patch_id:
- return None
- return self._tool.bugs.fetch_attachment(patch_id)
+ return self._next_patch()
def should_proceed_with_work_item(self, patch):
patch_text = "rollout patch" if patch.is_rollout() else "patch"
@@ -251,7 +269,6 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
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)
- self._release_work_item(patch)
def _error_message_for_bug(self, status_id, script_error):
if not script_error.output:
@@ -297,13 +314,17 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
def _author_emails_for_tests(self, flaky_tests):
test_paths = map(path_for_layout_test, flaky_tests)
commit_infos = self._tool.checkout().recent_commit_infos_for_files(test_paths)
- return [commit_info.author().bugzilla_email() for commit_info in commit_infos if commit_info.author()]
+ return set([commit_info.author().bugzilla_email() for commit_info in commit_infos if commit_info.author()])
def report_flaky_tests(self, patch, flaky_tests):
- authors = self._author_emails_for_tests(flaky_tests)
- cc_explaination = " The author(s) of the test(s) have been CCed on this bug." if authors else ""
- message = "The %s encountered the following flaky tests while processing attachment %s:\n\n%s\n\nPlease file bugs against the tests.%s The commit-queue is continuing to process your patch." % (self.name, patch.id(), "\n".join(flaky_tests), cc_explaination)
- self._tool.bugs.post_comment_to_bug(patch.bug_id(), message, cc=authors)
+ message = "The %s encountered the following flaky tests while processing attachment %s:" % (self.name, patch.id())
+ message += "\n\n%s\n\n" % ("\n".join(flaky_tests))
+ message += "Please file bugs against the tests. "
+ author_emails = self._author_emails_for_tests(flaky_tests)
+ if author_emails:
+ message += "These tests were authored by %s. " % (join_with_separators(sorted(author_emails)))
+ message += "The commit-queue is continuing to process your patch."
+ self._tool.bugs.post_comment_to_bug(patch.bug_id(), message)
# StepSequenceErrorHandler methods
@@ -327,52 +348,6 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
raise TryAgain()
-# FIXME: All the Rietveld code is no longer used and should be deleted.
-class RietveldUploadQueue(AbstractPatchQueue, StepSequenceErrorHandler):
- name = "rietveld-upload-queue"
-
- def __init__(self):
- AbstractPatchQueue.__init__(self)
-
- # AbstractPatchQueue methods
-
- def next_work_item(self):
- patch_id = self._tool.bugs.queries.fetch_first_patch_from_rietveld_queue()
- if patch_id:
- return patch_id
- self._update_status("Empty queue")
-
- def should_proceed_with_work_item(self, patch):
- self._update_status("Uploading patch", patch)
- return True
-
- def process_work_item(self, patch):
- try:
- self.run_webkit_patch(["post-attachment-to-rietveld", "--force-clean", "--non-interactive", "--parent-command=rietveld-upload-queue", patch.id()])
- self._did_pass(patch)
- return True
- except ScriptError, e:
- if e.exit_code != QueueEngine.handled_error_code:
- self._did_fail(patch)
- raise e
-
- @classmethod
- def _reject_patch(cls, tool, patch_id):
- tool.bugs.set_flag_on_attachment(patch_id, "in-rietveld", "-")
-
- def handle_unexpected_error(self, patch, message):
- log(message)
- self._reject_patch(self._tool, patch.id())
-
- # StepSequenceErrorHandler methods
-
- @classmethod
- def handle_script_error(cls, tool, state, script_error):
- log(script_error.message_with_output())
- cls._update_status_for_script_error(tool, state, script_error)
- cls._reject_patch(tool, state["patch"].id())
-
-
class AbstractReviewQueue(AbstractPatchQueue, StepSequenceErrorHandler):
"""This is the base-class for the EWS queues and the style-queue."""
def __init__(self, options=None):
@@ -387,10 +362,7 @@ class AbstractReviewQueue(AbstractPatchQueue, StepSequenceErrorHandler):
AbstractPatchQueue.begin_work_queue(self)
def next_work_item(self):
- patch_id = self._fetch_next_work_item()
- if not patch_id:
- return None
- return self._tool.bugs.fetch_attachment(patch_id)
+ return self._next_patch()
def should_proceed_with_work_item(self, patch):
raise NotImplementedError("subclasses must implement")
@@ -404,9 +376,11 @@ class AbstractReviewQueue(AbstractPatchQueue, StepSequenceErrorHandler):
except ScriptError, e:
if e.exit_code != QueueEngine.handled_error_code:
self._did_fail(patch)
+ else:
+ # The subprocess handled the error, but won't have released the patch, so we do.
+ # FIXME: We need to simplify the rules by which _release_work_item is called.
+ self._release_work_item(patch)
raise e
- finally:
- self._release_work_item(patch)
def handle_unexpected_error(self, patch, message):
log(message)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index b37b5dc..b45db7b 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -29,12 +29,13 @@
import os
from webkitpy.common.checkout.scm import CheckoutNeedsUpdate
+from webkitpy.common.config.committers import Committer
from webkitpy.common.net.bugzilla import Attachment
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.thirdparty.mock import Mock
from webkitpy.tool.commands.commandtest import CommandsTest
from webkitpy.tool.commands.queues import *
-from webkitpy.tool.commands.queuestest import QueuesTest, MockPatch
+from webkitpy.tool.commands.queuestest import QueuesTest
from webkitpy.tool.commands.stepsequence import StepSequence
from webkitpy.tool.mocktool import MockTool, MockSCM, MockStatusServer
@@ -51,11 +52,6 @@ class TestFeederQueue(FeederQueue):
_sleep_duration = 0
-class MockRolloutPatch(MockPatch):
- def is_rollout(self):
- return True
-
-
class AbstractQueueTest(CommandsTest):
def test_log_directory(self):
self.assertEquals(TestQueue()._log_directory(), "test-queue-logs")
@@ -144,15 +140,19 @@ MOCK: submit_to_ews: 103
class AbstractPatchQueueTest(CommandsTest):
- def test_fetch_next_work_item(self):
+ def test_next_patch(self):
queue = AbstractPatchQueue()
tool = MockTool()
queue.bind_to_tool(tool)
queue._options = Mock()
queue._options.port = None
- self.assertEquals(queue._fetch_next_work_item(), None)
- tool.status_server = MockStatusServer(work_items=[2, 1, 3])
- self.assertEquals(queue._fetch_next_work_item(), 2)
+ self.assertEquals(queue._next_patch(), None)
+ tool.status_server = MockStatusServer(work_items=[2, 197])
+ expected_stdout = "MOCK: fetch_attachment: 2 is not a known attachment id\n" # A mock-only message to prevent us from making mistakes.
+ expected_stderr = "MOCK: release_work_item: None 2\n"
+ patch_id = OutputCapture().assert_outputs(self, queue._next_patch, [], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+ self.assertEquals(patch_id, None) # 2 is an invalid patch id
+ self.assertEquals(queue._next_patch().id(), 197)
class NeedsUpdateSequence(StepSequence):
@@ -198,6 +198,19 @@ class SecondThoughtsCommitQueue(CommitQueue):
return Attachment(attachment_dictionary, None)
+# Creating fake CommitInfos is a pain, so we use a mock one here.
+class MockCommitInfo(object):
+ def __init__(self, author_email):
+ self._author_email = author_email
+
+ def author(self):
+ # It's definitely possible to have commits with authors who
+ # are not in our committers.py list.
+ if not self._author_email:
+ return None
+ return Committer("Mock Committer", self._author_email)
+
+
class CommitQueueTest(QueuesTest):
def test_commit_queue(self):
expected_stderr = {
@@ -209,6 +222,7 @@ 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
+MOCK: release_work_item: commit-queue 197
""",
"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",
@@ -243,15 +257,16 @@ MOCK: release_work_item: commit-queue 197
"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 run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
+ "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', 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-style=both', '--quiet']
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both']
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 run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--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 run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
MOCK: update_status: commit-queue Landed patch
MOCK: update_status: commit-queue Pass
+MOCK: release_work_item: commit-queue 197
""",
"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",
@@ -261,22 +276,22 @@ MOCK: update_status: commit-queue Pass
def test_rollout_lands(self):
tool = MockTool(log_executive=True)
tool.buildbot.light_tree_on_fire()
- rollout_patch = MockRolloutPatch()
+ rollout_patch = tool.bugs.fetch_attachment(106) # _patch6, a rollout patch.
+ assert(rollout_patch.is_rollout())
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 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]
+ "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', 106]
MOCK: update_status: commit-queue Applied patch
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both', '--quiet']
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both']
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 run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 106]
MOCK: update_status: commit-queue Landed patch
MOCK: update_status: commit-queue Pass
+MOCK: release_work_item: commit-queue 106
""",
- "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_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '106' with comment 'Rejecting patch 106 from commit-queue.' and additional comment 'Mock 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)
@@ -307,23 +322,36 @@ MOCK: update_status: commit-queue Passed tests
MOCK: update_status: commit-queue Retry
MOCK: release_work_item: commit-queue 197
"""
- OutputCapture().assert_outputs(self, queue.process_work_item, [MockPatch()], expected_stderr=expected_stderr)
+ OutputCapture().assert_outputs(self, queue.process_work_item, [QueuesTest.mock_work_item], expected_stderr=expected_stderr)
+
+ def _assert_emails_for_tests(self, emails):
+ queue = CommitQueue()
+ tool = MockTool()
+ queue.bind_to_tool(tool)
+ commit_infos = [MockCommitInfo(email) for email in emails]
+ tool.checkout().recent_commit_infos_for_files = lambda paths: set(commit_infos)
+ self.assertEqual(queue._author_emails_for_tests([]), set(emails))
+
+ def test_author_emails_for_tests(self):
+ self._assert_emails_for_tests([])
+ self._assert_emails_for_tests(["test1@test.com", "test1@test.com"])
+ self._assert_emails_for_tests(["test1@test.com", "test2@test.com"])
def test_report_flaky_tests(self):
queue = CommitQueue()
queue.bind_to_tool(MockTool())
- expected_stderr = """MOCK bug comment: bug_id=142, cc=['abarth@webkit.org']
+ expected_stderr = """MOCK bug comment: bug_id=42, cc=None
--- Begin comment ---
The commit-queue encountered the following flaky tests while processing attachment 197:
foo/bar.html
bar/baz.html
-Please file bugs against the tests. The author(s) of the test(s) have been CCed on this bug. The commit-queue is continuing to process your patch.
+Please file bugs against the tests. These tests were authored by abarth@webkit.org. The commit-queue is continuing to process your patch.
--- End comment ---
"""
- OutputCapture().assert_outputs(self, queue.report_flaky_tests, [MockPatch(), ["foo/bar.html", "bar/baz.html"]], expected_stderr=expected_stderr)
+ OutputCapture().assert_outputs(self, queue.report_flaky_tests, [QueuesTest.mock_work_item, ["foo/bar.html", "bar/baz.html"]], expected_stderr=expected_stderr)
def test_layout_test_results(self):
queue = CommitQueue()
@@ -333,17 +361,6 @@ Please file bugs against the tests. The author(s) of the test(s) have been CCed
queue._read_file_contents = lambda path: ""
self.assertEquals(queue.layout_test_results(), None)
-class RietveldUploadQueueTest(QueuesTest):
- def test_rietveld_upload_queue(self):
- expected_stderr = {
- "begin_work_queue": self._default_begin_work_queue_stderr("rietveld-upload-queue", MockSCM.fake_checkout_root),
- "should_proceed_with_work_item": "MOCK: update_status: rietveld-upload-queue Uploading patch\n",
- "process_work_item": "MOCK: update_status: rietveld-upload-queue Pass\n",
- "handle_unexpected_error": "Mock error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '197' with comment 'None' and additional comment 'None'\n",
- "handle_script_error": "ScriptError error message\nMOCK: update_status: rietveld-upload-queue ScriptError error message\nMOCK setting flag 'in-rietveld' to '-' on attachment '197' with comment 'None' and additional comment 'None'\n",
- }
- self.assert_queue_outputs(RietveldUploadQueue(), expected_stderr=expected_stderr)
-
class StyleQueueTest(QueuesTest):
def test_style_queue(self):
@@ -353,7 +370,7 @@ class StyleQueueTest(QueuesTest):
"should_proceed_with_work_item": "MOCK: update_status: style-queue Checking style\n",
"process_work_item": "MOCK: update_status: style-queue Pass\nMOCK: release_work_item: style-queue 197\n",
"handle_unexpected_error": "Mock error message\n",
- "handle_script_error": "MOCK: update_status: style-queue ScriptError error message\nMOCK bug comment: bug_id=142, cc=[]\n--- Begin comment ---\nAttachment 197 did not pass style-queue:\n\nScriptError error message\n\nIf any of these errors are false positives, please file a bug against check-webkit-style.\n--- End comment ---\n\n",
+ "handle_script_error": "MOCK: update_status: style-queue ScriptError error message\nMOCK bug comment: bug_id=42, cc=[]\n--- Begin comment ---\nAttachment 197 did not pass style-queue:\n\nScriptError error message\n\nIf any of these errors are false positives, please file a bug against check-webkit-style.\n--- End comment ---\n\n",
}
expected_exceptions = {
"handle_script_error": SystemExit,
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
index 379d380..6455617 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
@@ -44,25 +44,9 @@ class MockQueueEngine(object):
pass
-class MockPatch():
- def id(self):
- return 197
-
- def bug_id(self):
- return 142
-
- def is_rollout(self):
- return False
-
-
class QueuesTest(unittest.TestCase):
- # Ids match patch1 in mocktool.py
- mock_work_item = Attachment({
- "id": 197,
- "bug_id": 142,
- "name": "Patch",
- "attacher_email": "adam@example.com",
- }, None)
+ # This is _patch1 in mocktool.py
+ mock_work_item = MockTool().bugs.fetch_attachment(197)
def assert_outputs(self, func, func_name, args, expected_stdout, expected_stderr, expected_exceptions):
exception = None
@@ -108,4 +92,4 @@ class QueuesTest(unittest.TestCase):
self.assert_outputs(queue.handle_unexpected_error, "handle_unexpected_error", [work_item, "Mock error message"], 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)
+ self.assert_outputs(queue.handle_script_error, "handle_script_error", [tool, {"patch": self.mock_work_item}, ScriptError(message="ScriptError error message", script_args="MockErrorCommand")], expected_stdout, expected_stderr, expected_exceptions)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
index 32eb016..4db463e 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
@@ -38,9 +38,10 @@ class SheriffBotTest(QueuesTest):
builder2 = MockBuilder("Builder2")
def test_sheriff_bot(self):
- mock_work_item = MockFailureMap(MockTool().buildbot)
+ tool = MockTool()
+ mock_work_item = MockFailureMap(tool.buildbot)
expected_stderr = {
- "begin_work_queue": self._default_begin_work_queue_stderr("sheriff-bot", os.getcwd()),
+ "begin_work_queue": self._default_begin_work_queue_stderr("sheriff-bot", tool.scm().checkout_root),
"next_work_item": "",
"process_work_item": """MOCK: irc.post: abarth, darin, eseidel: http://trac.webkit.org/changeset/29837 might have broken Builder1
MOCK bug comment: bug_id=42, cc=['abarth@webkit.org', 'eric@webkit.org']
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
index 107d8db..ed91f5a 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
@@ -152,7 +152,9 @@ class AbstractPatchUploadingCommand(AbstractSequencedCommand):
# Perfer a bug id passed as an argument over a bug url in the diff (i.e. ChangeLogs).
bug_id = args and args[0]
if not bug_id:
- bug_id = tool.checkout().bug_id_for_this_commit(options.git_commit)
+ changed_files = self._tool.scm().changed_files(options.git_commit)
+ state["changed_files"] = changed_files
+ bug_id = tool.checkout().bug_id_for_this_commit(options.git_commit, changed_files)
return bug_id
def _prepare_state(self, options, args, tool):
@@ -171,6 +173,7 @@ class Post(AbstractPatchUploadingCommand):
steps.CheckStyle,
steps.ConfirmDiff,
steps.ObsoletePatches,
+ steps.SuggestReviewers,
steps.PostDiff,
]
@@ -219,6 +222,7 @@ class Upload(AbstractPatchUploadingCommand):
steps.EditChangeLog,
steps.ConfirmDiff,
steps.ObsoletePatches,
+ steps.SuggestReviewers,
steps.PostDiff,
]
long_help = """upload uploads the current diff to bugs.webkit.org.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
index 0d096b6..bd1fbd6 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
@@ -58,6 +58,7 @@ class UploadCommandsTest(CommandsTest):
options.description = "MOCK description"
options.request_commit = False
options.review = True
+ options.suggest_reviewers = False
expected_stderr = """Running check-webkit-style
MOCK: user.open_url: file://...
Obsoleting 2 old patches on bug 42
@@ -67,7 +68,8 @@ None
-- End comment --
MOCK: user.open_url: http://example.com/42
"""
- self.assert_execute_outputs(Post(), [42], options=options, expected_stderr=expected_stderr)
+ expected_stdout = "Was that diff correct?\n"
+ self.assert_execute_outputs(Post(), [42], options=options, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
def test_land_safely(self):
expected_stderr = "Obsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n-- Begin comment --\nNone\n-- End comment --\n"
@@ -88,6 +90,7 @@ MOCK: user.open_url: http://example.com/42
options.description = "MOCK description"
options.request_commit = False
options.review = True
+ options.suggest_reviewers = False
expected_stderr = """Running check-webkit-style
MOCK: user.open_url: file://...
Obsoleting 2 old patches on bug 42
@@ -97,7 +100,8 @@ None
-- End comment --
MOCK: user.open_url: http://example.com/42
"""
- self.assert_execute_outputs(Upload(), [42], options=options, expected_stderr=expected_stderr)
+ expected_stdout = "Was that diff correct?\n"
+ self.assert_execute_outputs(Upload(), [42], options=options, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
def test_mark_bug_fixed(self):
tool = MockTool()
@@ -106,7 +110,8 @@ MOCK: user.open_url: http://example.com/42
options.bug_id = 42
options.comment = "MOCK comment"
expected_stderr = "Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.\nRevision: 9876\nMOCK: user.open_url: http://example.com/42\nAdding comment to Bug 42.\nMOCK bug comment: bug_id=42, cc=None\n--- Begin comment ---\nMOCK comment\n\nCommitted r9876: <http://trac.webkit.org/changeset/9876>\n--- End comment ---\n\n"
- self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
+ expected_stdout = "Is this correct?\n"
+ self.assert_execute_outputs(MarkBugFixed(), [], expected_stdout=expected_stdout, expected_stderr=expected_stderr, tool=tool, options=options)
def test_edit_changelog(self):
self.assert_execute_outputs(EditChangeLogs(), [])
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
index ce6666e..e0862c5 100755
--- a/WebKitTools/Scripts/webkitpy/tool/main.py
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -37,7 +37,6 @@ from webkitpy.common.checkout.scm import default_scm
from webkitpy.common.config.ports import WebKitPort
from webkitpy.common.net.bugzilla import Bugzilla
from webkitpy.common.net.buildbot import BuildBot
-from webkitpy.common.net.rietveld import Rietveld
from webkitpy.common.net.irc.ircproxy import IRCProxy
from webkitpy.common.system.executive import Executive
from webkitpy.common.system.user import User
@@ -79,7 +78,6 @@ class WebKitPatch(MultiCommandTool):
self._scm = None
self._checkout = None
self.status_server = StatusServer()
- self.codereview = Rietveld(self.executive)
self.port_factory = port.factory
def scm(self):
@@ -126,7 +124,6 @@ class WebKitPatch(MultiCommandTool):
if options.dry_run:
self.scm().dryrun = True
self.bugs.dryrun = True
- self.codereview.dryrun = True
if options.status_host:
self.status_server.set_host(options.status_host)
if options.bot_id:
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index 05b30dd..af232d9 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -33,7 +33,6 @@ from webkitpy.common.config.committers import CommitterList, Reviewer
from webkitpy.common.checkout.commitinfo import CommitInfo
from webkitpy.common.checkout.scm import CommitMessage
from webkitpy.common.net.bugzilla import Bug, Attachment
-from webkitpy.common.net.rietveld import Rietveld
from webkitpy.thirdparty.mock import Mock
from webkitpy.common.system.deprecated_logging import log
@@ -86,7 +85,6 @@ _patch3 = {
"name": "Patch3",
"is_obsolete": False,
"is_patch": True,
- "in-rietveld": "?",
"review": "?",
"attacher_email": "eric@webkit.org",
}
@@ -113,7 +111,6 @@ _patch5 = {
"name": "Patch5",
"is_obsolete": False,
"is_patch": True,
- "in-rietveld": "?",
"review": "+",
"reviewer_email": "foo@bar.com",
"attacher_email": "eric@webkit.org",
@@ -127,7 +124,6 @@ _patch6 = { # Valid committer, but no reviewer.
"name": "ROLLOUT of r3489",
"is_obsolete": False,
"is_patch": True,
- "in-rietveld": "-",
"commit-queue": "+",
"committer_email": "foo@bar.com",
"attacher_email": "eric@webkit.org",
@@ -141,7 +137,6 @@ _patch7 = { # Valid review, patch is marked obsolete.
"name": "Patch7",
"is_obsolete": True,
"is_patch": True,
- "in-rietveld": "+",
"review": "+",
"reviewer_email": "foo@bar.com",
"attacher_email": "eric@webkit.org",
@@ -192,6 +187,7 @@ _bug4 = {
}
+# FIXME: This should not inherit from Mock
class MockBugzillaQueries(Mock):
def __init__(self, bugzilla):
@@ -229,18 +225,14 @@ class MockBugzillaQueries(Mock):
def fetch_patches_from_pending_commit_list(self):
return sum([bug.reviewed_patches() for bug in self._all_bugs()], [])
- def fetch_first_patch_from_rietveld_queue(self):
- for bug in self._all_bugs():
- patches = bug.in_rietveld_queue_patches()
- if len(patches):
- return patches[0]
- raise Exception('No patches in the rietveld queue')
+
+_mock_reviewer = Reviewer("Foo Bar", "foo@bar.com")
+
# FIXME: Bugzilla is the wrong Mock-point. Once we have a BugzillaNetwork
# class we should mock that instead.
# Most of this class is just copy/paste from Bugzilla.
-
-
+# FIXME: This should not inherit from Mock
class MockBugzilla(Mock):
bug_server_url = "http://example.com"
@@ -258,7 +250,7 @@ class MockBugzilla(Mock):
def __init__(self):
Mock.__init__(self)
self.queries = MockBugzillaQueries(self)
- self.committers = CommitterList(reviewers=[Reviewer("Foo Bar", "foo@bar.com")])
+ self.committers = CommitterList(reviewers=[_mock_reviewer])
self._override_patch = None
def create_bug(self,
@@ -288,8 +280,10 @@ class MockBugzilla(Mock):
if self._override_patch:
return self._override_patch
- # This could be changed to .get() if we wish to allow failed lookups.
- attachment_dictionary = self.attachment_cache[attachment_id]
+ attachment_dictionary = self.attachment_cache.get(attachment_id)
+ if not attachment_dictionary:
+ print "MOCK: fetch_attachment: %s is not a known attachment id" % attachment_id
+ return None
bug = self.fetch_bug(attachment_dictionary["bug_id"])
for attachment in bug.attachments(include_obsolete=True):
if attachment.id() == int(attachment_id):
@@ -418,6 +412,7 @@ class MockBuildBot(object):
return MockFailureMap(self)
+# FIXME: This should not inherit from Mock
class MockSCM(Mock):
fake_checkout_root = os.path.realpath("/tmp") # realpath is needed to allow for Mac OS X's /private/tmp
@@ -480,7 +475,7 @@ class MockCheckout(object):
# that LandDiff will try to actually read the patch from disk!
return []
- def commit_message_for_this_commit(self, git_commit):
+ def commit_message_for_this_commit(self, git_commit, changed_files=None):
commit_message = Mock()
commit_message.message = lambda:"This is a fake commit message that is at least 50 characters."
return commit_message
@@ -491,6 +486,9 @@ class MockCheckout(object):
def apply_reverse_diff(self, revision):
pass
+ def suggested_reviewers(self, git_commit, changed_files=None):
+ return [_mock_reviewer]
+
class MockUser(object):
@@ -508,6 +506,7 @@ class MockUser(object):
pass
def confirm(self, message=None, default='y'):
+ print message
return default == 'y'
def can_open_url(self):
@@ -545,7 +544,7 @@ class MockStatusServer(object):
def next_work_item(self, queue_name):
if not self._work_items:
return None
- return self._work_items[0]
+ return self._work_items.pop(0)
def release_work_item(self, queue_name, patch):
log("MOCK: release_work_item: %s %s" % (queue_name, patch.id()))
@@ -568,7 +567,8 @@ class MockStatusServer(object):
return "http://dummy_url"
-class MockExecute(Mock):
+# FIXME: This should not inherit from Mock
+class MockExecutive(Mock):
def __init__(self, should_log):
self._should_log = should_log
@@ -603,47 +603,37 @@ class MockOptions(object):
self.__dict__[key] = value
-class MockRietveld():
-
- def __init__(self, executive, dryrun=False):
- pass
-
- def post(self, diff, patch_id, codereview_issue, message=None, cc=None):
- log("MOCK: Uploading patch to rietveld")
-
-
-class MockTestPort1():
+class MockTestPort1(object):
def skips_layout_test(self, test_name):
return test_name in ["media/foo/bar.html", "foo"]
-class MockTestPort2():
+class MockTestPort2(object):
def skips_layout_test(self, test_name):
return test_name == "media/foo/bar.html"
-class MockPortFactory():
+class MockPortFactory(object):
def get_all(self, options=None):
return {"test_port1": MockTestPort1(), "test_port2": MockTestPort2()}
-class MockTool():
+class MockTool(object):
def __init__(self, log_executive=False):
self.wakeup_event = threading.Event()
self.bugs = MockBugzilla()
self.buildbot = MockBuildBot()
- self.executive = MockExecute(should_log=log_executive)
+ self.executive = MockExecutive(should_log=log_executive)
self._irc = None
self.user = MockUser()
self._scm = MockSCM()
self._checkout = MockCheckout()
self.status_server = MockStatusServer()
self.irc_password = "MOCK irc password"
- self.codereview = MockRietveld(self.executive)
self.port_factory = MockPortFactory()
def scm(self):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py b/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
index d59cdc5..64d9d05 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
@@ -44,7 +44,6 @@ from webkitpy.tool.steps.ensurebuildersaregreen import EnsureBuildersAreGreen
from webkitpy.tool.steps.ensurelocalcommitifneeded import EnsureLocalCommitIfNeeded
from webkitpy.tool.steps.obsoletepatches import ObsoletePatches
from webkitpy.tool.steps.options import Options
-from webkitpy.tool.steps.postcodereview import PostCodeReview
from webkitpy.tool.steps.postdiff import PostDiff
from webkitpy.tool.steps.postdiffforcommit import PostDiffForCommit
from webkitpy.tool.steps.postdiffforrevert import PostDiffForRevert
@@ -54,6 +53,7 @@ from webkitpy.tool.steps.promptforbugortitle import PromptForBugOrTitle
from webkitpy.tool.steps.reopenbugafterrollout import ReopenBugAfterRollout
from webkitpy.tool.steps.revertrevision import RevertRevision
from webkitpy.tool.steps.runtests import RunTests
+from webkitpy.tool.steps.suggestreviewers import SuggestReviewers
from webkitpy.tool.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
from webkitpy.tool.steps.update import Update
from webkitpy.tool.steps.validatereviewer import ValidateReviewer
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
index 835fdba..4f17dd3 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -54,5 +54,6 @@ class Options(object):
request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.")
+ suggest_reviewers = make_option("--suggest-reviewers", action="store_true", default=False, help="Offer to CC appropriate reviewers.")
test = make_option("--test", action="store_true", dest="test", default=False, help="Run run-webkit-tests before committing.")
update = make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory.")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py b/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
index 81b6bcb..bbb794c 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
@@ -32,3 +32,4 @@ from webkitpy.tool.steps.abstractstep import AbstractStep
class RevertRevision(AbstractStep):
def run(self, state):
self._tool.checkout().apply_reverse_diff(state["revision"])
+ self.did_modify_checkout(state)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
index dcbfc44..282e381 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
@@ -57,6 +57,7 @@ class RunTests(AbstractStep):
log("Running run-webkit-tests")
args = self._tool.port().run_webkit_tests_command()
if self._options.non_interactive:
+ args.append("--no-new-test-results")
args.append("--no-launch-safari")
args.append("--exit-after-n-failures=1")
args.append("--wait-for-httpd")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
index 7eb8e3a..eabb656 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
@@ -87,6 +87,6 @@ MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitperl']
Running JavaScriptCore tests
MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-javascriptcore-tests']
Running run-webkit-tests
-MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--wait-for-httpd', '--ignore-tests', 'compositing,media', '--quiet']
+MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-new-test-results', '--no-launch-safari', '--exit-after-n-failures=1', '--wait-for-httpd', '--ignore-tests', 'compositing,media', '--quiet']
"""
OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py
index d2f79f3..76bef35 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/postcodereview.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py
@@ -30,41 +30,22 @@ from webkitpy.tool.steps.abstractstep import AbstractStep
from webkitpy.tool.steps.options import Options
-class PostCodeReview(AbstractStep):
+class SuggestReviewers(AbstractStep):
@classmethod
def options(cls):
return AbstractStep.options() + [
- Options.cc,
- Options.description,
+ Options.git_commit,
+ Options.suggest_reviewers,
]
def run(self, state):
- patch = state.get("patch")
- bug_id = patch.bug_id()
- title = patch.name()
+ if not self._options.suggest_reviewers:
+ return
- # If the issue already exists, then the message becomes the label
- # of the new patch. Otherwise, it becomes the title of the whole
- # issue.
- if title:
- # This is the common case for the the first "upload" command.
- message = title
- elif bug_id:
- # This is the common case for the "post" command and
- # subsequent runs of the "upload" command.
- message = "Code review for %s" % self._tool.bugs.bug_url_for_bug_id(bug_id)
- else:
- # Unreachable with our current commands, but we might hit
- # this case if we support bug-less code reviews.
- message = "Code review"
-
- # Use the bug ID as the rietveld issue number. This means rietveld code reviews
- # when there are multiple different patches on a bug will be a bit wonky, but
- # webkit-patch assumes one-patch-per-bug.
- created_issue = self._tool.codereview.post(diff=self.cached_lookup(state, "diff"),
- message=message,
- codereview_issue=bug_id,
- cc=self._options.cc,
- patch_id=patch.id())
-
- self._tool.bugs.set_flag_on_attachment(patch.id(), 'in-rietveld', '+')
+ reviewers = self._tool.checkout().suggested_reviewers(self._options.git_commit, self._changed_files(state))
+ print "The following reviewers have recently modified files in your patch:"
+ print "\n".join([reviewer.full_name for reviewer in reviewers])
+ if not self._tool.user.confirm("Would you like to CC them?"):
+ return
+ reviewer_emails = [reviewer.bugzilla_email() for reviewer in reviewers]
+ self._tool.bugs.add_cc_to_bug(state['bug_id'], reviewer_emails)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py
new file mode 100644
index 0000000..0c86535
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py
@@ -0,0 +1,45 @@
+# 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.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.suggestreviewers import SuggestReviewers
+
+
+class SuggestReviewersTest(unittest.TestCase):
+ def test_disabled(self):
+ step = SuggestReviewers(MockTool(), MockOptions(suggest_reviewers=False))
+ OutputCapture().assert_outputs(self, step.run, [{}])
+
+ def test_basic(self):
+ capture = OutputCapture()
+ step = SuggestReviewers(MockTool(), MockOptions(suggest_reviewers=True, git_commit=None))
+ expected_stdout = "The following reviewers have recently modified files in your patch:\nFoo Bar\nWould you like to CC them?\n"
+ capture.assert_outputs(self, step.run, [{"bug_id": "123"}], expected_stdout=expected_stdout)
diff --git a/WebKitTools/TestResultServer/handlers/testfilehandler.py b/WebKitTools/TestResultServer/handlers/testfilehandler.py
index 4d1320f..d817890 100644
--- a/WebKitTools/TestResultServer/handlers/testfilehandler.py
+++ b/WebKitTools/TestResultServer/handlers/testfilehandler.py
@@ -36,6 +36,7 @@ from google.appengine.ext.webapp import template
from model.jsonresults import JsonResults
from model.testfile import TestFile
+PARAM_MASTER = "master"
PARAM_BUILDER = "builder"
PARAM_DIR = "dir"
PARAM_FILE = "file"
@@ -51,25 +52,26 @@ class DeleteFile(webapp.RequestHandler):
def get(self):
key = self.request.get(PARAM_KEY)
+ master = self.request.get(PARAM_MASTER)
builder = self.request.get(PARAM_BUILDER)
test_type = self.request.get(PARAM_TEST_TYPE)
name = self.request.get(PARAM_NAME)
logging.debug(
- "Deleting File, builder: %s, test_type: %s, name: %s, key: %s.",
- builder, test_type, name, key)
+ "Deleting File, master: %s, builder: %s, test_type: %s, name: %s, key: %s.",
+ master, builder, test_type, name, key)
- TestFile.delete_file(key, builder, test_type, name, 100)
+ TestFile.delete_file(key, master, builder, test_type, name, 100)
# Display file list after deleting the file.
- self.redirect("/testfile?builder=%s&testtype=%s&name=%s"
- % (builder, test_type, name))
+ self.redirect("/testfile?master=%s&builder=%s&testtype=%s&name=%s"
+ % (master, builder, test_type, name))
class GetFile(webapp.RequestHandler):
"""Get file content or list of files for given builder and name."""
- def _get_file_list(self, builder, test_type, name):
+ def _get_file_list(self, master, builder, test_type, name):
"""Get and display a list of files that matches builder and file name.
Args:
@@ -79,15 +81,16 @@ class GetFile(webapp.RequestHandler):
"""
files = TestFile.get_files(
- builder, test_type, name, load_data=False, limit=100)
+ master, builder, test_type, name, load_data=False, limit=100)
if not files:
- logging.info("File not found, builder: %s, test_type: %s, name: %s.",
- builder, test_type, name)
+ logging.info("File not found, master: %s, builder: %s, test_type: %s, name: %s.",
+ master, builder, test_type, name)
self.response.out.write("File not found")
return
template_values = {
"admin": users.is_current_user_admin(),
+ "master": master,
"builder": builder,
"test_type": test_type,
"name": name,
@@ -96,7 +99,7 @@ class GetFile(webapp.RequestHandler):
self.response.out.write(template.render("templates/showfilelist.html",
template_values))
- def _get_file_content(self, builder, test_type, name):
+ def _get_file_content(self, master, builder, test_type, name):
"""Return content of the file that matches builder and file name.
Args:
@@ -106,15 +109,15 @@ class GetFile(webapp.RequestHandler):
"""
files = TestFile.get_files(
- builder, test_type, name, load_data=True, limit=1)
+ master, builder, test_type, name, load_data=True, limit=1)
if not files:
- logging.info("File not found, builder: %s, test_type: %s, name: %s.",
- builder, test_type, name)
+ logging.info("File not found, master %s, builder: %s, test_type: %s, name: %s.",
+ master, builder, test_type, name)
return None
return files[0].data
- def _get_test_list_json(self, builder, test_type):
+ def _get_test_list_json(self, master, builder, test_type):
"""Return json file with test name list only, do not include test
results and other non-test-data .
@@ -123,13 +126,14 @@ class GetFile(webapp.RequestHandler):
test_type: type of test results.
"""
- json = self._get_file_content(builder, test_type, "results.json")
+ json = self._get_file_content(master, builder, test_type, "results.json")
if not json:
return None
return JsonResults.get_test_list(builder, json)
def get(self):
+ master = self.request.get(PARAM_MASTER)
builder = self.request.get(PARAM_BUILDER)
test_type = self.request.get(PARAM_TEST_TYPE)
name = self.request.get(PARAM_NAME)
@@ -137,19 +141,19 @@ class GetFile(webapp.RequestHandler):
test_list_json = self.request.get(PARAM_TEST_LIST_JSON)
logging.debug(
- "Getting files, builder: %s, test_type: %s, name: %s.",
- builder, test_type, name)
+ "Getting files, master %s, builder: %s, test_type: %s, name: %s.",
+ master, builder, test_type, name)
# If parameter "dir" is specified or there is no builder or filename
# specified in the request, return list of files, otherwise, return
# file content.
if dir or not builder or not name:
- return self._get_file_list(builder, test_type, name)
+ return self._get_file_list(master, builder, test_type, name)
if name == "results.json" and test_list_json:
- json = self._get_test_list_json(builder, test_type)
+ json = self._get_test_list_json(master, builder, test_type)
else:
- json = self._get_file_content(builder, test_type, name)
+ json = self._get_file_content(master, builder, test_type, name)
if json:
self.response.headers["Content-Type"] = "text/plain; charset=utf-8"
@@ -170,12 +174,13 @@ class Upload(webapp.RequestHandler):
self.response.out.write("FAIL: missing builder parameter.")
return
+ master = self.request.get(PARAM_MASTER)
test_type = self.request.get(PARAM_TEST_TYPE)
incremental = self.request.get(PARAM_INCREMENTAL)
logging.debug(
- "Processing upload request, builder: %s, test_type: %s.",
- builder, test_type)
+ "Processing upload request, master: %s, builder: %s, test_type: %s.",
+ master, builder, test_type)
# There are two possible types of each file_params in the request:
# one file item or a list of file items.
@@ -193,15 +198,15 @@ class Upload(webapp.RequestHandler):
if ((incremental and filename == "results.json") or
(filename == "incremental_results.json")):
# Merge incremental json results.
- saved_file = JsonResults.update(builder, test_type, file.value)
+ saved_file = JsonResults.update(master, builder, test_type, file.value)
else:
saved_file = TestFile.update(
- builder, test_type, file.filename, file.value)
+ master, builder, test_type, file.filename, file.value)
if not saved_file:
errors.append(
- "Upload failed, builder: %s, test_type: %s, name: %s." %
- (builder, test_type, file.filename))
+ "Upload failed, master: %s, builder: %s, test_type: %s, name: %s." %
+ (master, builder, test_type, file.filename))
if errors:
messages = "FAIL: " + "; ".join(errors)
diff --git a/WebKitTools/TestResultServer/index.yaml b/WebKitTools/TestResultServer/index.yaml
index 50284dc..a7d3e48 100644
--- a/WebKitTools/TestResultServer/index.yaml
+++ b/WebKitTools/TestResultServer/index.yaml
@@ -25,6 +25,15 @@ indexes:
- kind: TestFile
properties:
- name: builder
+ - name: master
+ - name: name
+ - name: test_type
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: builder
- name: name
- name: date
direction: desc
@@ -39,6 +48,12 @@ indexes:
- kind: TestFile
properties:
+ - name: master
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
- name: name
- name: date
direction: desc
diff --git a/WebKitTools/TestResultServer/model/jsonresults.py b/WebKitTools/TestResultServer/model/jsonresults.py
index 4520e96..97b277a 100755
--- a/WebKitTools/TestResultServer/model/jsonresults.py
+++ b/WebKitTools/TestResultServer/model/jsonresults.py
@@ -33,6 +33,7 @@ import logging
from model.testfile import TestFile
JSON_RESULTS_FILE = "results.json"
+JSON_RESULTS_FILE_SMALL = "results-small.json"
JSON_RESULTS_PREFIX = "ADD_RESULTS("
JSON_RESULTS_SUFFIX = ");"
JSON_RESULTS_VERSION_KEY = "version"
@@ -45,6 +46,7 @@ JSON_RESULTS_NO_DATA = "N"
JSON_RESULTS_MIN_TIME = 1
JSON_RESULTS_VERSION = 3
JSON_RESULTS_MAX_BUILDS = 1500
+JSON_RESULTS_MAX_BUILDS_SMALL = 200
class JsonResults(object):
@@ -106,7 +108,7 @@ class JsonResults(object):
return None
@classmethod
- def _merge_json(cls, aggregated_json, incremental_json):
+ def _merge_json(cls, aggregated_json, incremental_json, num_runs):
"""Merge incremental json into aggregated json results.
Args:
@@ -120,19 +122,19 @@ class JsonResults(object):
# Merge non tests property data.
# Tests properties are merged in _merge_tests.
- if not cls._merge_non_test_data(aggregated_json, incremental_json):
+ if not cls._merge_non_test_data(aggregated_json, incremental_json, num_runs):
return False
# Merge tests results and times
incremental_tests = incremental_json[JSON_RESULTS_TESTS]
if incremental_tests:
aggregated_tests = aggregated_json[JSON_RESULTS_TESTS]
- cls._merge_tests(aggregated_tests, incremental_tests)
+ cls._merge_tests(aggregated_tests, incremental_tests, num_runs)
return True
@classmethod
- def _merge_non_test_data(cls, aggregated_json, incremental_json):
+ def _merge_non_test_data(cls, aggregated_json, incremental_json, num_runs):
"""Merge incremental non tests property data into aggregated json results.
Args:
@@ -173,13 +175,13 @@ class JsonResults(object):
return False
# Merge this build into aggreagated results.
- cls._merge_one_build(aggregated_json, incremental_json, index)
+ cls._merge_one_build(aggregated_json, incremental_json, index, num_runs)
return True
@classmethod
def _merge_one_build(cls, aggregated_json, incremental_json,
- incremental_index):
+ incremental_index, num_runs):
"""Merge one build of incremental json into aggregated json results.
Args:
@@ -198,12 +200,12 @@ class JsonResults(object):
aggregated_json[key].insert(
0, incremental_json[key][incremental_index])
aggregated_json[key] = \
- aggregated_json[key][:JSON_RESULTS_MAX_BUILDS]
+ aggregated_json[key][:num_runs]
else:
aggregated_json[key] = incremental_json[key]
@classmethod
- def _merge_tests(cls, aggregated_json, incremental_json):
+ def _merge_tests(cls, aggregated_json, incremental_json, num_runs):
"""Merge "tests" properties:results, times.
Args:
@@ -225,15 +227,15 @@ class JsonResults(object):
times = [[1, 0]]
cls._insert_item_run_length_encoded(
- results, aggregated_test[JSON_RESULTS_RESULTS])
+ results, aggregated_test[JSON_RESULTS_RESULTS], num_runs)
cls._insert_item_run_length_encoded(
- times, aggregated_test[JSON_RESULTS_TIMES])
+ times, aggregated_test[JSON_RESULTS_TIMES], num_runs)
cls._normalize_results_json(test_name, aggregated_json)
else:
aggregated_json[test_name] = incremental_json[test_name]
@classmethod
- def _insert_item_run_length_encoded(cls, incremental_item, aggregated_item):
+ def _insert_item_run_length_encoded(cls, incremental_item, aggregated_item, num_runs):
"""Inserts the incremental run-length encoded results into the aggregated
run-length encoded results.
@@ -245,7 +247,7 @@ class JsonResults(object):
for item in incremental_item:
if len(aggregated_item) and item[1] == aggregated_item[0][1]:
aggregated_item[0][0] = min(
- aggregated_item[0][0] + item[0], JSON_RESULTS_MAX_BUILDS)
+ aggregated_item[0][0] + item[0], num_runs)
else:
aggregated_item.insert(0, item)
@@ -340,7 +342,7 @@ class JsonResults(object):
return True
@classmethod
- def merge(cls, builder, aggregated, incremental, sort_keys=False):
+ def merge(cls, builder, aggregated, incremental, num_runs, sort_keys=False):
"""Merge incremental json file data with aggregated json file data.
Args:
@@ -378,9 +380,7 @@ class JsonResults(object):
logging.info("Merging json results...")
try:
- if not cls._merge_json(
- aggregated_json[builder],
- incremental_json[builder]):
+ if not cls._merge_json(aggregated_json[builder], incremental_json[builder], num_runs):
return None
except Exception, err:
logging.error("Failed to merge json results: %s", str(err))
@@ -391,37 +391,48 @@ class JsonResults(object):
return cls._generate_file_data(aggregated_json, sort_keys)
@classmethod
- def update(cls, builder, test_type, incremental):
+ def update(cls, master, builder, test_type, incremental):
"""Update datastore json file data by merging it with incremental json
- file.
+ file. Writes the large file and a small file. The small file just stores
+ fewer runs.
Args:
+ master: master name.
builder: builder name.
test_type: type of test results.
incremental: incremental json file data to merge.
Returns:
- TestFile object if update succeeds or
+ Large TestFile object if update succeeds or
None on failure.
"""
+ small_file = cls.update_file(master, builder, test_type, incremental, JSON_RESULTS_FILE_SMALL, JSON_RESULTS_MAX_BUILDS_SMALL)
+ large_file = cls.update_file(master, builder, test_type, incremental, JSON_RESULTS_FILE, JSON_RESULTS_MAX_BUILDS)
- files = TestFile.get_files(builder, test_type, JSON_RESULTS_FILE)
+ if small_file and large_file:
+ return large_file
+ return None
+
+ @classmethod
+ def update_file(cls, master, builder, test_type, incremental, filename, num_runs):
+ files = TestFile.get_files(master, builder, test_type, filename)
if files:
file = files[0]
- new_results = cls.merge(builder, file.data, incremental)
+ new_results = cls.merge(builder, file.data, incremental, num_runs)
else:
# Use the incremental data if there is no aggregated file to merge.
- file = TestFile()
+ file = TestFile()
+ file.master = master
file.builder = builder
file.test_type = test_type
- file.name = JSON_RESULTS_FILE
+ file.name = filename
new_results = incremental
logging.info("No existing json results, incremental json is saved.")
- if not new_results:
- return None
-
- if not file.save(new_results):
+ if not new_results or not file.save(new_results):
+ logging.info(
+ "Update failed, master: %s, builder: %s, test_type: %s, name: %s." %
+ (master, builder, test_type, filename))
return None
return file
diff --git a/WebKitTools/TestResultServer/model/jsonresults_unittest.py b/WebKitTools/TestResultServer/model/jsonresults_unittest.py
index 15b659b..c70b90c 100755
--- a/WebKitTools/TestResultServer/model/jsonresults_unittest.py
+++ b/WebKitTools/TestResultServer/model/jsonresults_unittest.py
@@ -26,10 +26,14 @@
# (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 jsonresults
+try:
+ import jsonresults
+ from jsonresults import JsonResults
+except ImportError:
+ print "ERROR: Add the TestResultServer, google_appengine and yaml/lib directories to your PYTHONPATH"
+
import unittest
-from jsonresults import JsonResults
JSON_RESULTS_TEMPLATE = (
'{"Webkit":{'
@@ -118,7 +122,8 @@ class JsonResultsTest(unittest.TestCase):
aggregated_results = self._make_test_json(aggregated_data)
incremental_results = self._make_test_json(incremental_data)
merged_results = JsonResults.merge(self._builder,
- aggregated_results, incremental_results, sort_keys=True)
+ aggregated_results, incremental_results, jsonresults.JSON_RESULTS_MAX_BUILDS,
+ sort_keys=True)
if expected_data:
expected_results = self._make_test_json(expected_data)
diff --git a/WebKitTools/TestResultServer/model/testfile.py b/WebKitTools/TestResultServer/model/testfile.py
index ce92b65..e600c99 100644
--- a/WebKitTools/TestResultServer/model/testfile.py
+++ b/WebKitTools/TestResultServer/model/testfile.py
@@ -35,11 +35,12 @@ from model.datastorefile import DataStoreFile
class TestFile(DataStoreFile):
+ master = db.StringProperty()
builder = db.StringProperty()
test_type = db.StringProperty()
@classmethod
- def delete_file(cls, key, builder, test_type, name, limit):
+ def delete_file(cls, key, master, builder, test_type, name, limit):
if key:
file = db.get(key)
if not file:
@@ -48,10 +49,10 @@ class TestFile(DataStoreFile):
file._delete_all()
else:
- files = cls.get_files(builder, test_type, name, limit)
+ files = cls.get_files(master, builder, test_type, name, limit)
if not files:
logging.warning(
- "File not found, builder: %s, test_type:%s, name: %s.",
+ "File not found, master: %s, builder: %s, test_type:%s, name: %s.",
builder, test_type, name)
return False
@@ -61,8 +62,10 @@ class TestFile(DataStoreFile):
return True
@classmethod
- def get_files(cls, builder, test_type, name, load_data=True, limit=1):
+ def get_files(cls, master, builder, test_type, name, load_data=True, limit=1):
query = TestFile.all()
+ if master:
+ query = query.filter("master =", master)
if builder:
query = query.filter("builder =", builder)
if test_type:
@@ -78,8 +81,9 @@ class TestFile(DataStoreFile):
return files
@classmethod
- def add_file(cls, builder, test_type, name, data):
+ def add_file(cls, master, builder, test_type, name, data):
file = TestFile()
+ file.master = master
file.builder = builder
file.test_type = test_type
file.name = name
@@ -88,24 +92,24 @@ class TestFile(DataStoreFile):
return None
logging.info(
- "File saved, builder: %s, test_type: %s, name: %s, key: %s.",
- builder, test_type, file.name, str(file.data_keys))
+ "File saved, master: %s, builder: %s, test_type: %s, name: %s, key: %s.",
+ master, builder, test_type, file.name, str(file.data_keys))
return file
@classmethod
- def update(cls, builder, test_type, name, data):
- files = cls.get_files(builder, test_type, name)
+ def update(cls, master, builder, test_type, name, data):
+ files = cls.get_files(master, builder, test_type, name)
if not files:
- return cls.add_file(builder, test_type, name, data)
+ return cls.add_file(master, builder, test_type, name, data)
file = files[0]
if not file.save(data):
return None
logging.info(
- "File replaced, builder: %s, test_type: %s, name: %s, data key: %s.",
- builder, test_type, file.name, str(file.data_keys))
+ "File replaced, master: %s, builder: %s, test_type: %s, name: %s, data key: %s.",
+ master, builder, test_type, file.name, str(file.data_keys))
return file
diff --git a/WebKitTools/TestResultServer/templates/showfilelist.html b/WebKitTools/TestResultServer/templates/showfilelist.html
index fa72b7f..d292fe2 100644
--- a/WebKitTools/TestResultServer/templates/showfilelist.html
+++ b/WebKitTools/TestResultServer/templates/showfilelist.html
@@ -13,6 +13,7 @@
<div>
<table>
<tr>
+ <th>Master</th>
<th>Builder</th>
<th>Test Type</th>
<th>File</th>
@@ -22,6 +23,10 @@
{% endif %}
{% for file in files %}
<tr>{% if file.builder and file.name %}
+ <td><a href="/testfile?master={{ file.master }}" >
+ {{ file.master }}
+ </a>
+ </td>
<td><a href="/testfile?builder={{ file.builder }}" >
{{ file.builder }}
</a>
diff --git a/WebKitTools/TestResultServer/templates/uploadform.html b/WebKitTools/TestResultServer/templates/uploadform.html
index 3506c9c..9974a24 100644
--- a/WebKitTools/TestResultServer/templates/uploadform.html
+++ b/WebKitTools/TestResultServer/templates/uploadform.html
@@ -10,12 +10,16 @@
<br>
<table>
<tr>
+ <td class=label><label>Master:</label></td>
+ <td><input class=inputtext type="text" name="master" placeholder="Chromium"/></td>
+ </tr>
+ <tr>
<td class=label><label>Builder:</label></td>
- <td><input class=inputtext type="text" name="builder" value="Webkit"/></td>
+ <td><input class=inputtext type="text" name="builder" placeholder="Webkit"/></td>
</tr>
<tr>
<td class=label><label>Test Type:</label></td>
- <td><input class=inputtext type="text" name="testtype" value=""/></td>
+ <td><input class=inputtext type="text" name="testtype" placeholder="layout-tests"/></td>
</tr>
</table>
<br>
diff --git a/WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig b/WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig
index 4d3d1ee..6bf31b2 100644
--- a/WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig
+++ b/WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig
@@ -21,4 +21,4 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-PRODUCT_NAME = InjectedBundle
+PRODUCT_NAME = InjectedBundleTestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundleController.cpp b/WebKitTools/TestWebKitAPI/InjectedBundleController.cpp
index dc563ac..2674801 100644
--- a/WebKitTools/TestWebKitAPI/InjectedBundleController.cpp
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleController.cpp
@@ -81,7 +81,7 @@ void InjectedBundleController::didReceiveMessage(WKBundleRef bundle, WKStringRef
assert(WKGetTypeID(messageBody) == WKStringGetTypeID());
WKStringRef messageBodyString = static_cast<WKStringRef>(messageBody);
- self->initializeTestNamed(Util::toSTD(messageBodyString));
+ self->initializeTestNamed(bundle, Util::toSTD(messageBodyString));
return;
}
@@ -98,7 +98,7 @@ void InjectedBundleController::dumpTestNames()
printf("%s\n", (*it).first.c_str());
}
-void InjectedBundleController::initializeTestNamed(const std::string& identifier)
+void InjectedBundleController::initializeTestNamed(WKBundleRef bundle, const std::string& identifier)
{
CreateInjectedBundleTestFunction createTestFunction = m_createInjectedBundleTestFunctions[identifier];
if (!createTestFunction) {
@@ -107,7 +107,7 @@ void InjectedBundleController::initializeTestNamed(const std::string& identifier
}
m_currentTest = createTestFunction(identifier);
- m_currentTest->initialize();
+ m_currentTest->initialize(bundle);
}
void InjectedBundleController::registerCreateInjectedBundleTestFunction(const std::string& identifier, CreateInjectedBundleTestFunction function)
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundleController.h b/WebKitTools/TestWebKitAPI/InjectedBundleController.h
index 89e2c5e..8b45fff 100644
--- a/WebKitTools/TestWebKitAPI/InjectedBundleController.h
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleController.h
@@ -41,7 +41,7 @@ public:
void initialize(WKBundleRef);
void dumpTestNames();
- void initializeTestNamed(const std::string&);
+ void initializeTestNamed(WKBundleRef bundle, const std::string&);
typedef InjectedBundleTest* (*CreateInjectedBundleTestFunction)(const std::string&);
void registerCreateInjectedBundleTestFunction(const std::string&, CreateInjectedBundleTestFunction);
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundleTest.h b/WebKitTools/TestWebKitAPI/InjectedBundleTest.h
index f3812ef..b0224f2 100644
--- a/WebKitTools/TestWebKitAPI/InjectedBundleTest.h
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleTest.h
@@ -34,7 +34,7 @@ class InjectedBundleTest {
public:
virtual ~InjectedBundleTest() { }
- virtual void initialize() { }
+ virtual void initialize(WKBundleRef) { }
virtual void didCreatePage(WKBundleRef, WKBundlePageRef) { }
virtual void willDestroyPage(WKBundleRef, WKBundlePageRef) { }
diff --git a/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
index fa967b7..ef55b28 100644
--- a/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
+++ b/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
@@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02C84E125D4A8400E3F4BD /* Find.cpp */; };
1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; };
+ 1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */; };
+ 333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
BC131A9B1171316900B69727 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131A9A1171316900B69727 /* main.mm */; };
BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC131AA8117131FC00B69727 /* TestsController.cpp */; };
@@ -30,6 +32,8 @@
BC90995E12567BC100083756 /* WKString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90995D12567BC100083756 /* WKString.cpp */; };
BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9099931256ACF100083756 /* WKStringJSString.cpp */; };
BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA61DB411700EFD00460D1E /* WebKit2.framework */; };
+ BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */; };
+ BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */; };
BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB9E9F011235BDE00A137E0 /* Cocoa.framework */; };
BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */; };
BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCBD372E125ABBE600D2C29F /* icon.png */; };
@@ -45,7 +49,7 @@
isa = PBXContainerItemProxy;
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
proxyType = 1;
- remoteGlobalIDString = BC57597F126E74AF006F0F12 /* InjectedBundle */;
+ remoteGlobalIDString = BC57597F126E74AF006F0F12;
remoteInfo = InjectedBundle;
};
/* End PBXContainerItemProxy section */
@@ -79,6 +83,8 @@
/* Begin PBXFileReference section */
1A02C84B125D4A5E00E3F4BD /* find.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = find.html; sourceTree = "<group>"; };
1A02C84E125D4A8400E3F4BD /* Find.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Find.cpp; sourceTree = "<group>"; };
+ 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EvaluateJavaScript.cpp; sourceTree = "<group>"; };
+ 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
BC131883117114A800B69727 /* PlatformUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUtilities.h; sourceTree = "<group>"; };
BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUtilitiesMac.mm; sourceTree = "<group>"; };
@@ -86,7 +92,7 @@
BC131A9E1171317C00B69727 /* TestWebKitAPIPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestWebKitAPIPrefix.h; sourceTree = "<group>"; };
BC131AA8117131FC00B69727 /* TestsController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = TestsController.cpp; sourceTree = "<group>"; };
BC575946126E7351006F0F12 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
- BC575980126E74AF006F0F12 /* InjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundleTestWebKitAPI.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
BC575981126E74AF006F0F12 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
BC575A9E126E75FB006F0F12 /* InjectedBundleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleTest.h; sourceTree = "<group>"; };
BC575A9F126E7657006F0F12 /* InjectedBundleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleController.h; sourceTree = "<group>"; };
@@ -107,6 +113,8 @@
BC90995D12567BC100083756 /* WKString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKString.cpp; sourceTree = "<group>"; };
BC9099931256ACF100083756 /* WKStringJSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKStringJSString.cpp; sourceTree = "<group>"; };
BCA61DB411700EFD00460D1E /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentStartUserScriptAlertCrash.cpp; sourceTree = "<group>"; };
+ BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentStartUserScriptAlertCrash_Bundle.cpp; sourceTree = "<group>"; };
BCB9E7C711234E3A00A137E0 /* TestsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestsController.h; sourceTree = "<group>"; };
BCB9E7FA112359A300A137E0 /* Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test.h; sourceTree = "<group>"; };
BCB9E9F011235BDE00A137E0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@@ -188,7 +196,7 @@
isa = PBXGroup;
children = (
8DD76FA10486AA7600D96B5E /* TestWebKitAPI */,
- BC575980126E74AF006F0F12 /* InjectedBundle.bundle */,
+ BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -219,16 +227,20 @@
isa = PBXGroup;
children = (
BC90977B125571AE00083756 /* Resources */,
+ 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */,
1A02C84E125D4A8400E3F4BD /* Find.cpp */,
BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */,
BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */,
BC909779125571AB00083756 /* PageLoadBasic.cpp */,
+ 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */,
C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */,
BC90995D12567BC100083756 /* WKString.cpp */,
BC9099931256ACF100083756 /* WKStringJSString.cpp */,
BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */,
BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */,
+ BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */,
+ BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */,
);
path = WebKit2;
sourceTree = "<group>";
@@ -244,8 +256,8 @@
BC90977B125571AE00083756 /* Resources */ = {
isa = PBXGroup;
children = (
- BCBD372E125ABBE600D2C29F /* icon.png */,
1A02C84B125D4A5E00E3F4BD /* find.html */,
+ BCBD372E125ABBE600D2C29F /* icon.png */,
BC909778125571AB00083756 /* simple.html */,
C02B7882126615410026BF0F /* spacebar-scrolling.html */,
);
@@ -294,9 +306,9 @@
productReference = 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */;
productType = "com.apple.product-type.tool";
};
- BC57597F126E74AF006F0F12 /* InjectedBundle */ = {
+ BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */ = {
isa = PBXNativeTarget;
- buildConfigurationList = BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget "InjectedBundle" */;
+ buildConfigurationList = BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget "InjectedBundleTestWebKitAPI" */;
buildPhases = (
BC57597C126E74AF006F0F12 /* Resources */,
BC57597D126E74AF006F0F12 /* Sources */,
@@ -306,9 +318,9 @@
);
dependencies = (
);
- name = InjectedBundle;
+ name = InjectedBundleTestWebKitAPI;
productName = InjectedBundle;
- productReference = BC575980126E74AF006F0F12 /* InjectedBundle.bundle */;
+ productReference = BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
@@ -331,7 +343,7 @@
projectRoot = "";
targets = (
8DD76F960486AA7600D96B5E /* TestWebKitAPI */,
- BC57597F126E74AF006F0F12 /* InjectedBundle */,
+ BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */,
);
};
/* End PBXProject section */
@@ -366,6 +378,9 @@
C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */,
BC575AAD126E83B9006F0F12 /* InjectedBundleBasic.cpp in Sources */,
BC575BC0126F5752006F0F12 /* PlatformUtilities.cpp in Sources */,
+ BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */,
+ 1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */,
+ 333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -378,6 +393,7 @@
BC575AB0126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp in Sources */,
BC575BD9126F58E2006F0F12 /* PlatformUtilities.cpp in Sources */,
BC575BE0126F590D006F0F12 /* PlatformUtilitiesMac.mm in Sources */,
+ BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -386,7 +402,7 @@
/* Begin PBXTargetDependency section */
BC575A96126E74E7006F0F12 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = BC57597F126E74AF006F0F12 /* InjectedBundle */;
+ target = BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */;
targetProxy = BC575A95126E74E7006F0F12 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@@ -458,7 +474,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget "InjectedBundle" */ = {
+ BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget "InjectedBundleTestWebKitAPI" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BC575984126E74AF006F0F12 /* Debug */,
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
new file mode 100644
index 0000000..5e0655e
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
@@ -0,0 +1,65 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool done;
+
+static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
+{
+ TEST_ASSERT(frame);
+ TEST_ASSERT(WKFrameGetPage(frame) == page);
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(alertText, "an alert"));
+
+ done = true;
+}
+
+TEST(WebKit2, DocumentStartUserScriptAlertCrashTest)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest"));
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+ uiClient.version = 0;
+ uiClient.clientInfo = 0;
+ uiClient.runJavaScriptAlert = runJavaScriptAlert;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&done);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
new file mode 100644
index 0000000..a96bef2
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
@@ -0,0 +1,50 @@
+/*
+ * 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 "InjectedBundleTest.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKBundlePrivate.h>
+#include <WebKit2/WKBundleScriptWorld.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class DocumentStartUserScriptAlertCrashTest : public InjectedBundleTest {
+public:
+ DocumentStartUserScriptAlertCrashTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+ virtual void initialize(WKBundleRef bundle)
+ {
+ WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('an alert');"));
+ WKBundleAddUserScript(bundle, WKBundleScriptWorldNormalWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames);
+ }
+};
+
+static InjectedBundleTest::Register<DocumentStartUserScriptAlertCrashTest> registrar("DocumentStartUserScriptAlertCrashTest");
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp
new file mode 100644
index 0000000..bbdece3
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didRunJavaScript(WKStringRef resultString, WKErrorRef error, void* context)
+{
+ TEST_ASSERT(context == reinterpret_cast<void*>(0x1234578));
+ TEST_ASSERT(WKStringIsEmpty(resultString));
+
+ // FIXME: We should also check the error, but right now it's always null.
+ // Assert that it's null so we can revisit when this changes.
+ TEST_ASSERT(!error);
+
+ testDone = true;
+}
+
+TEST(WebKit2, EvaluateJavaScriptThatThrowsAnException)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("throw 'Hello'"));
+ WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript);
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
index a0b4058..c3af543 100644
--- a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
@@ -52,8 +52,13 @@ static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WK
State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
TEST_ASSERT(state->didDecidePolicyForNavigationAction);
TEST_ASSERT(!state->didCommitLoadForFrame);
+
+ // The commited URL should be null.
+ TEST_ASSERT(!WKFrameCopyURL(frame));
+
TEST_ASSERT(!state->didStartProvisionalLoadForFrame);
+
state->didStartProvisionalLoadForFrame = true;
}
@@ -63,6 +68,9 @@ static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
TEST_ASSERT(state->didDecidePolicyForNavigationAction);
TEST_ASSERT(state->didStartProvisionalLoadForFrame);
+ // The provisional URL should be null.
+ TEST_ASSERT(!WKFrameCopyProvisionalURL(frame));
+
state->didCommitLoadForFrame = true;
}
@@ -73,6 +81,9 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
TEST_ASSERT(state->didStartProvisionalLoadForFrame);
TEST_ASSERT(state->didCommitLoadForFrame);
+ // The provisional URL should be null.
+ TEST_ASSERT(!WKFrameCopyProvisionalURL(frame));
+
test1Done = true;
}
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp
new file mode 100644
index 0000000..af3ed12
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didRunJavaScript(WKStringRef resultString, WKErrorRef error, void* context)
+{
+ TEST_ASSERT(context == reinterpret_cast<void*>(0x1234578));
+
+ // Make sure that the result of navigator.userAgent isn't empty, even if we set the custom
+ // user agent to the empty string.
+ TEST_ASSERT(!WKStringIsEmpty(resultString));
+
+ testDone = true;
+}
+
+TEST(WebKit2, PreventEmptyUserAgent)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageSetCustomUserAgent(webView.page(), WKStringCreateWithUTF8CString(""));
+ WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("navigator.userAgent"));
+ WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript);
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
new file mode 100644
index 0000000..a019f08
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
@@ -0,0 +1,59 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool didReceiveClose;
+
+static void close(WKPageRef, const void*)
+{
+ didReceiveClose = true;
+}
+
+TEST(WebKit2, WMCloseCallsUIClientClose)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+
+ uiClient.close = close;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ ::SendMessageW(WKViewGetWindow(webView.platformView()), WM_CLOSE, 0, 0);
+
+ Util::run(&didReceiveClose);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm b/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
index a9552fd..474278f 100644
--- a/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
+++ b/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
@@ -41,7 +41,7 @@ void run(bool* done)
WKStringRef createInjectedBundlePath()
{
- NSString *nsString = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundle.bundle"];
+ NSString *nsString = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundleTestWebKitAPI.bundle"];
return WKStringCreateWithCFString((CFStringRef)nsString);
}
diff --git a/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
index 44bf963..2e7bbe4 100644
--- a/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
+++ b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
@@ -417,6 +417,10 @@
Name="WebKit2"
>
<File
+ RelativePath="..\Tests\WebKit2\EvaluateJavaScript.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\WebKit2\FailedLoad.cpp"
>
</File>
@@ -445,6 +449,10 @@
>
</File>
<File
+ RelativePath="..\Tests\WebKit2\PreventEmptyUserAgent.cpp"
+ >
+ </File>
+ <File
RelativePath="..\Tests\WebKit2\simple.html"
>
</File>
@@ -471,6 +479,10 @@
RelativePath="..\Tests\WebKit2\win\AltKeyGeneratesWMSysCommand.cpp"
>
</File>
+ <File
+ RelativePath="..\Tests\WebKit2\win\WMCloseCallsUIClientClose.cpp"
+ >
+ </File>
</Filter>
</Filter>
<Filter
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
index 4d3d1ee..dcf4be0 100644
--- a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
@@ -21,4 +21,4 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-PRODUCT_NAME = InjectedBundle
+PRODUCT_NAME = WebKitTestRunnerInjectedBundle
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index f3c5e88..a0e36ad 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -33,6 +33,7 @@ module WTR {
void notifyDone();
// Other dumping.
+ void dumpBackForwardList();
void dumpChildFrameScrollPositions();
void dumpEditingCallbacks();
void dumpSelectionRect();
@@ -45,14 +46,15 @@ module WTR {
void setCanOpenWindows(in boolean value);
void setCloseRemainingWindowsWhenComplete(in boolean value);
void setXSSAuditorEnabled(in boolean value);
- unsigned long windowCount();
// Special DOM functions.
+ void clearBackForwardList();
object computedStyleIncludingVisitedInfo(in object element);
DOMString counterValueForElementById(in DOMString elementId);
- DOMString markerTextForListItem(in object element);
void execCommand(in DOMString name, in DOMString argument);
boolean isCommandEnabled(in DOMString name);
+ DOMString markerTextForListItem(in object element);
+ unsigned long windowCount();
// Repaint testing.
void testRepaint();
@@ -66,6 +68,9 @@ module WTR {
// UserContent testing.
void addUserScript(in DOMString source, in boolean runAtStart, in boolean allFrames);
void addUserStyleSheet(in DOMString source, in boolean allFrames);
+
+ // Compositing testing.
+ DOMString layerTreeAsText();
};
}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index af8bb69..6bc1802 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -27,6 +27,7 @@
#include "ActivateFonts.h"
#include "InjectedBundlePage.h"
+#include "StringFunctions.h"
#include <WebKit2/WKBundle.h>
#include <WebKit2/WKBundlePage.h>
#include <WebKit2/WKBundlePagePrivate.h>
@@ -46,22 +47,21 @@ InjectedBundle& InjectedBundle::shared()
InjectedBundle::InjectedBundle()
: m_bundle(0)
- , m_mainPage(0)
, m_state(Idle)
{
}
-void InjectedBundle::_didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+void InjectedBundle::didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
{
static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didCreatePage(page);
}
-void InjectedBundle::_willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+void InjectedBundle::willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
{
static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->willDestroyPage(page);
}
-void InjectedBundle::_didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+void InjectedBundle::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
{
static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(messageName, messageBody);
}
@@ -73,9 +73,9 @@ void InjectedBundle::initialize(WKBundleRef bundle)
WKBundleClient client = {
0,
this,
- _didCreatePage,
- _willDestroyPage,
- _didReceiveMessage
+ didCreatePage,
+ willDestroyPage,
+ didReceiveMessage
};
WKBundleSetClient(m_bundle, &client);
@@ -85,20 +85,25 @@ void InjectedBundle::initialize(WKBundleRef bundle)
void InjectedBundle::didCreatePage(WKBundlePageRef page)
{
- // FIXME: we really need the main page ref to be sent over from the ui process
- OwnPtr<InjectedBundlePage> pageWrapper = adoptPtr(new InjectedBundlePage(page));
- if (!m_mainPage)
- m_mainPage = pageWrapper.release();
- else
- m_otherPages.add(page, pageWrapper.leakPtr());
+ m_pages.append(adoptPtr(new InjectedBundlePage(page)));
}
void InjectedBundle::willDestroyPage(WKBundlePageRef page)
{
- if (m_mainPage && m_mainPage->page() == page)
- m_mainPage.clear();
- else
- delete m_otherPages.take(page);
+ size_t size = m_pages.size();
+ for (size_t i = 0; i < size; ++i) {
+ if (m_pages[i]->page() == page) {
+ m_pages.remove(i);
+ break;
+ }
+ }
+}
+
+InjectedBundlePage* InjectedBundle::page() const
+{
+ // It might be better to have the UI process send over a reference to the main
+ // page instead of just assuming it's the first one.
+ return m_pages[0].get();
}
void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
@@ -134,14 +139,14 @@ void InjectedBundle::beginTesting()
WKBundleRemoveAllUserContent(m_bundle);
- m_mainPage->reset();
+ page()->reset();
}
void InjectedBundle::done()
{
m_state = Stopping;
- m_mainPage->stopLoading();
+ page()->stopLoading();
WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithUTF8CString(m_outputStream.str().c_str()));
@@ -153,10 +158,20 @@ void InjectedBundle::done()
void InjectedBundle::closeOtherPages()
{
- Vector<WKBundlePageRef> pages;
- copyKeysToVector(m_otherPages, pages);
- for (size_t i = 0; i < pages.size(); ++i)
- WKBundlePageClose(pages[i]);
+ Vector<WKBundlePageRef> pagesToClose;
+ size_t size = m_pages.size();
+ for (size_t i = 1; i < size; ++i)
+ pagesToClose.append(m_pages[i]->page());
+ size = pagesToClose.size();
+ for (size_t i = 0; i < size; ++i)
+ WKBundlePageClose(pagesToClose[i]);
+}
+
+void InjectedBundle::dumpBackForwardListsForAllPages()
+{
+ size_t size = m_pages.size();
+ for (size_t i = 0; i < size; ++i)
+ m_pages[i]->dumpBackForwardList();
}
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index 6c5c69e..2c6d14b 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -30,9 +30,9 @@
#include "GCController.h"
#include "LayoutTestController.h"
#include <WebKit2/WKBase.h>
-#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
#include <sstream>
@@ -53,10 +53,12 @@ public:
GCController* gcController() { return m_gcController.get(); }
EventSendingController* eventSendingController() { return m_eventSendingController.get(); }
- InjectedBundlePage* page() { return m_mainPage.get(); }
- size_t pageCount() { return !!m_mainPage + m_otherPages.size(); }
+ InjectedBundlePage* page() const;
+ size_t pageCount() const { return m_pages.size(); }
void closeOtherPages();
+ void dumpBackForwardListsForAllPages();
+
void done();
std::ostringstream& os() { return m_outputStream; }
@@ -66,19 +68,18 @@ private:
InjectedBundle();
~InjectedBundle();
- static void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
- static void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
- static void _didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
+ static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
+ static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
+ static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
- void didCreatePage(WKBundlePageRef page);
- void willDestroyPage(WKBundlePageRef page);
+ void didCreatePage(WKBundlePageRef);
+ void willDestroyPage(WKBundlePageRef);
void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
void beginTesting();
WKBundleRef m_bundle;
- HashMap<WKBundlePageRef, InjectedBundlePage*> m_otherPages;
- OwnPtr<InjectedBundlePage> m_mainPage;
+ Vector<OwnPtr<InjectedBundlePage> > m_pages;
RefPtr<LayoutTestController> m_layoutTestController;
RefPtr<GCController> m_gcController;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index 22af6ff..d852dd2 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -30,6 +30,9 @@
#include <cmath>
#include <JavaScriptCore/JSRetainPtr.h>
#include <WebKit2/WKArray.h>
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundleBackForwardList.h>
+#include <WebKit2/WKBundleBackForwardListItem.h>
#include <WebKit2/WKBundleFrame.h>
#include <WebKit2/WKBundleFramePrivate.h>
#include <WebKit2/WKBundlePagePrivate.h>
@@ -38,6 +41,16 @@ using namespace std;
namespace WTR {
+template<typename T> static inline WKRetainPtr<T> adoptWK(T item)
+{
+ return WKRetainPtr<T>(AdoptWK, item);
+}
+
+static bool hasPrefix(const string& searchString, const string& prefix)
+{
+ return searchString.length() >= prefix.length() && searchString.substr(0, prefix.length()) == prefix;
+}
+
static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
{
if (!object)
@@ -171,13 +184,13 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
0,
0,
0,
+ didDisplayInsecureContentForFrame,
+ didRunInsecureContentForFrame,
didClearWindowForFrame,
didCancelClientRedirectForFrame,
willPerformClientRedirectForFrame,
didChangeLocationWithinPageForFrame,
- didHandleOnloadEventsForFrame,
- didDisplayInsecureContentForFrame,
- didRunInsecureContentForFrame
+ didHandleOnloadEventsForFrame
};
WKBundlePageSetLoaderClient(m_page, &loaderClient);
@@ -189,7 +202,8 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
willRunJavaScriptAlert,
willRunJavaScriptConfirm,
willRunJavaScriptPrompt,
- 0 /*mouseDidMoveOverElement*/
+ 0, /*mouseDidMoveOverElement*/
+ 0, /*pageDidScroll*/
};
WKBundlePageSetUIClient(m_page, &uiClient);
@@ -227,6 +241,8 @@ void InjectedBundlePage::reset()
WKBundlePageSetPageZoomFactor(m_page, 1);
WKBundlePageSetTextZoomFactor(m_page, 1);
+
+ m_previousTestBackForwardListItem = adoptWK(WKBundleBackForwardListCopyItemAtIndex(WKBundlePageGetBackForwardList(m_page), 0));
}
// Loader Client Callbacks
@@ -296,12 +312,12 @@ void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundlePageRef page, WKB
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didHandleOnloadEventsForFrame(frame);
}
-void InjectedBundlePage::didDisplayInsecureContentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
+void InjectedBundlePage::didDisplayInsecureContentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didDisplayInsecureContentForFrame(frame);
}
-void InjectedBundlePage::didRunInsecureContentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
+void InjectedBundlePage::didRunInsecureContentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
{
static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didRunInsecureContentForFrame(frame);
}
@@ -361,8 +377,38 @@ void InjectedBundlePage::dumpAllFrameScrollPositions()
dumpDescendantFrameScrollPositions(frame);
}
+static JSRetainPtr<JSStringRef> toJS(const char* string)
+{
+ return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString(string));
+}
+
+static bool hasDocumentElement(WKBundleFrameRef frame)
+{
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ JSObjectRef globalObject = JSContextGetGlobalObject(context);
+
+ JSValueRef documentValue = JSObjectGetProperty(context, globalObject, toJS("document").get(), 0);
+ if (!documentValue)
+ return false;
+
+ ASSERT(JSValueIsObject(context, documentValue));
+ JSObjectRef document = JSValueToObject(context, documentValue, 0);
+
+ JSValueRef documentElementValue = JSObjectGetProperty(context, document, toJS("documentElement").get(), 0);
+ if (!documentElementValue)
+ return false;
+
+ return JSValueToBoolean(context, documentElementValue);
+}
+
static void dumpFrameText(WKBundleFrameRef frame)
{
+ // If the frame doesn't have a document element, its inner text will be an empty string, so
+ // we'll end up just appending a single newline below. But DumpRenderTree doesn't append
+ // anything in this case, so we shouldn't either.
+ if (!hasDocumentElement(frame))
+ return;
+
WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyInnerText(frame));
InjectedBundle::shared().os() << text << "\n";
}
@@ -412,6 +458,9 @@ void InjectedBundlePage::dump()
else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition())
dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page));
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpBackForwardListsForAllWindows())
+ InjectedBundle::shared().dumpBackForwardListsForAllPages();
+
InjectedBundle::shared().done();
}
@@ -764,4 +813,89 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChangeSelection:" << notificationName << "\n";
}
+static bool compareByTargetName(WKBundleBackForwardListItemRef item1, WKBundleBackForwardListItemRef item2)
+{
+ return toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item1))) < toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item2)));
+}
+
+static void dumpBackForwardListItem(WKBundleBackForwardListItemRef item, unsigned indent, bool isCurrentItem)
+{
+ unsigned column = 0;
+ if (isCurrentItem) {
+ InjectedBundle::shared().os() << "curr->";
+ column = 6;
+ }
+ for (unsigned i = column; i < indent; i++)
+ InjectedBundle::shared().os() << ' ';
+
+ string url = toSTD(adoptWK(WKURLCopyString(adoptWK(WKBundleBackForwardListItemCopyURL(item)).get())));
+ if (hasPrefix(url, "file:")) {
+ string directoryName = "/LayoutTests/";
+ size_t start = url.find(directoryName);
+ if (start == string::npos)
+ start = 0;
+ else
+ start += directoryName.size();
+ InjectedBundle::shared().os() << "(file test):" << url.substr(start);
+ } else
+ InjectedBundle::shared().os() << url;
+
+ string target = toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item)));
+ if (target.length())
+ InjectedBundle::shared().os() << " (in frame \"" << target << "\")";
+
+ // FIXME: Need WKBackForwardListItemIsTargetItem.
+ if (WKBundleBackForwardListItemIsTargetItem(item))
+ InjectedBundle::shared().os() << " **nav target**";
+
+ InjectedBundle::shared().os() << '\n';
+
+ if (WKRetainPtr<WKArrayRef> kids = adoptWK(WKBundleBackForwardListItemCopyChildren(item))) {
+ // Sort to eliminate arbitrary result ordering which defeats reproducible testing.
+ size_t size = WKArrayGetSize(kids.get());
+ Vector<WKBundleBackForwardListItemRef> sortedKids(size);
+ for (size_t i = 0; i < size; ++i)
+ sortedKids[i] = static_cast<WKBundleBackForwardListItemRef>(WKArrayGetItemAtIndex(kids.get(), i));
+ stable_sort(sortedKids.begin(), sortedKids.end(), compareByTargetName);
+ for (size_t i = 0; i < size; ++i)
+ dumpBackForwardListItem(sortedKids[i], indent + 4, false);
+ }
+}
+
+void InjectedBundlePage::dumpBackForwardList()
+{
+ InjectedBundle::shared().os() << "\n============== Back Forward List ==============\n";
+
+ WKBundleBackForwardListRef list = WKBundlePageGetBackForwardList(m_page);
+
+ // Print out all items in the list after m_previousTestBackForwardListItem.
+ // Gather items from the end of the list, then print them out from oldest to newest.
+ Vector<WKRetainPtr<WKBundleBackForwardListItemRef> > itemsToPrint;
+ for (unsigned i = WKBundleBackForwardListGetForwardListCount(list); i; --i) {
+ WKRetainPtr<WKBundleBackForwardListItemRef> item = adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, i));
+ // Something is wrong if the item from the last test is in the forward part of the list.
+ ASSERT(!WKBundleBackForwardListItemIsSame(item.get(), m_previousTestBackForwardListItem.get()));
+ itemsToPrint.append(item);
+ }
+
+ ASSERT(!WKBundleBackForwardListItemIsSame(adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, 0)).get(), m_previousTestBackForwardListItem.get()));
+
+ itemsToPrint.append(adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, 0)));
+
+ int currentItemIndex = itemsToPrint.size() - 1;
+
+ int backListCount = WKBundleBackForwardListGetBackListCount(list);
+ for (int i = -1; i >= -backListCount; --i) {
+ WKRetainPtr<WKBundleBackForwardListItemRef> item = adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, i));
+ if (WKBundleBackForwardListItemIsSame(item.get(), m_previousTestBackForwardListItem.get()))
+ break;
+ itemsToPrint.append(item);
+ }
+
+ for (int i = itemsToPrint.size() - 1; i >= 0; i--)
+ dumpBackForwardListItem(itemsToPrint[i].get(), 8, i == currentItemIndex);
+
+ InjectedBundle::shared().os() << "===============================================\n";
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 737ad18..b95744f9 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -45,6 +45,8 @@ public:
void reset();
+ void dumpBackForwardList();
+
private:
// Loader Client
static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
@@ -60,8 +62,8 @@ private:
static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*);
static void didChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
- static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
+ static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
void didStartProvisionalLoadForFrame(WKBundleFrameRef);
void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef);
void didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef, WKErrorRef);
@@ -119,6 +121,7 @@ private:
WKBundlePageRef m_page;
WKRetainPtr<WKBundleScriptWorldRef> m_world;
+ WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
bool m_isLoading;
};
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index f8cbd4f..e828c46 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -29,6 +29,7 @@
#include "InjectedBundlePage.h"
#include "JSLayoutTestController.h"
#include "StringFunctions.h"
+#include <WebKit2/WKBundleBackForwardList.h>
#include <WebKit2/WKBundleFrame.h>
#include <WebKit2/WKBundleFramePrivate.h>
#include <WebKit2/WKBundlePagePrivate.h>
@@ -85,6 +86,7 @@ PassRefPtr<LayoutTestController> LayoutTestController::create()
LayoutTestController::LayoutTestController()
: m_whatToDump(RenderTree)
, m_shouldDumpAllFrameScrollPositions(false)
+ , m_shouldDumpBackForwardListsForAllWindows(false)
, m_shouldAllowEditing(true)
, m_shouldCloseExtraWindows(false)
, m_dumpEditingCallbacks(false)
@@ -148,6 +150,13 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima
return WKBundleFramePauseAnimationOnElementWithId(mainFrame, toWK(animationName).get(), toWK(elementId).get(), time);
}
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyLayerTreeAsText(mainFrame));
+ return toJS(text);
+}
+
void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
WKRetainPtr<WKStringRef> sourceWK = toWK(source);
@@ -233,6 +242,11 @@ unsigned LayoutTestController::windowCount()
return InjectedBundle::shared().pageCount();
}
+void LayoutTestController::clearBackForwardList()
+{
+ WKBundleBackForwardListClear(WKBundlePageGetBackForwardList(InjectedBundle::shared().page()->page()));
+}
+
// Object Creation
void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index c892ba0..dfafb55 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -60,6 +60,7 @@ public:
void notifyDone();
// Other dumping.
+ void dumpBackForwardList() { m_shouldDumpBackForwardListsForAllWindows = true; }
void dumpChildFrameScrollPositions() { m_shouldDumpAllFrameScrollPositions = true; }
void dumpEditingCallbacks() { m_dumpEditingCallbacks = true; }
void dumpSelectionRect() { } // Will need to do something when we support pixel tests.
@@ -72,14 +73,15 @@ public:
void setCanOpenWindows(bool);
void setCloseRemainingWindowsWhenComplete(bool value) { m_shouldCloseExtraWindows = value; }
void setXSSAuditorEnabled(bool);
- unsigned windowCount();
// Special DOM functions.
JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);
JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef elementId);
- JSRetainPtr<JSStringRef> markerTextForListItem(JSValueRef element);
+ void clearBackForwardList();
void execCommand(JSStringRef name, JSStringRef argument);
bool isCommandEnabled(JSStringRef name);
+ JSRetainPtr<JSStringRef> markerTextForListItem(JSValueRef element);
+ unsigned windowCount();
// Repaint testing.
void testRepaint() { m_testRepaint = true; }
@@ -90,6 +92,9 @@ public:
unsigned numberOfActiveAnimations() const;
bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);
+ // Compositing testing.
+ JSRetainPtr<JSStringRef> layerTreeAsText() const;
+
// UserContent testing.
void addUserScript(JSStringRef source, bool runAtStart, bool allFrames);
void addUserStyleSheet(JSStringRef source, bool allFrames);
@@ -98,9 +103,9 @@ public:
WhatToDump whatToDump() const { return m_whatToDump; }
bool shouldDumpAllFrameScrollPositions() const { return m_shouldDumpAllFrameScrollPositions; }
+ bool shouldDumpBackForwardListsForAllWindows() const { return m_shouldDumpBackForwardListsForAllWindows; }
bool shouldDumpEditingCallbacks() const { return m_dumpEditingCallbacks; }
bool shouldDumpMainFrameScrollPosition() const { return m_whatToDump == RenderTree; }
-
bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
@@ -122,6 +127,7 @@ private:
WhatToDump m_whatToDump;
bool m_shouldDumpAllFrameScrollPositions;
+ bool m_shouldDumpBackForwardListsForAllWindows;
bool m_shouldAllowEditing;
bool m_shouldCloseExtraWindows;
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index aff8798..c88062a 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -98,7 +98,7 @@ static void closeOtherPage(WKPageRef page, const void* clientInfo)
delete view;
}
-static WKPageRef createOtherPage(WKPageRef oldPage, const void*)
+static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*)
{
PlatformWebView* view = new PlatformWebView(WKPageGetPageNamespace(oldPage));
WKPageRef newPage = view->page();
@@ -116,12 +116,20 @@ static WKPageRef createOtherPage(WKPageRef oldPage, const void*)
0, // runJavaScriptPrompt
0, // setStatusText
0, // mouseDidMoveOverElement
- 0, // contentsSizeChanged
0, // didNotHandleKeyEvent
+ 0, // toolbarsAreVisible
+ 0, // setToolbarsAreVisible
+ 0, // menuBarIsVisible
+ 0, // setMenuBarIsVisible
+ 0, // statusBarIsVisible
+ 0, // setStatusBarIsVisible
+ 0, // isResizable
+ 0, // setIsResizable
getWindowFrameOtherPage,
setWindowFrameOtherPage,
0, // runBeforeUnloadConfirmPanel
- 0 // didDraw
+ 0, // didDraw
+ 0 // pageDidScroll
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -181,7 +189,7 @@ void TestController::initialize(int argc, const char* argv[])
0,
this,
didReceiveMessageFromInjectedBundle,
- 0
+ didReceiveSynchronousMessageFromInjectedBundle
};
WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
@@ -201,12 +209,20 @@ void TestController::initialize(int argc, const char* argv[])
0, // runJavaScriptPrompt
0, // setStatusText
0, // mouseDidMoveOverElement
- 0, // contentsSizeChanged
0, // didNotHandleKeyEvent
+ 0, // toolbarsAreVisible
+ 0, // setToolbarsAreVisible
+ 0, // menuBarIsVisible
+ 0, // setMenuBarIsVisible
+ 0, // statusBarIsVisible
+ 0, // setStatusBarIsVisible
+ 0, // isResizable
+ 0, // setIsResizable
getWindowFrameMainPage,
setWindowFrameMainPage,
0, // runBeforeUnloadConfirmPanel
- 0 // didDraw
+ 0, // didDraw
+ 0 // pageDidScroll
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
@@ -224,6 +240,8 @@ void TestController::initialize(int argc, const char* argv[])
0, // didFirstLayoutForFrame
0, // didFirstVisuallyNonEmptyLayoutForFrame
0, // didRemoveFrameFromHierarchy
+ 0, // didDisplayInsecureContentForFrame
+ 0, // didRunInsecureContentForFrame
0, // didStartProgress
0, // didChangeProgress
0, // didFinishProgress
@@ -312,11 +330,21 @@ void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, W
static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(messageName, messageBody);
}
+void TestController::didReceiveSynchronousMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void* clientInfo)
+{
+ *returnData = static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody).leakRef();
+}
+
void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
{
m_currentInvocation->didReceiveMessageFromInjectedBundle(messageName, messageBody);
}
+WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
+{
+ return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
+}
+
// WKPageLoaderClient
void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef, const void* clientInfo)
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index a9e6ab3..b12f1b2 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -71,8 +71,10 @@ private:
void resetStateToConsistentValues();
// WKContextInjectedBundleClient
- static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void*);
+ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
+ static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+ WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
// WKPageLoaderClient
static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*);
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index c1bf894..04a56f1 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -182,4 +182,10 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
ASSERT_NOT_REACHED();
}
+WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef /*messageName*/, WKTypeRef /*messageBody*/)
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h
index 1b33e49..fec1f7a 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.h
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.h
@@ -38,6 +38,7 @@ public:
void invoke();
void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+ WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
private:
void dump(const char*);
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 599e09e..a15fe41 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -95,7 +95,7 @@
BC14E4E8120E03D800826C0C /* JSGCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSGCController.cpp; path = DerivedSources/WebKitTestRunner/JSGCController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
BC14E4E9120E03D800826C0C /* JSGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSGCController.h; path = DerivedSources/WebKitTestRunner/JSGCController.h; sourceTree = BUILT_PRODUCTS_DIR; };
BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
- BC25186211D15D54002EBC01 /* InjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebKitTestRunnerInjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = InjectedBundle.xcconfig; sourceTree = "<group>"; };
BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitTestRunnerPrefix.h; sourceTree = "<group>"; };
@@ -203,7 +203,7 @@
isa = PBXGroup;
children = (
8DD76FA10486AA7600D96B5E /* WebKitTestRunner */,
- BC25186211D15D54002EBC01 /* InjectedBundle.bundle */,
+ BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -343,9 +343,9 @@
productReference = 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */;
productType = "com.apple.product-type.tool";
};
- BC25186111D15D54002EBC01 /* InjectedBundle */ = {
+ BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */ = {
isa = PBXNativeTarget;
- buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */;
+ buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "WebKitTestRunnerInjectedBundle" */;
buildPhases = (
BC25185E11D15D54002EBC01 /* Resources */,
BC25185F11D15D54002EBC01 /* Sources */,
@@ -356,9 +356,9 @@
dependencies = (
BC952ED711F3C38B003398B4 /* PBXTargetDependency */,
);
- name = InjectedBundle;
+ name = WebKitTestRunnerInjectedBundle;
productName = InjectedBundle;
- productReference = BC25186211D15D54002EBC01 /* InjectedBundle.bundle */;
+ productReference = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
@@ -381,7 +381,7 @@
projectRoot = "";
targets = (
8DD76F960486AA7600D96B5E /* WebKitTestRunner */,
- BC25186111D15D54002EBC01 /* InjectedBundle */,
+ BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */,
BC952D7711F3BF5D003398B4 /* Derived Sources */,
);
};
@@ -462,7 +462,7 @@
/* Begin PBXTargetDependency section */
BC25194211D15D94002EBC01 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = BC25186111D15D54002EBC01 /* InjectedBundle */;
+ target = BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */;
targetProxy = BC25194111D15D94002EBC01 /* PBXContainerItemProxy */;
};
BC952ED711F3C38B003398B4 /* PBXTargetDependency */ = {
@@ -558,7 +558,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */ = {
+ BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "WebKitTestRunnerInjectedBundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BC25186411D15D55002EBC01 /* Debug */,
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
index dbe35e2..be9aa33 100644
--- a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -36,7 +36,7 @@ void TestController::platformInitialize()
void TestController::initializeInjectedBundlePath()
{
- NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundle.bundle"];
+ NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"WebKitTestRunnerInjectedBundle.bundle"];
m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
}
diff --git a/autotools/symbols.filter b/autotools/symbols.filter
index 7bc3f64..c42bce7 100644
--- a/autotools/symbols.filter
+++ b/autotools/symbols.filter
@@ -4,7 +4,7 @@ _ZN3WTF10fastMallocEj;
_ZN3WTF11fastReallocEPvj;
_ZN3WTF8fastFreeEPv;
_ZN3WTF10fastCallocEjj;
-
+_ZN24DumpRenderTreeSupportGtk*;
local:
_Z*;
cti*;