summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--JavaScriptCore/API/JSCallbackObject.h8
-rw-r--r--JavaScriptCore/API/JSCallbackObjectFunctions.h20
-rw-r--r--JavaScriptCore/API/JSClassRef.cpp16
-rw-r--r--JavaScriptCore/API/JSClassRef.h4
-rw-r--r--JavaScriptCore/API/JSRetainPtr.h89
-rw-r--r--JavaScriptCore/API/OpaqueJSString.cpp4
-rw-r--r--JavaScriptCore/CMakeLists.txt10
-rw-r--r--JavaScriptCore/ChangeLog1366
-rw-r--r--JavaScriptCore/GNUmakefile.am1
-rw-r--r--JavaScriptCore/JavaScriptCore.exp40
-rw-r--r--JavaScriptCore/JavaScriptCore.gypi1
-rw-r--r--JavaScriptCore/JavaScriptCore.pro1
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def17
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make1
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj4
-rw-r--r--JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj12
-rw-r--r--JavaScriptCore/assembler/ARMAssembler.cpp4
-rw-r--r--JavaScriptCore/assembler/ARMAssembler.h134
-rw-r--r--JavaScriptCore/assembler/ARMv7Assembler.h10
-rw-r--r--JavaScriptCore/assembler/AssemblerBuffer.h7
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerARM.h24
-rw-r--r--JavaScriptCore/bytecode/CodeBlock.cpp65
-rw-r--r--JavaScriptCore/bytecode/EvalCodeCache.h10
-rw-r--r--JavaScriptCore/bytecode/JumpTable.h6
-rw-r--r--JavaScriptCore/bytecode/SamplingTool.cpp2
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.cpp30
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.h6
-rw-r--r--JavaScriptCore/bytecompiler/NodesCodegen.cpp17
-rw-r--r--JavaScriptCore/debugger/DebuggerCallFrame.cpp2
-rw-r--r--JavaScriptCore/interpreter/CallFrame.cpp2
-rw-r--r--JavaScriptCore/interpreter/Interpreter.cpp4
-rw-r--r--JavaScriptCore/interpreter/RegisterFile.h4
-rw-r--r--JavaScriptCore/jit/JITStubs.cpp35
-rw-r--r--JavaScriptCore/jit/JITStubs.h2
-rw-r--r--JavaScriptCore/jsc.cpp16
-rw-r--r--JavaScriptCore/jsc/CMakeLists.txt10
-rw-r--r--JavaScriptCore/parser/ASTBuilder.h2
-rw-r--r--JavaScriptCore/parser/JSParser.cpp6
-rw-r--r--JavaScriptCore/parser/ParserArena.h2
-rw-r--r--JavaScriptCore/parser/SourceProvider.h6
-rw-r--r--JavaScriptCore/pcre/pcre_compile.cpp3
-rw-r--r--JavaScriptCore/pcre/pcre_exec.cpp6
-rw-r--r--JavaScriptCore/profiler/CallIdentifier.h10
-rw-r--r--JavaScriptCore/profiler/Profile.cpp4
-rw-r--r--JavaScriptCore/profiler/ProfileGenerator.cpp8
-rw-r--r--JavaScriptCore/profiler/ProfileNode.cpp10
-rw-r--r--JavaScriptCore/profiler/ProfileNode.h5
-rw-r--r--JavaScriptCore/profiler/Profiler.cpp1
-rw-r--r--JavaScriptCore/runtime/Arguments.cpp16
-rw-r--r--JavaScriptCore/runtime/ArrayPrototype.cpp8
-rw-r--r--JavaScriptCore/runtime/Collector.h14
-rw-r--r--JavaScriptCore/runtime/DateConversion.cpp3
-rw-r--r--JavaScriptCore/runtime/DatePrototype.cpp2
-rw-r--r--JavaScriptCore/runtime/ExceptionHelpers.cpp1
-rw-r--r--JavaScriptCore/runtime/FunctionConstructor.cpp1
-rw-r--r--JavaScriptCore/runtime/FunctionPrototype.cpp6
-rw-r--r--JavaScriptCore/runtime/Identifier.cpp87
-rw-r--r--JavaScriptCore/runtime/Identifier.h78
-rw-r--r--JavaScriptCore/runtime/InitializeThreading.cpp5
-rw-r--r--JavaScriptCore/runtime/InternalFunction.cpp2
-rw-r--r--JavaScriptCore/runtime/JSArray.cpp18
-rw-r--r--JavaScriptCore/runtime/JSArray.h15
-rw-r--r--JavaScriptCore/runtime/JSByteArray.cpp6
-rw-r--r--JavaScriptCore/runtime/JSCell.h3
-rw-r--r--JavaScriptCore/runtime/JSFunction.cpp2
-rw-r--r--JavaScriptCore/runtime/JSGlobalData.cpp1
-rw-r--r--JavaScriptCore/runtime/JSGlobalObject.h2
-rw-r--r--JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp186
-rw-r--r--JavaScriptCore/runtime/JSGlobalObjectFunctions.h1
-rw-r--r--JavaScriptCore/runtime/JSNumberCell.cpp2
-rw-r--r--JavaScriptCore/runtime/JSONObject.cpp25
-rw-r--r--JavaScriptCore/runtime/JSStaticScopeObject.h2
-rw-r--r--JavaScriptCore/runtime/JSString.cpp41
-rw-r--r--JavaScriptCore/runtime/JSString.h68
-rw-r--r--JavaScriptCore/runtime/JSStringBuilder.h13
-rw-r--r--JavaScriptCore/runtime/JSVariableObject.cpp4
-rw-r--r--JavaScriptCore/runtime/JSVariableObject.h8
-rw-r--r--JavaScriptCore/runtime/LiteralParser.h4
-rw-r--r--JavaScriptCore/runtime/Lookup.cpp4
-rw-r--r--JavaScriptCore/runtime/Lookup.h12
-rw-r--r--JavaScriptCore/runtime/NumberPrototype.cpp28
-rw-r--r--JavaScriptCore/runtime/NumericStrings.h8
-rw-r--r--JavaScriptCore/runtime/ObjectPrototype.cpp2
-rw-r--r--JavaScriptCore/runtime/Operations.h26
-rw-r--r--JavaScriptCore/runtime/PropertyMapHashTable.h6
-rw-r--r--JavaScriptCore/runtime/PropertyNameArray.cpp8
-rw-r--r--JavaScriptCore/runtime/PropertyNameArray.h8
-rw-r--r--JavaScriptCore/runtime/RegExp.cpp20
-rw-r--r--JavaScriptCore/runtime/RegExpCache.cpp6
-rw-r--r--JavaScriptCore/runtime/RegExpCache.h2
-rw-r--r--JavaScriptCore/runtime/RegExpConstructor.cpp3
-rw-r--r--JavaScriptCore/runtime/RegExpKey.h21
-rw-r--r--JavaScriptCore/runtime/RegExpObject.cpp3
-rw-r--r--JavaScriptCore/runtime/RegExpPrototype.cpp2
-rw-r--r--JavaScriptCore/runtime/RopeImpl.cpp2
-rw-r--r--JavaScriptCore/runtime/RopeImpl.h6
-rw-r--r--JavaScriptCore/runtime/ScopeChain.cpp2
-rw-r--r--JavaScriptCore/runtime/SmallStrings.cpp12
-rw-r--r--JavaScriptCore/runtime/SmallStrings.h2
-rw-r--r--JavaScriptCore/runtime/StringBuilder.h2
-rw-r--r--JavaScriptCore/runtime/StringConcatenate.h428
-rw-r--r--JavaScriptCore/runtime/StringConstructor.cpp2
-rw-r--r--JavaScriptCore/runtime/StringObject.cpp4
-rw-r--r--JavaScriptCore/runtime/StringPrototype.cpp131
-rw-r--r--JavaScriptCore/runtime/Structure.cpp26
-rw-r--r--JavaScriptCore/runtime/Structure.h12
-rw-r--r--JavaScriptCore/runtime/StructureTransitionTable.h4
-rw-r--r--JavaScriptCore/runtime/SymbolTable.h2
-rw-r--r--JavaScriptCore/runtime/UString.cpp516
-rw-r--r--JavaScriptCore/runtime/UString.h807
-rw-r--r--JavaScriptCore/runtime/UStringImpl.h30
-rw-r--r--JavaScriptCore/wscript36
-rw-r--r--JavaScriptCore/wtf/ByteArray.cpp3
-rw-r--r--JavaScriptCore/wtf/CMakeLists.txt4
-rw-r--r--JavaScriptCore/wtf/FastMalloc.cpp19
-rw-r--r--JavaScriptCore/wtf/Forward.h2
-rw-r--r--JavaScriptCore/wtf/MD5.cpp15
-rw-r--r--JavaScriptCore/wtf/PassRefPtr.h20
-rw-r--r--JavaScriptCore/wtf/Platform.h6
-rw-r--r--JavaScriptCore/wtf/RefPtr.h80
-rw-r--r--JavaScriptCore/wtf/RetainPtr.h70
-rw-r--r--JavaScriptCore/wtf/StdLibExtras.h34
-rw-r--r--JavaScriptCore/wtf/Vector.h3
-rw-r--r--JavaScriptCore/wtf/dtoa.cpp117
-rw-r--r--JavaScriptCore/wtf/gobject/GRefPtr.cpp14
-rw-r--r--JavaScriptCore/wtf/gobject/GRefPtr.h11
-rw-r--r--JavaScriptCore/wtf/qt/StringQt.cpp5
-rw-r--r--JavaScriptCore/wtf/text/AtomicString.h14
-rw-r--r--JavaScriptCore/wtf/text/AtomicStringHash.h (renamed from WebCore/platform/text/AtomicStringHash.h)12
-rw-r--r--JavaScriptCore/wtf/text/StringImpl.cpp409
-rw-r--r--JavaScriptCore/wtf/text/StringImpl.h23
-rw-r--r--JavaScriptCore/wtf/text/WTFString.cpp97
-rw-r--r--JavaScriptCore/wtf/text/WTFString.h226
-rw-r--r--JavaScriptCore/yarr/RegexJIT.cpp8
-rw-r--r--JavaScriptCore/yarr/RegexParser.h4
-rw-r--r--JavaScriptGlue/ChangeLog14
-rw-r--r--JavaScriptGlue/JSUtils.cpp6
-rw-r--r--JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj7
-rw-r--r--LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt1
-rw-r--r--LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt11
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt13
-rw-r--r--LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt12
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt16
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/disconnected-frame.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt16
-rw-r--r--LayoutTests/fast/dom/Geolocation/no-page-cache.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html11
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html8
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js14
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js51
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js55
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js35
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js45
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js31
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js24
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js2
-rw-r--r--WebCore/Android.derived.jscbindings.mk1
-rw-r--r--WebCore/Android.derived.v8bindings.mk1
-rw-r--r--WebCore/Android.jscbindings.mk1
-rw-r--r--WebCore/Android.mk17
-rw-r--r--WebCore/CMakeLists.txt104
-rw-r--r--WebCore/CMakeListsEfl.txt1
-rw-r--r--WebCore/ChangeLog5619
-rw-r--r--WebCore/Configurations/WebCore.xcconfig4
-rw-r--r--WebCore/DerivedSources.cpp14
-rw-r--r--WebCore/DerivedSources.make13
-rw-r--r--WebCore/ForwardingHeaders/wtf/text/AtomicStringHash.h4
-rw-r--r--WebCore/GNUmakefile.am101
-rw-r--r--WebCore/WebCore.exp.in2
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp123
-rw-r--r--WebCore/WebCore.gypi81
-rw-r--r--WebCore/WebCore.order4
-rw-r--r--WebCore/WebCore.pri33
-rw-r--r--WebCore/WebCore.pro94
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj870
-rwxr-xr-xWebCore/WebCore.vcproj/copyForwardingHeaders.cmd80
-rwxr-xr-xWebCore/WebCore.vcproj/copyInspectorFiles.cmd5
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj294
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp44
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp2
-rw-r--r--WebCore/bindings/ScriptControllerBase.cpp14
-rw-r--r--WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp48
-rw-r--r--WebCore/bindings/cpp/WebDOMCustomVoidCallback.h55
-rw-r--r--WebCore/bindings/cpp/WebDOMEventTarget.cpp7
-rw-r--r--WebCore/bindings/cpp/WebDOMEventTarget.h1
-rw-r--r--WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp2
-rw-r--r--WebCore/bindings/cpp/WebDOMHTMLDocumentCustom.cpp4
-rw-r--r--WebCore/bindings/cpp/WebDOMString.cpp2
-rw-r--r--WebCore/bindings/generic/ActiveDOMCallback.cpp1
-rw-r--r--WebCore/bindings/generic/BindingDOMWindow.h8
-rw-r--r--WebCore/bindings/gobject/GObjectEventListener.cpp3
-rw-r--r--WebCore/bindings/gobject/WebKitDOMBinding.cpp3
-rw-r--r--WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp20
-rw-r--r--WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSClipboardCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMBinding.cpp7
-rw-r--r--WebCore/bindings/js/JSDOMBinding.h10
-rw-r--r--WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMPluginArrayCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMPluginCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMStringMapCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMWindowCustom.cpp68
-rw-r--r--WebCore/bindings/js/JSDataGridColumnListCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSDocumentCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp8
-rw-r--r--WebCore/bindings/js/JSHTMLCollectionCustom.cpp8
-rw-r--r--WebCore/bindings/js/JSInjectedScriptHostCustom.cpp3
-rw-r--r--WebCore/bindings/js/JSLocationCustom.cpp6
-rw-r--r--WebCore/bindings/js/JSMessagePortCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSNodeListCustom.cpp4
-rw-r--r--WebCore/bindings/js/ScriptController.cpp18
-rw-r--r--WebCore/bindings/js/ScriptController.h2
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.cpp6
-rw-r--r--WebCore/bindings/js/ScriptProfile.cpp4
-rw-r--r--WebCore/bindings/js/ScriptString.h2
-rw-r--r--WebCore/bindings/js/ScriptValue.cpp6
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.cpp108
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.h27
-rw-r--r--WebCore/bindings/objc/WebScriptObject.mm2
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorCPP.pm21
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm18
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm33
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp15
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h1
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp7
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h1
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp9
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h7
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp6
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h6
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp158
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h82
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp8
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.h2
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.h2
-rw-r--r--WebCore/bindings/v8/IDBBindingUtilities.cpp34
-rw-r--r--WebCore/bindings/v8/IDBBindingUtilities.h3
-rw-r--r--WebCore/bindings/v8/ScriptCallStack.cpp2
-rw-r--r--WebCore/bindings/v8/ScriptController.cpp19
-rw-r--r--WebCore/bindings/v8/ScriptController.h2
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.cpp36
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.h12
-rw-r--r--WebCore/bindings/v8/ScriptProfile.cpp4
-rwxr-xr-xWebCore/bindings/v8/ScriptValue.cpp6
-rw-r--r--WebCore/bindings/v8/SerializedScriptValue.cpp73
-rw-r--r--WebCore/bindings/v8/V8Binding.cpp6
-rw-r--r--WebCore/bindings/v8/V8Binding.h2
-rw-r--r--WebCore/bindings/v8/V8DOMWindowShell.cpp42
-rw-r--r--WebCore/bindings/v8/V8DOMWindowShell.h5
-rw-r--r--WebCore/bindings/v8/V8DOMWrapper.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp6
-rw-r--r--WebCore/bindings/v8/custom/V8CustomPositionCallback.cpp4
-rw-r--r--WebCore/bindings/v8/custom/V8CustomPositionErrorCallback.cpp4
-rw-r--r--WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp65
-rw-r--r--WebCore/bindings/v8/custom/V8GeolocationCustom.cpp4
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp75
-rw-r--r--WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp3
-rw-r--r--WebCore/bindings/v8/specialization/V8BindingState.cpp3
-rw-r--r--WebCore/bridge/IdentifierRep.cpp4
-rw-r--r--WebCore/bridge/NP_jsobject.cpp2
-rw-r--r--WebCore/bridge/c/c_class.cpp12
-rw-r--r--WebCore/bridge/c/c_utility.cpp2
-rw-r--r--WebCore/bridge/jni/JNIBridge.cpp8
-rw-r--r--WebCore/bridge/jni/JNIBridge.h6
-rw-r--r--WebCore/bridge/jni/jni_jsobject.mm14
-rw-r--r--WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp6
-rw-r--r--WebCore/bridge/jni/jsc/JNIBridgeJSC.h2
-rw-r--r--WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp12
-rw-r--r--WebCore/bridge/jni/jsc/JavaClassJSC.cpp10
-rw-r--r--WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp6
-rw-r--r--WebCore/bridge/jni/jsc/JavaStringJSC.h18
-rw-r--r--WebCore/bridge/jni/v8/JavaClassV8.h2
-rw-r--r--WebCore/bridge/jsc/BridgeJSC.h6
-rw-r--r--WebCore/bridge/objc/objc_class.mm14
-rw-r--r--WebCore/bridge/objc/objc_instance.mm4
-rw-r--r--WebCore/bridge/objc/objc_runtime.mm2
-rw-r--r--WebCore/bridge/qt/qt_class.cpp5
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp22
-rw-r--r--WebCore/bridge/runtime_array.cpp6
-rwxr-xr-xWebCore/combine-javascript-resources4
-rw-r--r--WebCore/css/CSSCanvasValue.cpp2
-rw-r--r--WebCore/css/CSSFontFaceSource.h2
-rw-r--r--WebCore/css/CSSFontSelector.cpp2
-rw-r--r--WebCore/css/CSSFontSelector.h2
-rw-r--r--WebCore/css/CSSNamespace.h2
-rw-r--r--WebCore/css/CSSParser.cpp84
-rw-r--r--WebCore/css/CSSParser.h2
-rw-r--r--WebCore/css/CSSParserValues.h2
-rw-r--r--WebCore/css/CSSSelector.cpp70
-rw-r--r--WebCore/css/CSSSelector.h5
-rw-r--r--WebCore/css/CSSStyleDeclaration.cpp6
-rw-r--r--WebCore/css/CSSStyleSelector.cpp70
-rw-r--r--WebCore/css/CSSStyleSelector.h2
-rw-r--r--WebCore/css/CSSVariablesDeclaration.h2
-rw-r--r--WebCore/css/MediaFeatureNames.h2
-rw-r--r--WebCore/css/MediaQueryExp.h2
-rw-r--r--WebCore/css/WebKitCSSKeyframesRule.h2
-rw-r--r--WebCore/css/mathml.css3
-rw-r--r--WebCore/css/mediaControlsQt.css2
-rw-r--r--WebCore/dom/ActiveDOMObject.cpp6
-rw-r--r--WebCore/dom/CustomEvent.h2
-rw-r--r--WebCore/dom/Document.cpp14
-rw-r--r--WebCore/dom/Document.h9
-rw-r--r--WebCore/dom/DocumentFragment.cpp3
-rw-r--r--WebCore/dom/DocumentParser.h4
-rw-r--r--WebCore/dom/Element.cpp10
-rw-r--r--WebCore/dom/Element.h2
-rw-r--r--WebCore/dom/Event.cpp2
-rw-r--r--WebCore/dom/Event.h2
-rw-r--r--WebCore/dom/EventNames.h2
-rw-r--r--WebCore/dom/EventTarget.h2
-rw-r--r--WebCore/dom/InputElement.h5
-rw-r--r--WebCore/dom/MessagePort.cpp17
-rw-r--r--WebCore/dom/MessagePort.h2
-rw-r--r--WebCore/dom/NameNodeList.h2
-rw-r--r--WebCore/dom/Node.cpp5
-rw-r--r--WebCore/dom/Node.h21
-rw-r--r--WebCore/dom/Node.idl3
-rw-r--r--WebCore/dom/NodeRareData.h2
-rw-r--r--WebCore/dom/OverflowEvent.h4
-rw-r--r--WebCore/dom/OverflowEvent.idl3
-rw-r--r--WebCore/dom/PendingScript.h25
-rw-r--r--WebCore/dom/QualifiedName.h2
-rw-r--r--WebCore/dom/Range.cpp5
-rw-r--r--WebCore/dom/ScriptElement.cpp2
-rw-r--r--WebCore/dom/ScriptExecutionContext.cpp57
-rw-r--r--WebCore/dom/ScriptExecutionContext.h24
-rw-r--r--WebCore/dom/SpaceSplitString.h2
-rw-r--r--WebCore/dom/TagNodeList.h2
-rw-r--r--WebCore/dom/TextEvent.cpp42
-rw-r--r--WebCore/dom/TextEvent.h34
-rw-r--r--WebCore/dom/XMLDocumentParser.h2
-rw-r--r--WebCore/dom/XMLDocumentParserLibxml2.cpp2
-rw-r--r--WebCore/dom/XMLDocumentParserQt.cpp2
-rwxr-xr-xWebCore/dom/make_names.pl8
-rw-r--r--WebCore/editing/ApplyStyleCommand.cpp142
-rw-r--r--WebCore/editing/ApplyStyleCommand.h7
-rw-r--r--WebCore/editing/CompositeEditCommand.cpp35
-rw-r--r--WebCore/editing/DeleteSelectionCommand.cpp3
-rw-r--r--WebCore/editing/Editor.cpp26
-rw-r--r--WebCore/editing/Editor.h1
-rw-r--r--WebCore/editing/EditorCommand.cpp2
-rw-r--r--WebCore/editing/InsertTextCommand.cpp2
-rw-r--r--WebCore/editing/TextIterator.cpp27
-rw-r--r--WebCore/editing/TypingCommand.cpp8
-rw-r--r--WebCore/editing/markup.cpp108
-rw-r--r--WebCore/history/mac/HistoryItemMac.mm2
-rw-r--r--WebCore/html/Blob.cpp73
-rw-r--r--WebCore/html/Blob.h36
-rw-r--r--WebCore/html/BlobBuilder.cpp2
-rw-r--r--WebCore/html/BlobURL.cpp (renamed from WebCore/inspector/front-end/ObjectProxy.js)62
-rw-r--r--WebCore/html/BlobURL.h48
-rw-r--r--WebCore/html/DataGridColumn.h2
-rw-r--r--WebCore/html/DataGridColumnList.cpp2
-rw-r--r--WebCore/html/File.cpp12
-rw-r--r--WebCore/html/File.h12
-rw-r--r--WebCore/html/FileReader.cpp63
-rw-r--r--WebCore/html/FileReader.h13
-rw-r--r--WebCore/html/FileReader.idl3
-rw-r--r--WebCore/html/FileStream.cpp138
-rw-r--r--WebCore/html/FileStream.h45
-rw-r--r--WebCore/html/FileStreamClient.h10
-rw-r--r--WebCore/html/FileStreamProxy.cpp140
-rw-r--r--WebCore/html/FileStreamProxy.h31
-rw-r--r--WebCore/html/FileThreadTask.h50
-rw-r--r--WebCore/html/HTMLAnchorElement.cpp4
-rw-r--r--WebCore/html/HTMLCanvasElement.cpp39
-rw-r--r--WebCore/html/HTMLCanvasElement.h5
-rw-r--r--WebCore/html/HTMLConstructionSite.cpp9
-rw-r--r--WebCore/html/HTMLDocument.cpp9
-rw-r--r--WebCore/html/HTMLDocument.h2
-rw-r--r--WebCore/html/HTMLDocumentParser.h6
-rw-r--r--WebCore/html/HTMLElement.cpp94
-rw-r--r--WebCore/html/HTMLElement.h3
-rw-r--r--WebCore/html/HTMLEmbedElement.cpp4
-rw-r--r--WebCore/html/HTMLEntityNames.gperf303
-rw-r--r--WebCore/html/HTMLEntityParser.cpp109
-rw-r--r--WebCore/html/HTMLEntityParser.h3
-rw-r--r--WebCore/html/HTMLEntitySearch.cpp132
-rw-r--r--WebCore/html/HTMLEntitySearch.h75
-rw-r--r--WebCore/html/HTMLEntityTable.h (renamed from WebCore/html/canvas/CanvasNumberArray.h)48
-rw-r--r--WebCore/html/HTMLFormControlElement.cpp4
-rw-r--r--WebCore/html/HTMLInputElement.cpp2
-rw-r--r--WebCore/html/HTMLInputElement.h1
-rw-r--r--WebCore/html/HTMLLinkElement.cpp29
-rw-r--r--WebCore/html/HTMLLinkElement.h4
-rw-r--r--WebCore/html/HTMLMediaElement.cpp25
-rw-r--r--WebCore/html/HTMLMediaElement.h1
-rw-r--r--WebCore/html/HTMLObjectElement.cpp4
-rw-r--r--WebCore/html/HTMLScriptRunner.cpp84
-rw-r--r--WebCore/html/HTMLScriptRunner.h14
-rw-r--r--WebCore/html/HTMLSourceElement.cpp4
-rw-r--r--WebCore/html/HTMLSourceElement.h2
-rw-r--r--WebCore/html/HTMLToken.h60
-rw-r--r--WebCore/html/HTMLTokenizer.cpp85
-rw-r--r--WebCore/html/HTMLTokenizer.h4
-rw-r--r--WebCore/html/HTMLTreeBuilder.cpp67
-rw-r--r--WebCore/html/HTMLViewSourceDocument.cpp195
-rw-r--r--WebCore/html/HTMLViewSourceDocument.h17
-rw-r--r--WebCore/html/HTMLViewSourceParser.cpp106
-rw-r--r--WebCore/html/HTMLViewSourceParser.h77
-rw-r--r--WebCore/html/LegacyHTMLDocumentParser.cpp2126
-rw-r--r--WebCore/html/LegacyHTMLDocumentParser.h452
-rw-r--r--WebCore/html/LegacyHTMLTreeBuilder.cpp2
-rw-r--r--WebCore/html/LegacyHTMLTreeBuilder.h93
-rw-r--r--WebCore/html/LegacyPreloadScanner.cpp856
-rw-r--r--WebCore/html/LegacyPreloadScanner.h144
-rw-r--r--WebCore/html/ThreadableBlobRegistry.cpp96
-rw-r--r--WebCore/html/ThreadableBlobRegistry.h51
-rw-r--r--WebCore/html/canvas/CanvasPattern.cpp2
-rw-r--r--WebCore/html/canvas/CanvasPattern.h4
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.cpp60
-rw-r--r--WebCore/html/canvas/CanvasStyle.cpp18
-rw-r--r--WebCore/html/canvas/CanvasStyle.h22
-rw-r--r--WebCore/html/canvas/WebGLObject.cpp20
-rw-r--r--WebCore/html/canvas/WebGLObject.h21
-rw-r--r--WebCore/html/canvas/WebGLProgram.cpp62
-rw-r--r--WebCore/html/canvas/WebGLProgram.h9
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp418
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.h38
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.idl18
-rw-r--r--WebCore/html/canvas/WebGLTexture.cpp27
-rw-r--r--WebCore/inspector/CodeGeneratorInspector.pm132
-rw-r--r--WebCore/inspector/ConsoleMessage.cpp22
-rw-r--r--WebCore/inspector/Inspector.idl6
-rw-r--r--WebCore/inspector/InspectorApplicationCacheAgent.cpp4
-rw-r--r--WebCore/inspector/InspectorBackend.cpp5
-rw-r--r--WebCore/inspector/InspectorBackend.h1
-rw-r--r--WebCore/inspector/InspectorCSSStore.h2
-rw-r--r--WebCore/inspector/InspectorController.cpp33
-rw-r--r--WebCore/inspector/InspectorController.h6
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp64
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h2
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.cpp2
-rw-r--r--WebCore/inspector/InspectorDebuggerAgent.h2
-rw-r--r--WebCore/inspector/InspectorResource.cpp6
-rw-r--r--WebCore/inspector/InspectorStorageAgent.cpp2
-rw-r--r--WebCore/inspector/InspectorTimelineAgent.cpp20
-rw-r--r--WebCore/inspector/InspectorValues.cpp32
-rw-r--r--WebCore/inspector/InspectorValues.h47
-rw-r--r--WebCore/inspector/ScriptBreakpoint.cpp2
-rw-r--r--WebCore/inspector/TimelineRecordFactory.cpp2
-rw-r--r--WebCore/inspector/front-end/AuditRules.js8
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js46
-rw-r--r--WebCore/inspector/front-end/DOMAgent.js4
-rw-r--r--WebCore/inspector/front-end/DatabaseTableView.js2
-rw-r--r--WebCore/inspector/front-end/ElementsPanel.js2
-rw-r--r--WebCore/inspector/front-end/ElementsTreeOutline.js4
-rw-r--r--WebCore/inspector/front-end/EventListenersSidebarPane.js24
-rw-r--r--WebCore/inspector/front-end/ExtensionServer.js16
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js967
-rw-r--r--WebCore/inspector/front-end/InjectedScriptAccess.js32
-rw-r--r--WebCore/inspector/front-end/InspectorBackendStub.js129
-rw-r--r--WebCore/inspector/front-end/InspectorBackendStub.qrc6
-rw-r--r--WebCore/inspector/front-end/ObjectPropertiesSection.js14
-rw-r--r--WebCore/inspector/front-end/PropertiesSidebarPane.js11
-rw-r--r--WebCore/inspector/front-end/RemoteObject.js138
-rw-r--r--WebCore/inspector/front-end/ResourcesPanel.js2
-rw-r--r--WebCore/inspector/front-end/ScopeChainSidebarPane.js4
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js8
-rw-r--r--WebCore/inspector/front-end/SourceFrame.js8
-rw-r--r--WebCore/inspector/front-end/WatchExpressionsSidebarPane.js20
-rw-r--r--WebCore/inspector/front-end/WebKit.qrc3
-rw-r--r--WebCore/inspector/front-end/inspector.html2
-rw-r--r--WebCore/inspector/front-end/inspector.js56
-rw-r--r--WebCore/inspector/front-end/utilities.js18
-rw-r--r--WebCore/loader/Cache.h2
-rw-r--r--WebCore/loader/CrossOriginAccessControl.cpp2
-rw-r--r--WebCore/loader/CrossOriginPreflightResultCache.cpp8
-rw-r--r--WebCore/loader/CrossOriginPreflightResultCache.h2
-rw-r--r--WebCore/loader/DocLoader.h2
-rw-r--r--WebCore/loader/DocumentLoader.cpp1
-rw-r--r--WebCore/loader/DocumentLoader.h3
-rw-r--r--WebCore/loader/FTPDirectoryDocument.cpp98
-rw-r--r--WebCore/loader/FTPDirectoryParser.cpp6
-rw-r--r--WebCore/loader/FormSubmission.cpp16
-rw-r--r--WebCore/loader/FormSubmission.h2
-rw-r--r--WebCore/loader/FrameLoader.cpp136
-rw-r--r--WebCore/loader/FrameLoader.h13
-rw-r--r--WebCore/loader/FrameNetworkingContext.h51
-rw-r--r--WebCore/loader/ImageLoader.h2
-rw-r--r--WebCore/loader/MainResourceLoader.cpp4
-rw-r--r--WebCore/loader/RedirectScheduler.cpp38
-rw-r--r--WebCore/loader/RedirectScheduler.h4
-rw-r--r--WebCore/loader/appcache/ApplicationCache.cpp1
-rw-r--r--WebCore/loader/appcache/ApplicationCache.h2
-rw-r--r--WebCore/loader/appcache/ApplicationCacheStorage.cpp12
-rw-r--r--WebCore/loader/appcache/ApplicationCacheStorage.h3
-rw-r--r--WebCore/loader/appcache/DOMApplicationCache.h2
-rw-r--r--WebCore/loader/icon/IconDatabase.cpp10
-rw-r--r--WebCore/loader/icon/IconDatabase.h2
-rw-r--r--WebCore/loader/icon/IconFetcher.cpp4
-rw-r--r--WebCore/loader/icon/IconRecord.cpp1
-rw-r--r--WebCore/loader/icon/IconRecord.h4
-rw-r--r--WebCore/loader/loader.h4
-rw-r--r--WebCore/make-hash-tools.pl10
-rw-r--r--WebCore/manual-tests/back-forward-during-alert-1.html3
-rw-r--r--WebCore/manual-tests/back-forward-during-alert-2.html10
-rw-r--r--WebCore/manual-tests/indexed-database.html67
-rw-r--r--WebCore/notifications/Notification.h2
-rw-r--r--WebCore/page/Console.cpp2
-rw-r--r--WebCore/page/DOMSelection.cpp2
-rw-r--r--WebCore/page/DOMWindow.cpp14
-rw-r--r--WebCore/page/DOMWindow.idl11
-rw-r--r--WebCore/page/DragController.cpp15
-rw-r--r--WebCore/page/DragController.h1
-rw-r--r--WebCore/page/EventHandler.cpp6
-rw-r--r--WebCore/page/FrameTree.h2
-rw-r--r--WebCore/page/FrameView.cpp2
-rw-r--r--WebCore/page/Geolocation.cpp131
-rw-r--r--WebCore/page/Geolocation.h9
-rw-r--r--WebCore/page/GroupSettings.cpp46
-rw-r--r--WebCore/page/GroupSettings.h58
-rw-r--r--WebCore/page/Page.cpp10
-rw-r--r--WebCore/page/PageGroup.cpp10
-rw-r--r--WebCore/page/PageGroup.h10
-rw-r--r--WebCore/page/SecurityOrigin.cpp86
-rw-r--r--WebCore/page/SecurityOrigin.h2
-rw-r--r--WebCore/page/Settings.cpp10
-rw-r--r--WebCore/page/Settings.h10
-rw-r--r--WebCore/page/SpeechInput.cpp76
-rw-r--r--WebCore/page/SpeechInput.h25
-rw-r--r--WebCore/page/SpeechInputClient.h13
-rw-r--r--WebCore/page/SpeechInputListener.h6
-rw-r--r--WebCore/page/UserContentURLPattern.cpp14
-rw-r--r--WebCore/page/UserStyleSheet.h10
-rw-r--r--WebCore/page/WindowFeatures.cpp2
-rw-r--r--WebCore/page/XSSAuditor.cpp10
-rw-r--r--WebCore/page/XSSAuditor.h2
-rw-r--r--WebCore/page/animation/AnimationBase.h2
-rw-r--r--WebCore/page/animation/AnimationControllerPrivate.h2
-rw-r--r--WebCore/page/animation/CompositeAnimation.h3
-rw-r--r--WebCore/platform/ContentType.cpp18
-rw-r--r--WebCore/platform/Cookie.h2
-rw-r--r--WebCore/platform/FileSystem.cpp104
-rw-r--r--WebCore/platform/FileSystem.h3
-rw-r--r--WebCore/platform/KURL.cpp43
-rw-r--r--WebCore/platform/KURLGoogle.cpp2
-rw-r--r--WebCore/platform/KURLHash.h2
-rw-r--r--WebCore/platform/Length.cpp14
-rw-r--r--WebCore/platform/LinkHash.cpp58
-rw-r--r--WebCore/platform/LinkHash.h2
-rw-r--r--WebCore/platform/MIMETypeRegistry.cpp6
-rw-r--r--WebCore/platform/MIMETypeRegistry.h2
-rw-r--r--WebCore/platform/SchemeRegistry.cpp4
-rw-r--r--WebCore/platform/SchemeRegistry.h2
-rw-r--r--WebCore/platform/ScrollView.cpp1
-rw-r--r--WebCore/platform/ThreadGlobalData.cpp2
-rw-r--r--WebCore/platform/ThreadGlobalData.h2
-rw-r--r--WebCore/platform/android/PopupMenuAndroid.cpp57
-rw-r--r--WebCore/platform/android/SearchPopupMenuAndroid.cpp52
-rw-r--r--WebCore/platform/cf/BinaryPropertyList.cpp2
-rw-r--r--WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm5
-rw-r--r--WebCore/platform/chromium/SearchPopupMenuChromium.cpp2
-rw-r--r--WebCore/platform/efl/ClipboardEfl.cpp2
-rw-r--r--WebCore/platform/efl/CookieJarEfl.cpp3
-rw-r--r--WebCore/platform/efl/LocalizedStringsEfl.cpp20
-rw-r--r--WebCore/platform/efl/PlatformKeyboardEventEfl.cpp2
-rw-r--r--WebCore/platform/graphics/ANGLEWebKitBridge.cpp79
-rw-r--r--WebCore/platform/graphics/ANGLEWebKitBridge.h (renamed from WebCore/bindings/js/JSCanvasNumberArrayCustom.cpp)43
-rw-r--r--WebCore/platform/graphics/FontCache.cpp2
-rw-r--r--WebCore/platform/graphics/FontDescription.h4
-rw-r--r--WebCore/platform/graphics/FontFamily.h2
-rw-r--r--WebCore/platform/graphics/GeneratedImage.cpp7
-rw-r--r--WebCore/platform/graphics/GraphicsContext.cpp69
-rw-r--r--WebCore/platform/graphics/GraphicsContext.h18
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.cpp15
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h27
-rw-r--r--WebCore/platform/graphics/Image.h6
-rw-r--r--WebCore/platform/graphics/ImageBuffer.h27
-rw-r--r--WebCore/platform/graphics/MediaPlayer.cpp6
-rw-r--r--WebCore/platform/graphics/MediaPlayer.h2
-rw-r--r--WebCore/platform/graphics/Path.cpp2
-rw-r--r--WebCore/platform/graphics/Path.h4
-rw-r--r--WebCore/platform/graphics/Pattern.cpp4
-rw-r--r--WebCore/platform/graphics/Pattern.h6
-rw-r--r--WebCore/platform/graphics/WOFFFileFormat.cpp3
-rw-r--r--WebCore/platform/graphics/cairo/GRefPtrCairo.cpp52
-rw-r--r--WebCore/platform/graphics/cairo/GRefPtrCairo.h38
-rw-r--r--WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp12
-rw-r--r--WebCore/platform/graphics/cairo/ImageBufferCairo.cpp47
-rw-r--r--WebCore/platform/graphics/cairo/ImageCairo.cpp18
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContextCG.cpp26
-rw-r--r--WebCore/platform/graphics/cg/ImageBufferCG.cpp89
-rw-r--r--WebCore/platform/graphics/cg/ImageBufferData.h14
-rw-r--r--WebCore/platform/graphics/cg/ImageSourceCGWin.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/FontCacheLinux.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp115
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h2
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp3
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataLinux.h2
-rw-r--r--WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Canvas.cpp46
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Canvas.h1
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Texture.cpp144
-rw-r--r--WebCore/platform/graphics/chromium/GLES2Texture.h16
-rw-r--r--WebCore/platform/graphics/chromium/ImageLayerChromium.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.cpp3
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.h2
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.cpp3
-rwxr-xr-xWebCore/platform/graphics/chromium/TilingData.cpp218
-rwxr-xr-xWebCore/platform/graphics/chromium/TilingData.h87
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.cpp2
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.cpp20
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.cpp97
-rw-r--r--WebCore/platform/graphics/filters/FEGaussianBlur.h5
-rw-r--r--WebCore/platform/graphics/filters/Filter.h2
-rw-r--r--WebCore/platform/graphics/filters/SourceAlpha.cpp4
-rw-r--r--WebCore/platform/graphics/filters/SourceGraphic.cpp2
-rw-r--r--WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp4
-rw-r--r--WebCore/platform/graphics/gtk/ImageGtk.cpp75
-rw-r--r--WebCore/platform/graphics/mac/FontPlatformData.h2
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm182
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.h2
-rw-r--r--WebCore/platform/graphics/qt/ContextShadow.cpp256
-rw-r--r--WebCore/platform/graphics/qt/ContextShadow.h71
-rw-r--r--WebCore/platform/graphics/qt/FontCacheQt.cpp2
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp9
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp208
-rw-r--r--WebCore/platform/graphics/qt/ImageBufferData.h4
-rw-r--r--WebCore/platform/graphics/qt/ImageBufferQt.cpp53
-rw-r--r--WebCore/platform/graphics/qt/ImageDecoderQt.cpp25
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp4
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp66
-rw-r--r--WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h10
-rw-r--r--WebCore/platform/graphics/qt/PathQt.cpp27
-rw-r--r--WebCore/platform/graphics/qt/TransparencyLayer.h89
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp12
-rw-r--r--WebCore/platform/graphics/skia/ImageBufferSkia.cpp41
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp12
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp24
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.h2
-rw-r--r--WebCore/platform/graphics/win/FontCacheWin.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp2
-rw-r--r--WebCore/platform/graphics/win/FontPlatformDataWin.cpp2
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp2
-rw-r--r--WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp2
-rw-r--r--WebCore/platform/graphics/win/WKCACFLayer.h3
-rw-r--r--WebCore/platform/graphics/wince/FontPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/wince/PathWince.cpp8
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformData.h2
-rw-r--r--WebCore/platform/graphics/wx/GraphicsContextWx.cpp5
-rw-r--r--WebCore/platform/graphics/wx/ImageBufferWx.cpp26
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.cpp2
-rw-r--r--WebCore/platform/gtk/DataObjectGtk.h2
-rw-r--r--WebCore/platform/gtk/GOwnPtrGtk.cpp9
-rw-r--r--WebCore/platform/gtk/GOwnPtrGtk.h4
-rw-r--r--WebCore/platform/gtk/GtkVersioning.cpp50
-rw-r--r--WebCore/platform/gtk/GtkVersioning.h5
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.cpp17
-rw-r--r--WebCore/platform/gtk/ScrollViewGtk.cpp24
-rw-r--r--WebCore/platform/gtk/ScrollbarGtk.cpp30
-rw-r--r--WebCore/platform/gtk/SharedTimerGtk.cpp3
-rw-r--r--WebCore/platform/haiku/ClipboardHaiku.cpp2
-rw-r--r--WebCore/platform/haiku/CookieJarHaiku.cpp3
-rw-r--r--WebCore/platform/haiku/SearchPopupMenuHaiku.cpp2
-rw-r--r--WebCore/platform/mac/DragImageMac.mm4
-rw-r--r--WebCore/platform/mac/ScrollbarThemeMac.mm2
-rw-r--r--WebCore/platform/mac/SearchPopupMenuMac.mm2
-rw-r--r--WebCore/platform/mac/ThreadCheck.mm2
-rw-r--r--WebCore/platform/mock/SpeechInputClientMock.cpp28
-rw-r--r--WebCore/platform/mock/SpeechInputClientMock.h8
-rw-r--r--WebCore/platform/network/BlobData.cpp87
-rw-r--r--WebCore/platform/network/BlobData.h152
-rw-r--r--WebCore/platform/network/BlobRegistry.h64
-rw-r--r--WebCore/platform/network/BlobRegistryImpl.cpp177
-rw-r--r--WebCore/platform/network/BlobRegistryImpl.h74
-rw-r--r--WebCore/platform/network/BlobStorageData.h108
-rw-r--r--WebCore/platform/network/CredentialStorage.cpp14
-rw-r--r--WebCore/platform/network/HTTPHeaderMap.h6
-rw-r--r--WebCore/platform/network/HTTPParsers.cpp34
-rw-r--r--WebCore/platform/network/NetworkingContext.h68
-rw-r--r--WebCore/platform/network/ResourceResponseBase.cpp24
-rw-r--r--WebCore/platform/network/cf/DNSCFNet.cpp2
-rw-r--r--WebCore/platform/network/curl/CookieJarCurl.cpp3
-rw-r--r--WebCore/platform/qt/ClipboardQt.cpp2
-rw-r--r--WebCore/platform/sql/SQLiteDatabase.cpp5
-rw-r--r--WebCore/platform/sql/SQLiteStatement.cpp1
-rw-r--r--WebCore/platform/text/AtomicString.h27
-rw-r--r--WebCore/platform/text/AtomicStringImpl.h27
-rw-r--r--WebCore/platform/text/AtomicStringKeyedMRUCache.h2
-rw-r--r--WebCore/platform/text/SegmentedString.cpp15
-rw-r--r--WebCore/platform/text/SegmentedString.h32
-rw-r--r--WebCore/platform/text/StringBuilder.cpp2
-rw-r--r--WebCore/platform/text/StringHash.h28
-rw-r--r--WebCore/platform/text/StringImpl.h29
-rw-r--r--WebCore/platform/text/TextBoundaries.cpp2
-rw-r--r--WebCore/platform/text/TextCodecLatin1.cpp2
-rw-r--r--WebCore/platform/text/TextCodecUTF16.cpp2
-rw-r--r--WebCore/platform/text/TextCodecUserDefined.cpp2
-rw-r--r--WebCore/platform/text/cf/HyphenationCF.cpp1
-rw-r--r--WebCore/platform/text/cf/StringImplCF.cpp2
-rw-r--r--WebCore/platform/text/mac/HyphenationMac.mm1
-rw-r--r--WebCore/platform/text/mac/StringImplMac.mm2
-rw-r--r--WebCore/platform/text/transcoder/FontTranscoder.h2
-rw-r--r--WebCore/platform/text/wince/TextCodecWinCE.cpp2
-rw-r--r--WebCore/platform/win/BString.cpp4
-rw-r--r--WebCore/platform/win/COMPtr.h64
-rw-r--r--WebCore/platform/win/ClipboardWin.cpp2
-rw-r--r--WebCore/platform/win/SearchPopupMenuWin.cpp2
-rw-r--r--WebCore/platform/win/SharedBufferWin.cpp1
-rw-r--r--WebCore/platform/wince/SearchPopupMenuWince.cpp2
-rw-r--r--WebCore/platform/wx/ClipboardWx.cpp2
-rw-r--r--WebCore/plugins/DOMMimeTypeArray.cpp2
-rw-r--r--WebCore/plugins/DOMPlugin.cpp2
-rw-r--r--WebCore/plugins/DOMPluginArray.cpp2
-rw-r--r--WebCore/plugins/PluginDatabase.h3
-rw-r--r--WebCore/plugins/PluginPackage.cpp2
-rw-r--r--WebCore/plugins/PluginPackage.h2
-rw-r--r--WebCore/plugins/PluginStream.h2
-rw-r--r--WebCore/plugins/PluginView.cpp10
-rw-r--r--WebCore/plugins/PluginView.h10
-rw-r--r--WebCore/plugins/qt/PluginViewQt.cpp86
-rw-r--r--WebCore/plugins/symbian/PluginViewSymbian.cpp5
-rw-r--r--WebCore/plugins/win/PluginPackageWin.cpp2
-rw-r--r--WebCore/rendering/InlineTextBox.h1
-rw-r--r--WebCore/rendering/RenderApplet.h2
-rw-r--r--WebCore/rendering/RenderBlock.cpp8
-rw-r--r--WebCore/rendering/RenderBox.cpp10
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp2
-rw-r--r--WebCore/rendering/RenderEmbeddedObject.cpp4
-rw-r--r--WebCore/rendering/RenderInputSpeech.cpp12
-rw-r--r--WebCore/rendering/RenderRubyRun.cpp32
-rw-r--r--WebCore/rendering/RenderSVGAllInOne.cpp1
-rw-r--r--WebCore/rendering/RenderSVGGradientStop.cpp4
-rw-r--r--WebCore/rendering/RenderSVGImage.cpp2
-rw-r--r--WebCore/rendering/RenderSVGImage.h15
-rw-r--r--WebCore/rendering/RenderSVGResource.cpp2
-rw-r--r--WebCore/rendering/RenderSVGResource.h4
-rw-r--r--WebCore/rendering/RenderSVGResourceClipper.cpp11
-rw-r--r--WebCore/rendering/RenderSVGResourceClipper.h4
-rw-r--r--WebCore/rendering/RenderSVGResourceContainer.cpp27
-rw-r--r--WebCore/rendering/RenderSVGResourceContainer.h3
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp13
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.h4
-rw-r--r--WebCore/rendering/RenderSVGResourceGradient.cpp67
-rw-r--r--WebCore/rendering/RenderSVGResourceGradient.h4
-rw-r--r--WebCore/rendering/RenderSVGResourceMarker.cpp11
-rw-r--r--WebCore/rendering/RenderSVGResourceMarker.h4
-rw-r--r--WebCore/rendering/RenderSVGResourceMasker.cpp104
-rw-r--r--WebCore/rendering/RenderSVGResourceMasker.h16
-rw-r--r--WebCore/rendering/RenderSVGResourcePattern.cpp24
-rw-r--r--WebCore/rendering/RenderSVGResourcePattern.h4
-rw-r--r--WebCore/rendering/RenderSVGResourceSolidColor.h4
-rw-r--r--WebCore/rendering/RenderTableSection.cpp107
-rw-r--r--WebCore/rendering/RenderText.cpp2
-rw-r--r--WebCore/rendering/RenderTextControl.cpp7
-rw-r--r--WebCore/rendering/RenderTheme.h1
-rw-r--r--WebCore/rendering/RenderThemeChromiumMac.h3
-rw-r--r--WebCore/rendering/RenderThemeChromiumMac.mm14
-rw-r--r--WebCore/rendering/RenderThemeMac.mm3
-rw-r--r--WebCore/rendering/RenderTreeAsText.cpp2
-rw-r--r--WebCore/rendering/RenderVideo.cpp13
-rw-r--r--WebCore/rendering/RenderView.cpp2
-rw-r--r--WebCore/rendering/SVGImageBufferTools.cpp73
-rw-r--r--WebCore/rendering/SVGImageBufferTools.h49
-rw-r--r--WebCore/rendering/SVGRenderSupport.cpp29
-rw-r--r--WebCore/rendering/SVGRenderTreeAsText.cpp3
-rw-r--r--WebCore/rendering/SVGRenderTreeAsText.h3
-rw-r--r--WebCore/rendering/SVGResources.cpp38
-rw-r--r--WebCore/rendering/SVGResources.h2
-rw-r--r--WebCore/rendering/SVGResourcesCache.cpp2
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp46
-rw-r--r--WebCore/rendering/TextControlInnerElements.h17
-rw-r--r--WebCore/rendering/style/BindingURI.h2
-rw-r--r--WebCore/rendering/style/ContentData.cpp2
-rw-r--r--WebCore/rendering/style/CounterContent.h2
-rw-r--r--WebCore/rendering/style/CounterDirectives.h2
-rw-r--r--WebCore/rendering/style/KeyframeList.h2
-rw-r--r--WebCore/rendering/style/StyleRareInheritedData.h2
-rw-r--r--WebCore/storage/AbstractDatabase.cpp2
-rw-r--r--WebCore/storage/DOMFileSystem.cpp6
-rw-r--r--WebCore/storage/DOMFileSystem.h4
-rw-r--r--WebCore/storage/DOMFileSystem.idl2
-rw-r--r--WebCore/storage/Database.cpp15
-rw-r--r--WebCore/storage/DatabaseAuthorizer.h2
-rw-r--r--WebCore/storage/DatabaseTask.cpp8
-rw-r--r--WebCore/storage/DatabaseTask.h18
-rw-r--r--WebCore/storage/DatabaseThread.cpp12
-rw-r--r--WebCore/storage/DatabaseThread.h2
-rw-r--r--WebCore/storage/DatabaseTracker.cpp4
-rw-r--r--WebCore/storage/DatabaseTracker.h2
-rw-r--r--WebCore/storage/DirectoryEntry.cpp (renamed from WebKit/chromium/src/js/InjectDispatch.js)55
-rw-r--r--WebCore/storage/DirectoryEntry.h68
-rw-r--r--WebCore/storage/DirectoryEntry.idl41
-rw-r--r--WebCore/storage/DirectoryReader.cpp56
-rw-r--r--WebCore/storage/DirectoryReader.h66
-rw-r--r--WebCore/storage/DirectoryReader.idl37
-rw-r--r--WebCore/storage/EntriesCallback.h52
-rw-r--r--WebCore/storage/EntriesCallback.idl38
-rw-r--r--WebCore/storage/Entry.cpp23
-rw-r--r--WebCore/storage/Entry.h23
-rw-r--r--WebCore/storage/Entry.idl8
-rw-r--r--WebCore/storage/EntryArray.cpp51
-rw-r--r--WebCore/storage/EntryArray.h67
-rw-r--r--WebCore/storage/EntryArray.idl39
-rw-r--r--WebCore/storage/FileEntry.cpp45
-rw-r--r--WebCore/storage/FileEntry.h61
-rw-r--r--WebCore/storage/FileEntry.idl38
-rw-r--r--WebCore/storage/IDBDatabase.cpp1
-rw-r--r--WebCore/storage/IDBDatabase.h4
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.cpp75
-rw-r--r--WebCore/storage/IDBDatabaseBackendImpl.h14
-rw-r--r--WebCore/storage/IDBFactory.h2
-rw-r--r--WebCore/storage/IDBFactory.idl2
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.cpp74
-rw-r--r--WebCore/storage/IDBFactoryBackendImpl.h10
-rw-r--r--WebCore/storage/IDBKeyPath.cpp269
-rw-r--r--WebCore/storage/IDBKeyPath.h64
-rw-r--r--WebCore/storage/IDBObjectStoreBackendImpl.h2
-rw-r--r--WebCore/storage/OriginQuotaManager.h2
-rw-r--r--WebCore/storage/OriginUsageRecord.h5
-rw-r--r--WebCore/storage/SQLStatement.cpp1
-rw-r--r--WebCore/storage/SQLTransactionCoordinator.h2
-rw-r--r--WebCore/storage/StorageAreaSync.h2
-rw-r--r--WebCore/storage/StorageMap.h3
-rw-r--r--WebCore/storage/StorageNamespaceImpl.cpp2
-rw-r--r--WebCore/storage/chromium/QuotaTracker.h2
-rw-r--r--WebCore/svg/SVGAllInOne.cpp2
-rw-r--r--WebCore/svg/SVGAltGlyphElement.h2
-rw-r--r--WebCore/svg/SVGAnimateElement.cpp48
-rw-r--r--WebCore/svg/SVGAnimateElement.h9
-rw-r--r--WebCore/svg/SVGDocumentExtensions.cpp2
-rw-r--r--WebCore/svg/SVGDocumentExtensions.h4
-rw-r--r--WebCore/svg/SVGFEImageElement.cpp2
-rw-r--r--WebCore/svg/SVGFitToViewBox.cpp2
-rw-r--r--WebCore/svg/SVGFont.cpp4
-rw-r--r--WebCore/svg/SVGImageElement.cpp2
-rw-r--r--WebCore/svg/SVGLangSpace.h2
-rw-r--r--WebCore/svg/SVGPathBlender.cpp292
-rw-r--r--WebCore/svg/SVGPathBlender.h62
-rw-r--r--WebCore/svg/SVGPathBuilder.h2
-rw-r--r--WebCore/svg/SVGPathByteStreamBuilder.h2
-rw-r--r--WebCore/svg/SVGPathConsumer.h2
-rw-r--r--WebCore/svg/SVGPathElement.cpp7
-rw-r--r--WebCore/svg/SVGPathElement.h2
-rw-r--r--WebCore/svg/SVGPathElement.idl3
-rw-r--r--WebCore/svg/SVGPathParser.cpp5
-rw-r--r--WebCore/svg/SVGPathParserFactory.cpp61
-rw-r--r--WebCore/svg/SVGPathParserFactory.h4
-rw-r--r--WebCore/svg/SVGPathSegList.cpp190
-rw-r--r--WebCore/svg/SVGPathSegList.h27
-rw-r--r--WebCore/svg/SVGPathSegListBuilder.h2
-rw-r--r--WebCore/svg/SVGPathStringBuilder.h2
-rw-r--r--WebCore/svg/SVGPathTraversalStateBuilder.cpp87
-rw-r--r--WebCore/svg/SVGPathTraversalStateBuilder.h65
-rw-r--r--WebCore/svg/SVGPointList.cpp5
-rw-r--r--WebCore/svg/SVGURIReference.cpp9
-rw-r--r--WebCore/svg/animation/SMILTimeContainer.h2
-rw-r--r--WebCore/svg/animation/SVGSMILElement.cpp16
-rw-r--r--WebCore/svg/graphics/SVGImage.cpp9
-rw-r--r--WebCore/svg/graphics/SVGImage.h3
-rw-r--r--WebCore/svg/graphics/filters/SVGFEMerge.cpp2
-rw-r--r--WebCore/svg/graphics/filters/SVGFEOffset.cpp2
-rw-r--r--WebCore/svg/graphics/filters/SVGFETile.cpp4
-rw-r--r--WebCore/svg/graphics/filters/SVGFETurbulence.cpp12
-rw-r--r--WebCore/svg/graphics/filters/SVGFilterBuilder.h2
-rw-r--r--WebCore/websockets/WebSocket.h2
-rw-r--r--WebCore/websockets/WebSocketChannel.cpp77
-rw-r--r--WebCore/websockets/WebSocketChannel.h7
-rw-r--r--WebCore/websockets/WebSocketHandshake.cpp2
-rw-r--r--WebCore/websockets/WebSocketHandshakeResponse.cpp2
-rw-r--r--WebCore/wml/WMLInputElement.h1
-rw-r--r--WebCore/wml/WMLPageState.h2
-rw-r--r--WebCore/workers/AbstractWorker.h2
-rw-r--r--WebCore/workers/DefaultSharedWorkerRepository.h2
-rw-r--r--WebCore/workers/Worker.h2
-rw-r--r--WebCore/workers/WorkerContext.h2
-rw-r--r--WebCore/wscript247
-rw-r--r--WebCore/xml/XMLHttpRequest.h2
-rw-r--r--WebCore/xml/XMLHttpRequestUpload.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequestUpload.h2
-rw-r--r--WebCore/xml/XPathExpressionNode.h2
-rw-r--r--WebCore/xml/XPathFunctions.cpp18
-rw-r--r--WebCore/xml/XPathNamespace.h2
-rw-r--r--WebCore/xml/XPathParser.cpp6
-rw-r--r--WebCore/xml/XSLTProcessor.cpp6
-rw-r--r--WebCore/xml/XSLTProcessor.h2
-rw-r--r--WebKit/CMakeLists.txt10
-rw-r--r--WebKit/ChangeLog51
-rw-r--r--WebKit/WebKit.xcodeproj/project.pbxproj17
-rw-r--r--WebKit/chromium/ChangeLog648
-rw-r--r--WebKit/chromium/DEPS2
-rw-r--r--WebKit/chromium/WebKit.grd1
-rw-r--r--WebKit/chromium/WebKit.gyp39
-rw-r--r--WebKit/chromium/features.gypi25
-rw-r--r--WebKit/chromium/public/WebAnimationController.h2
-rw-r--r--WebKit/chromium/public/WebDevToolsAgent.h12
-rw-r--r--WebKit/chromium/public/WebDevToolsAgentClient.h2
-rw-r--r--WebKit/chromium/public/WebFileSystem.h35
-rw-r--r--WebKit/chromium/public/WebFileUtilities.h77
-rw-r--r--WebKit/chromium/public/WebFrameClient.h6
-rw-r--r--WebKit/chromium/public/WebGraphicsContext3D.h2
-rw-r--r--WebKit/chromium/public/WebIDBKey.h4
-rw-r--r--WebKit/chromium/public/WebIDBKeyPath.h68
-rw-r--r--WebKit/chromium/public/WebKitClient.h8
-rw-r--r--WebKit/chromium/public/WebNotification.h3
-rw-r--r--WebKit/chromium/public/WebPrivateOwnPtr.h75
-rw-r--r--WebKit/chromium/public/WebSpeechInputController.h13
-rw-r--r--WebKit/chromium/public/WebSpeechInputListener.h21
-rw-r--r--WebKit/chromium/src/ApplicationCacheHost.cpp9
-rw-r--r--WebKit/chromium/src/AssertMatchingEnums.cpp2
-rw-r--r--WebKit/chromium/src/ChromiumBridge.cpp36
-rw-r--r--WebKit/chromium/src/DebuggerAgentManager.cpp41
-rw-r--r--WebKit/chromium/src/DebuggerAgentManager.h19
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.cpp17
-rw-r--r--WebKit/chromium/src/FrameNetworkingContextImpl.h43
-rw-r--r--WebKit/chromium/src/GraphicsContext3D.cpp27
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.cpp30
-rw-r--r--WebKit/chromium/src/SpeechInputClientImpl.h15
-rw-r--r--WebKit/chromium/src/WebAnimationControllerImpl.cpp20
-rw-r--r--WebKit/chromium/src/WebAnimationControllerImpl.h2
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.cpp77
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.h1
-rw-r--r--WebKit/chromium/src/WebDevToolsFrontendImpl.cpp20
-rw-r--r--WebKit/chromium/src/WebDevToolsFrontendImpl.h2
-rw-r--r--WebKit/chromium/src/WebEntities.cpp69
-rw-r--r--WebKit/chromium/src/WebEntities.h1
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp379
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h120
-rw-r--r--WebKit/chromium/src/WebIDBKey.cpp12
-rw-r--r--WebKit/chromium/src/WebIDBKeyPath.cpp77
-rw-r--r--WebKit/chromium/src/WebKit.cpp2
-rw-r--r--WebKit/chromium/src/WebNotification.cpp5
-rw-r--r--WebKit/chromium/src/WebPageSerializerImpl.h2
-rw-r--r--WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp30
-rw-r--r--WebKit/chromium/src/WebSpeechInputControllerMockImpl.h13
-rw-r--r--WebKit/chromium/src/WebString.cpp2
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp8
-rw-r--r--WebKit/chromium/src/gtk/WebInputEventFactory.cpp19
-rw-r--r--WebKit/chromium/src/js/DevTools.js64
-rw-r--r--WebKit/chromium/src/js/Tests.js349
-rw-r--r--WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp165
-rw-r--r--WebKit/chromium/tests/IDBKeyPathTest.cpp205
-rwxr-xr-xWebKit/chromium/tests/TilingDataTest.cpp223
-rw-r--r--WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp112
-rw-r--r--WebKit/efl/CMakeListsEfl.txt70
-rw-r--r--WebKit/efl/ChangeLog137
-rw-r--r--WebKit/efl/DefaultTheme/default.edc6
-rw-r--r--WebKit/efl/DefaultTheme/widget/button/button.edc14
-rw-r--r--WebKit/efl/DefaultTheme/widget/button/img_button_focus.pngbin3373 -> 1343 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/button/img_button_hover.pngbin3281 -> 1343 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/button/img_button_normal.pngbin3323 -> 731 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/button/img_button_press.pngbin3817 -> 1466 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/check.edc6
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/img_check_off.pngbin3079 -> 362 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.pngbin3111 -> 371 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.pngbin3061 -> 371 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/img_check_on.pngbin3206 -> 514 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.pngbin510 -> 521 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.pngbin3148 -> 521 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo.edc24
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_focus.pngbin3197 -> 955 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.pngbin3115 -> 1141 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_hover.pngbin3145 -> 955 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.pngbin3068 -> 1141 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_normal.pngbin3134 -> 442 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.pngbin3062 -> 517 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_press.pngbin3297 -> 1093 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/combo_press_button.pngbin3247 -> 1120 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/combo/icon.pngbin2790 -> 170 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/entry/img_focused.pngbin3651 -> 2651 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/entry/img_hovered.pngbin3519 -> 2651 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/entry/img_normal.pngbin3573 -> 632 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/file/file_focus.pngbin4357 -> 1836 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/file/file_hover.pngbin4256 -> 1715 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/file/file_normal.pngbin4385 -> 1867 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/file/file_press.pngbin4318 -> 1805 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/img_radio_off.pngbin3355 -> 598 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.pngbin3278 -> 587 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.pngbin3309 -> 587 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/img_radio_on.pngbin3420 -> 615 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.pngbin3279 -> 610 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.pngbin3353 -> 610 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/radio/radio.edc6
-rw-r--r--WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc87
-rw-r--r--WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.pngbin2995 -> 161 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.pngbin266 -> 0 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.pngbin2946 -> 177 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.pngbin2939 -> 181 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.pngbin2992 -> 165 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.pngbin2999 -> 619 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.pngbin2883 -> 260 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/search/field/field_focused.pngbin3651 -> 2651 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/search/field/field_hovered.pngbin3519 -> 2651 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/search/field/field_normal.pngbin3573 -> 632 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider.edc358
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.pngbin0 -> 148 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.pngbin0 -> 311 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_h.pngbin2995 -> 326 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_hilight.pngbin266 -> 0 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.pngbin2946 -> 507 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.pngbin0 -> 555 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.pngbin0 -> 813 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.pngbin2939 -> 697 bytes
-rw-r--r--WebKit/efl/DefaultTheme/widget/slider/slider_v.pngbin2992 -> 482 bytes
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp19
-rw-r--r--WebKit/efl/ewk/ewk_frame.cpp2
-rw-r--r--WebKit/efl/ewk/ewk_private.h2
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp55
-rw-r--r--WebKit/efl/ewk/ewk_view.h6
-rw-r--r--WebKit/gtk/ChangeLog227
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp6
-rw-r--r--WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp29
-rw-r--r--WebKit/gtk/WebCoreSupport/EditorClientGtk.h3
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h45
-rw-r--r--WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp112
-rw-r--r--WebKit/gtk/gdom/ConvertToGCharPrivate.h2
-rw-r--r--WebKit/gtk/org.webkitgtk.gschema.xml.in32
-rw-r--r--WebKit/gtk/webkit/webkitprivate.cpp46
-rw-r--r--WebKit/gtk/webkit/webkitprivate.h10
-rw-r--r--WebKit/gtk/webkit/webkitwebbackforwardlist.cpp27
-rw-r--r--WebKit/gtk/webkit/webkitwebbackforwardlist.h2
-rw-r--r--WebKit/gtk/webkit/webkitwebframe.cpp26
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp18
-rw-r--r--WebKit/mac/ChangeLog188
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h2
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm2
-rw-r--r--WebKit/mac/Plugins/Hosted/ProxyInstance.mm12
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h39
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm21
-rw-r--r--WebKit/mac/WebCoreSupport/WebInspectorClient.mm8
-rw-r--r--WebKit/mac/WebInspector/WebInspector.h2
-rw-r--r--WebKit/mac/WebInspector/WebInspector.mm15
-rw-r--r--WebKit/mac/WebInspector/WebInspectorFrontend.h (renamed from WebCore/html/canvas/CanvasNumberArray.idl)22
-rw-r--r--WebKit/mac/WebInspector/WebInspectorFrontend.mm (renamed from WebCore/html/canvas/CanvasNumberArray.cpp)32
-rw-r--r--WebKit/mac/WebInspector/WebInspectorPrivate.h3
-rw-r--r--WebKit/mac/WebView/WebFrame.mm26
-rw-r--r--WebKit/mac/WebView/WebFramePrivate.h4
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm95
-rw-r--r--WebKit/mac/WebView/WebHTMLViewPrivate.h4
-rw-r--r--WebKit/mac/WebView/WebScriptDebugger.mm2
-rw-r--r--WebKit/mac/WebView/WebView.mm4
-rw-r--r--WebKit/qt/Api/qgraphicswebview.cpp12
-rw-r--r--WebKit/qt/Api/qgraphicswebview.h2
-rw-r--r--WebKit/qt/Api/qwebelement.cpp12
-rw-r--r--WebKit/qt/ChangeLog130
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp25
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp26
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h2
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp2
-rw-r--r--WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp21
-rw-r--r--WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h43
-rw-r--r--WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp2
-rw-r--r--WebKit/qt/symbian/eabi/QtWebKitu.def78
-rw-r--r--WebKit/win/ChangeLog73
-rw-r--r--WebKit/win/DefaultDownloadDelegate.cpp1
-rwxr-xr-xWebKit/win/Interfaces/IWebFramePrivate.idl2
-rw-r--r--WebKit/win/Interfaces/WebKit.idl2
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp21
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h42
-rw-r--r--WebKit/win/WebFrame.cpp28
-rw-r--r--WebKit/win/WebFrame.h2
-rw-r--r--WebKit/win/WebKit.vcproj/WebKit.vcproj8
-rw-r--r--WebKit/win/WebKitDLL.h2
-rw-r--r--WebKit/win/WebLocalizableStrings.cpp2
-rw-r--r--WebKit/win/WebNotificationCenter.cpp2
-rw-r--r--WebKit/win/WebPreferences.cpp2
-rw-r--r--WebKit/win/WebView.cpp4
-rw-r--r--WebKit/wx/ChangeLog63
-rw-r--r--WebKit/wx/WebEdit.cpp4
-rw-r--r--WebKit/wx/WebFrame.cpp2
-rw-r--r--WebKit/wx/WebKitDefines.h2
-rw-r--r--WebKit/wx/bindings/python/webview.i8
-rw-r--r--WebKit/wx/bindings/python/wscript13
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json10
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg11
-rw-r--r--WebKitTools/ChangeLog872
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.cpp16
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.h2
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp5
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h1
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp40
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.h4
-rw-r--r--WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp11
-rw-r--r--WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp13
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp21
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm10
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp14
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h2
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp9
-rw-r--r--WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp18
-rw-r--r--WebKitTools/DumpRenderTree/wscript4
-rw-r--r--WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp10
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m3
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.cpp3
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.cpp33
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.h5
-rw-r--r--WebKitTools/QtTestBrowser/mainwindow.cpp4
-rw-r--r--WebKitTools/QtTestBrowser/webview.cpp59
-rw-r--r--WebKitTools/QtTestBrowser/webview.h4
-rwxr-xr-xWebKitTools/Scripts/build-webkit23
-rwxr-xr-xWebKitTools/Scripts/commit-log-editor51
-rwxr-xr-xWebKitTools/Scripts/create-html-entity-table183
-rw-r--r--WebKitTools/Scripts/deduplicate-tests84
-rwxr-xr-xWebKitTools/Scripts/old-run-webkit-tests71
-rwxr-xr-xWebKitTools/Scripts/prepare-ChangeLog11
-rwxr-xr-xWebKitTools/Scripts/webkit-patch6
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm25
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/scm.py34
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py55
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py167
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py147
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py90
-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/json_results_generator.py93
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py6
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py74
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py46
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py14
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py142
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py113
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py71
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py6
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py22
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checker.py15
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/common.py19
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py32
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py124
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py172
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/text.py11
-rw-r--r--WebKitTools/Scripts/webkitpy/style_references.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py2
-rwxr-xr-xWebKitTools/Scripts/webkitpy/tool/main.py14
-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/TestResultServer/handlers/testfilehandler.py31
-rwxr-xr-xWebKitTools/TestResultServer/model/jsonresults.py127
-rwxr-xr-xWebKitTools/TestResultServer/model/jsonresults_unittest.py127
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp33
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h10
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp72
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h1
-rw-r--r--WebKitTools/WebKitTestRunner/PlatformWebView.h1
-rw-r--r--WebKitTools/WebKitTestRunner/StringFunctions.h10
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp81
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.h19
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.cpp15
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.h5
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj4
-rw-r--r--WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm5
-rw-r--r--WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm10
-rw-r--r--WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm36
-rw-r--r--WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp7
-rw-r--r--WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp28
-rw-r--r--WebKitTools/WebKitTestRunner/win/TestInvocationWin.cpp42
-rw-r--r--WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj4
-rw-r--r--WebKitTools/gdb/webcore.py171
-rw-r--r--WebKitTools/gdb/webkit.py272
-rw-r--r--WebKitTools/gdb/wtf.py133
-rw-r--r--WebKitTools/wx/browser/wscript4
-rw-r--r--WebKitTools/wx/build/settings.py123
-rw-r--r--WebKitTools/wx/build/waf_extensions.py7
-rw-r--r--autotools/gsettings.m493
1176 files changed, 30985 insertions, 13904 deletions
diff --git a/JavaScriptCore/API/JSCallbackObject.h b/JavaScriptCore/API/JSCallbackObject.h
index cf42818..83442b2 100644
--- a/JavaScriptCore/API/JSCallbackObject.h
+++ b/JavaScriptCore/API/JSCallbackObject.h
@@ -80,7 +80,7 @@ struct JSCallbackObjectData {
struct JSPrivatePropertyMap {
JSValue getPrivateProperty(const Identifier& propertyName) const
{
- PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.ustring().rep());
+ PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.impl());
if (location == m_propertyMap.end())
return JSValue();
return location->second;
@@ -88,12 +88,12 @@ struct JSCallbackObjectData {
void setPrivateProperty(const Identifier& propertyName, JSValue value)
{
- m_propertyMap.set(propertyName.ustring().rep(), value);
+ m_propertyMap.set(propertyName.impl(), value);
}
void deletePrivateProperty(const Identifier& propertyName)
{
- m_propertyMap.remove(propertyName.ustring().rep());
+ m_propertyMap.remove(propertyName.impl());
}
void markChildren(MarkStack& markStack)
@@ -105,7 +105,7 @@ struct JSCallbackObjectData {
}
private:
- typedef HashMap<RefPtr<UString::Rep>, JSValue, IdentifierRepHash> PrivatePropertyMap;
+ typedef HashMap<RefPtr<StringImpl>, JSValue, IdentifierRepHash> PrivatePropertyMap;
PrivatePropertyMap m_propertyMap;
};
OwnPtr<JSPrivatePropertyMap> m_privateProperties;
diff --git a/JavaScriptCore/API/JSCallbackObjectFunctions.h b/JavaScriptCore/API/JSCallbackObjectFunctions.h
index 9a3e448..de5d842 100644
--- a/JavaScriptCore/API/JSCallbackObjectFunctions.h
+++ b/JavaScriptCore/API/JSCallbackObjectFunctions.h
@@ -146,14 +146,14 @@ bool JSCallbackObject<Base>::getOwnPropertySlot(ExecState* exec, const Identifie
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
- if (staticValues->contains(propertyName.ustring().rep())) {
+ if (staticValues->contains(propertyName.impl())) {
slot.setCustom(this, staticValueGetter);
return true;
}
}
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
- if (staticFunctions->contains(propertyName.ustring().rep())) {
+ if (staticFunctions->contains(propertyName.impl())) {
slot.setCustom(this, staticFunctionGetter);
return true;
}
@@ -213,7 +213,7 @@ void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
- if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) {
+ if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeReadOnly)
return;
if (JSObjectSetPropertyCallback setProperty = entry->setProperty) {
@@ -235,7 +235,7 @@ void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName
}
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
- if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
+ if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeReadOnly)
return;
JSCallbackObject<Base>::putDirect(propertyName, value); // put as override property
@@ -271,7 +271,7 @@ bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, const Identifier& p
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
- if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) {
+ if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeDontDelete)
return false;
return true;
@@ -279,7 +279,7 @@ bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, const Identifier& p
}
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
- if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
+ if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (entry->attributes & kJSPropertyAttributeDontDelete)
return false;
return true;
@@ -417,7 +417,7 @@ void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameAr
typedef OpaqueJSClassStaticValuesTable::const_iterator iterator;
iterator end = staticValues->end();
for (iterator it = staticValues->begin(); it != end; ++it) {
- UString::Rep* name = it->first.get();
+ StringImpl* name = it->first.get();
StaticValueEntry* entry = it->second;
if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)))
propertyNames.add(Identifier(exec, name));
@@ -428,7 +428,7 @@ void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameAr
typedef OpaqueJSClassStaticFunctionsTable::const_iterator iterator;
iterator end = staticFunctions->end();
for (iterator it = staticFunctions->begin(); it != end; ++it) {
- UString::Rep* name = it->first.get();
+ StringImpl* name = it->first.get();
StaticFunctionEntry* entry = it->second;
if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))
propertyNames.add(Identifier(exec, name));
@@ -528,7 +528,7 @@ JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, JSValue slotB
for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass)
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec))
- if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep()))
+ if (StaticValueEntry* entry = staticValues->get(propertyName.impl()))
if (JSObjectGetPropertyCallback getProperty = entry->getProperty) {
if (!propertyNameRef)
propertyNameRef = OpaqueJSString::create(propertyName.ustring());
@@ -561,7 +561,7 @@ JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue sl
for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) {
if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
- if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) {
+ if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);
diff --git a/JavaScriptCore/API/JSClassRef.cpp b/JavaScriptCore/API/JSClassRef.cpp
index d8393f1..decf493 100644
--- a/JavaScriptCore/API/JSClassRef.cpp
+++ b/JavaScriptCore/API/JSClassRef.cpp
@@ -45,13 +45,13 @@ const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
static inline UString tryCreateStringFromUTF8(const char* string)
{
if (!string)
- return UString::null();
+ return UString();
size_t length = strlen(string);
Vector<UChar, 1024> buffer(length);
UChar* p = buffer.data();
if (conversionOK != convertUTF8ToUTF16(&string, string + length, &p, p + length))
- return UString::null();
+ return UString();
return UString(buffer.data(), p - buffer.data());
}
@@ -83,7 +83,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
if (!valueName.isNull()) {
// Use a local variable here to sidestep an RVCT compiler bug.
StaticValueEntry* entry = new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes);
- UStringImpl* impl = valueName.rep();
+ StringImpl* impl = valueName.impl();
impl->ref();
m_staticValues->add(impl, entry);
}
@@ -98,7 +98,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
if (!functionName.isNull()) {
// Use a local variable here to sidestep an RVCT compiler bug.
StaticFunctionEntry* entry = new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes);
- UStringImpl* impl = functionName.rep();
+ StringImpl* impl = functionName.impl();
impl->ref();
m_staticFunctions->add(impl, entry);
}
@@ -113,7 +113,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
OpaqueJSClass::~OpaqueJSClass()
{
// The empty string is shared across threads & is an identifier, in all other cases we should have done a deep copy in className(), below.
- ASSERT(!m_className.size() || !m_className.rep()->isIdentifier());
+ ASSERT(!m_className.length() || !m_className.impl()->isIdentifier());
if (m_staticValues) {
OpaqueJSClassStaticValuesTable::const_iterator end = m_staticValues->end();
@@ -173,7 +173,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass)
ASSERT(!it->first->isIdentifier());
// Use a local variable here to sidestep an RVCT compiler bug.
StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes);
- staticValues->add(UString::Rep::create(it->first->characters(), it->first->length()), entry);
+ staticValues->add(StringImpl::create(it->first->characters(), it->first->length()), entry);
}
} else
staticValues = 0;
@@ -185,7 +185,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass)
ASSERT(!it->first->isIdentifier());
// Use a local variable here to sidestep an RVCT compiler bug.
StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes);
- staticFunctions->add(UString::Rep::create(it->first->characters(), it->first->length()), entry);
+ staticFunctions->add(StringImpl::create(it->first->characters(), it->first->length()), entry);
}
} else
@@ -216,7 +216,7 @@ OpaqueJSClassContextData& OpaqueJSClass::contextData(ExecState* exec)
UString OpaqueJSClass::className()
{
// Make a deep copy, so that the caller has no chance to put the original into IdentifierTable.
- return UString(m_className.data(), m_className.size());
+ return UString(m_className.characters(), m_className.length());
}
OpaqueJSClassStaticValuesTable* OpaqueJSClass::staticValues(JSC::ExecState* exec)
diff --git a/JavaScriptCore/API/JSClassRef.h b/JavaScriptCore/API/JSClassRef.h
index 5a3a17e..5062093 100644
--- a/JavaScriptCore/API/JSClassRef.h
+++ b/JavaScriptCore/API/JSClassRef.h
@@ -55,8 +55,8 @@ struct StaticFunctionEntry : FastAllocBase {
JSPropertyAttributes attributes;
};
-typedef HashMap<RefPtr<JSC::UString::Rep>, StaticValueEntry*> OpaqueJSClassStaticValuesTable;
-typedef HashMap<RefPtr<JSC::UString::Rep>, StaticFunctionEntry*> OpaqueJSClassStaticFunctionsTable;
+typedef HashMap<RefPtr<StringImpl>, StaticValueEntry*> OpaqueJSClassStaticValuesTable;
+typedef HashMap<RefPtr<StringImpl>, StaticFunctionEntry*> OpaqueJSClassStaticFunctionsTable;
struct OpaqueJSClass;
diff --git a/JavaScriptCore/API/JSRetainPtr.h b/JavaScriptCore/API/JSRetainPtr.h
index 69c6de1..a884f38 100644
--- a/JavaScriptCore/API/JSRetainPtr.h
+++ b/JavaScriptCore/API/JSRetainPtr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 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
@@ -37,23 +37,20 @@ inline void JSRelease(JSStringRef string) { JSStringRelease(string); }
enum AdoptTag { Adopt };
-template <typename T> class JSRetainPtr {
+template<typename T> class JSRetainPtr {
public:
- JSRetainPtr() : m_ptr(0) {}
+ JSRetainPtr() : m_ptr(0) { }
JSRetainPtr(T ptr) : m_ptr(ptr) { if (ptr) JSRetain(ptr); }
-
JSRetainPtr(AdoptTag, T ptr) : m_ptr(ptr) { }
-
- JSRetainPtr(const JSRetainPtr& o) : m_ptr(o.m_ptr) { if (T ptr = m_ptr) JSRetain(ptr); }
-
- ~JSRetainPtr() { if (T ptr = m_ptr) JSRelease(ptr); }
-
- template <typename U> JSRetainPtr(const JSRetainPtr<U>& o) : m_ptr(o.get()) { if (T ptr = m_ptr) JSRetain(ptr); }
+ JSRetainPtr(const JSRetainPtr&);
+ template<typename U> JSRetainPtr(const JSRetainPtr<U>&);
+ ~JSRetainPtr();
T get() const { return m_ptr; }
- T releaseRef() { T tmp = m_ptr; m_ptr = 0; return tmp; }
-
+ void clear();
+ T leakRef();
+
T operator->() const { return m_ptr; }
bool operator!() const { return !m_ptr; }
@@ -63,19 +60,57 @@ public:
operator UnspecifiedBoolType() const { return m_ptr ? &JSRetainPtr::m_ptr : 0; }
JSRetainPtr& operator=(const JSRetainPtr&);
- template <typename U> JSRetainPtr& operator=(const JSRetainPtr<U>&);
+ template<typename U> JSRetainPtr& operator=(const JSRetainPtr<U>&);
JSRetainPtr& operator=(T);
- template <typename U> JSRetainPtr& operator=(U*);
+ template<typename U> JSRetainPtr& operator=(U*);
void adopt(T);
void swap(JSRetainPtr&);
+ // FIXME: Remove releaseRef once we change all callers to call leakRef instead.
+ T releaseRef() { return leakRef(); }
+
private:
T m_ptr;
};
-template <typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSRetainPtr<T>& o)
+template<typename T> inline JSRetainPtr<T>::JSRetainPtr(const JSRetainPtr& o)
+ : m_ptr(o.m_ptr)
+{
+ if (m_ptr)
+ JSRetain(m_ptr);
+}
+
+template<typename T> template<typename U> inline JSRetainPtr<T>::JSRetainPtr(const JSRetainPtr<U>& o)
+ : m_ptr(o.get())
+{
+ if (m_ptr)
+ JSRetain(m_ptr);
+}
+
+template<typename T> inline JSRetainPtr<T>::~JSRetainPtr()
+{
+ if (m_ptr)
+ JSRelease(m_ptr);
+}
+
+template<typename T> inline void JSRetainPtr<T>::clear()
+{
+ if (T ptr = m_ptr) {
+ m_ptr = 0;
+ JSRelease(ptr);
+ }
+}
+
+template<typename T> inline T JSRetainPtr<T>::leakRef()
+{
+ T ptr = m_ptr;
+ m_ptr = 0;
+ return ptr;
+}
+
+template<typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSRetainPtr<T>& o)
{
T optr = o.get();
if (optr)
@@ -87,7 +122,7 @@ template <typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSR
return *this;
}
-template <typename T> template <typename U> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSRetainPtr<U>& o)
+template<typename T> template<typename U> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSRetainPtr<U>& o)
{
T optr = o.get();
if (optr)
@@ -99,7 +134,7 @@ template <typename T> template <typename U> inline JSRetainPtr<T>& JSRetainPtr<T
return *this;
}
-template <typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(T optr)
+template<typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(T optr)
{
if (optr)
JSRetain(optr);
@@ -110,7 +145,7 @@ template <typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(T optr)
return *this;
}
-template <typename T> inline void JSRetainPtr<T>::adopt(T optr)
+template<typename T> inline void JSRetainPtr<T>::adopt(T optr)
{
T ptr = m_ptr;
m_ptr = optr;
@@ -118,7 +153,7 @@ template <typename T> inline void JSRetainPtr<T>::adopt(T optr)
JSRelease(ptr);
}
-template <typename T> template <typename U> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(U* optr)
+template<typename T> template<typename U> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(U* optr)
{
if (optr)
JSRetain(optr);
@@ -129,42 +164,42 @@ template <typename T> template <typename U> inline JSRetainPtr<T>& JSRetainPtr<T
return *this;
}
-template <class T> inline void JSRetainPtr<T>::swap(JSRetainPtr<T>& o)
+template<typename T> inline void JSRetainPtr<T>::swap(JSRetainPtr<T>& o)
{
std::swap(m_ptr, o.m_ptr);
}
-template <class T> inline void swap(JSRetainPtr<T>& a, JSRetainPtr<T>& b)
+template<typename T> inline void swap(JSRetainPtr<T>& a, JSRetainPtr<T>& b)
{
a.swap(b);
}
-template <typename T, typename U> inline bool operator==(const JSRetainPtr<T>& a, const JSRetainPtr<U>& b)
+template<typename T, typename U> inline bool operator==(const JSRetainPtr<T>& a, const JSRetainPtr<U>& b)
{
return a.get() == b.get();
}
-template <typename T, typename U> inline bool operator==(const JSRetainPtr<T>& a, U* b)
+template<typename T, typename U> inline bool operator==(const JSRetainPtr<T>& a, U* b)
{
return a.get() == b;
}
-template <typename T, typename U> inline bool operator==(T* a, const JSRetainPtr<U>& b)
+template<typename T, typename U> inline bool operator==(T* a, const JSRetainPtr<U>& b)
{
return a == b.get();
}
-template <typename T, typename U> inline bool operator!=(const JSRetainPtr<T>& a, const JSRetainPtr<U>& b)
+template<typename T, typename U> inline bool operator!=(const JSRetainPtr<T>& a, const JSRetainPtr<U>& b)
{
return a.get() != b.get();
}
-template <typename T, typename U> inline bool operator!=(const JSRetainPtr<T>& a, U* b)
+template<typename T, typename U> inline bool operator!=(const JSRetainPtr<T>& a, U* b)
{
return a.get() != b;
}
-template <typename T, typename U> inline bool operator!=(T* a, const JSRetainPtr<U>& b)
+template<typename T, typename U> inline bool operator!=(T* a, const JSRetainPtr<U>& b)
{
return a != b.get();
}
diff --git a/JavaScriptCore/API/OpaqueJSString.cpp b/JavaScriptCore/API/OpaqueJSString.cpp
index f740abe..9a116e6 100644
--- a/JavaScriptCore/API/OpaqueJSString.cpp
+++ b/JavaScriptCore/API/OpaqueJSString.cpp
@@ -35,7 +35,7 @@ using namespace JSC;
PassRefPtr<OpaqueJSString> OpaqueJSString::create(const UString& ustring)
{
if (!ustring.isNull())
- return adoptRef(new OpaqueJSString(ustring.data(), ustring.size()));
+ return adoptRef(new OpaqueJSString(ustring.characters(), ustring.length()));
return 0;
}
@@ -43,7 +43,7 @@ UString OpaqueJSString::ustring() const
{
if (this && m_characters)
return UString(m_characters, m_length);
- return UString::null();
+ return UString();
}
Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
diff --git a/JavaScriptCore/CMakeLists.txt b/JavaScriptCore/CMakeLists.txt
index a944363..89c9ef1 100644
--- a/JavaScriptCore/CMakeLists.txt
+++ b/JavaScriptCore/CMakeLists.txt
@@ -203,13 +203,10 @@ GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_
LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_DIR}/Lexer.lut.h)
# GENERATOR: "chartables.c": compile and execute the chartables generator (and add it to sources)
-IF (MSVC)
- SET(JSC_DFTABLES_PREPROCESSOR --preprocessor=cl.exe)
-ENDIF ()
ADD_CUSTOM_COMMAND(
OUTPUT ${DERIVED_SOURCES_DIR}/chartables.c
MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/pcre/dftables
- COMMAND ${PERL_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/pcre/dftables ${JSC_DFTABLES_PREPROCESSOR} ${DERIVED_SOURCES_DIR}/chartables.c
+ COMMAND ${PERL_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/pcre/dftables --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" ${DERIVED_SOURCES_DIR}/chartables.c
VERBATIM)
ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/pcre/pcre_tables.cpp ${DERIVED_SOURCES_DIR}/chartables.c)
@@ -264,7 +261,10 @@ INCLUDE_DIRECTORIES(${JavaScriptCore_INCLUDE_DIRECTORIES})
ADD_DEFINITIONS(-DBUILDING_JavaScriptCore)
ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES})
-ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS ${JavaScriptCore_LINK_FLAGS})
+
+IF (JavaScriptCore_LINK_FLAGS)
+ ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS "${JavaScriptCore_LINK_FLAGS}")
+ENDIF ()
IF (SHARED_CORE)
SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index c7c09b0..1c7f689 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,1369 @@
+2010-08-18 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Gavin Barraclough.
+
+ The JITStackFrame is wrong using Thumb-2 JIT with JSVALUE32_64
+ https://bugs.webkit.org/show_bug.cgi?id=43897
+
+ A 64 bits wide member in a structure is aligned to 8 bytes on ARM by
+ default, but this is not taken into account in the offset defines of
+ JITStackFrame.
+
+ * jit/JITStubs.cpp:
+ * jit/JITStubs.h:
+
+2010-08-18 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Rename UString::substr to substringSharingImpl, add to WTF::String.
+ Now WTF::String can do everything that JSC::UString can do!
+
+ * JavaScriptCore.exp:
+ * bytecode/CodeBlock.cpp:
+ (JSC::escapeQuotes):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::substitute):
+ * parser/SourceProvider.h:
+ (JSC::UStringSourceProvider::getRange):
+ * runtime/FunctionPrototype.cpp:
+ (JSC::insertSemicolonIfNeeded):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::parseInt):
+ * runtime/JSONObject.cpp:
+ (JSC::gap):
+ (JSC::Stringifier::indent):
+ (JSC::Stringifier::unindent):
+ * runtime/JSString.cpp:
+ (JSC::JSString::replaceCharacter):
+ * runtime/NumberPrototype.cpp:
+ (JSC::numberProtoFuncToFixed):
+ (JSC::numberProtoFuncToPrecision):
+ * runtime/StringPrototype.cpp:
+ (JSC::stringProtoFuncReplace):
+ (JSC::trimString):
+ * runtime/UString.cpp:
+ (JSC::UString::substringSharingImpl):
+ * runtime/UString.h:
+ * wtf/text/WTFString.cpp:
+ (WTF::String::substringSharingImpl):
+ * wtf/text/WTFString.h:
+
+2010-08-18 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2010-08-18 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2010-08-17 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Bug 44146 - Remove toDouble/toUInt32 methods from UString.
+
+ These methods all implement JavaScript language specific behaviour, and as such
+ are not suited to being on a generic string object. They are also inefficient
+ and incorrectly used, refactor & cleanup. Uses of these methods really divide
+ out into two cases.
+
+ ToNumber:
+ Uses of toDouble from JSString and from parseFloat are implementing ecma's
+ ToNumber conversion from strings (see ecma-262 9.3.1), so UString::toDouble
+ should largely just be moved out to a global jsToNumber function. ToNumber is
+ capable of recognizing either decimal or hexadecimal numbers, but parseFloat
+ should only recognize decimal values. This is currently handled by testing for
+ hexadecimal before calling toDouble, which should unnecessary - instead we can
+ just split out the two parts to the grammar into separate functions. Also,
+ strtod recognizes a set of literals (nan, inf, and infinity - all with any
+ capitalization) - which are not defined by any of the specs we are implementing.
+ To handle this we need to perform additional work in toDouble to convert the
+ unsupported cases of infinities back to NaNs. Instead we should simply remove
+ support for this literals from strtod. This should provide a more desirable
+ behaviour for all clients of strtod.
+
+ Indexed properties:
+ Uses of the toStrictUInt32 methods are were all converting property names to
+ indices, and all uses of toUInt32 were incorrect; in all cases we should have
+ been calling toUInt32. This error results in some incorrect behaviour in the
+ DOM (accessing property "0 " of a NodeList should fail; it currently does not).
+ Move this method onto Identifier (our canonical property name), and make it
+ always perform a strict conversion. Add a layout test to check NodeList does
+ convert indexed property names correctly.
+
+ * JavaScriptCore.exp:
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::getOwnPropertySlot):
+ (JSC::Arguments::getOwnPropertyDescriptor):
+ (JSC::Arguments::put):
+ (JSC::Arguments::deleteProperty):
+ * runtime/Identifier.cpp:
+ (JSC::Identifier::toUInt32):
+ * runtime/Identifier.h:
+ (JSC::Identifier::toUInt32):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::deleteProperty):
+ * runtime/JSArray.h:
+ (JSC::Identifier::toArrayIndex):
+ * runtime/JSByteArray.cpp:
+ (JSC::JSByteArray::getOwnPropertySlot):
+ (JSC::JSByteArray::getOwnPropertyDescriptor):
+ (JSC::JSByteArray::put):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::isInfinity):
+ (JSC::jsHexIntegerLiteral):
+ (JSC::jsStrDecimalLiteral):
+ (JSC::jsToNumber):
+ (JSC::parseFloat):
+ * runtime/JSGlobalObjectFunctions.h:
+ * runtime/JSString.cpp:
+ (JSC::JSString::getPrimitiveNumber):
+ (JSC::JSString::toNumber):
+ (JSC::JSString::getStringPropertyDescriptor):
+ * runtime/JSString.h:
+ (JSC::JSString::getStringPropertySlot):
+ * runtime/ObjectPrototype.cpp:
+ (JSC::ObjectPrototype::put):
+ * runtime/StringObject.cpp:
+ (JSC::StringObject::deleteProperty):
+ * runtime/UString.cpp:
+ * runtime/UString.h:
+ * wtf/dtoa.cpp:
+ (WTF::strtod):
+
+2010-08-17 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Bug 44099 - REGRESSION(r65468): Crashes in StringImpl::find
+
+ Bug 44080 introuduced a couple of cases in which array bounds could be overrun.
+ One of these was fixed in r65493, this patch fixes the other and address the
+ concerns voiced in comment #6 by restructuring the loops to remove the code
+ dupliction without introducing an additional if check.
+
+ * wtf/text/StringImpl.cpp:
+ (WTF::StringImpl::find):
+ (WTF::StringImpl::findIgnoringCase):
+ (WTF::StringImpl::reverseFind):
+ (WTF::StringImpl::reverseFindIgnoringCase):
+
+2010-08-17 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Move the accelerated compositing build flag to the right place
+ https://bugs.webkit.org/show_bug.cgi?id=43882
+
+ * wtf/Platform.h:
+
+2010-08-17 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Avoid uninitialized memory read in StringImpl::find().
+
+ REGRESSION(r65468): Crashes in StringImpl::find
+ https://bugs.webkit.org/show_bug.cgi?id=44099
+
+ * wtf/text/StringImpl.cpp:
+ (WTF::StringImpl::find):
+
+2010-08-16 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig
+
+ Add VectorTraits to String & DefaultHash traits to UString to unify behaviour.
+
+ * runtime/UString.h:
+ (JSC::UStringHash::hash):
+ (JSC::UStringHash::equal):
+ (WTF::):
+ * wtf/text/WTFString.h:
+ (WTF::):
+
+2010-08-16 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig
+
+ Remove unnecessary includes from UString.h, add new includes as necessary.
+
+ * profiler/CallIdentifier.h:
+ * profiler/ProfileNode.h:
+ * runtime/DateConversion.cpp:
+ * runtime/Identifier.h:
+ (JSC::IdentifierRepHash::hash):
+ * runtime/RegExpCache.h:
+ * runtime/RegExpKey.h:
+ * runtime/UString.cpp:
+ (JSC::UString::substr):
+ * runtime/UString.h:
+ * wtf/text/WTFString.h:
+
+2010-08-16 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Bug 44080 - String find/reverseFind methods need tidying up
+ These methods have a couple of problems with their interface, and implementation.
+
+ These methods take and int index, and return an int - however this is problematic
+ since on 64-bit string indices may have a full 32-bit range. This spills out into
+ surrounding code, which unsafely casts string indices from unsigned to int. Code
+ checking the result of these methods check for a mix of "== -1", "< 0", and
+ "== notFound". Clean this up by changing these methods to take an unsigned
+ starting index, and return a size_t. with a failed match indicated by notFound.
+ reverseFind also has a special meaning for the starting index argument, in that a
+ negative index is interpreted as an offset back from the end of the string. Remove
+ this functionality, in the (1!) case where it is used we should just calculate the
+ offset by subtracting from the string's length.
+
+ The implementation has a few problems too. The code is not in webkit style, in
+ using assorted abbreviations in variable names, and implementations of similar
+ find methods with differing argument types were unnecessarily inconsistent. When
+ find is passed const char* data the string would be handled as latin1 (zero
+ extended to UTF-16) for all characters but the first; this is sign extended.
+ Case-insensitive find is broken for unicode strings; the hashing optimization is
+ not unicode safe, and could result in false negatives.
+
+ Unify UString find methods to match String.
+
+ * JavaScriptCore.exp:
+ * bytecode/CodeBlock.cpp:
+ (JSC::escapeQuotes):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::substitute):
+ * runtime/JSString.cpp:
+ (JSC::JSString::replaceCharacter):
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::RegExp):
+ * runtime/RegExpKey.h:
+ (JSC::RegExpKey::getFlagsValue):
+ * runtime/StringPrototype.cpp:
+ (JSC::substituteBackreferencesSlow):
+ (JSC::substituteBackreferences):
+ (JSC::stringProtoFuncReplace):
+ (JSC::stringProtoFuncIndexOf):
+ (JSC::stringProtoFuncLastIndexOf):
+ (JSC::stringProtoFuncSplit):
+ * runtime/UString.cpp:
+ * runtime/UString.h:
+ (JSC::UString::find):
+ (JSC::UString::reverseFind):
+ * wtf/text/AtomicString.h:
+ (WTF::AtomicString::find):
+ * wtf/text/StringImpl.cpp:
+ (WTF::StringImpl::find):
+ (WTF::StringImpl::findCaseInsensitive):
+ (WTF::StringImpl::reverseFind):
+ (WTF::StringImpl::reverseFindCaseInsensitive):
+ (WTF::StringImpl::endsWith):
+ (WTF::StringImpl::replace):
+ * wtf/text/StringImpl.h:
+ (WTF::StringImpl::startsWith):
+ * wtf/text/WTFString.cpp:
+ (WTF::String::split):
+ * wtf/text/WTFString.h:
+ (WTF::String::find):
+ (WTF::String::reverseFind):
+ (WTF::String::findCaseInsensitive):
+ (WTF::String::reverseFindCaseInsensitive):
+ (WTF::String::contains):
+ (WTF::find):
+ (WTF::reverseFind):
+
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, do not build WebCore as a convenience library as this leads to
+ errors in the Win build w/export symbols and causes problems with DOM bindings
+ debugging in gdb.
+
+ * wscript:
+
+2010-08-16 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Build fix after r65366.
+
+ * CMakeLists.txt: Use if (VAR) instead of if (${VAR}) to check if
+ they're empty.
+ * jsc/CMakeLists.txt: Ditto.
+ * wtf/CMakeLists.txt: Ditto.
+
+2010-08-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, don't build intermediate source in DerivedSources dir.
+
+ * wscript:
+
+2010-08-14 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [CMake] Add preprocessor detection for generator scripts
+ https://bugs.webkit.org/show_bug.cgi?id=43984
+
+ * CMakeLists.txt:
+
+2010-08-14 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [CMake] Set target properties only if available
+ https://bugs.webkit.org/show_bug.cgi?id=43978
+
+ * CMakeLists.txt:
+ * jsc/CMakeLists.txt:
+ * wtf/CMakeLists.txt:
+
+2010-08-13 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add CString to the list of forwards.
+
+ * wtf/Forward.h:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+ Switch String::/UString::ascii() to return a CString.
+
+ * JavaScriptCore.exp:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dump):
+ * bytecode/SamplingTool.cpp:
+ (JSC::SamplingTool::dump):
+ * interpreter/CallFrame.cpp:
+ (JSC::CallFrame::dumpCaller):
+ * jsc.cpp:
+ (runWithScripts):
+ (runInteractive):
+ * runtime/Identifier.h:
+ (JSC::Identifier::ascii):
+ * runtime/ScopeChain.cpp:
+ (JSC::ScopeChainNode::print):
+ * runtime/UString.cpp:
+ (JSC::UString::ascii):
+ (JSC::UString::latin1):
+ * runtime/UString.h:
+ * wtf/text/StringImpl.cpp:
+ (WTF::StringImpl::asciiOLD):
+ * wtf/text/StringImpl.h:
+ * wtf/text/WTFString.cpp:
+ (WTF::String::ascii):
+ (WTF::String::latin1):
+ * wtf/text/WTFString.h:
+
+2010-08-13 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Gavin Barraclough.
+
+ Avoid increasing required alignment of target type warning on ARM
+ https://bugs.webkit.org/show_bug.cgi?id=38045
+
+ The reinterpret_cast<Type1*>([pointer to Type2]) expressions - where
+ sizeof(Type1) > sizeof(Type2) - cause the following warning on ARM:
+ increases required alignment of target type warnings.
+ Casting the type of [pointer to Type2] object to void* bypasses the
+ warning.
+
+ * assembler/ARMAssembler.cpp:
+ (JSC::ARMAssembler::executableCopy):
+ * assembler/AssemblerBuffer.h:
+ (JSC::AssemblerBuffer::putShortUnchecked):
+ (JSC::AssemblerBuffer::putIntUnchecked):
+ (JSC::AssemblerBuffer::putInt64Unchecked):
+ * interpreter/RegisterFile.h:
+ (JSC::RegisterFile::RegisterFile):
+ (JSC::RegisterFile::grow):
+ * jit/JITStubs.cpp:
+ * pcre/pcre_compile.cpp:
+ (jsRegExpCompile):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::putSlowCase):
+ (JSC::JSArray::increaseVectorLength):
+ (JSC::JSArray::increaseVectorPrefixLength):
+ (JSC::JSArray::shiftCount):
+ (JSC::JSArray::unshiftCount):
+ * wtf/FastMalloc.cpp:
+ (WTF::PageHeapAllocator::New):
+ (WTF::TCMalloc_Central_FreeList::Populate):
+ * wtf/MD5.cpp:
+ (WTF::reverseBytes):
+ (WTF::MD5::addBytes):
+ (WTF::MD5::checksum):
+ * wtf/StdLibExtras.h:
+ (isPointerTypeAlignmentOkay):
+ (reinterpret_cast_ptr):
+ * wtf/Vector.h:
+ (WTF::VectorBuffer::inlineBuffer):
+ * wtf/qt/StringQt.cpp:
+ (WTF::String::String):
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * JavaScriptCore.exp:
+ * bytecode/CodeBlock.cpp:
+ (JSC::constantName):
+ (JSC::idName):
+ (JSC::CodeBlock::registerName):
+ (JSC::regexpName):
+ (JSC::printGlobalResolveInfo):
+ (JSC::printStructureStubInfo):
+ (JSC::CodeBlock::printStructure):
+ (JSC::CodeBlock::printStructures):
+ * jsc.cpp:
+ (functionPrint):
+ (functionDebug):
+ (runInteractive):
+ (fillBufferWithContentsOfFile):
+ * pcre/pcre_exec.cpp:
+ (Histogram::~Histogram):
+ * profiler/CallIdentifier.h:
+ (JSC::CallIdentifier::c_str):
+ * profiler/Profile.cpp:
+ (JSC::Profile::debugPrintDataSampleStyle):
+ * profiler/ProfileGenerator.cpp:
+ (JSC::ProfileGenerator::willExecute):
+ (JSC::ProfileGenerator::didExecute):
+ * profiler/ProfileNode.cpp:
+ (JSC::ProfileNode::debugPrintData):
+ (JSC::ProfileNode::debugPrintDataSampleStyle):
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::getOwnPropertySlot):
+ (JSC::Arguments::getOwnPropertyDescriptor):
+ (JSC::Arguments::put):
+ (JSC::Arguments::deleteProperty):
+ * runtime/DateConversion.cpp:
+ (JSC::parseDate):
+ * runtime/Identifier.h:
+ (JSC::Identifier::toStrictUInt32):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::deleteProperty):
+ * runtime/JSArray.h:
+ (JSC::toArrayIndex):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::encode):
+ (JSC::parseInt):
+ (JSC::globalFuncJSCPrint):
+ * runtime/JSString.h:
+ (JSC::RopeBuilder::JSString):
+ * runtime/UString.cpp:
+ (JSC::UString::toDouble):
+ (JSC::putUTF8Triple):
+ (JSC::UString::utf8):
+ * runtime/UString.h:
+ (JSC::UString::~UString):
+ (JSC::UString::isNull):
+ (JSC::UString::isEmpty):
+ (JSC::UString::impl):
+ * wtf/text/WTFString.cpp:
+ (WTF::String::utf8):
+ * wtf/text/WTFString.h:
+ (WTF::String::~String):
+ (WTF::String::swap):
+ (WTF::String::isNull):
+ (WTF::String::isEmpty):
+ (WTF::String::impl):
+ (WTF::String::length):
+ (WTF::String::String):
+ (WTF::String::isHashTableDeletedValue):
+
+2010-08-12 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Reviewed by Gavin Barraclough.
+
+ Refactoring the fpu code generator for the ARM port
+ https://bugs.webkit.org/show_bug.cgi?id=43842
+
+ Support up to 32 double precision registers, and the
+ recent VFP instruction formats. This patch is mainly
+ a style change which keeps the current functionality.
+
+ * assembler/ARMAssembler.h:
+ (JSC::ARMRegisters::):
+ (JSC::ARMAssembler::):
+ (JSC::ARMAssembler::emitInst):
+ (JSC::ARMAssembler::emitDoublePrecisionInst):
+ (JSC::ARMAssembler::emitSinglePrecisionInst):
+ (JSC::ARMAssembler::vadd_f64_r):
+ (JSC::ARMAssembler::vdiv_f64_r):
+ (JSC::ARMAssembler::vsub_f64_r):
+ (JSC::ARMAssembler::vmul_f64_r):
+ (JSC::ARMAssembler::vcmp_f64_r):
+ (JSC::ARMAssembler::vsqrt_f64_r):
+ (JSC::ARMAssembler::vmov_vfp_r):
+ (JSC::ARMAssembler::vmov_arm_r):
+ (JSC::ARMAssembler::vcvt_f64_s32_r):
+ (JSC::ARMAssembler::vcvt_s32_f64_r):
+ (JSC::ARMAssembler::vmrs_apsr):
+ * assembler/MacroAssemblerARM.h:
+ (JSC::MacroAssemblerARM::addDouble):
+ (JSC::MacroAssemblerARM::divDouble):
+ (JSC::MacroAssemblerARM::subDouble):
+ (JSC::MacroAssemblerARM::mulDouble):
+ (JSC::MacroAssemblerARM::sqrtDouble):
+ (JSC::MacroAssemblerARM::convertInt32ToDouble):
+ (JSC::MacroAssemblerARM::branchDouble):
+ (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65295.
+ http://trac.webkit.org/changeset/65295
+ https://bugs.webkit.org/show_bug.cgi?id=43950
+
+ It broke 4 sputnik tests (Requested by Ossy on #webkit).
+
+ * JavaScriptCore.exp:
+ * bytecode/CodeBlock.cpp:
+ (JSC::constantName):
+ (JSC::idName):
+ (JSC::CodeBlock::registerName):
+ (JSC::regexpName):
+ (JSC::printGlobalResolveInfo):
+ (JSC::printStructureStubInfo):
+ (JSC::CodeBlock::printStructure):
+ (JSC::CodeBlock::printStructures):
+ * jsc.cpp:
+ (functionPrint):
+ (functionDebug):
+ (runInteractive):
+ (fillBufferWithContentsOfFile):
+ * pcre/pcre_exec.cpp:
+ (Histogram::~Histogram):
+ * profiler/CallIdentifier.h:
+ (JSC::CallIdentifier::c_str):
+ * profiler/Profile.cpp:
+ (JSC::Profile::debugPrintDataSampleStyle):
+ * profiler/ProfileGenerator.cpp:
+ (JSC::ProfileGenerator::willExecute):
+ (JSC::ProfileGenerator::didExecute):
+ * profiler/ProfileNode.cpp:
+ (JSC::ProfileNode::debugPrintData):
+ (JSC::ProfileNode::debugPrintDataSampleStyle):
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::getOwnPropertySlot):
+ (JSC::Arguments::getOwnPropertyDescriptor):
+ (JSC::Arguments::put):
+ (JSC::Arguments::deleteProperty):
+ * runtime/DateConversion.cpp:
+ (JSC::parseDate):
+ * runtime/Identifier.h:
+ (JSC::Identifier::Identifier):
+ (JSC::Identifier::toArrayIndex):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::deleteProperty):
+ * runtime/JSArray.h:
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::encode):
+ (JSC::parseInt):
+ (JSC::globalFuncJSCPrint):
+ * runtime/JSString.h:
+ (JSC::RopeBuilder::JSString):
+ * runtime/UString.cpp:
+ (JSC::UString::toDouble):
+ (JSC::UString::UTF8String):
+ * runtime/UString.h:
+ (JSC::UString::isNull):
+ (JSC::UString::isEmpty):
+ (JSC::UString::impl):
+ (JSC::UString::cost):
+ (JSC::UString::~UString):
+ (JSC::UString::toArrayIndex):
+ * wtf/text/WTFString.cpp:
+ (WTF::String::utf8):
+ * wtf/text/WTFString.h:
+ (WTF::String::String):
+ (WTF::String::isHashTableDeletedValue):
+ (WTF::String::length):
+ (WTF::String::operator[]):
+ (WTF::String::isNull):
+ (WTF::String::isEmpty):
+ (WTF::String::impl):
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * JavaScriptCore.exp:
+ * bytecode/CodeBlock.cpp:
+ (JSC::constantName):
+ (JSC::idName):
+ (JSC::CodeBlock::registerName):
+ (JSC::regexpName):
+ (JSC::printGlobalResolveInfo):
+ (JSC::printStructureStubInfo):
+ (JSC::CodeBlock::printStructure):
+ (JSC::CodeBlock::printStructures):
+ * jsc.cpp:
+ (functionPrint):
+ (functionDebug):
+ (runInteractive):
+ (fillBufferWithContentsOfFile):
+ * pcre/pcre_exec.cpp:
+ (Histogram::~Histogram):
+ * profiler/CallIdentifier.h:
+ (JSC::CallIdentifier::c_str):
+ * profiler/Profile.cpp:
+ (JSC::Profile::debugPrintDataSampleStyle):
+ * profiler/ProfileGenerator.cpp:
+ (JSC::ProfileGenerator::willExecute):
+ (JSC::ProfileGenerator::didExecute):
+ * profiler/ProfileNode.cpp:
+ (JSC::ProfileNode::debugPrintData):
+ (JSC::ProfileNode::debugPrintDataSampleStyle):
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::getOwnPropertySlot):
+ (JSC::Arguments::getOwnPropertyDescriptor):
+ (JSC::Arguments::put):
+ (JSC::Arguments::deleteProperty):
+ * runtime/DateConversion.cpp:
+ (JSC::parseDate):
+ * runtime/Identifier.h:
+ (JSC::Identifier::toStrictUInt32):
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::getOwnPropertySlot):
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ (JSC::JSArray::put):
+ (JSC::JSArray::deleteProperty):
+ * runtime/JSArray.h:
+ (JSC::toArrayIndex):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::encode):
+ (JSC::parseInt):
+ (JSC::globalFuncJSCPrint):
+ * runtime/JSString.h:
+ (JSC::RopeBuilder::JSString):
+ * runtime/UString.cpp:
+ (JSC::UString::toDouble):
+ (JSC::putUTF8Triple):
+ (JSC::UString::utf8):
+ * runtime/UString.h:
+ (JSC::UString::~UString):
+ (JSC::UString::isNull):
+ (JSC::UString::isEmpty):
+ (JSC::UString::impl):
+ * wtf/text/WTFString.cpp:
+ (WTF::String::utf8):
+ * wtf/text/WTFString.h:
+ (WTF::String::~String):
+ (WTF::String::swap):
+ (WTF::String::isNull):
+ (WTF::String::isEmpty):
+ (WTF::String::impl):
+ (WTF::String::length):
+ (WTF::String::String):
+ (WTF::String::isHashTableDeletedValue):
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Eeerk! - revert accidentally committed changes in UString!
+
+ * JavaScriptCore.exp:
+ * runtime/UString.cpp:
+ (JSC::UString::UString):
+ * runtime/UString.h:
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Change UString constructors to match those in WTF::String.
+ This changes behaviour of UString((char*)0) to create null
+ strings, akin to UString() rather than UString::empty().
+ (This matches String). Remove unused constructors from
+ UString, and add null-terminated UTF-16 constructor, to
+ match String. Move String's constructor into the .cpp to
+ match UString.
+
+ * JavaScriptCore.exp:
+ * debugger/DebuggerCallFrame.cpp:
+ (JSC::DebuggerCallFrame::calculatedFunctionName):
+ * runtime/RegExpKey.h:
+ (JSC::RegExpKey::RegExpKey):
+ * runtime/SmallStrings.cpp:
+ (JSC::SmallStrings::createSingleCharacterString):
+ * runtime/UString.cpp:
+ (JSC::UString::UString):
+ * runtime/UString.h:
+ (JSC::UString::UString):
+ (JSC::UString::swap):
+ (JSC::UString::adopt):
+ (JSC::UString::operator[]):
+ * wtf/text/WTFString.h:
+ (WTF::String::String):
+ (WTF::String::adopt):
+ (WTF::String::operator[]):
+
+2010-08-12 David Levin <levin@chromium.org>
+
+ Reviewed by NOBODY (build fix).
+
+ * runtime/UString.h: Removed unneccessary #include.
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Revert changes to ALWAYS_INLINEness of a couple of functions in UString.
+ This appears to have degraded performance.
+
+ * runtime/UString.cpp:
+ (JSC::UString::ascii):
+ * runtime/UString.h:
+ (JSC::UString::length):
+ (JSC::UString::isEmpty):
+ (JSC::UString::~UString):
+
+2010-08-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Fix warnings: unknown conversion type character 'l' in format
+ https://bugs.webkit.org/show_bug.cgi?id=43359
+
+ Qt port doesn't call any printf in String::format(...), consequently
+ using __attribute__((format(printf,m,n))) is incorrect and causes
+ false positive warnings on Windows if you build with MinGW.
+
+ Qt port calls QString::vsprintf(...) , which is platform
+ independent, and handles %lli, %llu and %llx on all platforms.
+ (http://trac.webkit.org/changeset/35712)
+
+ * wtf/text/WTFString.h:
+
+2010-08-12 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ Fix the array subscript is above array bounds warning in ByteArray on ARM.
+ https://bugs.webkit.org/show_bug.cgi?id=43358
+
+ The warning is very similar to this one: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37861
+
+ * wtf/ByteArray.cpp:
+ (WTF::ByteArray::create):
+
+2010-08-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Use GSettings to save/restore Web Inspector settings
+ https://bugs.webkit.org/show_bug.cgi?id=43512
+
+ * wtf/gobject/GRefPtr.cpp: Added support for GVariant, used by our
+ GSettings support.
+ (WTF::refGPtr):
+ (WTF::derefGPtr):
+ * wtf/gobject/GRefPtr.h:
+
+2010-08-12 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ The scratch register should be saved in YARR with ARM JIT
+ https://bugs.webkit.org/show_bug.cgi?id=43910
+
+ Reported by Jocelyn Turcotte.
+
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateEnter):
+ (JSC::Yarr::RegexGenerator::generateReturn):
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * wtf/Forward.h:
+
+2010-08-11 Leo Yang <leo.yang@torchmobile.com.cn>
+
+ Reviewed by Geoffrey Garen.
+
+ Date("") should be an invalid date. For IE, Firefox and Chrome, Date("") is invalid date,
+ which means isNaN(new Date("")) should return true.
+ https://bugs.webkit.org/show_bug.cgi?id=43793
+ Tests: fast/js/date-constructor.html
+
+ * runtime/JSGlobalData.cpp:
+ (JSC::JSGlobalData::resetDateCache):
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Windows & !JIT build fix.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::match):
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamp by sam weinig
+
+ Touch a file to stop the bot rolling a bit change out!
+
+ * runtime/UString.cpp:
+ (JSC::UString::ascii):
+
+2010-08-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix for wx and WebDOM bindings, add CString classes to the list of forwards.
+
+ * wtf/Forward.h:
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamps by Darin Adler & Sam Weinig.
+
+ Bug 43867 - Some UString cleanup
+
+ Change JSC::UString data(), size(), and from(), to characters(), length(), and number() to match WTF::String.
+ Move string concatenation methods to a new header to simplify down UString.h. Remove is8Bit().
+
+ * API/JSClassRef.cpp:
+ (OpaqueJSClass::~OpaqueJSClass):
+ (OpaqueJSClass::className):
+ * API/OpaqueJSString.cpp:
+ (OpaqueJSString::create):
+ * JavaScriptCore.exp:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecode/CodeBlock.cpp:
+ (JSC::constantName):
+ (JSC::idName):
+ (JSC::CodeBlock::registerName):
+ (JSC::regexpName):
+ * bytecode/EvalCodeCache.h:
+ (JSC::EvalCodeCache::get):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::ResolveNode::emitBytecode):
+ (JSC::FunctionCallResolveNode::emitBytecode):
+ (JSC::ReadModifyResolveNode::emitBytecode):
+ (JSC::processClauseList):
+ * parser/ASTBuilder.h:
+ (JSC::ASTBuilder::createRegex):
+ * parser/ParserArena.h:
+ (JSC::IdentifierArena::makeNumericIdentifier):
+ * parser/SourceProvider.h:
+ (JSC::UStringSourceProvider::data):
+ (JSC::UStringSourceProvider::length):
+ * profiler/Profiler.cpp:
+ * runtime/Arguments.cpp:
+ (JSC::Arguments::getOwnPropertySlot):
+ (JSC::Arguments::getOwnPropertyNames):
+ (JSC::Arguments::put):
+ (JSC::Arguments::deleteProperty):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncToString):
+ * runtime/DatePrototype.cpp:
+ (JSC::formatLocaleDate):
+ * runtime/ExceptionHelpers.cpp:
+ * runtime/FunctionConstructor.cpp:
+ * runtime/FunctionPrototype.cpp:
+ (JSC::insertSemicolonIfNeeded):
+ * runtime/Identifier.h:
+ (JSC::Identifier::characters):
+ (JSC::Identifier::length):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::decode):
+ (JSC::parseInt):
+ (JSC::parseFloat):
+ (JSC::globalFuncEscape):
+ (JSC::globalFuncUnescape):
+ * runtime/JSNumberCell.cpp:
+ (JSC::JSNumberCell::toString):
+ * runtime/JSONObject.cpp:
+ (JSC::gap):
+ (JSC::Stringifier::appendQuotedString):
+ (JSC::Stringifier::appendStringifiedValue):
+ (JSC::Stringifier::indent):
+ (JSC::Stringifier::unindent):
+ (JSC::Walker::walk):
+ * runtime/JSString.cpp:
+ (JSC::JSString::replaceCharacter):
+ (JSC::JSString::getIndexSlowCase):
+ * runtime/JSString.h:
+ (JSC::RopeBuilder::JSString):
+ (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
+ (JSC::RopeBuilder::fiberCount):
+ (JSC::jsSingleCharacterSubstring):
+ (JSC::jsNontrivialString):
+ (JSC::JSString::getIndex):
+ (JSC::jsString):
+ (JSC::jsStringWithFinalizer):
+ (JSC::jsSubstring):
+ (JSC::jsOwnedString):
+ * runtime/JSStringBuilder.h:
+ (JSC::JSStringBuilder::append):
+ * runtime/LiteralParser.h:
+ (JSC::LiteralParser::Lexer::Lexer):
+ * runtime/NumberPrototype.cpp:
+ (JSC::numberProtoFuncToString):
+ (JSC::numberProtoFuncToFixed):
+ (JSC::numberProtoFuncToExponential):
+ (JSC::numberProtoFuncToPrecision):
+ * runtime/NumericStrings.h:
+ (JSC::NumericStrings::add):
+ (JSC::NumericStrings::lookupSmallString):
+ * runtime/Operations.h:
+ (JSC::jsString):
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::match):
+ * runtime/RegExpCache.cpp:
+ (JSC::RegExpCache::lookupOrCreate):
+ (JSC::RegExpCache::create):
+ * runtime/RegExpConstructor.cpp:
+ (JSC::RegExpConstructor::getRightContext):
+ * runtime/RegExpObject.cpp:
+ (JSC::RegExpObject::match):
+ * runtime/RegExpPrototype.cpp:
+ (JSC::regExpProtoFuncToString):
+ * runtime/StringBuilder.h:
+ (JSC::StringBuilder::append):
+ * runtime/StringConcatenate.h: Copied from JavaScriptCore/runtime/UString.h.
+ (JSC::):
+ (JSC::sumWithOverflow):
+ (JSC::tryMakeString):
+ (JSC::makeString):
+ * runtime/StringObject.cpp:
+ (JSC::StringObject::getOwnPropertyNames):
+ * runtime/StringPrototype.cpp:
+ (JSC::substituteBackreferencesSlow):
+ (JSC::localeCompare):
+ (JSC::jsSpliceSubstringsWithSeparators):
+ (JSC::stringProtoFuncReplace):
+ (JSC::stringProtoFuncCharAt):
+ (JSC::stringProtoFuncCharCodeAt):
+ (JSC::stringProtoFuncIndexOf):
+ (JSC::stringProtoFuncLastIndexOf):
+ (JSC::stringProtoFuncSlice):
+ (JSC::stringProtoFuncSplit):
+ (JSC::stringProtoFuncSubstr):
+ (JSC::stringProtoFuncSubstring):
+ (JSC::stringProtoFuncToLowerCase):
+ (JSC::stringProtoFuncToUpperCase):
+ (JSC::stringProtoFuncFontsize):
+ (JSC::stringProtoFuncLink):
+ (JSC::trimString):
+ * runtime/UString.cpp:
+ (JSC::UString::number):
+ (JSC::UString::ascii):
+ (JSC::UString::operator[]):
+ (JSC::UString::toDouble):
+ (JSC::UString::find):
+ (JSC::UString::rfind):
+ (JSC::UString::substr):
+ (JSC::operator==):
+ (JSC::operator<):
+ (JSC::operator>):
+ (JSC::UString::UTF8String):
+ * runtime/UString.h:
+ (JSC::UString::UString):
+ (JSC::UString::adopt):
+ (JSC::UString::length):
+ (JSC::UString::characters):
+ (JSC::UString::isNull):
+ (JSC::UString::isEmpty):
+ (JSC::UString::impl):
+ (JSC::UString::cost):
+ (JSC::operator==):
+ (JSC::operator!=):
+ (JSC::codePointCompare):
+ (JSC::UString::toArrayIndex):
+ (JSC::IdentifierRepHash::hash):
+ (WTF::):
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::jitCompileRegex):
+ * yarr/RegexParser.h:
+ (JSC::Yarr::Parser::Parser):
+
+2010-08-11 Gabor Loki <loki@webkit.org>
+
+ Qt build fix (ARMv7).
+
+ Fix invalid conversion from int to Condition.
+ Add ARMv7Assembler.cpp to JavaScriptCore.pro.
+
+ * JavaScriptCore.pro:
+ * assembler/ARMv7Assembler.h:
+ (JSC::ARMv7Assembler::):
+ (JSC::ARMv7Assembler::JmpSrc::JmpSrc):
+
+2010-08-11 Nathan Lawrence <nlawrence@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ At collection time, we frequently want to mark a cell, while checking
+ whether it was originally checked. Previously, this was a get
+ operation follwed by a set operation. Fusing the two saves
+ computation and gives a 0.5% sunspider speedup.
+
+ * runtime/Collector.h:
+ (JSC::CollectorBitmap::getset):
+ (JSC::Heap::checkMarkCell):
+ * runtime/JSArray.h:
+ (JSC::MarkStack::drain):
+ * runtime/JSCell.h:
+ (JSC::MarkStack::append):
+
+2010-08-11 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Improve vsprops copying for Windows build
+ https://bugs.webkit.org/show_bug.cgi?id=41982
+
+ When we detect a new SDK, always copy a new set of vsprops files.
+ Previously, if someone updated their SDK after updating their sources,
+ they could end up with out-of-date vsprops files.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
+
+2010-08-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add leakRef and clear to all RefPtr variants
+ https://bugs.webkit.org/show_bug.cgi?id=42389
+
+ * API/JSRetainPtr.h: Changed all uses of "template <...>" to instead do
+ "template<...>". We should probably put this in the style guide and do it
+ consitently. Fixed other minor style issues. Defined many of the inlined
+ functions outside the class definition, to avoid style checker warnings
+ about multiple statements on a single line and for slightly better clarity
+ of the class definition itself. Renamed releaseRef to leakRef. Added a
+ releaseRef that calls leakRef so we don't have to rename all callers oat
+ once. Added a clear function.
+
+ * wtf/PassRefPtr.h: Changed all uses of releaseRef to leakRef.
+
+ * wtf/RefPtr.h: Changed all uses of "template <...>" to instead do
+ "template<...>". Tidied up declarations and comments a bit.
+ Changed all uses of releaseRef to leakRef.
+
+ * wtf/RetainPtr.h: Changed all uses of "template <...>" to instead do
+ "template<...>". Defined many of the inlined functions outside the class
+ definition, to avoid style checker warnings about multiple statements on
+ a single line and for slightly better clarity of the class definition itself.
+ Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we
+ don't have to rename all callers at once. Added a clear function.
+
+2010-08-10 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, reverting an unintentional change to a file submitted in r65108.
+
+ * bytecode/CodeBlock.h:
+ (JSC::binaryChop):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig
+
+ Bug 43817 - Remove UString::Rep
+ UString::Rep has for a long time been replaced by UStringImpl (Rep
+ remaining as a typedef). UStringImpl has since been removed too
+ (unified with StringImpl). Remove Rep, rename rep() to impl() and
+ m_rep to m_impl. Also add impl() method to Identifier, and rename
+ its UString member from _ustring to m_string.
+
+ * API/JSCallbackObject.h:
+ (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
+ (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
+ (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
+ * API/JSCallbackObjectFunctions.h:
+ (JSC::::getOwnPropertySlot):
+ (JSC::::put):
+ (JSC::::deleteProperty):
+ (JSC::::getOwnPropertyNames):
+ (JSC::::staticValueGetter):
+ (JSC::::staticFunctionGetter):
+ * API/JSClassRef.cpp:
+ (tryCreateStringFromUTF8):
+ (OpaqueJSClass::OpaqueJSClass):
+ (OpaqueJSClass::~OpaqueJSClass):
+ (OpaqueJSClassContextData::OpaqueJSClassContextData):
+ * API/JSClassRef.h:
+ * API/OpaqueJSString.cpp:
+ (OpaqueJSString::ustring):
+ * bytecode/EvalCodeCache.h:
+ (JSC::EvalCodeCache::get):
+ * bytecode/JumpTable.h:
+ (JSC::StringJumpTable::offsetForValue):
+ (JSC::StringJumpTable::ctiForValue):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::addVar):
+ (JSC::BytecodeGenerator::addGlobalVar):
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::addParameter):
+ (JSC::BytecodeGenerator::registerFor):
+ (JSC::BytecodeGenerator::willResolveToArguments):
+ (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
+ (JSC::BytecodeGenerator::constRegisterFor):
+ (JSC::BytecodeGenerator::isLocal):
+ (JSC::BytecodeGenerator::isLocalConstant):
+ (JSC::BytecodeGenerator::addConstant):
+ (JSC::BytecodeGenerator::emitLoad):
+ (JSC::BytecodeGenerator::findScopedProperty):
+ (JSC::keyForCharacterSwitch):
+ (JSC::prepareJumpTableForStringSwitch):
+ * bytecompiler/BytecodeGenerator.h:
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::processClauseList):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * parser/JSParser.cpp:
+ (JSC::JSParser::parseStrictObjectLiteral):
+ * pcre/pcre_exec.cpp:
+ (Histogram::add):
+ * profiler/CallIdentifier.h:
+ (JSC::CallIdentifier::Hash::hash):
+ * profiler/Profile.cpp:
+ * profiler/ProfileNode.cpp:
+ (JSC::ProfileNode::debugPrintDataSampleStyle):
+ * profiler/ProfileNode.h:
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncToString):
+ * runtime/Identifier.cpp:
+ (JSC::Identifier::equal):
+ (JSC::IdentifierCStringTranslator::hash):
+ (JSC::IdentifierCStringTranslator::equal):
+ (JSC::IdentifierCStringTranslator::translate):
+ (JSC::Identifier::add):
+ (JSC::IdentifierUCharBufferTranslator::hash):
+ (JSC::IdentifierUCharBufferTranslator::equal):
+ (JSC::IdentifierUCharBufferTranslator::translate):
+ (JSC::Identifier::addSlowCase):
+ * runtime/Identifier.h:
+ (JSC::Identifier::Identifier):
+ (JSC::Identifier::ustring):
+ (JSC::Identifier::impl):
+ (JSC::Identifier::data):
+ (JSC::Identifier::size):
+ (JSC::Identifier::ascii):
+ (JSC::Identifier::isNull):
+ (JSC::Identifier::isEmpty):
+ (JSC::Identifier::toUInt32):
+ (JSC::Identifier::toStrictUInt32):
+ (JSC::Identifier::toArrayIndex):
+ (JSC::Identifier::toDouble):
+ (JSC::Identifier::equal):
+ (JSC::Identifier::add):
+ * runtime/InitializeThreading.cpp:
+ (JSC::initializeThreadingOnce):
+ * runtime/InternalFunction.cpp:
+ (JSC::InternalFunction::displayName):
+ * runtime/JSFunction.cpp:
+ (JSC::JSFunction::displayName):
+ * runtime/JSGlobalObject.h:
+ (JSC::JSGlobalObject::addStaticGlobals):
+ * runtime/JSStaticScopeObject.h:
+ (JSC::JSStaticScopeObject::JSStaticScopeObject):
+ * runtime/JSString.h:
+ (JSC::):
+ (JSC::RopeBuilder::appendStringInConstruct):
+ (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
+ (JSC::jsSingleCharacterSubstring):
+ (JSC::jsSubstring):
+ * runtime/JSVariableObject.cpp:
+ (JSC::JSVariableObject::deleteProperty):
+ (JSC::JSVariableObject::symbolTableGet):
+ * runtime/JSVariableObject.h:
+ (JSC::JSVariableObject::symbolTableGet):
+ (JSC::JSVariableObject::symbolTablePut):
+ (JSC::JSVariableObject::symbolTablePutWithAttributes):
+ * runtime/Lookup.cpp:
+ (JSC::HashTable::createTable):
+ (JSC::HashTable::deleteTable):
+ * runtime/Lookup.h:
+ (JSC::HashEntry::initialize):
+ (JSC::HashEntry::setKey):
+ (JSC::HashEntry::key):
+ (JSC::HashTable::entry):
+ * runtime/PropertyMapHashTable.h:
+ (JSC::PropertyMapEntry::PropertyMapEntry):
+ * runtime/PropertyNameArray.cpp:
+ (JSC::PropertyNameArray::add):
+ * runtime/PropertyNameArray.h:
+ (JSC::PropertyNameArray::add):
+ (JSC::PropertyNameArray::addKnownUnique):
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::match):
+ * runtime/RegExpCache.cpp:
+ (JSC::RegExpCache::create):
+ * runtime/RegExpKey.h:
+ (JSC::RegExpKey::RegExpKey):
+ * runtime/SmallStrings.cpp:
+ (JSC::SmallStringsStorage::rep):
+ (JSC::SmallStrings::singleCharacterStringRep):
+ * runtime/SmallStrings.h:
+ * runtime/StringPrototype.cpp:
+ (JSC::jsSpliceSubstringsWithSeparators):
+ (JSC::stringProtoFuncMatch):
+ (JSC::stringProtoFuncSearch):
+ * runtime/Structure.cpp:
+ (JSC::Structure::~Structure):
+ (JSC::Structure::despecifyDictionaryFunction):
+ (JSC::Structure::addPropertyTransitionToExistingStructure):
+ (JSC::Structure::addPropertyTransition):
+ (JSC::Structure::copyPropertyTable):
+ (JSC::Structure::get):
+ (JSC::Structure::despecifyFunction):
+ (JSC::Structure::put):
+ (JSC::Structure::hasTransition):
+ (JSC::Structure::remove):
+ (JSC::Structure::checkConsistency):
+ * runtime/Structure.h:
+ (JSC::Structure::get):
+ (JSC::Structure::hasTransition):
+ * runtime/StructureTransitionTable.h:
+ * runtime/SymbolTable.h:
+ * runtime/UString.cpp:
+ (JSC::UString::UString):
+ (JSC::UString::toStrictUInt32):
+ (JSC::UString::substr):
+ * runtime/UString.h:
+ (JSC::UString::UString):
+ (JSC::UString::adopt):
+ (JSC::UString::data):
+ (JSC::UString::size):
+ (JSC::UString::isNull):
+ (JSC::UString::isEmpty):
+ (JSC::UString::impl):
+ (JSC::UString::cost):
+ (JSC::operator==):
+ (JSC::codePointCompare):
+ (JSC::IdentifierRepHash::hash):
+ (WTF::):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Bug 43816 - Remove UStringImpl
+ The class was actually removed a long time ago, replaced by StringImpl.
+ UStringImpl is just a typedef onto StringImpl. Remove this.
+
+ * API/JSClassRef.cpp:
+ (OpaqueJSClass::OpaqueJSClass):
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * runtime/JSString.cpp:
+ (JSC::JSString::resolveRope):
+ (JSC::JSString::replaceCharacter):
+ * runtime/JSString.h:
+ (JSC::RopeBuilder::RopeIterator::operator*):
+ (JSC::RopeBuilder::JSString):
+ (JSC::RopeBuilder::appendStringInConstruct):
+ (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
+ (JSC::jsSingleCharacterSubstring):
+ (JSC::jsSubstring):
+ * runtime/JSStringBuilder.h:
+ (JSC::jsMakeNontrivialString):
+ * runtime/RopeImpl.cpp:
+ (JSC::RopeImpl::derefFibersNonRecursive):
+ * runtime/RopeImpl.h:
+ (JSC::RopeImpl::deref):
+ * runtime/SmallStrings.cpp:
+ (JSC::SmallStringsStorage::SmallStringsStorage):
+ * runtime/StringConstructor.cpp:
+ (JSC::stringFromCharCodeSlowCase):
+ * runtime/StringPrototype.cpp:
+ (JSC::jsSpliceSubstringsWithSeparators):
+ (JSC::stringProtoFuncFontsize):
+ (JSC::stringProtoFuncLink):
+ * runtime/UString.cpp:
+ (JSC::initializeUString):
+ * runtime/UString.h:
+ (JSC::UString::adopt):
+ (JSC::tryMakeString):
+ (JSC::makeString):
+ * runtime/UStringImpl.h: Removed.
+
+2010-08-10 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Eric Seidel.
+
+ Make FastMalloc more portable.
+ https://bugs.webkit.org/show_bug.cgi?id=41790
+
+ * wtf/FastMalloc.cpp:
+ (WTF::TCMalloc_Central_FreeList::Populate):
+ (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
+
+2010-08-10 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by David Levin.
+
+ [WINCE] Buildfix for CE 6.0
+ https://bugs.webkit.org/show_bug.cgi?id=43027
+
+ CE 6.0 doesn't define localtime in the system include files.
+
+ * wtf/Platform.h: Include ce_time.h on all OS(WINCE).
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Bug 43786 - Move AtomicStringHash from WebCore to WTF
+ Also remove deprecated string headers from WebCore/platform/text.
+
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * wtf/text/AtomicString.h:
+ * wtf/text/AtomicStringHash.h: Copied from WebCore/platform/text/AtomicStringHash.h.
+
2010-08-09 Oliver Hunt <oliver@apple.com>
Fix Qt/ARM again, this time including the other changed file.
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index 2ead8e0..fae85e1 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -491,6 +491,7 @@ javascriptcore_sources += \
JavaScriptCore/wtf/TCSystemAlloc.h \
JavaScriptCore/wtf/text/AtomicString.cpp \
JavaScriptCore/wtf/text/AtomicString.h \
+ JavaScriptCore/wtf/text/AtomicStringHash.h \
JavaScriptCore/wtf/text/AtomicStringImpl.h \
JavaScriptCore/wtf/text/CString.cpp \
JavaScriptCore/wtf/text/CString.h \
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index 241ed5c..5cfa1c2 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -107,6 +107,7 @@ __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc
__ZN3JSC10Identifier4fromEPNS_9ExecStateEi
__ZN3JSC10Identifier4fromEPNS_9ExecStateEj
__ZN3JSC10Identifier5equalEPKN3WTF10StringImplEPKc
+__ZN3JSC10Identifier8toUInt32ERKNS_7UStringERb
__ZN3JSC10JSFunction4infoE
__ZN3JSC10JSFunction4nameEPNS_9ExecStateE
__ZN3JSC10throwErrorEPNS_9ExecStateENS_7JSValueE
@@ -251,11 +252,13 @@ __ZN3JSC7Profile10restoreAllEv
__ZN3JSC7Profile5focusEPKNS_11ProfileNodeE
__ZN3JSC7Profile7excludeEPKNS_11ProfileNodeE
__ZN3JSC7Profile7forEachEMNS_11ProfileNodeEFvvE
-__ZN3JSC7UString4fromEd
-__ZN3JSC7UString4fromEi
-__ZN3JSC7UString4fromEj
-__ZN3JSC7UString4fromEl
+__ZN3JSC7UString6numberEd
+__ZN3JSC7UString6numberEi
+__ZN3JSC7UString6numberEj
+__ZN3JSC7UString6numberEl
__ZN3JSC7UStringC1EPKc
+__ZN3JSC7UStringC1EPKcj
+__ZN3JSC7UStringC1EPKt
__ZN3JSC7UStringC1EPKtj
__ZN3JSC8Debugger23recompileAllJSFunctionsEPNS_12JSGlobalDataE
__ZN3JSC8Debugger6attachEPNS_14JSGlobalObjectE
@@ -317,21 +320,23 @@ __ZN3JSC9constructEPNS_9ExecStateENS_7JSValueENS_13ConstructTypeERKNS_13Construc
__ZN3JSCeqERKNS_7UStringEPKc
__ZN3JSCgtERKNS_7UStringES2_
__ZN3JSCltERKNS_7UStringES2_
-__ZN3WTF10StringImpl11reverseFindEPS0_ib
-__ZN3WTF10StringImpl11reverseFindEti
+__ZN3WTF10StringImpl11reverseFindEPS0_j
+__ZN3WTF10StringImpl11reverseFindEtj
__ZN3WTF10StringImpl12sharedBufferEv
+__ZN3WTF10StringImpl16findIgnoringCaseEPKcj
+__ZN3WTF10StringImpl16findIgnoringCaseEPS0_j
__ZN3WTF10StringImpl18simplifyWhiteSpaceEv
__ZN3WTF10StringImpl19characterStartingAtEj
__ZN3WTF10StringImpl19createUninitializedEjRPt
__ZN3WTF10StringImpl22containsOnlyWhitespaceEv
__ZN3WTF10StringImpl23defaultWritingDirectionEv
+__ZN3WTF10StringImpl23reverseFindIgnoringCaseEPS0_j
__ZN3WTF10StringImpl37createStrippingNullCharactersSlowCaseEPKtj
-__ZN3WTF10StringImpl4findEPFbtEi
-__ZN3WTF10StringImpl4findEPKcib
-__ZN3WTF10StringImpl4findEPS0_ib
-__ZN3WTF10StringImpl4findEti
+__ZN3WTF10StringImpl4findEPFbtEj
+__ZN3WTF10StringImpl4findEPKcj
+__ZN3WTF10StringImpl4findEPS0_j
+__ZN3WTF10StringImpl4findEtj
__ZN3WTF10StringImpl5adoptERNS_12StringBufferE
-__ZN3WTF10StringImpl5asciiEv
__ZN3WTF10StringImpl5emptyEv
__ZN3WTF10StringImpl5lowerEv
__ZN3WTF10StringImpl5toIntEPb
@@ -442,7 +447,10 @@ __ZN3WTF6String6removeEji
__ZN3WTF6String8fromUTF8EPKc
__ZN3WTF6String8fromUTF8EPKcm
__ZN3WTF6String8truncateEj
+__ZN3WTF6StringC1EPKc
+__ZN3WTF6StringC1EPKcj
__ZN3WTF6StringC1EPKt
+__ZN3WTF6StringC1EPKtj
__ZN3WTF6strtodEPKcPPc
__ZN3WTF7CString11mutableDataEv
__ZN3WTF7CString16newUninitializedEmRPc
@@ -508,13 +516,9 @@ __ZNK3JSC7JSValue16toObjectSlowCaseEPNS_9ExecStateE
__ZNK3JSC7JSValue19synthesizePrototypeEPNS_9ExecStateE
__ZNK3JSC7JSValue20toThisObjectSlowCaseEPNS_9ExecStateE
__ZNK3JSC7JSValue9toIntegerEPNS_9ExecStateE
-__ZNK3JSC7UString10UTF8StringEb
-__ZNK3JSC7UString14toStrictUInt32EPb
+__ZNK3JSC7UString20substringSharingImplEjj
+__ZNK3JSC7UString4utf8Eb
__ZNK3JSC7UString5asciiEv
-__ZNK3JSC7UString6is8BitEv
-__ZNK3JSC7UString6substrEjj
-__ZNK3JSC7UString8toUInt32EPb
-__ZNK3JSC7UString8toUInt32EPbb
__ZNK3JSC8JSObject11hasPropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZNK3JSC8JSObject11hasPropertyEPNS_9ExecStateEj
__ZNK3JSC8JSObject12defaultValueEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
@@ -536,7 +540,7 @@ __ZNK3WTF6String16removeCharactersEPFbtE
__ZNK3WTF6String17crossThreadStringEv
__ZNK3WTF6String18simplifyWhiteSpaceEv
__ZNK3WTF6String19characterStartingAtEj
-__ZNK3WTF6String4utf8Ev
+__ZNK3WTF6String4utf8Eb
__ZNK3WTF6String5asciiEv
__ZNK3WTF6String5lowerEv
__ZNK3WTF6String5splitERKS0_bRNS_6VectorIS0_Lm0EEE
diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi
index a85d11c..12614d0 100644
--- a/JavaScriptCore/JavaScriptCore.gypi
+++ b/JavaScriptCore/JavaScriptCore.gypi
@@ -445,6 +445,7 @@
'wtf/TypeTraits.h',
'wtf/text/AtomicString.cpp',
'wtf/text/AtomicString.h',
+ 'wtf/text/AtomicStringHash.h',
'wtf/text/AtomicStringImpl.h',
'wtf/text/CString.cpp',
'wtf/text/CString.h',
diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro
index d6c4420..7f6b27d 100644
--- a/JavaScriptCore/JavaScriptCore.pro
+++ b/JavaScriptCore/JavaScriptCore.pro
@@ -79,6 +79,7 @@ SOURCES += \
API/JSValueRef.cpp \
API/OpaqueJSString.cpp \
assembler/ARMAssembler.cpp \
+ assembler/ARMv7Assembler.cpp \
assembler/MacroAssemblerARM.cpp \
bytecode/CodeBlock.cpp \
bytecode/JumpTable.cpp \
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 90fd3ad..934688f 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -38,7 +38,7 @@ EXPORTS
??8JSC@@YA_NABVUString@0@0@Z
??8WTF@@YA_NABVCString@0@0@Z
?NaN@JSC@@3NB
- ?UTF8String@UString@JSC@@QBE?AVCString@WTF@@_N@Z
+ ?utf8@UString@JSC@@QBE?AVCString@WTF@@_N@Z
?add@Identifier@JSC@@SA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PBD@Z
?add@PropertyNameArray@JSC@@QAEXPAVStringImpl@WTF@@@Z
?addBytes@MD5@WTF@@QAEXPBEI@Z
@@ -50,7 +50,7 @@ EXPORTS
?allocate@Heap@JSC@@QAEPAXI@Z
?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z
?allocateStack@MarkStack@JSC@@CAPAXI@Z
- ?ascii@UString@JSC@@QBEPADXZ
+ ?ascii@UString@JSC@@QBE?AVCString@WTF@@XZ
?attach@Debugger@JSC@@QAEXPAVJSGlobalObject@2@@Z
?broadcast@ThreadCondition@WTF@@QAEXXZ
?calculatedFunctionName@DebuggerCallFrame@JSC@@QBE?AVUString@2@XZ
@@ -146,9 +146,9 @@ EXPORTS
?free@WeakGCHandlePool@JSC@@QAEXPAVWeakGCHandle@2@@Z
?from@Identifier@JSC@@SA?AV12@PAVExecState@2@H@Z
?from@Identifier@JSC@@SA?AV12@PAVExecState@2@I@Z
- ?from@UString@JSC@@SA?AV12@H@Z
- ?from@UString@JSC@@SA?AV12@I@Z
- ?from@UString@JSC@@SA?AV12@N@Z
+ ?number@UString@JSC@@SA?AV12@H@Z
+ ?number@UString@JSC@@SA?AV12@I@Z
+ ?number@UString@JSC@@SA?AV12@N@Z
?functionGetter@PropertySlot@JSC@@ABE?AVJSValue@2@PAVExecState@2@@Z
?functionName@DebuggerCallFrame@JSC@@QBEPBVUString@2@XZ
?get@Structure@JSC@@QAEIPBVStringImpl@WTF@@AAIAAPAVJSCell@2@@Z
@@ -193,7 +193,6 @@ EXPORTS
?initializeMainThread@WTF@@YAXXZ
?initializeThreading@JSC@@YAXXZ
?initializeThreading@WTF@@YAXXZ
- ?is8Bit@UString@JSC@@QBE_NXZ
?isAccessorDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
?isBusy@Heap@JSC@@QAE_NXZ
?isDataDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
@@ -286,7 +285,7 @@ EXPORTS
?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z
?stopSampling@JSGlobalData@JSC@@QAEXXZ
?strtod@WTF@@YANPBDPAPAD@Z
- ?substr@UString@JSC@@QBE?AV12@II@Z
+ ?substringSharingImpl@UString@JSC@@QBE?AV12@II@Z
?symbolTableGet@JSVariableObject@JSC@@IAE_NABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?synthesizePrototype@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
?thisObject@DebuggerCallFrame@JSC@@QBEPAVJSObject@2@XZ
@@ -311,7 +310,6 @@ EXPORTS
?toObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
?toPrimitive@JSCell@JSC@@UBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z
?toPrimitive@JSString@JSC@@EBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z
- ?toStrictUInt32@UString@JSC@@QBEIPA_N@Z
?toString@JSCell@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
?toString@JSObject@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
?toString@JSString@JSC@@EBE?AVUString@2@PAVExecState@2@@Z
@@ -319,8 +317,7 @@ EXPORTS
?toThisObject@JSObject@JSC@@UBEPAV12@PAVExecState@2@@Z
?toThisObject@JSString@JSC@@EBEPAVJSObject@2@PAVExecState@2@@Z
?toThisObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z
- ?toUInt32@UString@JSC@@QBEIPA_N@Z
- ?toUInt32@UString@JSC@@QBEIPA_N_N@Z
+ ?toUInt32@Identifier@JSC@@SAIABVUString@2@AA_N@Z
?toUInt32SlowCase@JSC@@YAINAA_N@Z
?tryFastCalloc@WTF@@YA?AUTryMallocReturnValue@1@II@Z
?tryFastMalloc@WTF@@YA?AUTryMallocReturnValue@1@I@Z
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
index 098ff08..a9493a3 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
@@ -1,4 +1,5 @@
all:
+ -if not exist "$(WEBKITLIBRARIESDIR)\tools\vsprops\.svn" del /s/q "$(WEBKITLIBRARIESDIR)\tools\vsprops\"
-xcopy /y/d/e/i "..\..\..\WebKitLibraries\win\tools" "$(WEBKITLIBRARIESDIR)\tools"
touch "$(WEBKITOUTPUTDIR)\buildfailed"
bash build-generated-files.sh "$(WEBKITOUTPUTDIR)" "$(WEBKITLIBRARIESDIR)"
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
index 9d551d0..aedc122 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
@@ -577,6 +577,10 @@
>
</File>
<File
+ RelativePath="..\..\wtf\text\AtomicStringHash.h"
+ >
+ </File>
+ <File
RelativePath="..\..\wtf\text\AtomicStringImpl.h"
>
</File>
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index de3afaa..511a7a0 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -216,12 +216,12 @@
868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA5F117D048200B908B1 /* StaticConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
8690231512092D5C00630AF9 /* PageReservation.h in Headers */ = {isa = PBXBuildFile; fileRef = 8690231412092D5C00630AF9 /* PageReservation.h */; settings = {ATTRIBUTES = (Private, ); }; };
8698B86910D44D9400D8D01B /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698B86810D44D9400D8D01B /* StringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698BB3710D86BAF00D8D01B /* UStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
869D04AF1193B54D00803475 /* CachedTranscendentalFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */; settings = {ATTRIBUTES = (Private, ); }; };
869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; };
86A90ED00EE7D51F00AB350D /* JITArithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */; };
86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; };
86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; };
+ 86B6DA0212132B9A000D316F /* StringConcatenate.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B6DA0112132B9A000D316F /* StringConcatenate.h */; };
86B99AB8117E391E00DF5A90 /* RopeImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */; };
86B99AB9117E391E00DF5A90 /* RopeImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AB7117E391E00DF5A90 /* RopeImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B99AE1117E578100DF5A90 /* StringBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -255,6 +255,7 @@
86EAC49A0F93E8D1008EC948 /* RegexJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4920F93E8D1008EC948 /* RegexJIT.h */; };
86EAC49B0F93E8D1008EC948 /* RegexParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4930F93E8D1008EC948 /* RegexParser.h */; };
86EAC49C0F93E8D1008EC948 /* RegexPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EAC4940F93E8D1008EC948 /* RegexPattern.h */; };
+ 86F38859121130CA007A7CE3 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F38858121130CA007A7CE3 /* AtomicStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
905B02AE0E28640F006DF882 /* RefCountedLeakCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 905B02AD0E28640F006DF882 /* RefCountedLeakCounter.cpp */; };
90D3469C0E285280009492EE /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D3469B0E285280009492EE /* RefCountedLeakCounter.h */; settings = {ATTRIBUTES = (Private, ); }; };
93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; };
@@ -803,12 +804,12 @@
868BFA5F117D048200B908B1 /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
8690231412092D5C00630AF9 /* PageReservation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageReservation.h; sourceTree = "<group>"; };
8698B86810D44D9400D8D01B /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; };
- 8698BB3710D86BAF00D8D01B /* UStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringImpl.h; sourceTree = "<group>"; };
869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTranscendentalFunction.h; sourceTree = "<group>"; };
869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = "<group>"; };
86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic.cpp; sourceTree = "<group>"; };
86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = "<group>"; };
86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARMv7.h; sourceTree = "<group>"; };
+ 86B6DA0112132B9A000D316F /* StringConcatenate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringConcatenate.h; sourceTree = "<group>"; };
86B99AB6117E391E00DF5A90 /* RopeImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RopeImpl.cpp; sourceTree = "<group>"; };
86B99AB7117E391E00DF5A90 /* RopeImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RopeImpl.h; sourceTree = "<group>"; };
86B99AE1117E578100DF5A90 /* StringBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuffer.h; path = text/StringBuffer.h; sourceTree = "<group>"; };
@@ -842,6 +843,7 @@
86EAC4920F93E8D1008EC948 /* RegexJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexJIT.h; path = yarr/RegexJIT.h; sourceTree = "<group>"; };
86EAC4930F93E8D1008EC948 /* RegexParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexParser.h; path = yarr/RegexParser.h; sourceTree = "<group>"; };
86EAC4940F93E8D1008EC948 /* RegexPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegexPattern.h; path = yarr/RegexPattern.h; sourceTree = "<group>"; };
+ 86F38858121130CA007A7CE3 /* AtomicStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicStringHash.h; path = text/AtomicStringHash.h; sourceTree = "<group>"; };
905B02AD0E28640F006DF882 /* RefCountedLeakCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefCountedLeakCounter.cpp; sourceTree = "<group>"; };
90D3469B0E285280009492EE /* RefCountedLeakCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefCountedLeakCounter.h; sourceTree = "<group>"; };
9303F567099118FA00AD71B8 /* OwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnPtr.h; sourceTree = "<group>"; };
@@ -1751,6 +1753,7 @@
93303FE80E6A72B500786E6A /* SmallStrings.cpp */,
93303FEA0E6A72C000786E6A /* SmallStrings.h */,
8698B86810D44D9400D8D01B /* StringBuilder.h */,
+ 86B6DA0112132B9A000D316F /* StringConcatenate.h */,
BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */,
BC18C3C10E16EE3300B34460 /* StringConstructor.h */,
BC18C3C20E16EE3300B34460 /* StringObject.cpp */,
@@ -1771,7 +1774,6 @@
5D53726E0E1C54880021E549 /* Tracing.h */,
F692A8850255597D01FF60F7 /* UString.cpp */,
F692A8860255597D01FF60F7 /* UString.h */,
- 8698BB3710D86BAF00D8D01B /* UStringImpl.h */,
14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */,
14035DB010DBFB2A00FFFFE7 /* WeakGCPtr.h */,
1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */,
@@ -1784,6 +1786,7 @@
children = (
868BFA00117CEFD100B908B1 /* AtomicString.cpp */,
868BFA01117CEFD100B908B1 /* AtomicString.h */,
+ 86F38858121130CA007A7CE3 /* AtomicStringHash.h */,
868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */,
86565740115BE3DA00291F40 /* CString.cpp */,
86565741115BE3DA00291F40 /* CString.h */,
@@ -2213,7 +2216,6 @@
BC18C4740E16F5CD00B34460 /* UnicodeIcu.h in Headers */,
BC18C4750E16F5CD00B34460 /* UnusedParam.h in Headers */,
BC18C4760E16F5CD00B34460 /* UString.h in Headers */,
- 8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */,
BC18C4770E16F5CD00B34460 /* UTF8.h in Headers */,
E17FF771112131D200076A19 /* ValueCheck.h in Headers */,
BC18C4780E16F5CD00B34460 /* Vector.h in Headers */,
@@ -2229,6 +2231,8 @@
DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */,
DD2724691208D1FF00F9ABE7 /* AlignedMemoryAllocator.h in Headers */,
DDE82AD81209D955005C1756 /* GCHandle.h in Headers */,
+ 86F38859121130CA007A7CE3 /* AtomicStringHash.h in Headers */,
+ 86B6DA0212132B9A000D316F /* StringConcatenate.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/JavaScriptCore/assembler/ARMAssembler.cpp b/JavaScriptCore/assembler/ARMAssembler.cpp
index 9442b4b..42a6402 100644
--- a/JavaScriptCore/assembler/ARMAssembler.cpp
+++ b/JavaScriptCore/assembler/ARMAssembler.cpp
@@ -357,11 +357,11 @@ void* ARMAssembler::executableCopy(ExecutablePool* allocator)
for (Jumps::Iterator iter = m_jumps.begin(); iter != m_jumps.end(); ++iter) {
// The last bit is set if the constant must be placed on constant pool.
int pos = (*iter) & (~0x1);
- ARMWord* ldrAddr = reinterpret_cast<ARMWord*>(data + pos);
+ ARMWord* ldrAddr = reinterpret_cast_ptr<ARMWord*>(data + pos);
ARMWord* addr = getLdrImmAddress(ldrAddr);
if (*addr != InvalidBranchTarget) {
if (!(*iter & 1)) {
- int diff = reinterpret_cast<ARMWord*>(data + *addr) - (ldrAddr + DefaultPrefetching);
+ int diff = reinterpret_cast_ptr<ARMWord*>(data + *addr) - (ldrAddr + DefaultPrefetching);
if ((diff <= BOFFSET_MAX && diff >= BOFFSET_MIN)) {
*ldrAddr = B | getConditionalField(*ldrAddr) | (diff & BRANCH_MASK);
diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h
index a19864a..da128e7 100644
--- a/JavaScriptCore/assembler/ARMAssembler.h
+++ b/JavaScriptCore/assembler/ARMAssembler.h
@@ -40,32 +40,54 @@ namespace JSC {
r0 = 0,
r1,
r2,
- r3,
- S0 = r3,
+ r3, S0 = r3,
r4,
r5,
r6,
r7,
- r8,
- S1 = r8,
+ r8, S1 = r8,
r9,
r10,
r11,
r12,
- r13,
- sp = r13,
- r14,
- lr = r14,
- r15,
- pc = r15
+ r13, sp = r13,
+ r14, lr = r14,
+ r15, pc = r15
} RegisterID;
typedef enum {
d0,
d1,
d2,
- d3,
- SD0 = d3
+ d3, SD0 = d3,
+ d4,
+ d5,
+ d6,
+ d7,
+ d8,
+ d9,
+ d10,
+ d11,
+ d12,
+ d13,
+ d14,
+ d15,
+ d16,
+ d17,
+ d18,
+ d19,
+ d20,
+ d21,
+ d22,
+ d23,
+ d24,
+ d25,
+ d26,
+ d27,
+ d28,
+ d29,
+ d30,
+ d31
} FPRegisterID;
} // namespace ARMRegisters
@@ -118,12 +140,12 @@ namespace JSC {
MVN = (0xf << 21),
MUL = 0x00000090,
MULL = 0x00c00090,
- FADDD = 0x0e300b00,
- FDIVD = 0x0e800b00,
- FSUBD = 0x0e300b40,
- FMULD = 0x0e200b00,
- FCMPD = 0x0eb40b40,
- FSQRTD = 0x0eb10bc0,
+ VADD_F64 = 0x0e300b00,
+ VDIV_F64 = 0x0e800b00,
+ VSUB_F64 = 0x0e300b40,
+ VMUL_F64 = 0x0e200b00,
+ VCMP_F64 = 0x0eb40b40,
+ VSQRT_F64 = 0x0eb10bc0,
DTR = 0x05000000,
LDRH = 0x00100090,
STRH = 0x00000090,
@@ -135,11 +157,11 @@ namespace JSC {
#if WTF_ARM_ARCH_AT_LEAST(5) || defined(__ARM_ARCH_4T__)
BX = 0x012fff10,
#endif
- FMSR = 0x0e000a10,
- FMRS = 0x0e100a10,
- FSITOD = 0x0eb80bc0,
- FTOSID = 0x0ebd0b40,
- FMSTAT = 0x0ef1fa10,
+ VMOV_VFP = 0x0e000a10,
+ VMOV_ARM = 0x0e100a10,
+ VCVT_F64_S32 = 0x0eb80bc0,
+ VCVT_S32_F64 = 0x0ebd0b40,
+ VMRS_APSR = 0x0ef1fa10,
#if WTF_ARM_ARCH_AT_LEAST(5)
CLZ = 0x016f0f10,
BKPT = 0xe120070,
@@ -234,10 +256,26 @@ namespace JSC {
void emitInst(ARMWord op, int rd, int rn, ARMWord op2)
{
- ASSERT ( ((op2 & ~OP2_IMM) <= 0xfff) || (((op2 & ~OP2_IMMh) <= 0xfff)) );
+ ASSERT(((op2 & ~OP2_IMM) <= 0xfff) || (((op2 & ~OP2_IMMh) <= 0xfff)));
m_buffer.putInt(op | RN(rn) | RD(rd) | op2);
}
+ void emitDoublePrecisionInst(ARMWord op, int dd, int dn, int dm)
+ {
+ ASSERT((dd >= 0 && dd <= 31) && (dn >= 0 && dn <= 31) && (dm >= 0 && dm <= 31));
+ m_buffer.putInt(op | ((dd & 0xf) << 12) | ((dd & 0x10) << (22 - 4))
+ | ((dn & 0xf) << 16) | ((dn & 0x10) << (7 - 4))
+ | (dm & 0xf) | ((dm & 0x10) << (5 - 4)));
+ }
+
+ void emitSinglePrecisionInst(ARMWord op, int sd, int sn, int sm)
+ {
+ ASSERT((sd >= 0 && sd <= 31) && (sn >= 0 && sn <= 31) && (sm >= 0 && sm <= 31));
+ m_buffer.putInt(op | ((sd >> 1) << 12) | ((sd & 0x1) << 22)
+ | ((sn >> 1) << 16) | ((sn & 0x1) << 7)
+ | (sm >> 1) | ((sm & 0x1) << 5));
+ }
+
void and_r(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInst(static_cast<ARMWord>(cc) | AND, rd, rn, op2);
@@ -402,34 +440,34 @@ namespace JSC {
m_buffer.putInt(static_cast<ARMWord>(cc) | MULL | RN(rdhi) | RD(rdlo) | RS(rn) | RM(rm));
}
- void faddd_r(int dd, int dn, int dm, Condition cc = AL)
+ void vadd_f64_r(int dd, int dn, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FADDD, dd, dn, dm);
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VADD_F64, dd, dn, dm);
}
- void fdivd_r(int dd, int dn, int dm, Condition cc = AL)
+ void vdiv_f64_r(int dd, int dn, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FDIVD, dd, dn, dm);
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VDIV_F64, dd, dn, dm);
}
- void fsubd_r(int dd, int dn, int dm, Condition cc = AL)
+ void vsub_f64_r(int dd, int dn, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FSUBD, dd, dn, dm);
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VSUB_F64, dd, dn, dm);
}
- void fmuld_r(int dd, int dn, int dm, Condition cc = AL)
+ void vmul_f64_r(int dd, int dn, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FMULD, dd, dn, dm);
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VMUL_F64, dd, dn, dm);
}
- void fcmpd_r(int dd, int dm, Condition cc = AL)
+ void vcmp_f64_r(int dd, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FCMPD, dd, 0, dm);
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VCMP_F64, dd, 0, dm);
}
- void fsqrtd_r(int dd, int dm, Condition cc = AL)
+ void vsqrt_f64_r(int dd, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FSQRTD, dd, 0, dm);
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VSQRT_F64, dd, 0, dm);
}
void ldr_imm(int rd, ARMWord imm, Condition cc = AL)
@@ -516,29 +554,33 @@ namespace JSC {
dtr_u(true, reg, ARMRegisters::sp, 0, cc);
}
- void fmsr_r(int dd, int rn, Condition cc = AL)
+ void vmov_vfp_r(int sn, int rt, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FMSR, rn, dd, 0);
+ ASSERT(rt <= 15);
+ emitSinglePrecisionInst(static_cast<ARMWord>(cc) | VMOV_VFP, rt << 1, sn, 0);
}
- void fmrs_r(int rd, int dn, Condition cc = AL)
+ void vmov_arm_r(int rt, int sn, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FMRS, rd, dn, 0);
+ ASSERT(rt <= 15);
+ emitSinglePrecisionInst(static_cast<ARMWord>(cc) | VMOV_ARM, rt << 1, sn, 0);
}
- void fsitod_r(int dd, int dm, Condition cc = AL)
+ void vcvt_f64_s32_r(int dd, int sm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FSITOD, dd, 0, dm);
+ ASSERT(!(sm & 0x1)); // sm must be divisible by 2
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VCVT_F64_S32, dd, 0, (sm >> 1));
}
- void ftosid_r(int fd, int dm, Condition cc = AL)
+ void vcvt_s32_f64_r(int sd, int dm, Condition cc = AL)
{
- emitInst(static_cast<ARMWord>(cc) | FTOSID, fd, 0, dm);
+ ASSERT(!(sd & 0x1)); // sd must be divisible by 2
+ emitDoublePrecisionInst(static_cast<ARMWord>(cc) | VCVT_S32_F64, (sd >> 1), 0, dm);
}
- void fmstat(Condition cc = AL)
+ void vmrs_apsr(Condition cc = AL)
{
- m_buffer.putInt(static_cast<ARMWord>(cc) | FMSTAT);
+ m_buffer.putInt(static_cast<ARMWord>(cc) | VMRS_APSR);
}
#if WTF_ARM_ARCH_AT_LEAST(5)
diff --git a/JavaScriptCore/assembler/ARMv7Assembler.h b/JavaScriptCore/assembler/ARMv7Assembler.h
index f1b57b8..d960546 100644
--- a/JavaScriptCore/assembler/ARMv7Assembler.h
+++ b/JavaScriptCore/assembler/ARMv7Assembler.h
@@ -462,8 +462,8 @@ public:
typedef enum {
ConditionEQ,
ConditionNE,
- ConditionHS,
- ConditionLO,
+ ConditionHS, ConditionCS = ConditionHS,
+ ConditionLO, ConditionCC = ConditionLO,
ConditionMI,
ConditionPL,
ConditionVS,
@@ -475,9 +475,7 @@ public:
ConditionGT,
ConditionLE,
ConditionAL,
-
- ConditionCS = ConditionHS,
- ConditionCC = ConditionLO,
+ ConditionInvalid
} Condition;
enum JumpType { JumpNoCondition, JumpCondition, JumpFullSize };
@@ -522,7 +520,7 @@ public:
private:
JmpSrc(int offset, JumpType type)
: m_offset(offset)
- , m_condition(0xffff)
+ , m_condition(ConditionInvalid)
, m_type(type)
{
ASSERT(m_type != JumpCondition);
diff --git a/JavaScriptCore/assembler/AssemblerBuffer.h b/JavaScriptCore/assembler/AssemblerBuffer.h
index 11e0df0..0454a99 100644
--- a/JavaScriptCore/assembler/AssemblerBuffer.h
+++ b/JavaScriptCore/assembler/AssemblerBuffer.h
@@ -33,6 +33,7 @@
#include <jit/ExecutableAllocator.h>
#include <wtf/Assertions.h>
#include <wtf/FastMalloc.h>
+#include <wtf/StdLibExtras.h>
namespace JSC {
@@ -81,7 +82,7 @@ namespace JSC {
void putShortUnchecked(int value)
{
ASSERT(!(m_size > m_capacity - 4));
- *reinterpret_cast<short*>(&m_buffer[m_size]) = value;
+ *reinterpret_cast_ptr<short*>(&m_buffer[m_size]) = value;
m_size += 2;
}
@@ -95,14 +96,14 @@ namespace JSC {
void putIntUnchecked(int value)
{
ASSERT(!(m_size > m_capacity - 4));
- *reinterpret_cast<int*>(&m_buffer[m_size]) = value;
+ *reinterpret_cast_ptr<int*>(&m_buffer[m_size]) = value;
m_size += 4;
}
void putInt64Unchecked(int64_t value)
{
ASSERT(!(m_size > m_capacity - 8));
- *reinterpret_cast<int64_t*>(&m_buffer[m_size]) = value;
+ *reinterpret_cast_ptr<int64_t*>(&m_buffer[m_size]) = value;
m_size += 8;
}
diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.h b/JavaScriptCore/assembler/MacroAssemblerARM.h
index bb1a6da..48ddf24 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -795,7 +795,7 @@ public:
void addDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.faddd_r(dest, dest, src);
+ m_assembler.vadd_f64_r(dest, dest, src);
}
void addDouble(Address src, FPRegisterID dest)
@@ -806,7 +806,7 @@ public:
void divDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.fdivd_r(dest, dest, src);
+ m_assembler.vdiv_f64_r(dest, dest, src);
}
void divDouble(Address src, FPRegisterID dest)
@@ -818,7 +818,7 @@ public:
void subDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.fsubd_r(dest, dest, src);
+ m_assembler.vsub_f64_r(dest, dest, src);
}
void subDouble(Address src, FPRegisterID dest)
@@ -829,7 +829,7 @@ public:
void mulDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.fmuld_r(dest, dest, src);
+ m_assembler.vmul_f64_r(dest, dest, src);
}
void mulDouble(Address src, FPRegisterID dest)
@@ -840,13 +840,13 @@ public:
void sqrtDouble(FPRegisterID src, FPRegisterID dest)
{
- m_assembler.fsqrtd_r(dest, src);
+ m_assembler.vsqrt_f64_r(dest, src);
}
void convertInt32ToDouble(RegisterID src, FPRegisterID dest)
{
- m_assembler.fmsr_r(dest, src);
- m_assembler.fsitod_r(dest, dest);
+ m_assembler.vmov_vfp_r(dest << 1, src);
+ m_assembler.vcvt_f64_s32_r(dest, dest << 1);
}
void convertInt32ToDouble(Address src, FPRegisterID dest)
@@ -868,8 +868,8 @@ public:
Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right)
{
- m_assembler.fcmpd_r(left, right);
- m_assembler.fmstat();
+ m_assembler.vcmp_f64_r(left, right);
+ m_assembler.vmrs_apsr();
if (cond & DoubleConditionBitSpecial)
m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::VS);
return Jump(m_assembler.jmp(static_cast<ARMAssembler::Condition>(cond & ~DoubleConditionMask)));
@@ -893,11 +893,11 @@ public:
// (specifically, in this case, 0).
void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp)
{
- m_assembler.ftosid_r(ARMRegisters::SD0, src);
- m_assembler.fmrs_r(dest, ARMRegisters::SD0);
+ m_assembler.vcvt_s32_f64_r(ARMRegisters::SD0 << 1, src);
+ m_assembler.vmov_arm_r(dest, ARMRegisters::SD0 << 1);
// Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump.
- m_assembler.fsitod_r(ARMRegisters::SD0, ARMRegisters::SD0);
+ m_assembler.vcvt_f64_s32_r(ARMRegisters::SD0, ARMRegisters::SD0 << 1);
failureCases.append(branchDouble(DoubleNotEqualOrUnordered, src, ARMRegisters::SD0));
// If the result is zero, it might have been -0.0, and 0.0 equals to -0.0
diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp
index 9a8c332..0749cf6 100644
--- a/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -30,13 +30,14 @@
#include "config.h"
#include "CodeBlock.h"
-#include "JIT.h"
-#include "JSValue.h"
+#include "BytecodeGenerator.h"
+#include "Debugger.h"
#include "Interpreter.h"
+#include "JIT.h"
#include "JSFunction.h"
#include "JSStaticScopeObject.h"
-#include "Debugger.h"
-#include "BytecodeGenerator.h"
+#include "JSValue.h"
+#include "StringConcatenate.h"
#include <stdio.h>
#include <wtf/StringExtras.h>
@@ -49,9 +50,9 @@ namespace JSC {
static UString escapeQuotes(const UString& str)
{
UString result = str;
- unsigned pos = 0;
- while ((pos = result.find('\"', pos)) != UString::NotFound) {
- result = makeString(result.substr(0, pos), "\"\\\"\"", result.substr(pos + 1));
+ size_t pos = 0;
+ while ((pos = result.find('\"', pos)) != notFound) {
+ result = makeString(result.substringSharingImpl(0, pos), "\"\\\"\"", result.substringSharingImpl(pos + 1));
pos += 4;
}
return result;
@@ -70,12 +71,12 @@ static UString valueToSourceString(ExecState* exec, JSValue val)
static CString constantName(ExecState* exec, int k, JSValue value)
{
- return makeString(valueToSourceString(exec, value), "(@k", UString::from(k - FirstConstantRegisterIndex), ")").UTF8String();
+ return makeString(valueToSourceString(exec, value), "(@k", UString::number(k - FirstConstantRegisterIndex), ")").utf8();
}
static CString idName(int id0, const Identifier& ident)
{
- return makeString(ident.ustring(), "(@id", UString::from(id0), ")").UTF8String();
+ return makeString(ident.ustring(), "(@id", UString::number(id0), ")").utf8();
}
CString CodeBlock::registerName(ExecState* exec, int r) const
@@ -86,7 +87,7 @@ CString CodeBlock::registerName(ExecState* exec, int r) const
if (isConstantRegisterIndex(r))
return constantName(exec, r, getConstant(r));
- return makeString("r", UString::from(r)).UTF8String();
+ return makeString("r", UString::number(r)).utf8();
}
static UString regexpToSourceString(RegExp* regExp)
@@ -105,7 +106,7 @@ static UString regexpToSourceString(RegExp* regExp)
static CString regexpName(int re, RegExp* regexp)
{
- return makeString(regexpToSourceString(regexp), "(@re", UString::from(re), ")").UTF8String();
+ return makeString(regexpToSourceString(regexp), "(@re", UString::number(re), ")").utf8();
}
static UString pointerToSourceString(void* p)
@@ -223,32 +224,32 @@ static unsigned instructionOffsetForNth(ExecState* exec, const Vector<Instructio
static void printGlobalResolveInfo(const GlobalResolveInfo& resolveInfo, unsigned instructionOffset)
{
- printf(" [%4d] %s: %s\n", instructionOffset, "resolve_global", pointerToSourceString(resolveInfo.structure).UTF8String().data());
+ printf(" [%4d] %s: %s\n", instructionOffset, "resolve_global", pointerToSourceString(resolveInfo.structure).utf8().data());
}
static void printStructureStubInfo(const StructureStubInfo& stubInfo, unsigned instructionOffset)
{
switch (stubInfo.accessType) {
case access_get_by_id_self:
- printf(" [%4d] %s: %s\n", instructionOffset, "get_by_id_self", pointerToSourceString(stubInfo.u.getByIdSelf.baseObjectStructure).UTF8String().data());
+ printf(" [%4d] %s: %s\n", instructionOffset, "get_by_id_self", pointerToSourceString(stubInfo.u.getByIdSelf.baseObjectStructure).utf8().data());
return;
case access_get_by_id_proto:
- printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(stubInfo.u.getByIdProto.baseObjectStructure).UTF8String().data(), pointerToSourceString(stubInfo.u.getByIdProto.prototypeStructure).UTF8String().data());
+ printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(stubInfo.u.getByIdProto.baseObjectStructure).utf8().data(), pointerToSourceString(stubInfo.u.getByIdProto.prototypeStructure).utf8().data());
return;
case access_get_by_id_chain:
- printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(stubInfo.u.getByIdChain.baseObjectStructure).UTF8String().data(), pointerToSourceString(stubInfo.u.getByIdChain.chain).UTF8String().data());
+ printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(stubInfo.u.getByIdChain.baseObjectStructure).utf8().data(), pointerToSourceString(stubInfo.u.getByIdChain.chain).utf8().data());
return;
case access_get_by_id_self_list:
- printf(" [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_self_list", pointerToSourceString(stubInfo.u.getByIdSelfList.structureList).UTF8String().data(), stubInfo.u.getByIdSelfList.listSize);
+ printf(" [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_self_list", pointerToSourceString(stubInfo.u.getByIdSelfList.structureList).utf8().data(), stubInfo.u.getByIdSelfList.listSize);
return;
case access_get_by_id_proto_list:
- printf(" [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_proto_list", pointerToSourceString(stubInfo.u.getByIdProtoList.structureList).UTF8String().data(), stubInfo.u.getByIdProtoList.listSize);
+ printf(" [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_proto_list", pointerToSourceString(stubInfo.u.getByIdProtoList.structureList).utf8().data(), stubInfo.u.getByIdProtoList.listSize);
return;
case access_put_by_id_transition:
- printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(stubInfo.u.putByIdTransition.previousStructure).UTF8String().data(), pointerToSourceString(stubInfo.u.putByIdTransition.structure).UTF8String().data(), pointerToSourceString(stubInfo.u.putByIdTransition.chain).UTF8String().data());
+ printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(stubInfo.u.putByIdTransition.previousStructure).utf8().data(), pointerToSourceString(stubInfo.u.putByIdTransition.structure).utf8().data(), pointerToSourceString(stubInfo.u.putByIdTransition.chain).utf8().data());
return;
case access_put_by_id_replace:
- printf(" [%4d] %s: %s\n", instructionOffset, "put_by_id_replace", pointerToSourceString(stubInfo.u.putByIdReplace.baseObjectStructure).UTF8String().data());
+ printf(" [%4d] %s: %s\n", instructionOffset, "put_by_id_replace", pointerToSourceString(stubInfo.u.putByIdReplace.baseObjectStructure).utf8().data());
return;
case access_get_by_id:
printf(" [%4d] %s\n", instructionOffset, "get_by_id");
@@ -277,7 +278,7 @@ static void printStructureStubInfo(const StructureStubInfo& stubInfo, unsigned i
void CodeBlock::printStructure(const char* name, const Instruction* vPC, int operand) const
{
unsigned instructionOffset = vPC - m_instructions.begin();
- printf(" [%4d] %s: %s\n", instructionOffset, name, pointerToSourceString(vPC[operand].u.structure).UTF8String().data());
+ printf(" [%4d] %s: %s\n", instructionOffset, name, pointerToSourceString(vPC[operand].u.structure).utf8().data());
}
void CodeBlock::printStructures(const Instruction* vPC) const
@@ -294,15 +295,15 @@ void CodeBlock::printStructures(const Instruction* vPC) const
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto)) {
- printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structure).UTF8String().data(), pointerToSourceString(vPC[5].u.structure).UTF8String().data());
+ printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structure).utf8().data(), pointerToSourceString(vPC[5].u.structure).utf8().data());
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
- printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(vPC[4].u.structure).UTF8String().data(), pointerToSourceString(vPC[5].u.structure).UTF8String().data(), pointerToSourceString(vPC[6].u.structureChain).UTF8String().data());
+ printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(vPC[4].u.structure).utf8().data(), pointerToSourceString(vPC[5].u.structure).utf8().data(), pointerToSourceString(vPC[6].u.structureChain).utf8().data());
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain)) {
- printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structure).UTF8String().data(), pointerToSourceString(vPC[5].u.structureChain).UTF8String().data());
+ printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structure).utf8().data(), pointerToSourceString(vPC[5].u.structureChain).utf8().data());
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id)) {
@@ -352,7 +353,7 @@ void CodeBlock::dump(ExecState* exec) const
printf("\nIdentifiers:\n");
size_t i = 0;
do {
- printf(" id%u = %s\n", static_cast<unsigned>(i), m_identifiers[i].ascii());
+ printf(" id%u = %s\n", static_cast<unsigned>(i), m_identifiers[i].ustring().utf8().data());
++i;
} while (i != m_identifiers.size());
}
@@ -362,7 +363,7 @@ void CodeBlock::dump(ExecState* exec) const
unsigned registerIndex = m_numVars;
size_t i = 0;
do {
- printf(" k%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).ascii());
+ printf(" k%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).utf8().data());
++i;
++registerIndex;
} while (i < m_constantRegisters.size());
@@ -372,7 +373,7 @@ void CodeBlock::dump(ExecState* exec) const
printf("\nm_regexps:\n");
size_t i = 0;
do {
- printf(" re%u = %s\n", static_cast<unsigned>(i), regexpToSourceString(m_rareData->m_regexps[i].get()).ascii());
+ printf(" re%u = %s\n", static_cast<unsigned>(i), regexpToSourceString(m_rareData->m_regexps[i].get()).utf8().data());
++i;
} while (i < m_rareData->m_regexps.size());
}
@@ -453,7 +454,7 @@ void CodeBlock::dump(ExecState* exec) const
continue;
ASSERT(!((i + m_rareData->m_characterSwitchJumpTables[i].min) & ~0xFFFF));
UChar ch = static_cast<UChar>(entry + m_rareData->m_characterSwitchJumpTables[i].min);
- printf("\t\t\"%s\" => %04d\n", UString(&ch, 1).ascii(), *iter);
+ printf("\t\t\"%s\" => %04d\n", UString(&ch, 1).utf8().data(), *iter);
}
printf(" }\n");
++i;
@@ -467,7 +468,7 @@ void CodeBlock::dump(ExecState* exec) const
printf(" %1d = {\n", i);
StringJumpTable::StringOffsetTable::const_iterator end = m_rareData->m_stringSwitchJumpTables[i].offsetTable.end();
for (StringJumpTable::StringOffsetTable::const_iterator iter = m_rareData->m_stringSwitchJumpTables[i].offsetTable.begin(); iter != end; ++iter)
- printf("\t\t\"%s\" => %04d\n", UString(iter->first).ascii(), iter->second.branchOffset);
+ printf("\t\t\"%s\" => %04d\n", UString(iter->first).utf8().data(), iter->second.branchOffset);
printf(" }\n");
++i;
} while (i < m_rareData->m_stringSwitchJumpTables.size());
@@ -713,7 +714,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
JSValue scope = JSValue((++it)->u.jsCell);
int id0 = (++it)->u.operand;
- printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).data());
+ printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data());
it += 2;
break;
}
@@ -722,7 +723,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
JSValue scope = JSValue((++it)->u.jsCell);
int id0 = (++it)->u.operand;
int depth = it[2].u.operand;
- printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).data(), depth);
+ printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data(), depth);
it += 3;
break;
}
@@ -744,14 +745,14 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
JSValue scope = JSValue((++it)->u.jsCell);
int index = (++it)->u.operand;
- printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), index);
+ printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), index);
break;
}
case op_put_global_var: {
JSValue scope = JSValue((++it)->u.jsCell);
int index = (++it)->u.operand;
int r0 = (++it)->u.operand;
- printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(exec, r0).data());
+ printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).utf8().data(), index, registerName(exec, r0).data());
break;
}
case op_resolve_base: {
diff --git a/JavaScriptCore/bytecode/EvalCodeCache.h b/JavaScriptCore/bytecode/EvalCodeCache.h
index 27c479d..7c4cb33 100644
--- a/JavaScriptCore/bytecode/EvalCodeCache.h
+++ b/JavaScriptCore/bytecode/EvalCodeCache.h
@@ -47,8 +47,8 @@ namespace JSC {
{
RefPtr<EvalExecutable> evalExecutable;
- if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject())
- evalExecutable = m_cacheMap.get(evalSource.rep());
+ if (evalSource.length() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject())
+ evalExecutable = m_cacheMap.get(evalSource.impl());
if (!evalExecutable) {
evalExecutable = EvalExecutable::create(exec, makeSource(evalSource));
@@ -56,8 +56,8 @@ namespace JSC {
if (exceptionValue)
return 0;
- if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries)
- m_cacheMap.set(evalSource.rep(), evalExecutable);
+ if (evalSource.length() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries)
+ m_cacheMap.set(evalSource.impl(), evalExecutable);
}
return evalExecutable.release();
@@ -69,7 +69,7 @@ namespace JSC {
static const unsigned maxCacheableSourceLength = 256;
static const int maxCacheEntries = 64;
- typedef HashMap<RefPtr<UString::Rep>, RefPtr<EvalExecutable> > EvalCacheMap;
+ typedef HashMap<RefPtr<StringImpl>, RefPtr<EvalExecutable> > EvalCacheMap;
EvalCacheMap m_cacheMap;
};
diff --git a/JavaScriptCore/bytecode/JumpTable.h b/JavaScriptCore/bytecode/JumpTable.h
index b4f8e44..5bbe047 100644
--- a/JavaScriptCore/bytecode/JumpTable.h
+++ b/JavaScriptCore/bytecode/JumpTable.h
@@ -45,13 +45,13 @@ namespace JSC {
};
struct StringJumpTable {
- typedef HashMap<RefPtr<UString::Rep>, OffsetLocation> StringOffsetTable;
+ typedef HashMap<RefPtr<StringImpl>, OffsetLocation> StringOffsetTable;
StringOffsetTable offsetTable;
#if ENABLE(JIT)
CodeLocationLabel ctiDefault; // FIXME: it should not be necessary to store this.
#endif
- inline int32_t offsetForValue(UString::Rep* value, int32_t defaultOffset)
+ inline int32_t offsetForValue(StringImpl* value, int32_t defaultOffset)
{
StringOffsetTable::const_iterator end = offsetTable.end();
StringOffsetTable::const_iterator loc = offsetTable.find(value);
@@ -61,7 +61,7 @@ namespace JSC {
}
#if ENABLE(JIT)
- inline CodeLocationLabel ctiForValue(UString::Rep* value)
+ inline CodeLocationLabel ctiForValue(StringImpl* value)
{
StringOffsetTable::const_iterator end = offsetTable.end();
StringOffsetTable::const_iterator loc = offsetTable.find(value);
diff --git a/JavaScriptCore/bytecode/SamplingTool.cpp b/JavaScriptCore/bytecode/SamplingTool.cpp
index 7191e38..4614776 100644
--- a/JavaScriptCore/bytecode/SamplingTool.cpp
+++ b/JavaScriptCore/bytecode/SamplingTool.cpp
@@ -337,7 +337,7 @@ void SamplingTool::dump(ExecState* exec)
if (blockPercent >= 1) {
//Instruction* code = codeBlock->instructions().begin();
- printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().ascii(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
+ printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().utf8().data(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
if (i < 10) {
HashMap<unsigned,unsigned> lineCounts;
codeBlock->dump(exec);
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 34011c1..ab259a6 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -165,7 +165,7 @@ bool BytecodeGenerator::addVar(const Identifier& ident, bool isConstant, Registe
{
int index = m_calleeRegisters.size();
SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
- pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
+ pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry);
if (!result.second) {
r0 = &registerFor(result.first->second.getIndex());
@@ -180,7 +180,7 @@ bool BytecodeGenerator::addGlobalVar(const Identifier& ident, bool isConstant, R
{
int index = m_nextGlobalIndex;
SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
- pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.ustring().rep(), newEntry);
+ pair<SymbolTable::iterator, bool> result = symbolTable().add(ident.impl(), newEntry);
if (!result.second)
index = result.first->second.getIndex();
@@ -350,7 +350,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug
for (size_t i = 0; i < functionStack.size(); ++i) {
FunctionBodyNode* function = functionStack[i];
const Identifier& ident = function->ident();
- m_functions.add(ident.ustring().rep());
+ m_functions.add(ident.impl());
emitNewFunction(addVar(ident, false), function);
}
@@ -437,7 +437,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge
void BytecodeGenerator::addParameter(const Identifier& ident, int parameterIndex)
{
// Parameters overwrite var declarations, but not function declarations.
- UString::Rep* rep = ident.ustring().rep();
+ StringImpl* rep = ident.impl();
if (!m_functions.contains(rep)) {
symbolTable().set(rep, parameterIndex);
RegisterID& parameter = registerFor(parameterIndex);
@@ -457,7 +457,7 @@ RegisterID* BytecodeGenerator::registerFor(const Identifier& ident)
if (!shouldOptimizeLocals())
return 0;
- SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
+ SymbolTableEntry entry = symbolTable().get(ident.impl());
if (entry.isNull())
return 0;
@@ -475,7 +475,7 @@ bool BytecodeGenerator::willResolveToArguments(const Identifier& ident)
if (!shouldOptimizeLocals())
return false;
- SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
+ SymbolTableEntry entry = symbolTable().get(ident.impl());
if (entry.isNull())
return false;
@@ -489,7 +489,7 @@ RegisterID* BytecodeGenerator::uncheckedRegisterForArguments()
{
ASSERT(willResolveToArguments(propertyNames().arguments));
- SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.ustring().rep());
+ SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.impl());
ASSERT(!entry.isNull());
return &registerFor(entry.getIndex());
}
@@ -499,7 +499,7 @@ RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident)
if (m_codeType == EvalCode)
return 0;
- SymbolTableEntry entry = symbolTable().get(ident.ustring().rep());
+ SymbolTableEntry entry = symbolTable().get(ident.impl());
if (entry.isNull())
return 0;
@@ -511,12 +511,12 @@ bool BytecodeGenerator::isLocal(const Identifier& ident)
if (ident == propertyNames().thisIdentifier)
return true;
- return shouldOptimizeLocals() && symbolTable().contains(ident.ustring().rep());
+ return shouldOptimizeLocals() && symbolTable().contains(ident.impl());
}
bool BytecodeGenerator::isLocalConstant(const Identifier& ident)
{
- return symbolTable().get(ident.ustring().rep()).isReadOnly();
+ return symbolTable().get(ident.impl()).isReadOnly();
}
RegisterID* BytecodeGenerator::newRegister()
@@ -829,7 +829,7 @@ PassRefPtr<Label> BytecodeGenerator::emitJumpIfNotFunctionApply(RegisterID* cond
unsigned BytecodeGenerator::addConstant(const Identifier& ident)
{
- UString::Rep* rep = ident.ustring().rep();
+ StringImpl* rep = ident.impl();
pair<IdentifierMap::iterator, bool> result = m_identifierMap.add(rep, m_codeBlock->numberOfIdentifiers());
if (result.second) // new entry
m_codeBlock->addIdentifier(Identifier(m_globalData, rep));
@@ -1001,7 +1001,7 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number)
RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, const Identifier& identifier)
{
- JSString*& stringInMap = m_stringMap.add(identifier.ustring().rep(), 0).first->second;
+ JSString*& stringInMap = m_stringMap.add(identifier.impl(), 0).first->second;
if (!stringInMap)
stringInMap = jsOwnedString(globalData(), identifier.ustring());
return emitLoad(dst, JSValue(stringInMap));
@@ -1039,7 +1039,7 @@ bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& inde
if (!currentScope->isVariableObject())
break;
JSVariableObject* currentVariableObject = static_cast<JSVariableObject*>(currentScope);
- SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.ustring().rep());
+ SymbolTableEntry entry = currentVariableObject->symbolTable().get(property.impl());
// Found the property
if (!entry.isNull()) {
@@ -1974,7 +1974,7 @@ static int32_t keyForCharacterSwitch(ExpressionNode* node, int32_t min, int32_t
{
UNUSED_PARAM(max);
ASSERT(node->isString());
- UString::Rep* clause = static_cast<StringNode*>(node)->value().ustring().rep();
+ StringImpl* clause = static_cast<StringNode*>(node)->value().impl();
ASSERT(clause->length() == 1);
int32_t key = clause->characters()[0];
@@ -2004,7 +2004,7 @@ static void prepareJumpTableForStringSwitch(StringJumpTable& jumpTable, int32_t
ASSERT(!labels[i]->isForward());
ASSERT(nodes[i]->isString());
- UString::Rep* clause = static_cast<StringNode*>(nodes[i])->value().ustring().rep();
+ StringImpl* clause = static_cast<StringNode*>(nodes[i])->value().impl();
OffsetLocation location;
location.branchOffset = labels[i]->bind(switchAddress, switchAddress + 3);
jumpTable.offsetTable.add(clause, location);
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index f855d12..f7bd0bf 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -436,9 +436,9 @@ namespace JSC {
static const bool needsRef = false;
};
- typedef HashMap<RefPtr<UString::Rep>, int, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap;
+ typedef HashMap<RefPtr<StringImpl>, int, IdentifierRepHash, HashTraits<RefPtr<StringImpl> >, IdentifierMapIndexHashTraits> IdentifierMap;
typedef HashMap<double, JSValue> NumberMap;
- typedef HashMap<UString::Rep*, JSString*, IdentifierRepHash> IdentifierStringMap;
+ typedef HashMap<StringImpl*, JSString*, IdentifierRepHash> IdentifierStringMap;
RegisterID* emitCall(OpcodeID, RegisterID* dst, RegisterID* func, CallArguments&, unsigned divot, unsigned startOffset, unsigned endOffset);
@@ -524,7 +524,7 @@ namespace JSC {
// Some of these objects keep pointers to one another. They are arranged
// to ensure a sane destruction order that avoids references to freed memory.
- HashSet<RefPtr<UString::Rep>, IdentifierRepHash> m_functions;
+ HashSet<RefPtr<StringImpl>, IdentifierRepHash> m_functions;
RegisterID m_ignoredResultRegister;
RegisterID m_thisRegister;
RegisterID* m_activationRegister;
diff --git a/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 277562d..f098ba6 100644
--- a/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -42,6 +42,7 @@
#include "RegExpCache.h"
#include "RegExpObject.h"
#include "SamplingTool.h"
+#include "StringConcatenate.h"
#include <wtf/Assertions.h>
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/Threading.h>
@@ -77,9 +78,9 @@ namespace JSC {
static void substitute(UString& string, const UString& substring)
{
- unsigned position = string.find("%s");
- ASSERT(position != UString::NotFound);
- string = makeString(string.substr(0, position), substring, string.substr(position + 2));
+ size_t position = string.find("%s");
+ ASSERT(position != notFound);
+ string = makeString(string.substringSharingImpl(0, position), substring, string.substringSharingImpl(position + 2));
}
RegisterID* ThrowableExpressionData::emitThrowError(BytecodeGenerator& generator, bool isReferenceError, const char* message)
@@ -177,7 +178,7 @@ RegisterID* ResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID*
return generator.moveToDestinationIfNeeded(dst, local);
}
- generator.emitExpressionInfo(m_startOffset + m_ident.size(), m_ident.size(), 0);
+ generator.emitExpressionInfo(m_startOffset + m_ident.length(), m_ident.length(), 0);
return generator.emitResolve(generator.finalDestination(dst), m_ident);
}
@@ -381,7 +382,7 @@ RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator,
RefPtr<RegisterID> func = generator.newTemporary();
CallArguments callArguments(generator, m_args);
int identifierStart = divot() - startOffset();
- generator.emitExpressionInfo(identifierStart + m_ident.size(), m_ident.size(), 0);
+ generator.emitExpressionInfo(identifierStart + m_ident.length(), m_ident.length(), 0);
generator.emitResolveWithBase(callArguments.thisRegister(), func.get(), m_ident);
return generator.emitCall(generator.finalDestinationOrIgnored(dst, func.get()), func.get(), callArguments, divot(), startOffset(), endOffset());
}
@@ -1183,7 +1184,7 @@ RegisterID* ReadModifyResolveNode::emitBytecode(BytecodeGenerator& generator, Re
}
RefPtr<RegisterID> src1 = generator.tempDestination(dst);
- generator.emitExpressionInfo(divot() - startOffset() + m_ident.size(), m_ident.size(), 0);
+ generator.emitExpressionInfo(divot() - startOffset() + m_ident.length(), m_ident.length(), 0);
RefPtr<RegisterID> base = generator.emitResolveWithBase(generator.newTemporary(), src1.get(), m_ident);
RegisterID* result = emitReadModifyAssignment(generator, generator.finalDestination(dst, src1.get()), src1.get(), m_right, m_operator, OperandTypes(ResultType::unknownType(), m_right->resultDescriptor()), this);
return generator.emitPutById(base.get(), m_ident, result);
@@ -1747,8 +1748,8 @@ static void processClauseList(ClauseListNode* list, Vector<ExpressionNode*, 8>&
break;
}
const UString& value = static_cast<StringNode*>(clauseExpression)->value().ustring();
- if (singleCharacterSwitch &= value.size() == 1) {
- int32_t intVal = value.rep()->characters()[0];
+ if (singleCharacterSwitch &= value.length() == 1) {
+ int32_t intVal = value.impl()->characters()[0];
if (intVal < min_num)
min_num = intVal;
if (intVal > max_num)
diff --git a/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index da9cb52..32f65dd 100644
--- a/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -57,7 +57,7 @@ UString DebuggerCallFrame::calculatedFunctionName() const
JSObject* function = m_callFrame->callee();
if (!function || !function->inherits(&JSFunction::info))
- return 0;
+ return UString();
return asFunction(function)->calculatedDisplayName(m_callFrame);
}
diff --git a/JavaScriptCore/interpreter/CallFrame.cpp b/JavaScriptCore/interpreter/CallFrame.cpp
index ff061db..5819875 100644
--- a/JavaScriptCore/interpreter/CallFrame.cpp
+++ b/JavaScriptCore/interpreter/CallFrame.cpp
@@ -40,7 +40,7 @@ void CallFrame::dumpCaller()
JSValue function;
interpreter()->retrieveLastCaller(this, signedLineNumber, sourceID, urlString, function);
- printf("Callpoint => %s:%d\n", urlString.ascii(), signedLineNumber);
+ printf("Callpoint => %s:%d\n", urlString.utf8().data(), signedLineNumber);
}
RegisterFile* CallFrame::registerFile()
diff --git a/JavaScriptCore/interpreter/Interpreter.cpp b/JavaScriptCore/interpreter/Interpreter.cpp
index e7ae540..b1049ad 100644
--- a/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/JavaScriptCore/interpreter/Interpreter.cpp
@@ -3574,7 +3574,7 @@ skip_id_custom_self:
if (!scrutinee.isString())
vPC += defaultOffset;
else {
- UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
+ StringImpl* value = asString(scrutinee)->value(callFrame).impl();
if (value->length() != 1)
vPC += defaultOffset;
else
@@ -3597,7 +3597,7 @@ skip_id_custom_self:
if (!scrutinee.isString())
vPC += defaultOffset;
else
- vPC += codeBlock->stringSwitchJumpTable(tableIndex).offsetForValue(asString(scrutinee)->value(callFrame).rep(), defaultOffset);
+ vPC += codeBlock->stringSwitchJumpTable(tableIndex).offsetForValue(asString(scrutinee)->value(callFrame).impl(), defaultOffset);
NEXT_INSTRUCTION();
}
DEFINE_OPCODE(op_new_func) {
diff --git a/JavaScriptCore/interpreter/RegisterFile.h b/JavaScriptCore/interpreter/RegisterFile.h
index 6c4e969..f3284ff 100644
--- a/JavaScriptCore/interpreter/RegisterFile.h
+++ b/JavaScriptCore/interpreter/RegisterFile.h
@@ -166,7 +166,7 @@ namespace JSC {
checkAllocatedOkay(base);
size_t committedSize = roundUpAllocationSize(maxGlobals * sizeof(Register), commitSize);
checkAllocatedOkay(m_reservation.commit(base, committedSize));
- m_commitEnd = reinterpret_cast<Register*>(reinterpret_cast<char*>(base) + committedSize);
+ m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(base) + committedSize);
m_start = static_cast<Register*>(base) + maxGlobals;
m_end = m_start;
m_maxUsed = m_end;
@@ -193,7 +193,7 @@ namespace JSC {
if (newEnd > m_commitEnd) {
size_t size = roundUpAllocationSize(reinterpret_cast<char*>(newEnd) - reinterpret_cast<char*>(m_commitEnd), commitSize);
checkAllocatedOkay(m_reservation.commit(m_commitEnd, size));
- m_commitEnd = reinterpret_cast<Register*>(reinterpret_cast<char*>(m_commitEnd) + size);
+ m_commitEnd = reinterpret_cast_ptr<Register*>(reinterpret_cast<char*>(m_commitEnd) + size);
}
if (newEnd > m_maxUsed)
diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp
index c4ff0ca..f1808d5 100644
--- a/JavaScriptCore/jit/JITStubs.cpp
+++ b/JavaScriptCore/jit/JITStubs.cpp
@@ -45,6 +45,7 @@
#include "JSArray.h"
#include "JSByteArray.h"
#include "JSFunction.h"
+#include "JSGlobalObjectFunctions.h"
#include "JSNotAnObject.h"
#include "JSPropertyNameIterator.h"
#include "JSStaticScopeObject.h"
@@ -229,15 +230,15 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
#elif COMPILER(GCC) && CPU(ARM_THUMB2)
-#define THUNK_RETURN_ADDRESS_OFFSET 0x3C
-#define PRESERVED_RETURN_ADDRESS_OFFSET 0x40
-#define PRESERVED_R4_OFFSET 0x44
-#define PRESERVED_R5_OFFSET 0x48
-#define PRESERVED_R6_OFFSET 0x4C
-#define REGISTER_FILE_OFFSET 0x50
-#define CALLFRAME_OFFSET 0x54
-#define EXCEPTION_OFFSET 0x58
-#define ENABLE_PROFILER_REFERENCE_OFFSET 0x60
+#define THUNK_RETURN_ADDRESS_OFFSET 0x40
+#define PRESERVED_RETURN_ADDRESS_OFFSET 0x44
+#define PRESERVED_R4_OFFSET 0x48
+#define PRESERVED_R5_OFFSET 0x4C
+#define PRESERVED_R6_OFFSET 0x50
+#define REGISTER_FILE_OFFSET 0x54
+#define CALLFRAME_OFFSET 0x58
+#define EXCEPTION_OFFSET 0x5C
+#define ENABLE_PROFILER_REFERENCE_OFFSET 0x64
#elif (COMPILER(GCC) || COMPILER(RVCT)) && CPU(ARM_TRADITIONAL)
@@ -967,13 +968,13 @@ struct StackHack {
ReturnAddressPtr savedReturnAddress;
};
-#define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame)
+#define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS); StackHack stackHack(stackFrame)
#define STUB_SET_RETURN_ADDRESS(returnAddress) stackHack.savedReturnAddress = ReturnAddressPtr(returnAddress)
#define STUB_RETURN_ADDRESS stackHack.savedReturnAddress
#else
-#define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast<JITStackFrame*>(STUB_ARGS)
+#define STUB_INIT_STACK_FRAME(stackFrame) JITStackFrame& stackFrame = *reinterpret_cast_ptr<JITStackFrame*>(STUB_ARGS)
#define STUB_SET_RETURN_ADDRESS(returnAddress) *stackFrame.returnAddressSlot() = ReturnAddressPtr(returnAddress)
#define STUB_RETURN_ADDRESS *stackFrame.returnAddressSlot()
@@ -2814,16 +2815,16 @@ DEFINE_STUB_FUNCTION(int, op_eq)
if (cell1->isString()) {
if (src2.isInt32())
- return static_cast<JSString*>(cell1)->value(stackFrame.callFrame).toDouble() == src2.asInt32();
+ return jsToNumber(static_cast<JSString*>(cell1)->value(stackFrame.callFrame)) == src2.asInt32();
if (src2.isDouble())
- return static_cast<JSString*>(cell1)->value(stackFrame.callFrame).toDouble() == src2.asDouble();
+ return jsToNumber(static_cast<JSString*>(cell1)->value(stackFrame.callFrame)) == src2.asDouble();
if (src2.isTrue())
- return static_cast<JSString*>(cell1)->value(stackFrame.callFrame).toDouble() == 1.0;
+ return jsToNumber(static_cast<JSString*>(cell1)->value(stackFrame.callFrame)) == 1.0;
if (src2.isFalse())
- return static_cast<JSString*>(cell1)->value(stackFrame.callFrame).toDouble() == 0.0;
+ return jsToNumber(static_cast<JSString*>(cell1)->value(stackFrame.callFrame)) == 0.0;
JSCell* cell2 = asCell(src2);
if (cell2->isString())
@@ -3362,7 +3363,7 @@ DEFINE_STUB_FUNCTION(void*, op_switch_char)
void* result = codeBlock->characterSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
if (scrutinee.isString()) {
- UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
+ StringImpl* value = asString(scrutinee)->value(callFrame).impl();
if (value->length() == 1)
result = codeBlock->characterSwitchJumpTable(tableIndex).ctiForValue(value->characters()[0]).executableAddress();
}
@@ -3383,7 +3384,7 @@ DEFINE_STUB_FUNCTION(void*, op_switch_string)
void* result = codeBlock->stringSwitchJumpTable(tableIndex).ctiDefault.executableAddress();
if (scrutinee.isString()) {
- UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
+ StringImpl* value = asString(scrutinee)->value(callFrame).impl();
result = codeBlock->stringSwitchJumpTable(tableIndex).ctiForValue(value).executableAddress();
}
diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h
index 94e319f..43f3d19 100644
--- a/JavaScriptCore/jit/JITStubs.h
+++ b/JavaScriptCore/jit/JITStubs.h
@@ -144,7 +144,7 @@ namespace JSC {
#endif // COMPILER(MSVC) || (OS(WINDOWS) && COMPILER(GCC))
#elif CPU(ARM_THUMB2)
struct JITStackFrame {
- void* reserved; // Unused
+ JITStubArg reserved; // Unused
JITStubArg args[6];
#if USE(JSVALUE32_64)
void* padding[2]; // Maintain 16-byte stack alignment.
diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp
index 03bc411..8b535a9 100644
--- a/JavaScriptCore/jsc.cpp
+++ b/JavaScriptCore/jsc.cpp
@@ -178,7 +178,7 @@ EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
if (i)
putchar(' ');
- printf("%s", exec->argument(i).toString(exec).UTF8String().data());
+ printf("%s", exec->argument(i).toString(exec).utf8().data());
}
putchar('\n');
@@ -188,7 +188,7 @@ EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
EncodedJSValue JSC_HOST_CALL functionDebug(ExecState* exec)
{
- fprintf(stderr, "--> %s\n", exec->argument(0).toString(exec).UTF8String().data());
+ fprintf(stderr, "--> %s\n", exec->argument(0).toString(exec).utf8().data());
return JSValue::encode(jsUndefined());
}
@@ -392,9 +392,9 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scr
success = success && completion.complType() != Throw;
if (dump) {
if (completion.complType() == Throw)
- printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
+ printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
else
- printf("End: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
+ printf("End: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
}
globalData->stopSampling();
@@ -440,9 +440,9 @@ static void runInteractive(GlobalObject* globalObject)
Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(line.data(), interpreterName));
#endif
if (completion.complType() == Throw)
- printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
+ printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
else
- printf("%s\n", completion.value().toString(globalObject->globalExec()).UTF8String().data());
+ printf("%s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
globalObject->globalExec()->clearException();
}
@@ -532,9 +532,9 @@ int jscmain(int argc, char** argv, JSGlobalData* globalData)
static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer)
{
- FILE* f = fopen(fileName.UTF8String().data(), "r");
+ FILE* f = fopen(fileName.utf8().data(), "r");
if (!f) {
- fprintf(stderr, "Could not open file: %s\n", fileName.UTF8String().data());
+ fprintf(stderr, "Could not open file: %s\n", fileName.utf8().data());
return false;
}
diff --git a/JavaScriptCore/jsc/CMakeLists.txt b/JavaScriptCore/jsc/CMakeLists.txt
index 756ba92..1f529a5 100644
--- a/JavaScriptCore/jsc/CMakeLists.txt
+++ b/JavaScriptCore/jsc/CMakeLists.txt
@@ -15,5 +15,11 @@ WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
INCLUDE_DIRECTORIES(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
ADD_EXECUTABLE(${JSC_EXECUTABLE_NAME} ${JSC_HEADERS} ${JSC_SOURCES})
TARGET_LINK_LIBRARIES(${JSC_EXECUTABLE_NAME} ${JSC_LIBRARIES})
-ADD_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} LINK_FLAGS ${JSC_LINK_FLAGS})
-SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
+
+IF (JSC_LINK_FLAGS)
+ ADD_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} LINK_FLAGS "${JSC_LINK_FLAGS}")
+ENDIF ()
+
+IF (SHARED_CORE)
+ SET_TARGET_PROPERTIES(${JSC_EXECUTABLE_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
+ENDIF ()
diff --git a/JavaScriptCore/parser/ASTBuilder.h b/JavaScriptCore/parser/ASTBuilder.h
index f627756..dbf3c07 100644
--- a/JavaScriptCore/parser/ASTBuilder.h
+++ b/JavaScriptCore/parser/ASTBuilder.h
@@ -210,7 +210,7 @@ public:
ExpressionNode* createRegex(const Identifier& pattern, const Identifier& flags, int start)
{
RegExpNode* node = new (m_globalData) RegExpNode(m_globalData, pattern, flags);
- int size = pattern.size() + 2; // + 2 for the two /'s
+ int size = pattern.length() + 2; // + 2 for the two /'s
setExceptionLocation(node, start, start + size, start + size);
return node;
}
diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp
index 13013c7..3baceba 100644
--- a/JavaScriptCore/parser/JSParser.cpp
+++ b/JavaScriptCore/parser/JSParser.cpp
@@ -1186,11 +1186,11 @@ template <class TreeBuilder> TreeExpression JSParser::parseStrictObjectLiteral(T
TreeProperty property = parseProperty<true>(context);
failIfFalse(property);
- typedef HashMap<RefPtr<UString::Rep>, unsigned, IdentifierRepHash> ObjectValidationMap;
+ typedef HashMap<RefPtr<StringImpl>, unsigned, IdentifierRepHash> ObjectValidationMap;
ObjectValidationMap objectValidator;
// Add the first property
if (!m_syntaxAlreadyValidated)
- objectValidator.add(context.getName(property).ustring().rep(), context.getType(property));
+ objectValidator.add(context.getName(property).impl(), context.getType(property));
TreePropertyList propertyList = context.createPropertyList(property);
TreePropertyList tail = propertyList;
@@ -1202,7 +1202,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseStrictObjectLiteral(T
property = parseProperty<true>(context);
failIfFalse(property);
if (!m_syntaxAlreadyValidated) {
- std::pair<ObjectValidationMap::iterator, bool> propertyEntryIter = objectValidator.add(context.getName(property).ustring().rep(), context.getType(property));
+ std::pair<ObjectValidationMap::iterator, bool> propertyEntryIter = objectValidator.add(context.getName(property).impl(), context.getType(property));
if (!propertyEntryIter.second) {
if ((context.getType(property) & propertyEntryIter.first->second) != PropertyNode::Constant) {
// Can't have multiple getters or setters with the same name, nor can we define
diff --git a/JavaScriptCore/parser/ParserArena.h b/JavaScriptCore/parser/ParserArena.h
index eef8e93..7c1809e 100644
--- a/JavaScriptCore/parser/ParserArena.h
+++ b/JavaScriptCore/parser/ParserArena.h
@@ -55,7 +55,7 @@ namespace JSC {
inline const Identifier& IdentifierArena::makeNumericIdentifier(JSGlobalData* globalData, double number)
{
- m_identifiers.append(Identifier(globalData, UString::from(number)));
+ m_identifiers.append(Identifier(globalData, UString::number(number)));
return m_identifiers.last();
}
diff --git a/JavaScriptCore/parser/SourceProvider.h b/JavaScriptCore/parser/SourceProvider.h
index 5a57542..5ff1d14 100644
--- a/JavaScriptCore/parser/SourceProvider.h
+++ b/JavaScriptCore/parser/SourceProvider.h
@@ -67,10 +67,10 @@ namespace JSC {
UString getRange(int start, int end) const
{
- return m_source.substr(start, end - start);
+ return m_source.substringSharingImpl(start, end - start);
}
- const UChar* data() const { return m_source.data(); }
- int length() const { return m_source.size(); }
+ const UChar* data() const { return m_source.characters(); }
+ int length() const { return m_source.length(); }
private:
UStringSourceProvider(const UString& source, const UString& url)
diff --git a/JavaScriptCore/pcre/pcre_compile.cpp b/JavaScriptCore/pcre/pcre_compile.cpp
index ea6e44c..9d472d8 100644
--- a/JavaScriptCore/pcre/pcre_compile.cpp
+++ b/JavaScriptCore/pcre/pcre_compile.cpp
@@ -49,6 +49,7 @@ supporting internal functions that are not used by other modules. */
#include <wtf/ASCIICType.h>
#include <wtf/FastMalloc.h>
#include <wtf/FixedArray.h>
+#include <wtf/StdLibExtras.h>
using namespace WTF;
@@ -2590,7 +2591,7 @@ JSRegExp* jsRegExpCompile(const UChar* pattern, int patternLength,
size_t stringOffset = (size + sizeof(UChar) - 1) / sizeof(UChar) * sizeof(UChar);
size = stringOffset + patternLength * sizeof(UChar);
#endif
- JSRegExp* re = reinterpret_cast<JSRegExp*>(new char[size]);
+ JSRegExp* re = reinterpret_cast_ptr<JSRegExp*>(new char[size]);
if (!re)
return returnError(ERR13, errorPtr);
diff --git a/JavaScriptCore/pcre/pcre_exec.cpp b/JavaScriptCore/pcre/pcre_exec.cpp
index 994ec57..f4899f2 100644
--- a/JavaScriptCore/pcre/pcre_exec.cpp
+++ b/JavaScriptCore/pcre/pcre_exec.cpp
@@ -88,7 +88,7 @@ public:
void add(const JSRegExp*, double);
private:
- typedef HashMap<RefPtr<UString::Rep>, double> Map;
+ typedef HashMap<RefPtr<StringImpl>, double> Map;
Map times;
};
@@ -2143,7 +2143,7 @@ Histogram::~Histogram()
size_t size = values.size();
printf("Regular Expressions, sorted by time spent evaluating them:\n");
for (size_t i = 0; i < size; ++i)
- printf(" %f - %s\n", values[size - i - 1].second, values[size - i - 1].first.UTF8String().c_str());
+ printf(" %f - %s\n", values[size - i - 1].second, values[size - i - 1].first.utf8().c_str());
}
void Histogram::add(const JSRegExp* re, double elapsedTime)
@@ -2157,7 +2157,7 @@ void Histogram::add(const JSRegExp* re, double elapsedTime)
if (re->options & MatchAcrossMultipleLinesOption)
string += " (multi-line)";
}
- pair<Map::iterator, bool> result = times.add(string.rep(), elapsedTime);
+ pair<Map::iterator, bool> result = times.add(string.impl(), elapsedTime);
if (!result.second)
result.first->second += elapsedTime;
}
diff --git a/JavaScriptCore/profiler/CallIdentifier.h b/JavaScriptCore/profiler/CallIdentifier.h
index f2d04fc..5487209 100644
--- a/JavaScriptCore/profiler/CallIdentifier.h
+++ b/JavaScriptCore/profiler/CallIdentifier.h
@@ -29,6 +29,8 @@
#include <runtime/UString.h>
#include "FastAllocBase.h"
+#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
namespace JSC {
@@ -56,11 +58,11 @@ namespace JSC {
static unsigned hash(const CallIdentifier& key)
{
unsigned hashCodes[3] = {
- key.m_name.rep()->hash(),
- key.m_url.rep()->hash(),
+ key.m_name.impl()->hash(),
+ key.m_url.impl()->hash(),
key.m_lineNumber
};
- return UString::Rep::computeHash(reinterpret_cast<char*>(hashCodes), sizeof(hashCodes));
+ return StringImpl::computeHash(reinterpret_cast<char*>(hashCodes), sizeof(hashCodes));
}
static bool equal(const CallIdentifier& a, const CallIdentifier& b) { return a == b; }
@@ -71,7 +73,7 @@ namespace JSC {
#ifndef NDEBUG
operator const char*() const { return c_str(); }
- const char* c_str() const { return m_name.UTF8String().data(); }
+ const char* c_str() const { return m_name.utf8().data(); }
#endif
};
diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp
index 126e6f6..bc239b3 100644
--- a/JavaScriptCore/profiler/Profile.cpp
+++ b/JavaScriptCore/profiler/Profile.cpp
@@ -106,7 +106,7 @@ void Profile::debugPrintData() const
m_head->debugPrintData(0);
}
-typedef pair<UString::Rep*, unsigned> NameCountPair;
+typedef pair<StringImpl*, unsigned> NameCountPair;
static inline bool functionNameCountPairComparator(const NameCountPair& a, const NameCountPair& b)
{
@@ -127,7 +127,7 @@ void Profile::debugPrintDataSampleStyle() const
std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
- printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().data());
+ printf(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data());
printf("\nSort by top of stack, same collapsed (when >= 5):\n");
}
diff --git a/JavaScriptCore/profiler/ProfileGenerator.cpp b/JavaScriptCore/profiler/ProfileGenerator.cpp
index bdfa27b..1d916ea 100644
--- a/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -75,8 +75,8 @@ const UString& ProfileGenerator::title() const
void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
{
if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
- CString name = callIdentifier.m_name.UTF8String();
- CString url = callIdentifier.m_url.UTF8String();
+ CString name = callIdentifier.m_name.utf8();
+ CString url = callIdentifier.m_url.utf8();
JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
}
@@ -90,8 +90,8 @@ void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
void ProfileGenerator::didExecute(const CallIdentifier& callIdentifier)
{
if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) {
- CString name = callIdentifier.m_name.UTF8String();
- CString url = callIdentifier.m_url.UTF8String();
+ CString name = callIdentifier.m_name.utf8();
+ CString url = callIdentifier.m_url.utf8();
JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
}
diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp
index 1391f99..bfcfcbe 100644
--- a/JavaScriptCore/profiler/ProfileNode.cpp
+++ b/JavaScriptCore/profiler/ProfileNode.cpp
@@ -294,11 +294,11 @@ void ProfileNode::debugPrintData(int indentLevel) const
printf(" ");
printf("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n",
- functionName().UTF8String().data(),
+ functionName().utf8().data(),
m_numberOfCalls, m_actualSelfTime, selfPercent(), m_actualTotalTime, totalPercent(),
m_visibleSelfTime, m_visibleTotalTime,
(m_visible ? "True" : "False"),
- m_nextSibling ? m_nextSibling->functionName().UTF8String().data() : "");
+ m_nextSibling ? m_nextSibling->functionName().utf8().data() : "");
++indentLevel;
@@ -313,13 +313,13 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC
printf(" ");
// Print function names
- const char* name = functionName().UTF8String().data();
+ const char* name = functionName().utf8().data();
double sampleCount = m_actualTotalTime * 1000;
if (indentLevel) {
for (int i = 0; i < indentLevel; ++i)
printf(" ");
- countedFunctions.add(functionName().rep());
+ countedFunctions.add(functionName().impl());
printf("%.0f %s\n", sampleCount ? sampleCount : 1, name);
} else
@@ -339,7 +339,7 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC
while (indentLevel--)
printf(" ");
- printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().UTF8String().data());
+ printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data());
}
return m_actualTotalTime;
diff --git a/JavaScriptCore/profiler/ProfileNode.h b/JavaScriptCore/profiler/ProfileNode.h
index 2b5a936..eafeea6 100644
--- a/JavaScriptCore/profiler/ProfileNode.h
+++ b/JavaScriptCore/profiler/ProfileNode.h
@@ -30,16 +30,17 @@
#define ProfileNode_h
#include "CallIdentifier.h"
-#include <wtf/Vector.h>
+#include <wtf/HashCountedSet.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
namespace JSC {
class ProfileNode;
typedef Vector<RefPtr<ProfileNode> >::const_iterator StackIterator;
- typedef HashCountedSet<UString::Rep*> FunctionCallHashCount;
+ typedef HashCountedSet<StringImpl*> FunctionCallHashCount;
class ProfileNode : public RefCounted<ProfileNode> {
public:
diff --git a/JavaScriptCore/profiler/Profiler.cpp b/JavaScriptCore/profiler/Profiler.cpp
index 94e46a4..021ecff 100644
--- a/JavaScriptCore/profiler/Profiler.cpp
+++ b/JavaScriptCore/profiler/Profiler.cpp
@@ -39,6 +39,7 @@
#include "Profile.h"
#include "ProfileGenerator.h"
#include "ProfileNode.h"
+#include "StringConcatenate.h"
#include <stdio.h>
namespace JSC {
diff --git a/JavaScriptCore/runtime/Arguments.cpp b/JavaScriptCore/runtime/Arguments.cpp
index bb30e3b..450dc7d 100644
--- a/JavaScriptCore/runtime/Arguments.cpp
+++ b/JavaScriptCore/runtime/Arguments.cpp
@@ -151,13 +151,13 @@ bool Arguments::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& sl
return true;
}
- return JSObject::getOwnPropertySlot(exec, Identifier(exec, UString::from(i)), slot);
+ return JSObject::getOwnPropertySlot(exec, Identifier(exec, UString::number(i)), slot);
}
bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
if (i < d->numParameters) {
slot.setRegisterSlot(&d->registers[d->firstParameterIndex + i]);
@@ -182,7 +182,7 @@ bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyNa
bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
if (i < d->numParameters) {
descriptor.setDescriptor(d->registers[d->firstParameterIndex + i].jsValue(), DontEnum);
@@ -209,7 +209,7 @@ void Arguments::getOwnPropertyNames(ExecState* exec, PropertyNameArray& property
if (mode == IncludeDontEnumProperties) {
for (unsigned i = 0; i < d->numArguments; ++i) {
if (!d->deletedArguments || !d->deletedArguments[i])
- propertyNames.add(Identifier(exec, UString::from(i)));
+ propertyNames.add(Identifier(exec, UString::number(i)));
}
propertyNames.add(exec->propertyNames().callee);
propertyNames.add(exec->propertyNames().length);
@@ -227,13 +227,13 @@ void Arguments::put(ExecState* exec, unsigned i, JSValue value, PutPropertySlot&
return;
}
- JSObject::put(exec, Identifier(exec, UString::from(i)), value, slot);
+ JSObject::put(exec, Identifier(exec, UString::number(i)), value, slot);
}
void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
if (i < d->numParameters)
d->registers[d->firstParameterIndex + i] = JSValue(value);
@@ -270,13 +270,13 @@ bool Arguments::deleteProperty(ExecState* exec, unsigned i)
}
}
- return JSObject::deleteProperty(exec, Identifier(exec, UString::from(i)));
+ return JSObject::deleteProperty(exec, Identifier(exec, UString::number(i)));
}
bool Arguments::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < d->numArguments) {
if (!d->deletedArguments) {
d->deletedArguments.set(new bool[d->numArguments]);
diff --git a/JavaScriptCore/runtime/ArrayPrototype.cpp b/JavaScriptCore/runtime/ArrayPrototype.cpp
index fa6eb99..e49ca28 100644
--- a/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -166,7 +166,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec)
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
unsigned totalSize = length ? length - 1 : 0;
- Vector<RefPtr<UString::Rep>, 256> strBuffer(length);
+ Vector<RefPtr<StringImpl>, 256> strBuffer(length);
for (unsigned k = 0; k < length; k++) {
JSValue element;
if (isRealArray && thisObj->canGetIndex(k))
@@ -178,8 +178,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec)
continue;
UString str = element.toString(exec);
- strBuffer[k] = str.rep();
- totalSize += str.size();
+ strBuffer[k] = str.impl();
+ totalSize += str.length();
if (!strBuffer.data()) {
throwOutOfMemoryError(exec);
@@ -199,7 +199,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec)
for (unsigned i = 0; i < length; i++) {
if (i)
buffer.append(',');
- if (RefPtr<UString::Rep> rep = strBuffer[i])
+ if (RefPtr<StringImpl> rep = strBuffer[i])
buffer.append(rep->characters(), rep->length());
}
ASSERT(buffer.size() == totalSize);
diff --git a/JavaScriptCore/runtime/Collector.h b/JavaScriptCore/runtime/Collector.h
index 38c178b..05d5c10 100644
--- a/JavaScriptCore/runtime/Collector.h
+++ b/JavaScriptCore/runtime/Collector.h
@@ -130,6 +130,7 @@ namespace JSC {
void registerThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
static bool isCellMarked(const JSCell*);
+ static bool checkMarkCell(const JSCell*);
static void markCell(JSCell*);
WeakGCHandle* addWeakGCHandle(JSCell*);
@@ -226,6 +227,14 @@ namespace JSC {
FixedArray<uint32_t, BITMAP_WORDS> bits;
bool get(size_t n) const { return !!(bits[n >> 5] & (1 << (n & 0x1F))); }
void set(size_t n) { bits[n >> 5] |= (1 << (n & 0x1F)); }
+ bool getset(size_t n)
+ {
+ unsigned i = (1 << (n & 0x1F));
+ uint32_t& b = bits[n >> 5];
+ bool r = !!(b & i);
+ b |= i;
+ return r;
+ }
void clear(size_t n) { bits[n >> 5] &= ~(1 << (n & 0x1F)); }
void clearAll() { memset(bits.data(), 0, sizeof(bits)); }
ALWAYS_INLINE void advanceToNextPossibleFreeCell(size_t& startCell)
@@ -288,6 +297,11 @@ namespace JSC {
return cellBlock(cell)->marked.get(cellOffset(cell));
}
+ inline bool Heap::checkMarkCell(const JSCell* cell)
+ {
+ return cellBlock(cell)->marked.getset(cellOffset(cell));
+ }
+
inline void Heap::markCell(JSCell* cell)
{
cellBlock(cell)->marked.set(cellOffset(cell));
diff --git a/JavaScriptCore/runtime/DateConversion.cpp b/JavaScriptCore/runtime/DateConversion.cpp
index 70dbaa0..7eb82e4 100644
--- a/JavaScriptCore/runtime/DateConversion.cpp
+++ b/JavaScriptCore/runtime/DateConversion.cpp
@@ -47,6 +47,7 @@
#include "UString.h"
#include <wtf/DateMath.h>
#include <wtf/StringExtras.h>
+#include <wtf/text/CString.h>
using namespace WTF;
@@ -56,7 +57,7 @@ double parseDate(ExecState* exec, const UString &date)
{
if (date == exec->globalData().cachedDateString)
return exec->globalData().cachedDateStringValue;
- double value = parseDateFromNullTerminatedCharacters(exec, date.UTF8String().data());
+ double value = parseDateFromNullTerminatedCharacters(exec, date.utf8().data());
exec->globalData().cachedDateString = date;
exec->globalData().cachedDateStringValue = value;
return value;
diff --git a/JavaScriptCore/runtime/DatePrototype.cpp b/JavaScriptCore/runtime/DatePrototype.cpp
index 9dec33b..249f427 100644
--- a/JavaScriptCore/runtime/DatePrototype.cpp
+++ b/JavaScriptCore/runtime/DatePrototype.cpp
@@ -170,7 +170,7 @@ static JSCell* formatLocaleDate(ExecState* exec, DateInstance*, double timeInMil
CFRelease(locale);
if (useCustomFormat) {
- CFStringRef customFormatCFString = CFStringCreateWithCharacters(0, customFormatString.data(), customFormatString.size());
+ CFStringRef customFormatCFString = CFStringCreateWithCharacters(0, customFormatString.characters(), customFormatString.length());
CFDateFormatterSetFormat(formatter, customFormatCFString);
CFRelease(customFormatCFString);
}
diff --git a/JavaScriptCore/runtime/ExceptionHelpers.cpp b/JavaScriptCore/runtime/ExceptionHelpers.cpp
index 3e0b70c..871b2d5 100644
--- a/JavaScriptCore/runtime/ExceptionHelpers.cpp
+++ b/JavaScriptCore/runtime/ExceptionHelpers.cpp
@@ -36,6 +36,7 @@
#include "JSNotAnObject.h"
#include "Interpreter.h"
#include "Nodes.h"
+#include "StringConcatenate.h"
namespace JSC {
diff --git a/JavaScriptCore/runtime/FunctionConstructor.cpp b/JavaScriptCore/runtime/FunctionConstructor.cpp
index a036eef..f72a273 100644
--- a/JavaScriptCore/runtime/FunctionConstructor.cpp
+++ b/JavaScriptCore/runtime/FunctionConstructor.cpp
@@ -31,6 +31,7 @@
#include "Nodes.h"
#include "Parser.h"
#include "StringBuilder.h"
+#include "StringConcatenate.h"
namespace JSC {
diff --git a/JavaScriptCore/runtime/FunctionPrototype.cpp b/JavaScriptCore/runtime/FunctionPrototype.cpp
index fb2f627..c740624 100644
--- a/JavaScriptCore/runtime/FunctionPrototype.cpp
+++ b/JavaScriptCore/runtime/FunctionPrototype.cpp
@@ -71,13 +71,13 @@ CallType FunctionPrototype::getCallData(CallData& callData)
static inline void insertSemicolonIfNeeded(UString& functionBody)
{
ASSERT(functionBody[0] == '{');
- ASSERT(functionBody[functionBody.size() - 1] == '}');
+ ASSERT(functionBody[functionBody.length() - 1] == '}');
- for (size_t i = functionBody.size() - 2; i > 0; --i) {
+ for (size_t i = functionBody.length() - 2; i > 0; --i) {
UChar ch = functionBody[i];
if (!Lexer::isWhiteSpace(ch) && !Lexer::isLineTerminator(ch)) {
if (ch != ';' && ch != '}')
- functionBody = makeString(functionBody.substr(0, i + 1), ";", functionBody.substr(i + 1, functionBody.size() - (i + 1)));
+ functionBody = makeString(functionBody.substringSharingImpl(0, i + 1), ";", functionBody.substringSharingImpl(i + 1, functionBody.length() - (i + 1)));
return;
}
}
diff --git a/JavaScriptCore/runtime/Identifier.cpp b/JavaScriptCore/runtime/Identifier.cpp
index 46772d0..d375eff 100644
--- a/JavaScriptCore/runtime/Identifier.cpp
+++ b/JavaScriptCore/runtime/Identifier.cpp
@@ -65,7 +65,7 @@ void deleteIdentifierTable(IdentifierTable* table)
delete table;
}
-bool Identifier::equal(const UString::Rep* r, const char* s)
+bool Identifier::equal(const StringImpl* r, const char* s)
{
int length = r->length();
const UChar* d = r->characters();
@@ -75,7 +75,7 @@ bool Identifier::equal(const UString::Rep* r, const char* s)
return s[length] == 0;
}
-bool Identifier::equal(const UString::Rep* r, const UChar* s, unsigned length)
+bool Identifier::equal(const StringImpl* r, const UChar* s, unsigned length)
{
if (r->length() != length)
return false;
@@ -89,19 +89,19 @@ bool Identifier::equal(const UString::Rep* r, const UChar* s, unsigned length)
struct IdentifierCStringTranslator {
static unsigned hash(const char* c)
{
- return UString::Rep::computeHash(c);
+ return StringImpl::computeHash(c);
}
- static bool equal(UString::Rep* r, const char* s)
+ static bool equal(StringImpl* r, const char* s)
{
return Identifier::equal(r, s);
}
- static void translate(UString::Rep*& location, const char* c, unsigned hash)
+ static void translate(StringImpl*& location, const char* c, unsigned hash)
{
size_t length = strlen(c);
UChar* d;
- UString::Rep* r = UString::Rep::createUninitialized(length, d).releaseRef();
+ StringImpl* r = StringImpl::createUninitialized(length, d).releaseRef();
for (size_t i = 0; i != length; i++)
d[i] = static_cast<unsigned char>(c[i]); // use unsigned char to zero-extend instead of sign-extend
r->setHash(hash);
@@ -109,12 +109,12 @@ struct IdentifierCStringTranslator {
}
};
-PassRefPtr<UString::Rep> Identifier::add(JSGlobalData* globalData, const char* c)
+PassRefPtr<StringImpl> Identifier::add(JSGlobalData* globalData, const char* c)
{
if (!c)
- return UString::null().rep();
+ return 0;
if (!c[0])
- return UString::Rep::empty();
+ return StringImpl::empty();
if (!c[1])
return add(globalData, globalData->smallStrings.singleCharacterStringRep(static_cast<unsigned char>(c[0])));
@@ -125,18 +125,18 @@ PassRefPtr<UString::Rep> Identifier::add(JSGlobalData* globalData, const char* c
if (iter != literalIdentifierTable.end())
return iter->second;
- pair<HashSet<UString::Rep*>::iterator, bool> addResult = identifierTable.add<const char*, IdentifierCStringTranslator>(c);
+ pair<HashSet<StringImpl*>::iterator, bool> addResult = identifierTable.add<const char*, IdentifierCStringTranslator>(c);
// If the string is newly-translated, then we need to adopt it.
// The boolean in the pair tells us if that is so.
- RefPtr<UString::Rep> addedString = addResult.second ? adoptRef(*addResult.first) : *addResult.first;
+ RefPtr<StringImpl> addedString = addResult.second ? adoptRef(*addResult.first) : *addResult.first;
literalIdentifierTable.add(c, addedString.get());
return addedString.release();
}
-PassRefPtr<UString::Rep> Identifier::add(ExecState* exec, const char* c)
+PassRefPtr<StringImpl> Identifier::add(ExecState* exec, const char* c)
{
return add(&exec->globalData(), c);
}
@@ -149,18 +149,18 @@ struct UCharBuffer {
struct IdentifierUCharBufferTranslator {
static unsigned hash(const UCharBuffer& buf)
{
- return UString::Rep::computeHash(buf.s, buf.length);
+ return StringImpl::computeHash(buf.s, buf.length);
}
- static bool equal(UString::Rep* str, const UCharBuffer& buf)
+ static bool equal(StringImpl* str, const UCharBuffer& buf)
{
return Identifier::equal(str, buf.s, buf.length);
}
- static void translate(UString::Rep*& location, const UCharBuffer& buf, unsigned hash)
+ static void translate(StringImpl*& location, const UCharBuffer& buf, unsigned hash)
{
UChar* d;
- UString::Rep* r = UString::Rep::createUninitialized(buf.length, d).releaseRef();
+ StringImpl* r = StringImpl::createUninitialized(buf.length, d).releaseRef();
for (unsigned i = 0; i != buf.length; i++)
d[i] = buf.s[i];
r->setHash(hash);
@@ -168,7 +168,50 @@ struct IdentifierUCharBufferTranslator {
}
};
-PassRefPtr<UString::Rep> Identifier::add(JSGlobalData* globalData, const UChar* s, int length)
+uint32_t Identifier::toUInt32(const UString& string, bool& ok)
+{
+ ok = false;
+
+ unsigned length = string.length();
+ const UChar* characters = string.characters();
+
+ // An empty string is not a number.
+ if (!length)
+ return 0;
+
+ // Get the first character, turning it into a digit.
+ uint32_t value = characters[0] - '0';
+ if (value > 9)
+ return 0;
+
+ // Check for leading zeros. If the first characher is 0, then the
+ // length of the string must be one - e.g. "042" is not equal to "42".
+ if (!value && length > 1)
+ return 0;
+
+ while (--length) {
+ // Multiply value by 10, checking for overflow out of 32 bits.
+ if (value > 0xFFFFFFFFU / 10)
+ return 0;
+ value *= 10;
+
+ // Get the next character, turning it into a digit.
+ uint32_t newValue = *(++characters) - '0';
+ if (newValue > 9)
+ return 0;
+
+ // Add in the old value, checking for overflow out of 32 bits.
+ newValue += value;
+ if (newValue < value)
+ return 0;
+ value = newValue;
+ }
+
+ ok = true;
+ return value;
+}
+
+PassRefPtr<StringImpl> Identifier::add(JSGlobalData* globalData, const UChar* s, int length)
{
if (length == 1) {
UChar c = s[0];
@@ -176,21 +219,21 @@ PassRefPtr<UString::Rep> Identifier::add(JSGlobalData* globalData, const UChar*
return add(globalData, globalData->smallStrings.singleCharacterStringRep(c));
}
if (!length)
- return UString::Rep::empty();
+ return StringImpl::empty();
UCharBuffer buf = {s, length};
- pair<HashSet<UString::Rep*>::iterator, bool> addResult = globalData->identifierTable->add<UCharBuffer, IdentifierUCharBufferTranslator>(buf);
+ pair<HashSet<StringImpl*>::iterator, bool> addResult = globalData->identifierTable->add<UCharBuffer, IdentifierUCharBufferTranslator>(buf);
// If the string is newly-translated, then we need to adopt it.
// The boolean in the pair tells us if that is so.
return addResult.second ? adoptRef(*addResult.first) : *addResult.first;
}
-PassRefPtr<UString::Rep> Identifier::add(ExecState* exec, const UChar* s, int length)
+PassRefPtr<StringImpl> Identifier::add(ExecState* exec, const UChar* s, int length)
{
return add(&exec->globalData(), s, length);
}
-PassRefPtr<UString::Rep> Identifier::addSlowCase(JSGlobalData* globalData, UString::Rep* r)
+PassRefPtr<StringImpl> Identifier::addSlowCase(JSGlobalData* globalData, StringImpl* r)
{
ASSERT(!r->isIdentifier());
// The empty & null strings are static singletons, and static strings are handled
@@ -208,7 +251,7 @@ PassRefPtr<UString::Rep> Identifier::addSlowCase(JSGlobalData* globalData, UStri
return *globalData->identifierTable->add(r).first;
}
-PassRefPtr<UString::Rep> Identifier::addSlowCase(ExecState* exec, UString::Rep* r)
+PassRefPtr<StringImpl> Identifier::addSlowCase(ExecState* exec, StringImpl* r)
{
return addSlowCase(&exec->globalData(), r);
}
diff --git a/JavaScriptCore/runtime/Identifier.h b/JavaScriptCore/runtime/Identifier.h
index 2db0716..3a8aed7 100644
--- a/JavaScriptCore/runtime/Identifier.h
+++ b/JavaScriptCore/runtime/Identifier.h
@@ -24,6 +24,7 @@
#include "JSGlobalData.h"
#include "ThreadSpecific.h"
#include "UString.h"
+#include <wtf/text/CString.h>
namespace JSC {
@@ -34,25 +35,23 @@ namespace JSC {
public:
Identifier() { }
- Identifier(ExecState* exec, const char* s) : _ustring(add(exec, s)) { } // Only to be used with string literals.
- Identifier(ExecState* exec, const UChar* s, int length) : _ustring(add(exec, s, length)) { }
- Identifier(ExecState* exec, UString::Rep* rep) : _ustring(add(exec, rep)) { }
- Identifier(ExecState* exec, const UString& s) : _ustring(add(exec, s.rep())) { }
+ Identifier(ExecState* exec, const char* s) : m_string(add(exec, s)) { } // Only to be used with string literals.
+ Identifier(ExecState* exec, const UChar* s, int length) : m_string(add(exec, s, length)) { }
+ Identifier(ExecState* exec, StringImpl* rep) : m_string(add(exec, rep)) { }
+ Identifier(ExecState* exec, const UString& s) : m_string(add(exec, s.impl())) { }
- Identifier(JSGlobalData* globalData, const char* s) : _ustring(add(globalData, s)) { } // Only to be used with string literals.
- Identifier(JSGlobalData* globalData, const UChar* s, int length) : _ustring(add(globalData, s, length)) { }
- Identifier(JSGlobalData* globalData, UString::Rep* rep) : _ustring(add(globalData, rep)) { }
- Identifier(JSGlobalData* globalData, const UString& s) : _ustring(add(globalData, s.rep())) { }
+ Identifier(JSGlobalData* globalData, const char* s) : m_string(add(globalData, s)) { } // Only to be used with string literals.
+ Identifier(JSGlobalData* globalData, const UChar* s, int length) : m_string(add(globalData, s, length)) { }
+ Identifier(JSGlobalData* globalData, StringImpl* rep) : m_string(add(globalData, rep)) { }
+ Identifier(JSGlobalData* globalData, const UString& s) : m_string(add(globalData, s.impl())) { }
- // Special constructor for cases where we overwrite an object in place.
- Identifier(PlacementNewAdoptType) : _ustring(PlacementNewAdopt) { }
+ const UString& ustring() const { return m_string; }
+ StringImpl* impl() const { return m_string.impl(); }
- const UString& ustring() const { return _ustring; }
+ const UChar* characters() const { return m_string.characters(); }
+ int length() const { return m_string.length(); }
- const UChar* data() const { return _ustring.data(); }
- int size() const { return _ustring.size(); }
-
- const char* ascii() const { return _ustring.ascii(); }
+ CString ascii() const { return m_string.ascii(); }
static Identifier from(ExecState* exec, unsigned y);
static Identifier from(ExecState* exec, int y);
@@ -60,15 +59,13 @@ namespace JSC {
static Identifier from(JSGlobalData*, unsigned y);
static Identifier from(JSGlobalData*, int y);
static Identifier from(JSGlobalData*, double y);
-
- bool isNull() const { return _ustring.isNull(); }
- bool isEmpty() const { return _ustring.isEmpty(); }
-
- uint32_t toUInt32(bool* ok) const { return _ustring.toUInt32(ok); }
- uint32_t toUInt32(bool* ok, bool tolerateEmptyString) const { return _ustring.toUInt32(ok, tolerateEmptyString); };
- uint32_t toStrictUInt32(bool* ok) const { return _ustring.toStrictUInt32(ok); }
- unsigned toArrayIndex(bool* ok) const { return _ustring.toArrayIndex(ok); }
- double toDouble() const { return _ustring.toDouble(); }
+
+ static uint32_t toUInt32(const UString&, bool& ok);
+ uint32_t toUInt32(bool& ok) const { return toUInt32(m_string, ok); }
+ unsigned toArrayIndex(bool& ok) const;
+
+ bool isNull() const { return m_string.isNull(); }
+ bool isEmpty() const { return m_string.isEmpty(); }
friend bool operator==(const Identifier&, const Identifier&);
friend bool operator!=(const Identifier&, const Identifier&);
@@ -76,23 +73,23 @@ namespace JSC {
friend bool operator==(const Identifier&, const char*);
friend bool operator!=(const Identifier&, const char*);
- static bool equal(const UString::Rep*, const char*);
- static bool equal(const UString::Rep*, const UChar*, unsigned length);
- static bool equal(const UString::Rep* a, const UString::Rep* b) { return ::equal(a, b); }
+ static bool equal(const StringImpl*, const char*);
+ static bool equal(const StringImpl*, const UChar*, unsigned length);
+ static bool equal(const StringImpl* a, const StringImpl* b) { return ::equal(a, b); }
- static PassRefPtr<UString::Rep> add(ExecState*, const char*); // Only to be used with string literals.
- static PassRefPtr<UString::Rep> add(JSGlobalData*, const char*); // Only to be used with string literals.
+ static PassRefPtr<StringImpl> add(ExecState*, const char*); // Only to be used with string literals.
+ static PassRefPtr<StringImpl> add(JSGlobalData*, const char*); // Only to be used with string literals.
private:
- UString _ustring;
+ UString m_string;
- static bool equal(const Identifier& a, const Identifier& b) { return a._ustring.rep() == b._ustring.rep(); }
- static bool equal(const Identifier& a, const char* b) { return equal(a._ustring.rep(), b); }
+ static bool equal(const Identifier& a, const Identifier& b) { return a.m_string.impl() == b.m_string.impl(); }
+ static bool equal(const Identifier& a, const char* b) { return equal(a.m_string.impl(), b); }
- static PassRefPtr<UString::Rep> add(ExecState*, const UChar*, int length);
- static PassRefPtr<UString::Rep> add(JSGlobalData*, const UChar*, int length);
+ static PassRefPtr<StringImpl> add(ExecState*, const UChar*, int length);
+ static PassRefPtr<StringImpl> add(JSGlobalData*, const UChar*, int length);
- static PassRefPtr<UString::Rep> add(ExecState* exec, UString::Rep* r)
+ static PassRefPtr<StringImpl> add(ExecState* exec, StringImpl* r)
{
#ifndef NDEBUG
checkCurrentIdentifierTable(exec);
@@ -101,7 +98,7 @@ namespace JSC {
return r;
return addSlowCase(exec, r);
}
- static PassRefPtr<UString::Rep> add(JSGlobalData* globalData, UString::Rep* r)
+ static PassRefPtr<StringImpl> add(JSGlobalData* globalData, StringImpl* r)
{
#ifndef NDEBUG
checkCurrentIdentifierTable(globalData);
@@ -111,8 +108,8 @@ namespace JSC {
return addSlowCase(globalData, r);
}
- static PassRefPtr<UString::Rep> addSlowCase(ExecState*, UString::Rep* r);
- static PassRefPtr<UString::Rep> addSlowCase(JSGlobalData*, UString::Rep* r);
+ static PassRefPtr<StringImpl> addSlowCase(ExecState*, StringImpl* r);
+ static PassRefPtr<StringImpl> addSlowCase(JSGlobalData*, StringImpl* r);
static void checkCurrentIdentifierTable(ExecState*);
static void checkCurrentIdentifierTable(JSGlobalData*);
@@ -141,6 +138,11 @@ namespace JSC {
IdentifierTable* createIdentifierTable();
void deleteIdentifierTable(IdentifierTable*);
+ struct IdentifierRepHash : PtrHash<RefPtr<StringImpl> > {
+ static unsigned hash(const RefPtr<StringImpl>& key) { return key->existingHash(); }
+ static unsigned hash(StringImpl* key) { return key->existingHash(); }
+ };
+
} // namespace JSC
#endif // Identifier_h
diff --git a/JavaScriptCore/runtime/InitializeThreading.cpp b/JavaScriptCore/runtime/InitializeThreading.cpp
index 51d43ee..33e8e68 100644
--- a/JavaScriptCore/runtime/InitializeThreading.cpp
+++ b/JavaScriptCore/runtime/InitializeThreading.cpp
@@ -48,9 +48,12 @@ static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT;
static void initializeThreadingOnce()
{
+ // StringImpl::empty() does not construct its static string in a threadsafe fashion,
+ // so ensure it has been initialized from here.
+ StringImpl::empty();
+
WTF::initializeThreading();
wtfThreadData();
- initializeUString();
JSGlobalData::storeVPtrs();
#if ENABLE(JSC_MULTIPLE_THREADS)
s_dtoaP5Mutex = new Mutex;
diff --git a/JavaScriptCore/runtime/InternalFunction.cpp b/JavaScriptCore/runtime/InternalFunction.cpp
index f774993..0a8d9de 100644
--- a/JavaScriptCore/runtime/InternalFunction.cpp
+++ b/JavaScriptCore/runtime/InternalFunction.cpp
@@ -61,7 +61,7 @@ const UString InternalFunction::displayName(ExecState* exec)
if (displayName && isJSString(&exec->globalData(), displayName))
return asString(displayName)->tryGetValue();
- return UString::null();
+ return UString();
}
const UString InternalFunction::calculatedDisplayName(ExecState* exec)
diff --git a/JavaScriptCore/runtime/JSArray.cpp b/JavaScriptCore/runtime/JSArray.cpp
index 0db0a63..9c3570b 100644
--- a/JavaScriptCore/runtime/JSArray.cpp
+++ b/JavaScriptCore/runtime/JSArray.cpp
@@ -273,7 +273,7 @@ bool JSArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName
}
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex)
return JSArray::getOwnPropertySlot(exec, i, slot);
@@ -290,7 +290,7 @@ bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& proper
ArrayStorage* storage = m_storage;
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex) {
if (i >= storage->m_length)
return false;
@@ -317,7 +317,7 @@ bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& proper
void JSArray::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex) {
put(exec, i, value);
return;
@@ -441,7 +441,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
return;
}
- m_storage = reinterpret_cast<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
+ m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
m_storage->m_allocBase = baseStorage;
storage = m_storage;
@@ -475,7 +475,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
bool JSArray::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
bool isArrayIndex;
- unsigned i = propertyName.toArrayIndex(&isArrayIndex);
+ unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex)
return deleteProperty(exec, i);
@@ -591,7 +591,7 @@ bool JSArray::increaseVectorLength(unsigned newLength)
if (!tryFastRealloc(baseStorage, storageSize(newVectorLength + m_indexBias)).getValue(baseStorage))
return false;
- storage = m_storage = reinterpret_cast<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
+ storage = m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(baseStorage) + m_indexBias * sizeof(JSValue));
m_storage->m_allocBase = baseStorage;
JSValue* vector = storage->m_vector;
@@ -623,7 +623,7 @@ bool JSArray::increaseVectorPrefixLength(unsigned newLength)
m_indexBias += newVectorLength - newLength;
- m_storage = reinterpret_cast<ArrayStorage*>(static_cast<char*>(newBaseStorage) + m_indexBias * sizeof(JSValue));
+ m_storage = reinterpret_cast_ptr<ArrayStorage*>(static_cast<char*>(newBaseStorage) + m_indexBias * sizeof(JSValue));
memcpy(m_storage, storage, storageSize(0));
memcpy(&m_storage->m_vector[newLength - m_vectorLength], &storage->m_vector[0], vectorLength * sizeof(JSValue));
@@ -802,7 +802,7 @@ void JSArray::shiftCount(ExecState* exec, int count)
if (m_vectorLength) {
char* newBaseStorage = reinterpret_cast<char*>(storage) + count * sizeof(JSValue);
memmove(newBaseStorage, storage, storageSize(0));
- m_storage = reinterpret_cast<ArrayStorage*>(newBaseStorage);
+ m_storage = reinterpret_cast_ptr<ArrayStorage*>(newBaseStorage);
m_indexBias += count;
}
@@ -839,7 +839,7 @@ void JSArray::unshiftCount(ExecState* exec, int count)
m_indexBias -= count;
char* newBaseStorage = reinterpret_cast<char*>(storage) - count * sizeof(JSValue);
memmove(newBaseStorage, storage, storageSize(0));
- m_storage = reinterpret_cast<ArrayStorage*>(newBaseStorage);
+ m_storage = reinterpret_cast_ptr<ArrayStorage*>(newBaseStorage);
m_vectorLength += count;
} else if (!increaseVectorPrefixLength(m_vectorLength + count)) {
throwOutOfMemoryError(exec);
diff --git a/JavaScriptCore/runtime/JSArray.h b/JavaScriptCore/runtime/JSArray.h
index f718d7e..9e155d8 100644
--- a/JavaScriptCore/runtime/JSArray.h
+++ b/JavaScriptCore/runtime/JSArray.h
@@ -236,7 +236,7 @@ namespace JSC {
current.m_values++;
JSCell* cell;
- if (!value || !value.isCell() || Heap::isCellMarked(cell = value.asCell())) {
+ if (!value || !value.isCell() || Heap::checkMarkCell(cell = value.asCell())) {
if (current.m_values == end) {
m_markSets.removeLast();
continue;
@@ -244,7 +244,6 @@ namespace JSC {
goto findNextUnmarkedNullValue;
}
- Heap::markCell(cell);
if (cell->structure()->typeInfo().type() < CompoundType) {
if (current.m_values == end) {
m_markSets.removeLast();
@@ -262,7 +261,17 @@ namespace JSC {
markChildren(m_values.removeLast());
}
}
-
+
+ // Rule from ECMA 15.2 about what an array index is.
+ // Must exactly match string form of an unsigned integer, and be less than 2^32 - 1.
+ inline unsigned Identifier::toArrayIndex(bool& ok) const
+ {
+ unsigned i = toUInt32(ok);
+ if (ok && i >= 0xFFFFFFFFU)
+ ok = false;
+ return i;
+ }
+
} // namespace JSC
#endif // JSArray_h
diff --git a/JavaScriptCore/runtime/JSByteArray.cpp b/JavaScriptCore/runtime/JSByteArray.cpp
index 803a08c..88519cf 100644
--- a/JavaScriptCore/runtime/JSByteArray.cpp
+++ b/JavaScriptCore/runtime/JSByteArray.cpp
@@ -60,7 +60,7 @@ PassRefPtr<Structure> JSByteArray::createStructure(JSValue prototype)
bool JSByteArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
bool ok;
- unsigned index = propertyName.toUInt32(&ok, false);
+ unsigned index = propertyName.toUInt32(ok);
if (ok && canAccessIndex(index)) {
slot.setValue(getIndex(exec, index));
return true;
@@ -71,7 +71,7 @@ bool JSByteArray::getOwnPropertySlot(ExecState* exec, const Identifier& property
bool JSByteArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
bool ok;
- unsigned index = propertyName.toUInt32(&ok, false);
+ unsigned index = propertyName.toUInt32(ok);
if (ok && canAccessIndex(index)) {
descriptor.setDescriptor(getIndex(exec, index), DontDelete);
return true;
@@ -91,7 +91,7 @@ bool JSByteArray::getOwnPropertySlot(ExecState* exec, unsigned propertyName, Pro
void JSByteArray::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
bool ok;
- unsigned index = propertyName.toUInt32(&ok, false);
+ unsigned index = propertyName.toUInt32(ok);
if (ok) {
setIndex(exec, index, value);
return;
diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h
index 72f81df..2ffce8d 100644
--- a/JavaScriptCore/runtime/JSCell.h
+++ b/JavaScriptCore/runtime/JSCell.h
@@ -333,9 +333,8 @@ namespace JSC {
{
ASSERT(!m_isCheckingForDefaultMarkViolation);
ASSERT(cell);
- if (Heap::isCellMarked(cell))
+ if (Heap::checkMarkCell(cell))
return;
- Heap::markCell(cell);
if (cell->structure()->typeInfo().type() >= CompoundType)
m_values.append(cell);
}
diff --git a/JavaScriptCore/runtime/JSFunction.cpp b/JavaScriptCore/runtime/JSFunction.cpp
index 49cc8fa..7eb9ba5 100644
--- a/JavaScriptCore/runtime/JSFunction.cpp
+++ b/JavaScriptCore/runtime/JSFunction.cpp
@@ -134,7 +134,7 @@ const UString JSFunction::displayName(ExecState* exec)
if (displayName && isJSString(&exec->globalData(), displayName))
return asString(displayName)->tryGetValue();
- return UString::null();
+ return UString();
}
const UString JSFunction::calculatedDisplayName(ExecState* exec)
diff --git a/JavaScriptCore/runtime/JSGlobalData.cpp b/JavaScriptCore/runtime/JSGlobalData.cpp
index abb2db2..ca8605b 100644
--- a/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -283,6 +283,7 @@ void JSGlobalData::resetDateCache()
cachedUTCOffset = NaN;
dstOffsetCache.reset();
cachedDateString = UString();
+ cachedDateStringValue = NaN;
dateInstanceCache.reset();
}
diff --git a/JavaScriptCore/runtime/JSGlobalObject.h b/JavaScriptCore/runtime/JSGlobalObject.h
index 115af87..e57b737 100644
--- a/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/JavaScriptCore/runtime/JSGlobalObject.h
@@ -353,7 +353,7 @@ namespace JSC {
GlobalPropertyInfo& global = globals[i];
ASSERT(global.attributes & DontDelete);
SymbolTableEntry newEntry(index, global.attributes);
- symbolTable().add(global.identifier.ustring().rep(), newEntry);
+ symbolTable().add(global.identifier.impl(), newEntry);
registerAt(index) = global.value;
}
}
diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index d88d6a9..1e20f7f 100644
--- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -53,7 +53,7 @@ namespace JSC {
static JSValue encode(ExecState* exec, const char* doNotEscape)
{
UString str = exec->argument(0).toString(exec);
- CString cstr = str.UTF8String(true);
+ CString cstr = str.utf8(true);
if (!cstr.data())
return throwError(exec, createURIError(exec, "String contained an illegal UTF-16 sequence."));
@@ -77,8 +77,8 @@ static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict)
JSStringBuilder builder;
UString str = exec->argument(0).toString(exec);
int k = 0;
- int len = str.size();
- const UChar* d = str.data();
+ int len = str.length();
+ const UChar* d = str.characters();
UChar u = 0;
while (k < len) {
const UChar* p = d + k;
@@ -220,8 +220,8 @@ double parseIntOverflow(const UChar* s, int length, int radix)
static double parseInt(const UString& s, int radix)
{
- int length = s.size();
- const UChar* data = s.data();
+ int length = s.length();
+ const UChar* data = s.characters();
int p = 0;
while (p < length && isStrWhiteSpace(data[p]))
@@ -265,9 +265,9 @@ static double parseInt(const UString& s, int radix)
if (number >= mantissaOverflowLowerBound) {
if (radix == 10)
- number = WTF::strtod(s.substr(firstDigitPosition, p - firstDigitPosition).UTF8String().data(), 0);
+ number = WTF::strtod(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), 0);
else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32)
- number = parseIntOverflow(s.substr(firstDigitPosition, p - firstDigitPosition).UTF8String().data(), p - firstDigitPosition, radix);
+ number = parseIntOverflow(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), p - firstDigitPosition, radix);
}
if (!sawDigit)
@@ -276,23 +276,161 @@ static double parseInt(const UString& s, int radix)
return sign * number;
}
+static const int SizeOfInfinity = 8;
+
+static bool isInfinity(const UChar* data, const UChar* end)
+{
+ return (end - data) >= SizeOfInfinity
+ && data[0] == 'I'
+ && data[1] == 'n'
+ && data[2] == 'f'
+ && data[3] == 'i'
+ && data[4] == 'n'
+ && data[5] == 'i'
+ && data[6] == 't'
+ && data[7] == 'y';
+}
+
+// See ecma-262 9.3.1
+static double jsHexIntegerLiteral(const UChar*& data, const UChar* end)
+{
+ // Hex number.
+ data += 2;
+ const UChar* firstDigitPosition = data;
+ double number = 0;
+ while (true) {
+ number = number * 16 + toASCIIHexValue(*data);
+ ++data;
+ if (data == end)
+ break;
+ if (!isASCIIHexDigit(*data))
+ break;
+ }
+ if (number >= mantissaOverflowLowerBound)
+ number = parseIntOverflow(firstDigitPosition, data - firstDigitPosition, 16);
+
+ return number;
+}
+
+// See ecma-262 9.3.1
+static double jsStrDecimalLiteral(const UChar*& data, const UChar* end)
+{
+ ASSERT(data < end);
+
+ // Copy the sting into a null-terminated byte buffer, and call strtod.
+ Vector<char, 32> byteBuffer;
+ for (const UChar* characters = data; characters < end; ++characters) {
+ UChar character = *characters;
+ byteBuffer.append(isASCII(character) ? character : 0);
+ }
+ byteBuffer.append(0);
+ char* endOfNumber;
+ double number = WTF::strtod(byteBuffer.data(), &endOfNumber);
+
+ // Check if strtod found a number; if so return it.
+ ptrdiff_t consumed = endOfNumber - byteBuffer.data();
+ if (consumed) {
+ data += consumed;
+ return number;
+ }
+
+ // Check for [+-]?Infinity
+ switch (*data) {
+ case 'I':
+ if (isInfinity(data, end)) {
+ data += SizeOfInfinity;
+ return Inf;
+ }
+ break;
+
+ case '+':
+ if (isInfinity(data + 1, end)) {
+ data += SizeOfInfinity + 1;
+ return Inf;
+ }
+ break;
+
+ case '-':
+ if (isInfinity(data + 1, end)) {
+ data += SizeOfInfinity + 1;
+ return -Inf;
+ }
+ break;
+ }
+
+ // Not a number.
+ return NaN;
+}
+
+// See ecma-262 9.3.1
+double jsToNumber(const UString& s)
+{
+ unsigned size = s.length();
+
+ if (size == 1) {
+ UChar c = s.characters()[0];
+ if (isASCIIDigit(c))
+ return c - '0';
+ if (isStrWhiteSpace(c))
+ return 0;
+ return NaN;
+ }
+
+ const UChar* data = s.characters();
+ const UChar* end = data + size;
+
+ // Skip leading white space.
+ for (; data < end; ++data) {
+ if (!isStrWhiteSpace(*data))
+ break;
+ }
+
+ // Empty string.
+ if (data == end)
+ return 0.0;
+
+ double number;
+ if (data[0] == '0' && data + 2 < end && (data[1] | 0x20) == 'x' && isASCIIHexDigit(data[2]))
+ number = jsHexIntegerLiteral(data, end);
+ else
+ number = jsStrDecimalLiteral(data, end);
+
+ // Allow trailing white space.
+ for (; data < end; ++data) {
+ if (!isStrWhiteSpace(*data))
+ break;
+ }
+ if (data != end)
+ return NaN;
+
+ return number;
+}
+
static double parseFloat(const UString& s)
{
- // Check for 0x prefix here, because toDouble allows it, but we must treat it as 0.
- // Need to skip any whitespace and then one + or - sign.
- int length = s.size();
- const UChar* data = s.data();
- int p = 0;
- while (p < length && isStrWhiteSpace(data[p]))
- ++p;
+ unsigned size = s.length();
- if (p < length && (data[p] == '+' || data[p] == '-'))
- ++p;
+ if (size == 1) {
+ UChar c = s.characters()[0];
+ if (isASCIIDigit(c))
+ return c - '0';
+ return NaN;
+ }
+
+ const UChar* data = s.characters();
+ const UChar* end = data + size;
+
+ // Skip leading white space.
+ for (; data < end; ++data) {
+ if (!isStrWhiteSpace(*data))
+ break;
+ }
- if (length - p >= 2 && data[p] == '0' && (data[p + 1] == 'x' || data[p + 1] == 'X'))
- return 0;
+ // Empty string.
+ if (data == end)
+ return NaN;
- return s.toDouble(true /*tolerant*/, false /* NaN for empty string */);
+ return jsStrDecimalLiteral(data, end);
}
EncodedJSValue JSC_HOST_CALL globalFuncEval(ExecState* exec)
@@ -404,8 +542,8 @@ EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState* exec)
JSStringBuilder builder;
UString str = exec->argument(0).toString(exec);
- const UChar* c = str.data();
- for (unsigned k = 0; k < str.size(); k++, c++) {
+ const UChar* c = str.characters();
+ for (unsigned k = 0; k < str.length(); k++, c++) {
int u = c[0];
if (u > 255) {
char tmp[7];
@@ -428,9 +566,9 @@ EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState* exec)
StringBuilder builder;
UString str = exec->argument(0).toString(exec);
int k = 0;
- int len = str.size();
+ int len = str.length();
while (k < len) {
- const UChar* c = str.data() + k;
+ const UChar* c = str.characters() + k;
UChar u;
if (c[0] == '%' && k <= len - 6 && c[1] == 'u') {
if (isASCIIHexDigit(c[2]) && isASCIIHexDigit(c[3]) && isASCIIHexDigit(c[4]) && isASCIIHexDigit(c[5])) {
@@ -453,7 +591,7 @@ EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState* exec)
#ifndef NDEBUG
EncodedJSValue JSC_HOST_CALL globalFuncJSCPrint(ExecState* exec)
{
- CString string = exec->argument(0).toString(exec).UTF8String();
+ CString string = exec->argument(0).toString(exec).utf8();
puts(string.data());
return JSValue::encode(jsUndefined());
}
diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.h b/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
index e634fae..6dc7343 100644
--- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
+++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
@@ -55,6 +55,7 @@ namespace JSC {
double parseIntOverflow(const char*, int length, int radix);
double parseIntOverflow(const UChar*, int length, int radix);
bool isStrWhiteSpace(UChar);
+ double jsToNumber(const UString& s);
} // namespace JSC
diff --git a/JavaScriptCore/runtime/JSNumberCell.cpp b/JavaScriptCore/runtime/JSNumberCell.cpp
index a61c751..77388e0 100644
--- a/JavaScriptCore/runtime/JSNumberCell.cpp
+++ b/JavaScriptCore/runtime/JSNumberCell.cpp
@@ -54,7 +54,7 @@ double JSNumberCell::toNumber(ExecState*) const
UString JSNumberCell::toString(ExecState*) const
{
- return UString::from(m_value);
+ return UString::number(m_value);
}
JSObject* JSNumberCell::toObject(ExecState* exec) const
diff --git a/JavaScriptCore/runtime/JSONObject.cpp b/JavaScriptCore/runtime/JSONObject.cpp
index ccfd43a..ba50721 100644
--- a/JavaScriptCore/runtime/JSONObject.cpp
+++ b/JavaScriptCore/runtime/JSONObject.cpp
@@ -35,6 +35,7 @@
#include "Lookup.h"
#include "PropertyNameArray.h"
#include "StringBuilder.h"
+#include "StringConcatenate.h"
#include <wtf/MathExtras.h>
namespace JSC {
@@ -163,8 +164,8 @@ static inline UString gap(ExecState* exec, JSValue space)
// If the space value is a string, use it as the gap string, otherwise use no gap string.
UString spaces = space.getString(exec);
- if (spaces.size() > maxGapLength) {
- spaces = spaces.substr(0, maxGapLength);
+ if (spaces.length() > maxGapLength) {
+ spaces = spaces.substringSharingImpl(0, maxGapLength);
}
return spaces;
}
@@ -280,14 +281,14 @@ JSValue Stringifier::stringify(JSValue value)
void Stringifier::appendQuotedString(StringBuilder& builder, const UString& value)
{
- int length = value.size();
+ int length = value.length();
// String length plus 2 for quote marks plus 8 so we can accomodate a few escaped characters.
builder.reserveCapacity(builder.size() + length + 2 + 8);
builder.append('"');
- const UChar* data = value.data();
+ const UChar* data = value.characters();
for (int i = 0; i < length; ++i) {
int start = i;
while (i < length && (data[i] > 0x1F && data[i] != '"' && data[i] != '\\'))
@@ -405,7 +406,7 @@ Stringifier::StringifyResult Stringifier::appendStringifiedValue(StringBuilder&
if (!isfinite(numericValue))
builder.append("null");
else
- builder.append(UString::from(numericValue));
+ builder.append(UString::number(numericValue));
return StringifySucceeded;
}
@@ -463,17 +464,17 @@ inline bool Stringifier::willIndent() const
inline void Stringifier::indent()
{
// Use a single shared string, m_repeatedGap, so we don't keep allocating new ones as we indent and unindent.
- unsigned newSize = m_indent.size() + m_gap.size();
- if (newSize > m_repeatedGap.size())
+ unsigned newSize = m_indent.length() + m_gap.length();
+ if (newSize > m_repeatedGap.length())
m_repeatedGap = makeString(m_repeatedGap, m_gap);
- ASSERT(newSize <= m_repeatedGap.size());
- m_indent = m_repeatedGap.substr(0, newSize);
+ ASSERT(newSize <= m_repeatedGap.length());
+ m_indent = m_repeatedGap.substringSharingImpl(0, newSize);
}
inline void Stringifier::unindent()
{
- ASSERT(m_indent.size() >= m_gap.size());
- m_indent = m_repeatedGap.substr(0, m_indent.size() - m_gap.size());
+ ASSERT(m_indent.length() >= m_gap.length());
+ m_indent = m_repeatedGap.substringSharingImpl(0, m_indent.length() - m_gap.length());
}
inline void Stringifier::startNewLine(StringBuilder& builder) const
@@ -722,7 +723,7 @@ NEVER_INLINE JSValue Walker::walk(JSValue unfiltered)
}
case ArrayEndVisitMember: {
JSArray* array = arrayStack.last();
- JSValue filteredValue = callReviver(array, jsString(m_exec, UString::from(indexStack.last())), outValue);
+ JSValue filteredValue = callReviver(array, jsString(m_exec, UString::number(indexStack.last())), outValue);
if (filteredValue.isUndefined())
array->deleteProperty(m_exec, indexStack.last());
else {
diff --git a/JavaScriptCore/runtime/JSStaticScopeObject.h b/JavaScriptCore/runtime/JSStaticScopeObject.h
index dcece9d..c0519c1 100644
--- a/JavaScriptCore/runtime/JSStaticScopeObject.h
+++ b/JavaScriptCore/runtime/JSStaticScopeObject.h
@@ -47,7 +47,7 @@ namespace JSC{
: JSVariableObject(exec->globalData().staticScopeStructure, new JSStaticScopeObjectData())
{
d()->registerStore = value;
- symbolTable().add(ident.ustring().rep(), SymbolTableEntry(-1, attributes));
+ symbolTable().add(ident.impl(), SymbolTableEntry(-1, attributes));
}
virtual ~JSStaticScopeObject();
virtual void markChildren(MarkStack&);
diff --git a/JavaScriptCore/runtime/JSString.cpp b/JavaScriptCore/runtime/JSString.cpp
index 13c5a51..bc0120f 100644
--- a/JavaScriptCore/runtime/JSString.cpp
+++ b/JavaScriptCore/runtime/JSString.cpp
@@ -24,6 +24,7 @@
#include "JSString.h"
#include "JSGlobalObject.h"
+#include "JSGlobalObjectFunctions.h"
#include "JSObject.h"
#include "Operations.h"
#include "StringObject.h"
@@ -37,7 +38,7 @@ namespace JSC {
// representing the rope is likely imbalanced with more nodes down the left side
// (since appending to the string is likely more common) - and as such resolving
// in this fashion should minimize work queue size. (If we built the queue forwards
-// we would likely have to place all of the constituent UStringImpls into the
+// we would likely have to place all of the constituent StringImpls into the
// Vector before performing any concatenation, but by working backwards we likely
// only fill the queue with the number of substrings at any given level in a
// rope-of-ropes.)
@@ -47,7 +48,7 @@ void JSString::resolveRope(ExecState* exec) const
// Allocate the buffer to hold the final string, position initially points to the end.
UChar* buffer;
- if (PassRefPtr<UStringImpl> newImpl = UStringImpl::tryCreateUninitialized(m_length, buffer))
+ if (PassRefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
m_value = newImpl;
else {
for (unsigned i = 0; i < m_fiberCount; ++i) {
@@ -79,10 +80,10 @@ void JSString::resolveRope(ExecState* exec) const
workQueue.append(rope->fibers()[i]);
currentFiber = rope->fibers()[fiberCountMinusOne];
} else {
- UStringImpl* string = static_cast<UStringImpl*>(currentFiber);
+ StringImpl* string = static_cast<StringImpl*>(currentFiber);
unsigned length = string->length();
position -= length;
- UStringImpl::copyChars(position, string->characters(), length);
+ StringImpl::copyChars(position, string->characters(), length);
// Was this the last item in the work queue?
if (workQueue.isEmpty()) {
@@ -108,26 +109,26 @@ void JSString::resolveRope(ExecState* exec) const
JSValue JSString::replaceCharacter(ExecState* exec, UChar character, const UString& replacement)
{
if (!isRope()) {
- unsigned matchPosition = m_value.find(character);
- if (matchPosition == UString::NotFound)
+ size_t matchPosition = m_value.find(character);
+ if (matchPosition == notFound)
return JSValue(this);
- return jsString(exec, m_value.substr(0, matchPosition), replacement, m_value.substr(matchPosition + 1));
+ return jsString(exec, m_value.substringSharingImpl(0, matchPosition), replacement, m_value.substringSharingImpl(matchPosition + 1));
}
RopeIterator end;
// Count total fibers and find matching string.
size_t fiberCount = 0;
- UStringImpl* matchString = 0;
- int matchPosition = -1;
+ StringImpl* matchString = 0;
+ size_t matchPosition = notFound;
for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) {
++fiberCount;
if (matchString)
continue;
- UStringImpl* string = *it;
+ StringImpl* string = *it;
matchPosition = string->find(character);
- if (matchPosition == -1)
+ if (matchPosition == notFound)
continue;
matchString = string;
}
@@ -135,21 +136,21 @@ JSValue JSString::replaceCharacter(ExecState* exec, UChar character, const UStri
if (!matchString)
return this;
- RopeBuilder builder(replacement.size() ? fiberCount + 2 : fiberCount + 1);
+ RopeBuilder builder(replacement.length() ? fiberCount + 2 : fiberCount + 1);
if (UNLIKELY(builder.isOutOfMemory()))
return throwOutOfMemoryError(exec);
for (RopeIterator it(m_other.m_fibers.data(), m_fiberCount); it != end; ++it) {
- UStringImpl* string = *it;
+ StringImpl* string = *it;
if (string != matchString) {
builder.append(UString(string));
continue;
}
- builder.append(UString(string).substr(0, matchPosition));
- if (replacement.size())
+ builder.append(UString(string).substringSharingImpl(0, matchPosition));
+ if (replacement.length())
builder.append(replacement);
- builder.append(UString(string).substr(matchPosition + 1));
+ builder.append(UString(string).substringSharingImpl(matchPosition + 1));
matchString = 0;
}
@@ -165,7 +166,7 @@ JSString* JSString::getIndexSlowCase(ExecState* exec, unsigned i)
if (exec->exception())
return jsString(exec, "");
ASSERT(!isRope());
- ASSERT(i < m_value.size());
+ ASSERT(i < m_value.length());
return jsSingleCharacterSubstring(exec, m_value, i);
}
@@ -177,7 +178,7 @@ JSValue JSString::toPrimitive(ExecState*, PreferredPrimitiveType) const
bool JSString::getPrimitiveNumber(ExecState* exec, double& number, JSValue& result)
{
result = this;
- number = value(exec).toDouble();
+ number = jsToNumber(value(exec));
return false;
}
@@ -188,7 +189,7 @@ bool JSString::toBoolean(ExecState*) const
double JSString::toNumber(ExecState* exec) const
{
- return value(exec).toDouble();
+ return jsToNumber(value(exec));
}
UString JSString::toString(ExecState* exec) const
@@ -240,7 +241,7 @@ bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& pr
}
bool isStrictUInt32;
- unsigned i = propertyName.toStrictUInt32(&isStrictUInt32);
+ unsigned i = propertyName.toUInt32(isStrictUInt32);
if (isStrictUInt32 && i < m_length) {
descriptor.setDescriptor(getIndex(exec, i), DontDelete | ReadOnly);
return true;
diff --git a/JavaScriptCore/runtime/JSString.h b/JavaScriptCore/runtime/JSString.h
index 53c144b..12ced10 100644
--- a/JavaScriptCore/runtime/JSString.h
+++ b/JavaScriptCore/runtime/JSString.h
@@ -87,7 +87,7 @@ namespace JSC {
void append(const UString& string)
{
ASSERT(m_rope);
- m_rope->initializeFiber(m_index, string.rep());
+ m_rope->initializeFiber(m_index, string.impl());
}
void append(JSString* jsString)
{
@@ -132,12 +132,12 @@ namespace JSC {
return *this;
}
- UStringImpl* operator*()
+ StringImpl* operator*()
{
WorkItem& item = m_workQueue.last();
RopeImpl::Fiber fiber = item.fibers[item.i];
ASSERT(!RopeImpl::isRope(fiber));
- return static_cast<UStringImpl*>(fiber);
+ return static_cast<StringImpl*>(fiber);
}
bool operator!=(const RopeIterator& other) const
@@ -186,24 +186,24 @@ namespace JSC {
ALWAYS_INLINE JSString(JSGlobalData* globalData, const UString& value)
: JSCell(globalData->stringStructure.get())
- , m_length(value.size())
+ , m_length(value.length())
, m_value(value)
, m_fiberCount(0)
{
ASSERT(!m_value.isNull());
- Heap::heap(this)->reportExtraMemoryCost(value.cost());
+ Heap::heap(this)->reportExtraMemoryCost(value.impl()->cost());
}
enum HasOtherOwnerType { HasOtherOwner };
JSString(JSGlobalData* globalData, const UString& value, HasOtherOwnerType)
: JSCell(globalData->stringStructure.get())
- , m_length(value.size())
+ , m_length(value.length())
, m_value(value)
, m_fiberCount(0)
{
ASSERT(!m_value.isNull());
}
- JSString(JSGlobalData* globalData, PassRefPtr<UStringImpl> value, HasOtherOwnerType)
+ JSString(JSGlobalData* globalData, PassRefPtr<StringImpl> value, HasOtherOwnerType)
: JSCell(globalData->stringStructure.get())
, m_length(value->length())
, m_value(value)
@@ -235,7 +235,7 @@ namespace JSC {
// This should only be called with fiberCount <= 3.
JSString(JSGlobalData* globalData, unsigned fiberCount, JSString* s1, const UString& u2)
: JSCell(globalData->stringStructure.get())
- , m_length(s1->length() + u2.size())
+ , m_length(s1->length() + u2.length())
, m_fiberCount(fiberCount)
{
ASSERT(fiberCount <= s_maxInternalRopeLength);
@@ -248,7 +248,7 @@ namespace JSC {
// This should only be called with fiberCount <= 3.
JSString(JSGlobalData* globalData, unsigned fiberCount, const UString& u1, JSString* s2)
: JSCell(globalData->stringStructure.get())
- , m_length(u1.size() + s2->length())
+ , m_length(u1.length() + s2->length())
, m_fiberCount(fiberCount)
{
ASSERT(fiberCount <= s_maxInternalRopeLength);
@@ -276,7 +276,7 @@ namespace JSC {
// This constructor constructs a new string by concatenating u1 & u2.
JSString(JSGlobalData* globalData, const UString& u1, const UString& u2)
: JSCell(globalData->stringStructure.get())
- , m_length(u1.size() + u2.size())
+ , m_length(u1.length() + u2.length())
, m_fiberCount(2)
{
unsigned index = 0;
@@ -288,7 +288,7 @@ namespace JSC {
// This constructor constructs a new string by concatenating u1, u2 & u3.
JSString(JSGlobalData* globalData, const UString& u1, const UString& u2, const UString& u3)
: JSCell(globalData->stringStructure.get())
- , m_length(u1.size() + u2.size() + u3.size())
+ , m_length(u1.length() + u2.length() + u3.length())
, m_fiberCount(s_maxInternalRopeLength)
{
unsigned index = 0;
@@ -300,7 +300,7 @@ namespace JSC {
JSString(JSGlobalData* globalData, const UString& value, JSStringFinalizerCallback finalizer, void* context)
: JSCell(globalData->stringStructure.get())
- , m_length(value.size())
+ , m_length(value.length())
, m_value(value)
, m_fiberCount(0)
{
@@ -308,7 +308,7 @@ namespace JSC {
// nasty hack because we can't union non-POD types
m_other.m_finalizerCallback = finalizer;
m_other.m_finalizerContext = context;
- Heap::heap(this)->reportExtraMemoryCost(value.cost());
+ Heap::heap(this)->reportExtraMemoryCost(value.impl()->cost());
}
~JSString()
@@ -359,7 +359,7 @@ namespace JSC {
void appendStringInConstruct(unsigned& index, const UString& string)
{
- UStringImpl* impl = string.rep();
+ StringImpl* impl = string.impl();
impl->ref();
m_other.m_fibers[index++] = impl;
}
@@ -381,15 +381,15 @@ namespace JSC {
if (v.isString()) {
ASSERT(asCell(v)->isString());
JSString* s = static_cast<JSString*>(asCell(v));
- ASSERT(s->size() == 1);
+ ASSERT(s->fiberCount() == 1);
appendStringInConstruct(index, s);
m_length += s->length();
} else {
UString u(v.toString(exec));
- UStringImpl* impl = u.rep();
+ StringImpl* impl = u.impl();
impl->ref();
m_other.m_fibers[index++] = impl;
- m_length += u.size();
+ m_length += u.length();
}
}
@@ -427,7 +427,7 @@ namespace JSC {
bool isRope() const { return m_fiberCount; }
UString& string() { ASSERT(!isRope()); return m_value; }
- unsigned size() { return m_fiberCount ? m_fiberCount : 1; }
+ unsigned fiberCount() { return m_fiberCount ? m_fiberCount : 1; }
friend JSValue jsString(ExecState* exec, JSString* s1, JSString* s2);
friend JSValue jsString(ExecState* exec, const UString& u1, JSString* s2);
@@ -470,11 +470,11 @@ namespace JSC {
inline JSString* jsSingleCharacterSubstring(ExecState* exec, const UString& s, unsigned offset)
{
JSGlobalData* globalData = &exec->globalData();
- ASSERT(offset < static_cast<unsigned>(s.size()));
- UChar c = s.data()[offset];
+ ASSERT(offset < static_cast<unsigned>(s.length()));
+ UChar c = s.characters()[offset];
if (c <= 0xFF)
return globalData->smallStrings.singleCharacterString(globalData, c);
- return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(UStringImpl::create(s.rep(), offset, 1))));
+ return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(StringImpl::create(s.impl(), offset, 1))));
}
inline JSString* jsNontrivialString(JSGlobalData* globalData, const char* s)
@@ -487,7 +487,7 @@ namespace JSC {
inline JSString* jsNontrivialString(JSGlobalData* globalData, const UString& s)
{
- ASSERT(s.size() > 1);
+ ASSERT(s.length() > 1);
return fixupVPtr(globalData, new (globalData) JSString(globalData, s));
}
@@ -496,17 +496,17 @@ namespace JSC {
ASSERT(canGetIndex(i));
if (isRope())
return getIndexSlowCase(exec, i);
- ASSERT(i < m_value.size());
+ ASSERT(i < m_value.length());
return jsSingleCharacterSubstring(exec, m_value, i);
}
inline JSString* jsString(JSGlobalData* globalData, const UString& s)
{
- int size = s.size();
+ int size = s.length();
if (!size)
return globalData->smallStrings.emptyString(globalData);
if (size == 1) {
- UChar c = s.data()[0];
+ UChar c = s.characters()[0];
if (c <= 0xFF)
return globalData->smallStrings.singleCharacterString(globalData, c);
}
@@ -515,33 +515,33 @@ namespace JSC {
inline JSString* jsStringWithFinalizer(ExecState* exec, const UString& s, JSStringFinalizerCallback callback, void* context)
{
- ASSERT(s.size() && (s.size() > 1 || s.data()[0] > 0xFF));
+ ASSERT(s.length() && (s.length() > 1 || s.characters()[0] > 0xFF));
JSGlobalData* globalData = &exec->globalData();
return fixupVPtr(globalData, new (globalData) JSString(globalData, s, callback, context));
}
inline JSString* jsSubstring(JSGlobalData* globalData, const UString& s, unsigned offset, unsigned length)
{
- ASSERT(offset <= static_cast<unsigned>(s.size()));
- ASSERT(length <= static_cast<unsigned>(s.size()));
- ASSERT(offset + length <= static_cast<unsigned>(s.size()));
+ ASSERT(offset <= static_cast<unsigned>(s.length()));
+ ASSERT(length <= static_cast<unsigned>(s.length()));
+ ASSERT(offset + length <= static_cast<unsigned>(s.length()));
if (!length)
return globalData->smallStrings.emptyString(globalData);
if (length == 1) {
- UChar c = s.data()[offset];
+ UChar c = s.characters()[offset];
if (c <= 0xFF)
return globalData->smallStrings.singleCharacterString(globalData, c);
}
- return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(UStringImpl::create(s.rep(), offset, length)), JSString::HasOtherOwner));
+ return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(StringImpl::create(s.impl(), offset, length)), JSString::HasOtherOwner));
}
inline JSString* jsOwnedString(JSGlobalData* globalData, const UString& s)
{
- int size = s.size();
+ int size = s.length();
if (!size)
return globalData->smallStrings.emptyString(globalData);
if (size == 1) {
- UChar c = s.data()[0];
+ UChar c = s.characters()[0];
if (c <= 0xFF)
return globalData->smallStrings.singleCharacterString(globalData, c);
}
@@ -564,7 +564,7 @@ namespace JSC {
}
bool isStrictUInt32;
- unsigned i = propertyName.toStrictUInt32(&isStrictUInt32);
+ unsigned i = propertyName.toUInt32(isStrictUInt32);
if (isStrictUInt32 && i < m_length) {
slot.setValue(getIndex(exec, i));
return true;
diff --git a/JavaScriptCore/runtime/JSStringBuilder.h b/JavaScriptCore/runtime/JSStringBuilder.h
index 8f208a1..25fe685 100644
--- a/JavaScriptCore/runtime/JSStringBuilder.h
+++ b/JavaScriptCore/runtime/JSStringBuilder.h
@@ -28,6 +28,7 @@
#include "ExceptionHelpers.h"
#include "JSString.h"
+#include "StringConcatenate.h"
#include "Vector.h"
namespace JSC {
@@ -65,7 +66,7 @@ public:
void append(const UString& str)
{
- m_okay &= buffer.tryAppend(str.data(), str.size());
+ m_okay &= buffer.tryAppend(str.characters(), str.length());
}
JSValue build(ExecState* exec)
@@ -86,7 +87,7 @@ protected:
template<typename StringType1, typename StringType2>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2)
{
- PassRefPtr<UStringImpl> result = tryMakeString(string1, string2);
+ PassRefPtr<StringImpl> result = tryMakeString(string1, string2);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
@@ -95,7 +96,7 @@ inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, Stri
template<typename StringType1, typename StringType2, typename StringType3>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3)
{
- PassRefPtr<UStringImpl> result = tryMakeString(string1, string2, string3);
+ PassRefPtr<StringImpl> result = tryMakeString(string1, string2, string3);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
@@ -104,7 +105,7 @@ inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, Stri
template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
{
- PassRefPtr<UStringImpl> result = tryMakeString(string1, string2, string3, string4);
+ PassRefPtr<StringImpl> result = tryMakeString(string1, string2, string3, string4);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
@@ -113,7 +114,7 @@ inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, Stri
template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
{
- PassRefPtr<UStringImpl> result = tryMakeString(string1, string2, string3, string4, string5);
+ PassRefPtr<StringImpl> result = tryMakeString(string1, string2, string3, string4, string5);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
@@ -122,7 +123,7 @@ inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, Stri
template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
inline JSValue jsMakeNontrivialString(ExecState* exec, StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
{
- PassRefPtr<UStringImpl> result = tryMakeString(string1, string2, string3, string4, string5, string6);
+ PassRefPtr<StringImpl> result = tryMakeString(string1, string2, string3, string4, string5, string6);
if (!result)
return throwOutOfMemoryError(exec);
return jsNontrivialString(exec, result);
diff --git a/JavaScriptCore/runtime/JSVariableObject.cpp b/JavaScriptCore/runtime/JSVariableObject.cpp
index 7365001..81d05ba 100644
--- a/JavaScriptCore/runtime/JSVariableObject.cpp
+++ b/JavaScriptCore/runtime/JSVariableObject.cpp
@@ -36,7 +36,7 @@ namespace JSC {
bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
- if (symbolTable().contains(propertyName.ustring().rep()))
+ if (symbolTable().contains(propertyName.impl()))
return false;
return JSObject::deleteProperty(exec, propertyName);
@@ -60,7 +60,7 @@ bool JSVariableObject::isVariableObject() const
bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertyDescriptor& descriptor)
{
- SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep());
+ SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl());
if (!entry.isNull()) {
descriptor.setDescriptor(registerAt(entry.getIndex()).jsValue(), entry.getAttributes() | DontDelete);
return true;
diff --git a/JavaScriptCore/runtime/JSVariableObject.h b/JavaScriptCore/runtime/JSVariableObject.h
index f2efcdf..3f2e218 100644
--- a/JavaScriptCore/runtime/JSVariableObject.h
+++ b/JavaScriptCore/runtime/JSVariableObject.h
@@ -103,7 +103,7 @@ namespace JSC {
inline bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertySlot& slot)
{
- SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep());
+ SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl());
if (!entry.isNull()) {
slot.setRegisterSlot(&registerAt(entry.getIndex()));
return true;
@@ -113,7 +113,7 @@ namespace JSC {
inline bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertySlot& slot, bool& slotIsWriteable)
{
- SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep());
+ SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl());
if (!entry.isNull()) {
slot.setRegisterSlot(&registerAt(entry.getIndex()));
slotIsWriteable = !entry.isReadOnly();
@@ -126,7 +126,7 @@ namespace JSC {
{
ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
- SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep());
+ SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl());
if (entry.isNull())
return false;
if (entry.isReadOnly())
@@ -139,7 +139,7 @@ namespace JSC {
{
ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
- SymbolTable::iterator iter = symbolTable().find(propertyName.ustring().rep());
+ SymbolTable::iterator iter = symbolTable().find(propertyName.impl());
if (iter == symbolTable().end())
return false;
SymbolTableEntry& entry = iter->second;
diff --git a/JavaScriptCore/runtime/LiteralParser.h b/JavaScriptCore/runtime/LiteralParser.h
index 0f8072b..6df5d06 100644
--- a/JavaScriptCore/runtime/LiteralParser.h
+++ b/JavaScriptCore/runtime/LiteralParser.h
@@ -72,8 +72,8 @@ namespace JSC {
Lexer(const UString& s, ParserMode mode)
: m_string(s)
, m_mode(mode)
- , m_ptr(s.data())
- , m_end(s.data() + s.size())
+ , m_ptr(s.characters())
+ , m_end(s.characters() + s.length())
{
}
diff --git a/JavaScriptCore/runtime/Lookup.cpp b/JavaScriptCore/runtime/Lookup.cpp
index 50d096c..07416af 100644
--- a/JavaScriptCore/runtime/Lookup.cpp
+++ b/JavaScriptCore/runtime/Lookup.cpp
@@ -34,7 +34,7 @@ void HashTable::createTable(JSGlobalData* globalData) const
for (int i = 0; i < compactSize; ++i)
entries[i].setKey(0);
for (int i = 0; values[i].key; ++i) {
- UString::Rep* identifier = Identifier::add(globalData, values[i].key).releaseRef();
+ StringImpl* identifier = Identifier::add(globalData, values[i].key).releaseRef();
int hashIndex = identifier->existingHash() & compactHashSizeMask;
HashEntry* entry = &entries[hashIndex];
@@ -61,7 +61,7 @@ void HashTable::deleteTable() const
if (table) {
int max = compactSize;
for (int i = 0; i != max; ++i) {
- if (UString::Rep* key = table[i].key())
+ if (StringImpl* key = table[i].key())
key->deref();
}
delete [] table;
diff --git a/JavaScriptCore/runtime/Lookup.h b/JavaScriptCore/runtime/Lookup.h
index 5a96fd3..9bc81d4 100644
--- a/JavaScriptCore/runtime/Lookup.h
+++ b/JavaScriptCore/runtime/Lookup.h
@@ -55,7 +55,7 @@ namespace JSC {
class HashEntry : public FastAllocBase {
public:
- void initialize(UString::Rep* key, unsigned char attributes, intptr_t v1, intptr_t v2
+ void initialize(StringImpl* key, unsigned char attributes, intptr_t v1, intptr_t v2
#if ENABLE(JIT)
, ThunkGenerator generator = 0
#endif
@@ -71,8 +71,8 @@ namespace JSC {
m_next = 0;
}
- void setKey(UString::Rep* key) { m_key = key; }
- UString::Rep* key() const { return m_key; }
+ void setKey(StringImpl* key) { m_key = key; }
+ StringImpl* key() const { return m_key; }
unsigned char attributes() const { return m_attributes; }
@@ -91,7 +91,7 @@ namespace JSC {
HashEntry* next() const { return m_next; }
private:
- UString::Rep* m_key;
+ StringImpl* m_key;
unsigned char m_attributes; // JSObject attributes
union {
@@ -159,13 +159,13 @@ namespace JSC {
{
ASSERT(table);
- const HashEntry* entry = &table[identifier.ustring().rep()->existingHash() & compactHashSizeMask];
+ const HashEntry* entry = &table[identifier.impl()->existingHash() & compactHashSizeMask];
if (!entry->key())
return 0;
do {
- if (entry->key() == identifier.ustring().rep())
+ if (entry->key() == identifier.impl())
return entry;
entry = entry->next();
} while (entry);
diff --git a/JavaScriptCore/runtime/NumberPrototype.cpp b/JavaScriptCore/runtime/NumberPrototype.cpp
index e338d7c..80b7ce0 100644
--- a/JavaScriptCore/runtime/NumberPrototype.cpp
+++ b/JavaScriptCore/runtime/NumberPrototype.cpp
@@ -179,7 +179,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToString(ExecState* exec)
const char* lastCharInString = s + sizeof(s) - 1;
double x = v.uncheckedGetNumber();
if (isnan(x) || isinf(x))
- return JSValue::encode(jsString(exec, UString::from(x)));
+ return JSValue::encode(jsString(exec, UString::number(x)));
bool isNegative = x < 0.0;
if (isNegative)
@@ -271,7 +271,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToFixed(ExecState* exec)
}
if (x >= pow(10.0, 21.0))
- return JSValue::encode(jsString(exec, makeString(s, UString::from(x))));
+ return JSValue::encode(jsString(exec, makeString(s, UString::number(x))));
const double tenToTheF = pow(10.0, f);
double n = floor(x * tenToTheF);
@@ -280,7 +280,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToFixed(ExecState* exec)
UString m = integerPartNoExp(n);
- int k = m.size();
+ int k = m.length();
if (k <= f) {
StringBuilder z;
for (int i = 0; i < f + 1 - k; i++)
@@ -288,13 +288,13 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToFixed(ExecState* exec)
z.append(m);
m = z.build();
k = f + 1;
- ASSERT(k == static_cast<int>(m.size()));
+ ASSERT(k == static_cast<int>(m.length()));
}
int kMinusf = k - f;
- if (kMinusf < static_cast<int>(m.size()))
- return JSValue::encode(jsString(exec, makeString(s, m.substr(0, kMinusf), ".", m.substr(kMinusf))));
- return JSValue::encode(jsString(exec, makeString(s, m.substr(0, kMinusf))));
+ if (kMinusf < static_cast<int>(m.length()))
+ return JSValue::encode(jsString(exec, makeString(s, m.substringSharingImpl(0, kMinusf), ".", m.substringSharingImpl(kMinusf))));
+ return JSValue::encode(jsString(exec, makeString(s, m.substringSharingImpl(0, kMinusf))));
}
static void fractionalPartToString(char* buf, int& i, const char* result, int resultLength, int fractionalDigits)
@@ -345,7 +345,7 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToExponential(ExecState* exec)
double x = v.uncheckedGetNumber();
if (isnan(x) || isinf(x))
- return JSValue::encode(jsString(exec, UString::from(x)));
+ return JSValue::encode(jsString(exec, UString::number(x)));
JSValue fractionalDigitsValue = exec->argument(0);
double df = fractionalDigitsValue.toInteger(exec);
@@ -455,11 +455,11 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState* exec)
m = integerPartNoExp(n);
if (e < -6 || e >= precision) {
- if (m.size() > 1)
- m = makeString(m.substr(0, 1), ".", m.substr(1));
+ if (m.length() > 1)
+ m = makeString(m.substringSharingImpl(0, 1), ".", m.substringSharingImpl(1));
if (e >= 0)
- return JSValue::encode(jsMakeNontrivialString(exec, s, m, "e+", UString::from(e)));
- return JSValue::encode(jsMakeNontrivialString(exec, s, m, "e-", UString::from(-e)));
+ return JSValue::encode(jsMakeNontrivialString(exec, s, m, "e+", UString::number(e)));
+ return JSValue::encode(jsMakeNontrivialString(exec, s, m, "e-", UString::number(-e)));
}
} else {
m = charSequence('0', precision);
@@ -469,8 +469,8 @@ EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState* exec)
if (e == precision - 1)
return JSValue::encode(jsString(exec, makeString(s, m)));
if (e >= 0) {
- if (e + 1 < static_cast<int>(m.size()))
- return JSValue::encode(jsString(exec, makeString(s, m.substr(0, e + 1), ".", m.substr(e + 1))));
+ if (e + 1 < static_cast<int>(m.length()))
+ return JSValue::encode(jsString(exec, makeString(s, m.substringSharingImpl(0, e + 1), ".", m.substringSharingImpl(e + 1))));
return JSValue::encode(jsString(exec, makeString(s, m)));
}
return JSValue::encode(jsMakeNontrivialString(exec, s, "0.", charSequence('0', -(e + 1)), m));
diff --git a/JavaScriptCore/runtime/NumericStrings.h b/JavaScriptCore/runtime/NumericStrings.h
index 47fbbb2..d65f142 100644
--- a/JavaScriptCore/runtime/NumericStrings.h
+++ b/JavaScriptCore/runtime/NumericStrings.h
@@ -40,7 +40,7 @@ namespace JSC {
if (d == entry.key && !entry.value.isNull())
return entry.value;
entry.key = d;
- entry.value = UString::from(d);
+ entry.value = UString::number(d);
return entry.value;
}
@@ -52,7 +52,7 @@ namespace JSC {
if (i == entry.key && !entry.value.isNull())
return entry.value;
entry.key = i;
- entry.value = UString::from(i);
+ entry.value = UString::number(i);
return entry.value;
}
@@ -64,7 +64,7 @@ namespace JSC {
if (i == entry.key && !entry.value.isNull())
return entry.value;
entry.key = i;
- entry.value = UString::from(i);
+ entry.value = UString::number(i);
return entry.value;
}
private:
@@ -83,7 +83,7 @@ namespace JSC {
{
ASSERT(i < cacheSize);
if (smallIntCache[i].isNull())
- smallIntCache[i] = UString::from(i);
+ smallIntCache[i] = UString::number(i);
return smallIntCache[i];
}
diff --git a/JavaScriptCore/runtime/ObjectPrototype.cpp b/JavaScriptCore/runtime/ObjectPrototype.cpp
index 6197f75..57a8a31 100644
--- a/JavaScriptCore/runtime/ObjectPrototype.cpp
+++ b/JavaScriptCore/runtime/ObjectPrototype.cpp
@@ -65,7 +65,7 @@ void ObjectPrototype::put(ExecState* exec, const Identifier& propertyName, JSVal
if (m_hasNoPropertiesWithUInt32Names) {
bool isUInt32;
- propertyName.toStrictUInt32(&isUInt32);
+ propertyName.toUInt32(isUInt32);
m_hasNoPropertiesWithUInt32Names = !isUInt32;
}
}
diff --git a/JavaScriptCore/runtime/Operations.h b/JavaScriptCore/runtime/Operations.h
index bd6c205..eed1f16 100644
--- a/JavaScriptCore/runtime/Operations.h
+++ b/JavaScriptCore/runtime/Operations.h
@@ -46,7 +46,7 @@ namespace JSC {
if ((length1 + length2) < length1)
return throwOutOfMemoryError(exec);
- unsigned fiberCount = s1->size() + s2->size();
+ unsigned fiberCount = s1->fiberCount() + s2->fiberCount();
JSGlobalData* globalData = &exec->globalData();
if (fiberCount <= JSString::s_maxInternalRopeLength)
@@ -62,7 +62,7 @@ namespace JSC {
ALWAYS_INLINE JSValue jsString(ExecState* exec, const UString& u1, JSString* s2)
{
- unsigned length1 = u1.size();
+ unsigned length1 = u1.length();
if (!length1)
return s2;
unsigned length2 = s2->length();
@@ -71,7 +71,7 @@ namespace JSC {
if ((length1 + length2) < length1)
return throwOutOfMemoryError(exec);
- unsigned fiberCount = 1 + s2->size();
+ unsigned fiberCount = 1 + s2->fiberCount();
JSGlobalData* globalData = &exec->globalData();
if (fiberCount <= JSString::s_maxInternalRopeLength)
@@ -90,13 +90,13 @@ namespace JSC {
unsigned length1 = s1->length();
if (!length1)
return jsString(exec, u2);
- unsigned length2 = u2.size();
+ unsigned length2 = u2.length();
if (!length2)
return s1;
if ((length1 + length2) < length1)
return throwOutOfMemoryError(exec);
- unsigned fiberCount = s1->size() + 1;
+ unsigned fiberCount = s1->fiberCount() + 1;
JSGlobalData* globalData = &exec->globalData();
if (fiberCount <= JSString::s_maxInternalRopeLength)
@@ -112,10 +112,10 @@ namespace JSC {
ALWAYS_INLINE JSValue jsString(ExecState* exec, const UString& u1, const UString& u2)
{
- unsigned length1 = u1.size();
+ unsigned length1 = u1.length();
if (!length1)
return jsString(exec, u2);
- unsigned length2 = u2.size();
+ unsigned length2 = u2.length();
if (!length2)
return jsString(exec, u1);
if ((length1 + length2) < length1)
@@ -127,9 +127,9 @@ namespace JSC {
ALWAYS_INLINE JSValue jsString(ExecState* exec, const UString& u1, const UString& u2, const UString& u3)
{
- unsigned length1 = u1.size();
- unsigned length2 = u2.size();
- unsigned length3 = u3.size();
+ unsigned length1 = u1.length();
+ unsigned length2 = u2.length();
+ unsigned length3 = u3.length();
if (!length1)
return jsString(exec, u2, u3);
if (!length2)
@@ -154,7 +154,7 @@ namespace JSC {
for (unsigned i = 0; i < count; ++i) {
JSValue v = strings[i].jsValue();
if (LIKELY(v.isString()))
- fiberCount += asString(v)->size();
+ fiberCount += asString(v)->fiberCount();
else
++fiberCount;
}
@@ -193,13 +193,13 @@ namespace JSC {
{
unsigned fiberCount = 0;
if (LIKELY(thisValue.isString()))
- fiberCount += asString(thisValue)->size();
+ fiberCount += asString(thisValue)->fiberCount();
else
++fiberCount;
for (unsigned i = 0; i < exec->argumentCount(); ++i) {
JSValue v = exec->argument(i);
if (LIKELY(v.isString()))
- fiberCount += asString(v)->size();
+ fiberCount += asString(v)->fiberCount();
else
++fiberCount;
}
diff --git a/JavaScriptCore/runtime/PropertyMapHashTable.h b/JavaScriptCore/runtime/PropertyMapHashTable.h
index 44dc2b8..bd452b6 100644
--- a/JavaScriptCore/runtime/PropertyMapHashTable.h
+++ b/JavaScriptCore/runtime/PropertyMapHashTable.h
@@ -27,13 +27,13 @@
namespace JSC {
struct PropertyMapEntry {
- UString::Rep* key;
+ StringImpl* key;
unsigned offset;
unsigned attributes;
JSCell* specificValue;
unsigned index;
- PropertyMapEntry(UString::Rep* key, unsigned attributes, JSCell* specificValue)
+ PropertyMapEntry(StringImpl* key, unsigned attributes, JSCell* specificValue)
: key(key)
, offset(0)
, attributes(attributes)
@@ -42,7 +42,7 @@ namespace JSC {
{
}
- PropertyMapEntry(UString::Rep* key, unsigned offset, unsigned attributes, JSCell* specificValue, unsigned index)
+ PropertyMapEntry(StringImpl* key, unsigned offset, unsigned attributes, JSCell* specificValue, unsigned index)
: key(key)
, offset(offset)
, attributes(attributes)
diff --git a/JavaScriptCore/runtime/PropertyNameArray.cpp b/JavaScriptCore/runtime/PropertyNameArray.cpp
index 6b24669..afb41be 100644
--- a/JavaScriptCore/runtime/PropertyNameArray.cpp
+++ b/JavaScriptCore/runtime/PropertyNameArray.cpp
@@ -28,20 +28,20 @@ namespace JSC {
static const size_t setThreshold = 20;
-void PropertyNameArray::add(UString::Rep* identifier)
+void PropertyNameArray::add(StringImpl* identifier)
{
- ASSERT(identifier == UString::null().rep() || identifier == UString::Rep::empty() || identifier->isIdentifier());
+ ASSERT(!identifier || identifier == StringImpl::empty() || identifier->isIdentifier());
size_t size = m_data->propertyNameVector().size();
if (size < setThreshold) {
for (size_t i = 0; i < size; ++i) {
- if (identifier == m_data->propertyNameVector()[i].ustring().rep())
+ if (identifier == m_data->propertyNameVector()[i].impl())
return;
}
} else {
if (m_set.isEmpty()) {
for (size_t i = 0; i < size; ++i)
- m_set.add(m_data->propertyNameVector()[i].ustring().rep());
+ m_set.add(m_data->propertyNameVector()[i].impl());
}
if (!m_set.add(identifier).second)
return;
diff --git a/JavaScriptCore/runtime/PropertyNameArray.h b/JavaScriptCore/runtime/PropertyNameArray.h
index 3dbcc9d..0da930f 100644
--- a/JavaScriptCore/runtime/PropertyNameArray.h
+++ b/JavaScriptCore/runtime/PropertyNameArray.h
@@ -68,9 +68,9 @@ namespace JSC {
JSGlobalData* globalData() { return m_globalData; }
- void add(const Identifier& identifier) { add(identifier.ustring().rep()); }
- void add(UString::Rep*);
- void addKnownUnique(UString::Rep* identifier) { m_data->propertyNameVector().append(Identifier(m_globalData, identifier)); }
+ void add(const Identifier& identifier) { add(identifier.impl()); }
+ void add(StringImpl*);
+ void addKnownUnique(StringImpl* identifier) { m_data->propertyNameVector().append(Identifier(m_globalData, identifier)); }
Identifier& operator[](unsigned i) { return m_data->propertyNameVector()[i]; }
const Identifier& operator[](unsigned i) const { return m_data->propertyNameVector()[i]; }
@@ -86,7 +86,7 @@ namespace JSC {
const_iterator end() const { return m_data->propertyNameVector().end(); }
private:
- typedef HashSet<UString::Rep*, PtrHash<UString::Rep*> > IdentifierSet;
+ typedef HashSet<StringImpl*, PtrHash<StringImpl*> > IdentifierSet;
RefPtr<PropertyNameArrayData> m_data;
IdentifierSet m_set;
diff --git a/JavaScriptCore/runtime/RegExp.cpp b/JavaScriptCore/runtime/RegExp.cpp
index 59e3f35..2b844c1 100644
--- a/JavaScriptCore/runtime/RegExp.cpp
+++ b/JavaScriptCore/runtime/RegExp.cpp
@@ -56,11 +56,11 @@ inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const US
// NOTE: The global flag is handled on a case-by-case basis by functions like
// String::match and RegExpObject::match.
if (!flags.isNull()) {
- if (flags.find('g') != UString::NotFound)
+ if (flags.find('g') != notFound)
m_flagBits |= Global;
- if (flags.find('i') != UString::NotFound)
+ if (flags.find('i') != notFound)
m_flagBits |= IgnoreCase;
- if (flags.find('m') != UString::NotFound)
+ if (flags.find('m') != notFound)
m_flagBits |= Multiline;
}
compile(globalData);
@@ -96,7 +96,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
if (ovector)
ovector->resize(0);
- if (static_cast<unsigned>(startOffset) > s.size() || s.isNull()) {
+ if (static_cast<unsigned>(startOffset) > s.length() || s.isNull()) {
m_lastMatchString = UString();
m_lastMatchStart = -1;
m_lastOVector.shrink(0);
@@ -105,7 +105,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
// Perform check to see if this match call is the same as the last match invocation
// and if it is return the prior result.
- if ((startOffset == m_lastMatchStart) && (s.rep() == m_lastMatchString.rep())) {
+ if ((startOffset == m_lastMatchStart) && (s.impl() == m_lastMatchString.impl())) {
if (ovector)
*ovector = m_lastOVector;
@@ -136,9 +136,9 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
offsetVector[j] = -1;
#if ENABLE(YARR_JIT)
- int result = Yarr::executeRegex(m_regExpJITCode, s.data(), startOffset, s.size(), offsetVector, offsetVectorSize);
+ int result = Yarr::executeRegex(m_regExpJITCode, s.characters(), startOffset, s.length(), offsetVector, offsetVectorSize);
#else
- int result = Yarr::interpretRegex(m_regExpBytecode.get(), s.data(), startOffset, s.size(), offsetVector);
+ int result = Yarr::interpretRegex(m_regExpBytecode.get(), s.characters(), startOffset, s.length(), offsetVector);
#endif
if (result < 0) {
@@ -176,7 +176,7 @@ void RegExp::compile(JSGlobalData*)
m_regExp = 0;
JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
JSRegExpMultilineOption multilineOption = multiline() ? JSRegExpMultiline : JSRegExpSingleLine;
- m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(m_pattern.data()), m_pattern.size(), ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
+ m_regExp = jsRegExpCompile(reinterpret_cast<const UChar*>(m_pattern.characters()), m_pattern.length(), ignoreCaseOption, multilineOption, &m_numSubpatterns, &m_constructionError);
}
int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
@@ -186,7 +186,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
if (ovector)
ovector->clear();
- if (static_cast<unsigned>(startOffset) > s.size() || s.isNull())
+ if (static_cast<unsigned>(startOffset) > s.length() || s.isNull())
return -1;
if (m_regExp) {
@@ -204,7 +204,7 @@ int RegExp::match(const UString& s, int startOffset, Vector<int, 32>* ovector)
offsetVector = ovector->data();
}
- int numMatches = jsRegExpExecute(m_regExp, reinterpret_cast<const UChar*>(s.data()), s.size(), startOffset, offsetVector, offsetVectorSize);
+ int numMatches = jsRegExpExecute(m_regExp, reinterpret_cast<const UChar*>(s.characters()), s.length(), startOffset, offsetVector, offsetVectorSize);
if (numMatches < 0) {
#ifndef NDEBUG
diff --git a/JavaScriptCore/runtime/RegExpCache.cpp b/JavaScriptCore/runtime/RegExpCache.cpp
index b9d250d..d101758 100644
--- a/JavaScriptCore/runtime/RegExpCache.cpp
+++ b/JavaScriptCore/runtime/RegExpCache.cpp
@@ -33,7 +33,7 @@ namespace JSC {
PassRefPtr<RegExp> RegExpCache::lookupOrCreate(const UString& patternString, const UString& flags)
{
- if (patternString.size() < maxCacheablePatternLength) {
+ if (patternString.length() < maxCacheablePatternLength) {
pair<RegExpCacheMap::iterator, bool> result = m_cacheMap.add(RegExpKey(flags, patternString), 0);
if (!result.second)
return result.first->second;
@@ -47,7 +47,7 @@ PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UStri
{
RefPtr<RegExp> regExp = RegExp::create(m_globalData, patternString, flags);
- if (patternString.size() >= maxCacheablePatternLength)
+ if (patternString.length() >= maxCacheablePatternLength)
return regExp;
RegExpKey key = RegExpKey(flags, patternString);
@@ -63,7 +63,7 @@ PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UStri
m_cacheMap.remove(RegExpKey(patternKeyArray[m_nextKeyToEvict].flagsValue, patternKeyArray[m_nextKeyToEvict].pattern));
patternKeyArray[m_nextKeyToEvict].flagsValue = key.flagsValue;
- patternKeyArray[m_nextKeyToEvict].pattern = patternString.rep();
+ patternKeyArray[m_nextKeyToEvict].pattern = patternString.impl();
return regExp;
}
diff --git a/JavaScriptCore/runtime/RegExpCache.h b/JavaScriptCore/runtime/RegExpCache.h
index fb30a9e..e897b43 100644
--- a/JavaScriptCore/runtime/RegExpCache.h
+++ b/JavaScriptCore/runtime/RegExpCache.h
@@ -28,6 +28,8 @@
#include "RegExp.h"
#include "RegExpKey.h"
#include "UString.h"
+#include <wtf/FixedArray.h>
+#include <wtf/HashMap.h>
#ifndef RegExpCache_h
#define RegExpCache_h
diff --git a/JavaScriptCore/runtime/RegExpConstructor.cpp b/JavaScriptCore/runtime/RegExpConstructor.cpp
index aff83e7..214e528 100644
--- a/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -35,6 +35,7 @@
#include "RegExpPrototype.h"
#include "RegExp.h"
#include "RegExpCache.h"
+#include "StringConcatenate.h"
#include <wtf/PassOwnPtr.h>
namespace JSC {
@@ -185,7 +186,7 @@ JSValue RegExpConstructor::getLeftContext(ExecState* exec) const
JSValue RegExpConstructor::getRightContext(ExecState* exec) const
{
if (!d->lastOvector().isEmpty())
- return jsSubstring(exec, d->lastInput, d->lastOvector()[1], d->lastInput.size() - d->lastOvector()[1]);
+ return jsSubstring(exec, d->lastInput, d->lastOvector()[1], d->lastInput.length() - d->lastOvector()[1]);
return jsEmptyString(exec);
}
diff --git a/JavaScriptCore/runtime/RegExpKey.h b/JavaScriptCore/runtime/RegExpKey.h
index 2bbdb07..cd1368d 100644
--- a/JavaScriptCore/runtime/RegExpKey.h
+++ b/JavaScriptCore/runtime/RegExpKey.h
@@ -26,6 +26,7 @@
*/
#include "UString.h"
+#include <wtf/text/StringHash.h>
#ifndef RegExpKey_h
#define RegExpKey_h
@@ -34,7 +35,7 @@ namespace JSC {
struct RegExpKey {
int flagsValue;
- RefPtr<UString::Rep> pattern;
+ RefPtr<StringImpl> pattern;
RegExpKey()
: flagsValue(0)
@@ -48,18 +49,24 @@ struct RegExpKey {
RegExpKey(int flags, const UString& pattern)
: flagsValue(flags)
- , pattern(pattern.rep())
+ , pattern(pattern.impl())
{
}
- RegExpKey(int flags, const PassRefPtr<UString::Rep> pattern)
+ RegExpKey(int flags, const PassRefPtr<StringImpl> pattern)
+ : flagsValue(flags)
+ , pattern(pattern)
+ {
+ }
+
+ RegExpKey(int flags, const RefPtr<StringImpl>& pattern)
: flagsValue(flags)
, pattern(pattern)
{
}
RegExpKey(const UString& flags, const UString& pattern)
- : pattern(pattern.rep())
+ : pattern(pattern.impl())
{
flagsValue = getFlagsValue(flags);
}
@@ -67,11 +74,11 @@ struct RegExpKey {
int getFlagsValue(const UString flags)
{
flagsValue = 0;
- if (flags.find('g') != UString::NotFound)
+ if (flags.find('g') != notFound)
flagsValue += 4;
- if (flags.find('i') != UString::NotFound)
+ if (flags.find('i') != notFound)
flagsValue += 2;
- if (flags.find('m') != UString::NotFound)
+ if (flags.find('m') != notFound)
flagsValue += 1;
return flagsValue;
}
diff --git a/JavaScriptCore/runtime/RegExpObject.cpp b/JavaScriptCore/runtime/RegExpObject.cpp
index 0f2c1e1..4462879 100644
--- a/JavaScriptCore/runtime/RegExpObject.cpp
+++ b/JavaScriptCore/runtime/RegExpObject.cpp
@@ -29,6 +29,7 @@
#include "Lookup.h"
#include "RegExpConstructor.h"
#include "RegExpPrototype.h"
+#include "StringConcatenate.h"
#include <wtf/PassOwnPtr.h>
namespace JSC {
@@ -156,7 +157,7 @@ bool RegExpObject::match(ExecState* exec)
return position >= 0;
}
- if (d->lastIndex < 0 || d->lastIndex > input.size()) {
+ if (d->lastIndex < 0 || d->lastIndex > input.length()) {
d->lastIndex = 0;
return false;
}
diff --git a/JavaScriptCore/runtime/RegExpPrototype.cpp b/JavaScriptCore/runtime/RegExpPrototype.cpp
index ac215ec..d66f5d7 100644
--- a/JavaScriptCore/runtime/RegExpPrototype.cpp
+++ b/JavaScriptCore/runtime/RegExpPrototype.cpp
@@ -120,7 +120,7 @@ EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState* exec)
postfix[index] = 'm';
UString source = asRegExpObject(thisValue)->get(exec, exec->propertyNames().source).toString(exec);
// If source is empty, use "/(?:)/" to avoid colliding with comment syntax
- return JSValue::encode(jsMakeNontrivialString(exec, "/", source.size() ? source : UString("(?:)"), postfix));
+ return JSValue::encode(jsMakeNontrivialString(exec, "/", source.length() ? source : UString("(?:)"), postfix));
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/RopeImpl.cpp b/JavaScriptCore/runtime/RopeImpl.cpp
index 25b9848..09c24a9 100644
--- a/JavaScriptCore/runtime/RopeImpl.cpp
+++ b/JavaScriptCore/runtime/RopeImpl.cpp
@@ -40,7 +40,7 @@ void RopeImpl::derefFibersNonRecursive(Vector<RopeImpl*, 32>& workQueue)
else
nextRope->deref();
} else
- static_cast<UStringImpl*>(fiber)->deref();
+ static_cast<StringImpl*>(fiber)->deref();
}
}
diff --git a/JavaScriptCore/runtime/RopeImpl.h b/JavaScriptCore/runtime/RopeImpl.h
index ac2b502..dfacbf5 100644
--- a/JavaScriptCore/runtime/RopeImpl.h
+++ b/JavaScriptCore/runtime/RopeImpl.h
@@ -26,14 +26,14 @@
#ifndef RopeImpl_h
#define RopeImpl_h
-#include "UStringImpl.h"
+#include <wtf/text/StringImpl.h>
namespace JSC {
class RopeImpl : public StringImplBase {
public:
// A RopeImpl is composed from a set of smaller strings called Fibers.
- // Each Fiber in a rope is either UStringImpl or another RopeImpl.
+ // Each Fiber in a rope is either StringImpl or another RopeImpl.
typedef StringImplBase* Fiber;
// Creates a RopeImpl comprising of 'fiberCount' Fibers.
@@ -56,7 +56,7 @@ public:
if (isRope(fiber))
static_cast<RopeImpl*>(fiber)->deref();
else
- static_cast<UStringImpl*>(fiber)->deref();
+ static_cast<StringImpl*>(fiber)->deref();
}
void initializeFiber(unsigned &index, Fiber fiber)
diff --git a/JavaScriptCore/runtime/ScopeChain.cpp b/JavaScriptCore/runtime/ScopeChain.cpp
index 981794b..54c5082 100644
--- a/JavaScriptCore/runtime/ScopeChain.cpp
+++ b/JavaScriptCore/runtime/ScopeChain.cpp
@@ -43,7 +43,7 @@ void ScopeChainNode::print() const
fprintf(stderr, "----- [scope %p] -----\n", o);
for (PropertyNameArray::const_iterator propIter = propertyNames.begin(); propIter != propEnd; propIter++) {
Identifier name = *propIter;
- fprintf(stderr, "%s, ", name.ascii());
+ fprintf(stderr, "%s, ", name.ustring().utf8().data());
}
fprintf(stderr, "\n");
}
diff --git a/JavaScriptCore/runtime/SmallStrings.cpp b/JavaScriptCore/runtime/SmallStrings.cpp
index 822303c..f358727 100644
--- a/JavaScriptCore/runtime/SmallStrings.cpp
+++ b/JavaScriptCore/runtime/SmallStrings.cpp
@@ -44,19 +44,19 @@ class SmallStringsStorage : public Noncopyable {
public:
SmallStringsStorage();
- UString::Rep* rep(unsigned char character) { return m_reps[character].get(); }
+ StringImpl* rep(unsigned char character) { return m_reps[character].get(); }
private:
- RefPtr<UString::Rep> m_reps[numCharactersToStore];
+ RefPtr<StringImpl> m_reps[numCharactersToStore];
};
SmallStringsStorage::SmallStringsStorage()
{
UChar* characterBuffer = 0;
- RefPtr<UStringImpl> baseString = UStringImpl::createUninitialized(numCharactersToStore, characterBuffer);
+ RefPtr<StringImpl> baseString = StringImpl::createUninitialized(numCharactersToStore, characterBuffer);
for (unsigned i = 0; i < numCharactersToStore; ++i) {
characterBuffer[i] = i;
- m_reps[i] = UStringImpl::create(baseString, i, 1);
+ m_reps[i] = StringImpl::create(baseString, i, 1);
}
}
@@ -129,10 +129,10 @@ void SmallStrings::createSingleCharacterString(JSGlobalData* globalData, unsigne
if (!m_storage)
m_storage = adoptPtr(new SmallStringsStorage);
ASSERT(!m_singleCharacterStrings[character]);
- m_singleCharacterStrings[character] = new (globalData) JSString(globalData, m_storage->rep(character), JSString::HasOtherOwner);
+ m_singleCharacterStrings[character] = new (globalData) JSString(globalData, PassRefPtr<StringImpl>(m_storage->rep(character)), JSString::HasOtherOwner);
}
-UString::Rep* SmallStrings::singleCharacterStringRep(unsigned char character)
+StringImpl* SmallStrings::singleCharacterStringRep(unsigned char character)
{
if (!m_storage)
m_storage = adoptPtr(new SmallStringsStorage);
diff --git a/JavaScriptCore/runtime/SmallStrings.h b/JavaScriptCore/runtime/SmallStrings.h
index b550a04..d1ebfb1 100644
--- a/JavaScriptCore/runtime/SmallStrings.h
+++ b/JavaScriptCore/runtime/SmallStrings.h
@@ -55,7 +55,7 @@ namespace JSC {
return m_singleCharacterStrings[character];
}
- UString::Rep* singleCharacterStringRep(unsigned char character);
+ StringImpl* singleCharacterStringRep(unsigned char character);
void markChildren(MarkStack&);
void clear();
diff --git a/JavaScriptCore/runtime/StringBuilder.h b/JavaScriptCore/runtime/StringBuilder.h
index 59b01e0..a26b94c 100644
--- a/JavaScriptCore/runtime/StringBuilder.h
+++ b/JavaScriptCore/runtime/StringBuilder.h
@@ -56,7 +56,7 @@ public:
void append(const UString& str)
{
- buffer.append(str.data(), str.size());
+ buffer.append(str.characters(), str.length());
}
bool isEmpty() { return buffer.isEmpty(); }
diff --git a/JavaScriptCore/runtime/StringConcatenate.h b/JavaScriptCore/runtime/StringConcatenate.h
new file mode 100644
index 0000000..18a52ef
--- /dev/null
+++ b/JavaScriptCore/runtime/StringConcatenate.h
@@ -0,0 +1,428 @@
+/*
+ * 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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StringConcatenate_h
+#define StringConcatenate_h
+
+#include "UString.h"
+
+namespace JSC {
+
+template<typename StringType>
+class StringTypeAdapter {
+};
+
+template<>
+class StringTypeAdapter<char*> {
+public:
+ StringTypeAdapter<char*>(char* buffer)
+ : m_buffer((unsigned char*)buffer)
+ , m_length(strlen(buffer))
+ {
+ }
+
+ unsigned length() { return m_length; }
+
+ void writeTo(UChar* destination)
+ {
+ for (unsigned i = 0; i < m_length; ++i)
+ destination[i] = m_buffer[i];
+ }
+
+private:
+ const unsigned char* m_buffer;
+ unsigned m_length;
+};
+
+template<>
+class StringTypeAdapter<const char*> {
+public:
+ StringTypeAdapter<const char*>(const char* buffer)
+ : m_buffer((unsigned char*)buffer)
+ , m_length(strlen(buffer))
+ {
+ }
+
+ unsigned length() { return m_length; }
+
+ void writeTo(UChar* destination)
+ {
+ for (unsigned i = 0; i < m_length; ++i)
+ destination[i] = m_buffer[i];
+ }
+
+private:
+ const unsigned char* m_buffer;
+ unsigned m_length;
+};
+
+template<>
+class StringTypeAdapter<UString> {
+public:
+ StringTypeAdapter<UString>(UString& string)
+ : m_data(string.characters())
+ , m_length(string.length())
+ {
+ }
+
+ unsigned length() { return m_length; }
+
+ void writeTo(UChar* destination)
+ {
+ for (unsigned i = 0; i < m_length; ++i)
+ destination[i] = m_data[i];
+ }
+
+private:
+ const UChar* m_data;
+ unsigned m_length;
+};
+
+inline void sumWithOverflow(unsigned& total, unsigned addend, bool& overflow)
+{
+ unsigned oldTotal = total;
+ total = oldTotal + addend;
+ if (total < oldTotal)
+ overflow = true;
+}
+
+template<typename StringType1, typename StringType2>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+
+ UChar* buffer;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+ StringTypeAdapter<StringType3> adapter3(string3);
+
+ UChar* buffer = 0;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ sumWithOverflow(length, adapter3.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+ result += adapter2.length();
+ adapter3.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+ StringTypeAdapter<StringType3> adapter3(string3);
+ StringTypeAdapter<StringType4> adapter4(string4);
+
+ UChar* buffer;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ sumWithOverflow(length, adapter3.length(), overflow);
+ sumWithOverflow(length, adapter4.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+ result += adapter2.length();
+ adapter3.writeTo(result);
+ result += adapter3.length();
+ adapter4.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+ StringTypeAdapter<StringType3> adapter3(string3);
+ StringTypeAdapter<StringType4> adapter4(string4);
+ StringTypeAdapter<StringType5> adapter5(string5);
+
+ UChar* buffer;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ sumWithOverflow(length, adapter3.length(), overflow);
+ sumWithOverflow(length, adapter4.length(), overflow);
+ sumWithOverflow(length, adapter5.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+ result += adapter2.length();
+ adapter3.writeTo(result);
+ result += adapter3.length();
+ adapter4.writeTo(result);
+ result += adapter4.length();
+ adapter5.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+ StringTypeAdapter<StringType3> adapter3(string3);
+ StringTypeAdapter<StringType4> adapter4(string4);
+ StringTypeAdapter<StringType5> adapter5(string5);
+ StringTypeAdapter<StringType6> adapter6(string6);
+
+ UChar* buffer;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ sumWithOverflow(length, adapter3.length(), overflow);
+ sumWithOverflow(length, adapter4.length(), overflow);
+ sumWithOverflow(length, adapter5.length(), overflow);
+ sumWithOverflow(length, adapter6.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+ result += adapter2.length();
+ adapter3.writeTo(result);
+ result += adapter3.length();
+ adapter4.writeTo(result);
+ result += adapter4.length();
+ adapter5.writeTo(result);
+ result += adapter5.length();
+ adapter6.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+ StringTypeAdapter<StringType3> adapter3(string3);
+ StringTypeAdapter<StringType4> adapter4(string4);
+ StringTypeAdapter<StringType5> adapter5(string5);
+ StringTypeAdapter<StringType6> adapter6(string6);
+ StringTypeAdapter<StringType7> adapter7(string7);
+
+ UChar* buffer;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ sumWithOverflow(length, adapter3.length(), overflow);
+ sumWithOverflow(length, adapter4.length(), overflow);
+ sumWithOverflow(length, adapter5.length(), overflow);
+ sumWithOverflow(length, adapter6.length(), overflow);
+ sumWithOverflow(length, adapter7.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+ result += adapter2.length();
+ adapter3.writeTo(result);
+ result += adapter3.length();
+ adapter4.writeTo(result);
+ result += adapter4.length();
+ adapter5.writeTo(result);
+ result += adapter5.length();
+ adapter6.writeTo(result);
+ result += adapter6.length();
+ adapter7.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7, typename StringType8>
+PassRefPtr<StringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7, StringType8 string8)
+{
+ StringTypeAdapter<StringType1> adapter1(string1);
+ StringTypeAdapter<StringType2> adapter2(string2);
+ StringTypeAdapter<StringType3> adapter3(string3);
+ StringTypeAdapter<StringType4> adapter4(string4);
+ StringTypeAdapter<StringType5> adapter5(string5);
+ StringTypeAdapter<StringType6> adapter6(string6);
+ StringTypeAdapter<StringType7> adapter7(string7);
+ StringTypeAdapter<StringType8> adapter8(string8);
+
+ UChar* buffer;
+ bool overflow = false;
+ unsigned length = adapter1.length();
+ sumWithOverflow(length, adapter2.length(), overflow);
+ sumWithOverflow(length, adapter3.length(), overflow);
+ sumWithOverflow(length, adapter4.length(), overflow);
+ sumWithOverflow(length, adapter5.length(), overflow);
+ sumWithOverflow(length, adapter6.length(), overflow);
+ sumWithOverflow(length, adapter7.length(), overflow);
+ sumWithOverflow(length, adapter8.length(), overflow);
+ if (overflow)
+ return 0;
+ PassRefPtr<StringImpl> resultImpl = StringImpl::tryCreateUninitialized(length, buffer);
+ if (!resultImpl)
+ return 0;
+
+ UChar* result = buffer;
+ adapter1.writeTo(result);
+ result += adapter1.length();
+ adapter2.writeTo(result);
+ result += adapter2.length();
+ adapter3.writeTo(result);
+ result += adapter3.length();
+ adapter4.writeTo(result);
+ result += adapter4.length();
+ adapter5.writeTo(result);
+ result += adapter5.length();
+ adapter6.writeTo(result);
+ result += adapter6.length();
+ adapter7.writeTo(result);
+ result += adapter7.length();
+ adapter8.writeTo(result);
+
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2>
+UString makeString(StringType1 string1, StringType2 string2)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3>
+UString makeString(StringType1 string1, StringType2 string2, StringType3 string3)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2, string3);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
+UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2, string3, string4);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
+UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
+UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5, string6);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7>
+UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5, string6, string7);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7, typename StringType8>
+UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7, StringType8 string8)
+{
+ PassRefPtr<StringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5, string6, string7, string8);
+ if (!resultImpl)
+ CRASH();
+ return resultImpl;
+}
+
+} // namespace JSC
+
+#endif
diff --git a/JavaScriptCore/runtime/StringConstructor.cpp b/JavaScriptCore/runtime/StringConstructor.cpp
index f02ab09..159386d 100644
--- a/JavaScriptCore/runtime/StringConstructor.cpp
+++ b/JavaScriptCore/runtime/StringConstructor.cpp
@@ -34,7 +34,7 @@ static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec)
{
unsigned length = exec->argumentCount();
UChar* buf;
- PassRefPtr<UStringImpl> impl = UStringImpl::createUninitialized(length, buf);
+ PassRefPtr<StringImpl> impl = StringImpl::createUninitialized(length, buf);
for (unsigned i = 0; i < length; ++i)
buf[i] = static_cast<UChar>(exec->argument(i).toUInt32(exec));
return jsString(exec, impl);
diff --git a/JavaScriptCore/runtime/StringObject.cpp b/JavaScriptCore/runtime/StringObject.cpp
index f8e0e87..dc27618 100644
--- a/JavaScriptCore/runtime/StringObject.cpp
+++ b/JavaScriptCore/runtime/StringObject.cpp
@@ -80,7 +80,7 @@ bool StringObject::deleteProperty(ExecState* exec, const Identifier& propertyNam
if (propertyName == exec->propertyNames().length)
return false;
bool isStrictUInt32;
- unsigned i = propertyName.toStrictUInt32(&isStrictUInt32);
+ unsigned i = propertyName.toUInt32(isStrictUInt32);
if (isStrictUInt32 && internalValue()->canGetIndex(i))
return false;
return JSObject::deleteProperty(exec, propertyName);
@@ -90,7 +90,7 @@ void StringObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& prope
{
int size = internalValue()->length();
for (int i = 0; i < size; ++i)
- propertyNames.add(Identifier(exec, UString::from(i)));
+ propertyNames.add(Identifier(exec, UString::number(i)));
if (mode == IncludeDontEnumProperties)
propertyNames.add(exec->propertyNames().length);
return JSObject::getOwnPropertyNames(exec, propertyNames, mode);
diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp
index fb6e0f3..cfbb3be 100644
--- a/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/JavaScriptCore/runtime/StringPrototype.cpp
@@ -151,19 +151,19 @@ bool StringPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier
// ------------------------------ Functions --------------------------
-static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacement, const UString& source, const int* ovector, RegExp* reg, unsigned i)
+static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacement, const UString& source, const int* ovector, RegExp* reg, size_t i)
{
Vector<UChar> substitutedReplacement;
int offset = 0;
do {
- if (i + 1 == replacement.size())
+ if (i + 1 == replacement.length())
break;
UChar ref = replacement[i + 1];
if (ref == '$') {
// "$$" -> "$"
++i;
- substitutedReplacement.append(replacement.data() + offset, i - offset);
+ substitutedReplacement.append(replacement.characters() + offset, i - offset);
offset = i + 1;
continue;
}
@@ -179,13 +179,13 @@ static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacem
backrefLength = ovector[0];
} else if (ref == '\'') {
backrefStart = ovector[1];
- backrefLength = source.size() - backrefStart;
+ backrefLength = source.length() - backrefStart;
} else if (reg && ref >= '0' && ref <= '9') {
// 1- and 2-digit back references are allowed
unsigned backrefIndex = ref - '0';
if (backrefIndex > reg->numSubpatterns())
continue;
- if (replacement.size() > i + 2) {
+ if (replacement.length() > i + 2) {
ref = replacement[i + 2];
if (ref >= '0' && ref <= '9') {
backrefIndex = 10 * backrefIndex + ref - '0';
@@ -203,14 +203,14 @@ static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacem
continue;
if (i - offset)
- substitutedReplacement.append(replacement.data() + offset, i - offset);
+ substitutedReplacement.append(replacement.characters() + offset, i - offset);
i += 1 + advance;
offset = i + 1;
- substitutedReplacement.append(source.data() + backrefStart, backrefLength);
- } while ((i = replacement.find('$', i + 1)) != UString::NotFound);
+ substitutedReplacement.append(source.characters() + backrefStart, backrefLength);
+ } while ((i = replacement.find('$', i + 1)) != notFound);
- if (replacement.size() - offset)
- substitutedReplacement.append(replacement.data() + offset, replacement.size() - offset);
+ if (replacement.length() - offset)
+ substitutedReplacement.append(replacement.characters() + offset, replacement.length() - offset);
substitutedReplacement.shrinkToFit();
return UString::adopt(substitutedReplacement);
@@ -218,15 +218,15 @@ static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacem
static inline UString substituteBackreferences(const UString& replacement, const UString& source, const int* ovector, RegExp* reg)
{
- unsigned i = replacement.find('$', 0);
- if (UNLIKELY(i != UString::NotFound))
+ size_t i = replacement.find('$', 0);
+ if (UNLIKELY(i != notFound))
return substituteBackreferencesSlow(replacement, source, ovector, reg, i);
return replacement;
}
static inline int localeCompare(const UString& a, const UString& b)
{
- return Collator::userDefault()->collate(reinterpret_cast<const ::UChar*>(a.data()), a.size(), reinterpret_cast<const ::UChar*>(b.data()), b.size());
+ return Collator::userDefault()->collate(reinterpret_cast<const ::UChar*>(a.characters()), a.length(), reinterpret_cast<const ::UChar*>(b.characters()), b.length());
}
struct StringRange {
@@ -248,26 +248,26 @@ public:
static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount, const UString* separators, int separatorCount)
{
if (rangeCount == 1 && separatorCount == 0) {
- int sourceSize = source.size();
+ int sourceSize = source.length();
int position = substringRanges[0].position;
int length = substringRanges[0].length;
if (position <= 0 && length >= sourceSize)
return sourceVal;
// We could call UString::substr, but this would result in redundant checks
- return jsString(exec, UStringImpl::create(source.rep(), max(0, position), min(sourceSize, length)));
+ return jsString(exec, StringImpl::create(source.impl(), max(0, position), min(sourceSize, length)));
}
int totalLength = 0;
for (int i = 0; i < rangeCount; i++)
totalLength += substringRanges[i].length;
for (int i = 0; i < separatorCount; i++)
- totalLength += separators[i].size();
+ totalLength += separators[i].length();
if (totalLength == 0)
return jsString(exec, "");
UChar* buffer;
- PassRefPtr<UStringImpl> impl = UStringImpl::tryCreateUninitialized(totalLength, buffer);
+ PassRefPtr<StringImpl> impl = StringImpl::tryCreateUninitialized(totalLength, buffer);
if (!impl)
return throwOutOfMemoryError(exec);
@@ -275,12 +275,12 @@ static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, J
int bufferPos = 0;
for (int i = 0; i < maxCount; i++) {
if (i < rangeCount) {
- UStringImpl::copyChars(buffer + bufferPos, source.data() + substringRanges[i].position, substringRanges[i].length);
+ StringImpl::copyChars(buffer + bufferPos, source.characters() + substringRanges[i].position, substringRanges[i].length);
bufferPos += substringRanges[i].length;
}
if (i < separatorCount) {
- UStringImpl::copyChars(buffer + bufferPos, separators[i].data(), separators[i].size());
- bufferPos += separators[i].size();
+ StringImpl::copyChars(buffer + bufferPos, separators[i].characters(), separators[i].length());
+ bufferPos += separators[i].length();
}
}
@@ -363,7 +363,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
// special case of empty match
if (matchLen == 0) {
startPosition++;
- if (startPosition > source.size())
+ if (startPosition > source.length())
break;
}
}
@@ -407,7 +407,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
// special case of empty match
if (matchLen == 0) {
startPosition++;
- if (startPosition > source.size())
+ if (startPosition > source.length())
break;
}
} while (global);
@@ -416,8 +416,8 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
if (!lastIndex && replacements.isEmpty())
return JSValue::encode(sourceVal);
- if (static_cast<unsigned>(lastIndex) < source.size())
- sourceRanges.append(StringRange(lastIndex, source.size() - lastIndex));
+ if (static_cast<unsigned>(lastIndex) < source.length())
+ sourceRanges.append(StringRange(lastIndex, source.length() - lastIndex));
return JSValue::encode(jsSpliceSubstringsWithSeparators(exec, sourceVal, source, sourceRanges.data(), sourceRanges.size(), replacements.data(), replacements.size()));
}
@@ -425,16 +425,16 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
// Not a regular expression, so treat the pattern as a string.
UString patternString = pattern.toString(exec);
- if (patternString.size() == 1 && callType == CallTypeNone)
+ if (patternString.length() == 1 && callType == CallTypeNone)
return JSValue::encode(sourceVal->replaceCharacter(exec, patternString[0], replacementString));
const UString& source = sourceVal->value(exec);
- unsigned matchPos = source.find(patternString);
+ size_t matchPos = source.find(patternString);
- if (matchPos == UString::NotFound)
+ if (matchPos == notFound)
return JSValue::encode(sourceVal);
- int matchLen = patternString.size();
+ int matchLen = patternString.length();
if (callType != CallTypeNone) {
MarkedArgumentBuffer args;
args.append(jsSubstring(exec, source, matchPos, matchLen));
@@ -446,7 +446,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
size_t matchEnd = matchPos + matchLen;
int ovector[2] = { matchPos, matchEnd };
- return JSValue::encode(jsString(exec, source.substr(0, matchPos), substituteBackreferences(replacementString, source, ovector, 0), source.substr(matchEnd)));
+ return JSValue::encode(jsString(exec, source.substringSharingImpl(0, matchPos), substituteBackreferences(replacementString, source, ovector, 0), source.substringSharingImpl(matchEnd)));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncToString(ExecState* exec)
@@ -469,7 +469,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncCharAt(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- unsigned len = s.size();
+ unsigned len = s.length();
JSValue a0 = exec->argument(0);
if (a0.isUInt32()) {
uint32_t i = a0.asUInt32();
@@ -489,12 +489,12 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncCharCodeAt(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- unsigned len = s.size();
+ unsigned len = s.length();
JSValue a0 = exec->argument(0);
if (a0.isUInt32()) {
uint32_t i = a0.asUInt32();
if (i < len)
- return JSValue::encode(jsNumber(exec, s.data()[i]));
+ return JSValue::encode(jsNumber(exec, s.characters()[i]));
return JSValue::encode(jsNaN(exec));
}
double dpos = a0.toInteger(exec);
@@ -523,7 +523,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncIndexOf(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- int len = s.size();
+ int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -542,8 +542,8 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncIndexOf(ExecState* exec)
pos = static_cast<int>(dpos);
}
- unsigned result = s.find(u2, pos);
- if (result == UString::NotFound)
+ size_t result = s.find(u2, pos);
+ if (result == notFound)
return JSValue::encode(jsNumber(exec, -1));
return JSValue::encode(jsNumber(exec, result));
}
@@ -554,7 +554,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLastIndexOf(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- int len = s.size();
+ int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -571,8 +571,8 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLastIndexOf(ExecState* exec)
dpos = len;
#endif
- unsigned result = s.rfind(u2, static_cast<unsigned>(dpos));
- if (result == UString::NotFound)
+ 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));
}
@@ -597,7 +597,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
* If regexp is not an object whose [[Class]] property is "RegExp", it is
* replaced with the result of the expression new RegExp(regexp).
*/
- reg = exec->globalData().regExpCache()->lookupOrCreate(a0.toString(exec), UString::null());
+ reg = exec->globalData().regExpCache()->lookupOrCreate(a0.toString(exec), UString());
}
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
@@ -650,7 +650,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
* If regexp is not an object whose [[Class]] property is "RegExp", it is
* replaced with the result of the expression new RegExp(regexp).
*/
- reg = exec->globalData().regExpCache()->lookupOrCreate(a0.toString(exec), UString::null());
+ reg = exec->globalData().regExpCache()->lookupOrCreate(a0.toString(exec), UString());
}
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
@@ -665,7 +665,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSlice(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- int len = s.size();
+ int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -707,7 +707,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
return JSValue::encode(result);
}
unsigned pos = 0;
- while (i != limit && pos < s.size()) {
+ while (i != limit && pos < s.length()) {
Vector<int, 32> ovector;
int mpos = reg->match(s, pos, &ovector);
if (mpos < 0)
@@ -733,21 +733,20 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSplit(ExecState* exec)
// empty separator matches empty string -> empty array
return JSValue::encode(result);
}
- while (i != limit && p0 < s.size() - 1)
+ while (i != limit && p0 < s.length() - 1)
result->put(exec, i++, jsSingleCharacterSubstring(exec, s, p0++));
} else {
- unsigned pos;
-
- while (i != limit && (pos = s.find(u2, p0)) != UString::NotFound) {
+ size_t pos;
+ while (i != limit && (pos = s.find(u2, p0)) != notFound) {
result->put(exec, i++, jsSubstring(exec, s, p0, pos - p0));
- p0 = pos + u2.size();
+ p0 = pos + u2.length();
}
}
}
// add remaining string
if (i != limit)
- result->put(exec, i++, jsSubstring(exec, s, p0, s.size() - p0));
+ result->put(exec, i++, jsSubstring(exec, s, p0, s.length() - p0));
return JSValue::encode(result);
}
@@ -758,7 +757,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSubstr(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- int len = s.size();
+ int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -783,7 +782,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSubstring(ExecState* exec)
if (thisValue.isUndefinedOrNull()) // CheckObjectCoercible
return throwVMTypeError(exec);
UString s = thisValue.toThisString(exec);
- int len = s.size();
+ int len = s.length();
JSValue a0 = exec->argument(0);
JSValue a1 = exec->argument(1);
@@ -819,11 +818,11 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToLowerCase(ExecState* exec)
JSString* sVal = thisValue.toThisJSString(exec);
const UString& s = sVal->value(exec);
- int sSize = s.size();
+ int sSize = s.length();
if (!sSize)
return JSValue::encode(sVal);
- const UChar* sData = s.data();
+ const UChar* sData = s.characters();
Vector<UChar> buffer(sSize);
UChar ored = 0;
@@ -859,11 +858,11 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec)
JSString* sVal = thisValue.toThisJSString(exec);
const UString& s = sVal->value(exec);
- int sSize = s.size();
+ int sSize = s.length();
if (!sSize)
return JSValue::encode(sVal);
- const UChar* sData = s.data();
+ const UChar* sData = s.characters();
Vector<UChar> buffer(sSize);
UChar ored = 0;
@@ -984,10 +983,10 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFontsize(ExecState* exec)
uint32_t smallInteger;
if (a0.getUInt32(smallInteger) && smallInteger <= 9) {
- unsigned stringSize = s.size();
+ unsigned stringSize = s.length();
unsigned bufferSize = 22 + stringSize;
UChar* buffer;
- PassRefPtr<UStringImpl> impl = UStringImpl::tryCreateUninitialized(bufferSize, buffer);
+ PassRefPtr<StringImpl> impl = StringImpl::tryCreateUninitialized(bufferSize, buffer);
if (!impl)
return JSValue::encode(jsUndefined());
buffer[0] = '<';
@@ -1005,7 +1004,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFontsize(ExecState* exec)
buffer[12] = '0' + smallInteger;
buffer[13] = '"';
buffer[14] = '>';
- memcpy(&buffer[15], s.data(), stringSize * sizeof(UChar));
+ memcpy(&buffer[15], s.characters(), stringSize * sizeof(UChar));
buffer[15 + stringSize] = '<';
buffer[16 + stringSize] = '/';
buffer[17 + stringSize] = 'f';
@@ -1034,11 +1033,11 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLink(ExecState* exec)
JSValue a0 = exec->argument(0);
UString linkText = a0.toString(exec);
- unsigned linkTextSize = linkText.size();
- unsigned stringSize = s.size();
+ unsigned linkTextSize = linkText.length();
+ unsigned stringSize = s.length();
unsigned bufferSize = 15 + linkTextSize + stringSize;
UChar* buffer;
- PassRefPtr<UStringImpl> impl = UStringImpl::tryCreateUninitialized(bufferSize, buffer);
+ PassRefPtr<StringImpl> impl = StringImpl::tryCreateUninitialized(bufferSize, buffer);
if (!impl)
return JSValue::encode(jsUndefined());
buffer[0] = '<';
@@ -1050,10 +1049,10 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLink(ExecState* exec)
buffer[6] = 'f';
buffer[7] = '=';
buffer[8] = '"';
- memcpy(&buffer[9], linkText.data(), linkTextSize * sizeof(UChar));
+ memcpy(&buffer[9], linkText.characters(), linkTextSize * sizeof(UChar));
buffer[9 + linkTextSize] = '"';
buffer[10 + linkTextSize] = '>';
- memcpy(&buffer[11 + linkTextSize], s.data(), stringSize * sizeof(UChar));
+ memcpy(&buffer[11 + linkTextSize], s.characters(), stringSize * sizeof(UChar));
buffer[11 + linkTextSize + stringSize] = '<';
buffer[12 + linkTextSize + stringSize] = '/';
buffer[13 + linkTextSize + stringSize] = 'a';
@@ -1078,20 +1077,20 @@ static inline JSValue trimString(ExecState* exec, JSValue thisValue, int trimKin
UString str = thisValue.toThisString(exec);
unsigned left = 0;
if (trimKind & TrimLeft) {
- while (left < str.size() && isTrimWhitespace(str[left]))
+ while (left < str.length() && isTrimWhitespace(str[left]))
left++;
}
- unsigned right = str.size();
+ unsigned right = str.length();
if (trimKind & TrimRight) {
while (right > left && isTrimWhitespace(str[right - 1]))
right--;
}
// Don't gc allocate a new string if we don't have to.
- if (left == 0 && right == str.size() && thisValue.isString())
+ if (left == 0 && right == str.length() && thisValue.isString())
return thisValue;
- return jsString(exec, str.substr(left, right - left));
+ return jsString(exec, str.substringSharingImpl(left, right - left));
}
EncodedJSValue JSC_HOST_CALL stringProtoFuncTrim(ExecState* exec)
diff --git a/JavaScriptCore/runtime/Structure.cpp b/JavaScriptCore/runtime/Structure.cpp
index 6d13f4b..d06a239 100644
--- a/JavaScriptCore/runtime/Structure.cpp
+++ b/JavaScriptCore/runtime/Structure.cpp
@@ -270,7 +270,7 @@ Structure::~Structure()
if (m_propertyTable) {
unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount;
for (unsigned i = 1; i <= entryCount; i++) {
- if (UString::Rep* key = m_propertyTable->entries()[i].key)
+ if (StringImpl* key = m_propertyTable->entries()[i].key)
key->deref();
}
@@ -395,7 +395,7 @@ void Structure::growPropertyStorageCapacity()
void Structure::despecifyDictionaryFunction(const Identifier& propertyName)
{
- const UString::Rep* rep = propertyName._ustring.rep();
+ const StringImpl* rep = propertyName.impl();
materializePropertyMapIfNecessary();
@@ -444,7 +444,7 @@ PassRefPtr<Structure> Structure::addPropertyTransitionToExistingStructure(Struct
ASSERT(!structure->isDictionary());
ASSERT(structure->typeInfo().type() == ObjectType);
- if (Structure* existingTransition = structure->transitionTableGet(make_pair(propertyName.ustring().rep(), attributes), specificValue)) {
+ if (Structure* existingTransition = structure->transitionTableGet(make_pair(propertyName.impl(), attributes), specificValue)) {
ASSERT(existingTransition->m_offset != noOffset);
offset = existingTransition->m_offset + existingTransition->m_anonymousSlotCount;
ASSERT(offset >= structure->m_anonymousSlotCount);
@@ -479,7 +479,7 @@ PassRefPtr<Structure> Structure::addPropertyTransition(Structure* structure, con
transition->m_cachedPrototypeChain = structure->m_cachedPrototypeChain;
transition->m_previous = structure;
- transition->m_nameInPrevious = propertyName.ustring().rep();
+ transition->m_nameInPrevious = propertyName.impl();
transition->m_attributesInPrevious = attributes;
transition->m_specificValueInPrevious = specificValue;
transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity;
@@ -509,7 +509,7 @@ PassRefPtr<Structure> Structure::addPropertyTransition(Structure* structure, con
transition->m_offset = offset - structure->m_anonymousSlotCount;
ASSERT(structure->anonymousSlotCount() == transition->anonymousSlotCount());
- structure->transitionTableAdd(make_pair(propertyName.ustring().rep(), attributes), transition.get(), specificValue);
+ structure->transitionTableAdd(make_pair(propertyName.impl(), attributes), transition.get(), specificValue);
return transition.release();
}
@@ -738,7 +738,7 @@ PropertyMapHashTable* Structure::copyPropertyTable()
unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount;
for (unsigned i = 1; i <= entryCount; ++i) {
- if (UString::Rep* key = newTable->entries()[i].key)
+ if (StringImpl* key = newTable->entries()[i].key)
key->ref();
}
@@ -749,7 +749,7 @@ PropertyMapHashTable* Structure::copyPropertyTable()
return newTable;
}
-size_t Structure::get(const UString::Rep* rep, unsigned& attributes, JSCell*& specificValue)
+size_t Structure::get(const StringImpl* rep, unsigned& attributes, JSCell*& specificValue)
{
materializePropertyMapIfNecessary();
if (!m_propertyTable)
@@ -806,7 +806,7 @@ bool Structure::despecifyFunction(const Identifier& propertyName)
if (!m_propertyTable)
return false;
- UString::Rep* rep = propertyName._ustring.rep();
+ StringImpl* rep = propertyName.impl();
unsigned i = rep->existingHash();
@@ -870,7 +870,7 @@ size_t Structure::put(const Identifier& propertyName, unsigned attributes, JSCel
if (attributes & DontEnum)
m_hasNonEnumerableProperties = true;
- UString::Rep* rep = propertyName._ustring.rep();
+ StringImpl* rep = propertyName.impl();
if (!m_propertyTable)
createPropertyMapHashTable();
@@ -954,7 +954,7 @@ size_t Structure::put(const Identifier& propertyName, unsigned attributes, JSCel
return newOffset;
}
-bool Structure::hasTransition(UString::Rep* rep, unsigned attributes)
+bool Structure::hasTransition(StringImpl* rep, unsigned attributes)
{
return transitionTableHasTransition(make_pair(rep, attributes));
}
@@ -965,7 +965,7 @@ size_t Structure::remove(const Identifier& propertyName)
checkConsistency();
- UString::Rep* rep = propertyName._ustring.rep();
+ StringImpl* rep = propertyName.impl();
if (!m_propertyTable)
return notFound;
@@ -979,7 +979,7 @@ size_t Structure::remove(const Identifier& propertyName)
unsigned i = rep->existingHash();
unsigned k = 0;
unsigned entryIndex;
- UString::Rep* key = 0;
+ StringImpl* key = 0;
while (1) {
entryIndex = m_propertyTable->entryIndices[i & m_propertyTable->sizeMask];
if (entryIndex == emptyEntryIndex)
@@ -1241,7 +1241,7 @@ void Structure::checkConsistency()
unsigned nonEmptyEntryCount = 0;
for (unsigned c = 1; c <= m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount; ++c) {
ASSERT(m_hasNonEnumerableProperties || !(m_propertyTable->entries()[c].attributes & DontEnum));
- UString::Rep* rep = m_propertyTable->entries()[c].key;
+ StringImpl* rep = m_propertyTable->entries()[c].key;
ASSERT(m_propertyTable->entries()[c].offset >= m_anonymousSlotCount);
if (!rep)
continue;
diff --git a/JavaScriptCore/runtime/Structure.h b/JavaScriptCore/runtime/Structure.h
index 968443a..f480051 100644
--- a/JavaScriptCore/runtime/Structure.h
+++ b/JavaScriptCore/runtime/Structure.h
@@ -106,20 +106,20 @@ namespace JSC {
bool isUsingInlineStorage() const;
size_t get(const Identifier& propertyName);
- size_t get(const UString::Rep* rep, unsigned& attributes, JSCell*& specificValue);
+ size_t get(const StringImpl* rep, unsigned& attributes, JSCell*& specificValue);
size_t get(const Identifier& propertyName, unsigned& attributes, JSCell*& specificValue)
{
ASSERT(!propertyName.isNull());
- return get(propertyName.ustring().rep(), attributes, specificValue);
+ return get(propertyName.impl(), attributes, specificValue);
}
bool transitionedFor(const JSCell* specificValue)
{
return m_specificValueInPrevious == specificValue;
}
- bool hasTransition(UString::Rep*, unsigned attributes);
+ bool hasTransition(StringImpl*, unsigned attributes);
bool hasTransition(const Identifier& propertyName, unsigned attributes)
{
- return hasTransition(propertyName._ustring.rep(), attributes);
+ return hasTransition(propertyName.impl(), attributes);
}
bool hasGetterSetterProperties() const { return m_hasGetterSetterProperties; }
@@ -210,7 +210,7 @@ namespace JSC {
mutable RefPtr<StructureChain> m_cachedPrototypeChain;
RefPtr<Structure> m_previous;
- RefPtr<UString::Rep> m_nameInPrevious;
+ RefPtr<StringImpl> m_nameInPrevious;
JSCell* m_specificValueInPrevious;
// 'm_isUsingSingleSlot' indicates whether we are using the single transition optimisation.
@@ -254,7 +254,7 @@ namespace JSC {
if (!m_propertyTable)
return WTF::notFound;
- UString::Rep* rep = propertyName._ustring.rep();
+ StringImpl* rep = propertyName.impl();
unsigned i = rep->existingHash();
diff --git a/JavaScriptCore/runtime/StructureTransitionTable.h b/JavaScriptCore/runtime/StructureTransitionTable.h
index d1dc2d9..7e9d7ff 100644
--- a/JavaScriptCore/runtime/StructureTransitionTable.h
+++ b/JavaScriptCore/runtime/StructureTransitionTable.h
@@ -38,7 +38,7 @@ namespace JSC {
class Structure;
struct StructureTransitionTableHash {
- typedef std::pair<RefPtr<UString::Rep>, unsigned> Key;
+ typedef std::pair<RefPtr<StringImpl>, unsigned> Key;
static unsigned hash(const Key& p)
{
return p.first->existingHash();
@@ -53,7 +53,7 @@ namespace JSC {
};
struct StructureTransitionTableHashTraits {
- typedef WTF::HashTraits<RefPtr<UString::Rep> > FirstTraits;
+ typedef WTF::HashTraits<RefPtr<StringImpl> > FirstTraits;
typedef WTF::GenericHashTraits<unsigned> SecondTraits;
typedef std::pair<FirstTraits::TraitType, SecondTraits::TraitType > TraitType;
diff --git a/JavaScriptCore/runtime/SymbolTable.h b/JavaScriptCore/runtime/SymbolTable.h
index 2717075..1b1636d 100644
--- a/JavaScriptCore/runtime/SymbolTable.h
+++ b/JavaScriptCore/runtime/SymbolTable.h
@@ -119,7 +119,7 @@ namespace JSC {
static const bool needsDestruction = false;
};
- typedef HashMap<RefPtr<UString::Rep>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, SymbolTableIndexHashTraits> SymbolTable;
+ typedef HashMap<RefPtr<StringImpl>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<StringImpl> >, SymbolTableIndexHashTraits> SymbolTable;
class SharedSymbolTable : public SymbolTable, public RefCounted<SharedSymbolTable> {
public:
diff --git a/JavaScriptCore/runtime/UString.cpp b/JavaScriptCore/runtime/UString.cpp
index c442500..ac3acfd 100644
--- a/JavaScriptCore/runtime/UString.cpp
+++ b/JavaScriptCore/runtime/UString.cpp
@@ -54,36 +54,40 @@ namespace JSC {
extern const double NaN;
extern const double Inf;
-// The null string is immutable, except for refCount.
-UString* UString::s_nullUString;
-
COMPILE_ASSERT(sizeof(UString) == sizeof(void*), UString_should_stay_small);
-void initializeUString()
+// Construct a string with UTF-16 data.
+UString::UString(const UChar* characters, unsigned length)
+ : m_impl(characters ? StringImpl::create(characters, length) : 0)
{
- // UStringImpl::empty() does not construct its static string in a threadsafe fashion,
- // so ensure it has been initialized from here.
- UStringImpl::empty();
-
- UString::s_nullUString = new UString;
}
-UString::UString(const char* c)
- : m_rep(Rep::create(c))
+// Construct a string with UTF-16 data, from a null-terminated source.
+UString::UString(const UChar* characters)
{
+ if (!characters)
+ return;
+
+ int length = 0;
+ while (characters[length] != UChar(0))
+ ++length;
+
+ m_impl = StringImpl::create(characters, length);
}
-UString::UString(const char* c, unsigned length)
- : m_rep(Rep::create(c, length))
+// Construct a string with latin1 data.
+UString::UString(const char* characters, unsigned length)
+ : m_impl(characters ? StringImpl::create(characters, length) : 0)
{
}
-UString::UString(const UChar* c, unsigned length)
- : m_rep(Rep::create(c, length))
+// Construct a string with latin1 data, from a null-terminated source.
+UString::UString(const char* characters)
+ : m_impl(characters ? StringImpl::create(characters) : 0)
{
}
-UString UString::from(int i)
+UString UString::number(int i)
{
UChar buf[1 + sizeof(i) * 3];
UChar* end = buf + sizeof(buf) / sizeof(UChar);
@@ -112,7 +116,7 @@ UString UString::from(int i)
return UString(p, static_cast<unsigned>(end - p));
}
-UString UString::from(long long i)
+UString UString::number(long long i)
{
UChar buf[1 + sizeof(i) * 3];
UChar* end = buf + sizeof(buf) / sizeof(UChar);
@@ -145,7 +149,7 @@ UString UString::from(long long i)
return UString(p, static_cast<unsigned>(end - p));
}
-UString UString::from(unsigned u)
+UString UString::number(unsigned u)
{
UChar buf[sizeof(u) * 3];
UChar* end = buf + sizeof(buf) / sizeof(UChar);
@@ -163,7 +167,7 @@ UString UString::from(unsigned u)
return UString(p, static_cast<unsigned>(end - p));
}
-UString UString::from(long l)
+UString UString::number(long l)
{
UChar buf[1 + sizeof(l) * 3];
UChar* end = buf + sizeof(buf) / sizeof(UChar);
@@ -192,7 +196,7 @@ UString UString::from(long l)
return UString(p, end - p);
}
-UString UString::from(double d)
+UString UString::number(double d)
{
DtoaBuffer buffer;
unsigned length;
@@ -200,359 +204,17 @@ UString UString::from(double d)
return UString(buffer, length);
}
-char* UString::ascii() const
-{
- static char* asciiBuffer = 0;
-
- unsigned length = size();
- unsigned neededSize = length + 1;
- delete[] asciiBuffer;
- asciiBuffer = new char[neededSize];
-
- const UChar* p = data();
- char* q = asciiBuffer;
- const UChar* limit = p + length;
- while (p != limit) {
- *q = static_cast<char>(p[0]);
- ++p;
- ++q;
- }
- *q = '\0';
-
- return asciiBuffer;
-}
-
-bool UString::is8Bit() const
-{
- const UChar* u = data();
- const UChar* limit = u + size();
- while (u < limit) {
- if (u[0] > 0xFF)
- return false;
- ++u;
- }
-
- return true;
-}
-
-UChar UString::operator[](unsigned pos) const
+UString UString::substringSharingImpl(unsigned offset, unsigned length) const
{
- if (pos >= size())
- return '\0';
- return data()[pos];
-}
-
-static inline bool isInfinity(double number)
-{
- return number == Inf || number == -Inf;
-}
-
-static bool isInfinity(const UChar* data, const UChar* end)
-{
- return data + 7 < end
- && data[0] == 'I'
- && data[1] == 'n'
- && data[2] == 'f'
- && data[3] == 'i'
- && data[4] == 'n'
- && data[5] == 'i'
- && data[6] == 't'
- && data[7] == 'y';
-}
-
-double UString::toDouble(bool tolerateTrailingJunk, bool tolerateEmptyString) const
-{
- unsigned size = this->size();
-
- if (size == 1) {
- UChar c = data()[0];
- if (isASCIIDigit(c))
- return c - '0';
- if (isStrWhiteSpace(c) && tolerateEmptyString)
- return 0;
- return NaN;
- }
-
- // FIXME: If tolerateTrailingJunk is true, then we want to tolerate junk
- // after the number, even if it contains invalid UTF-16 sequences. So we
- // shouldn't use the UTF8String function, which returns null when it
- // encounters invalid UTF-16. Further, we have no need to convert the
- // non-ASCII characters to UTF-8, so the UTF8String does quite a bit of
- // unnecessary work.
-
- // FIXME: The space skipping code below skips only ASCII spaces, but callers
- // need to skip all StrWhiteSpace. The isStrWhiteSpace function does the
- // right thing but requires UChar, not char, for its argument.
-
- const UChar* data = this->data();
- const UChar* end = data + size;
-
- // Skip leading white space.
- for (; data < end; ++data) {
- if (!isStrWhiteSpace(*data))
- break;
- }
-
- // Empty string.
- if (data == end)
- return tolerateEmptyString ? 0.0 : NaN;
-
- double number;
-
- if (data[0] == '0' && data + 2 < end && (data[1] | 0x20) == 'x' && isASCIIHexDigit(data[2])) {
- // Hex number.
- data += 2;
- const UChar* firstDigitPosition = data;
- number = 0;
- while (true) {
- number = number * 16 + toASCIIHexValue(*data);
- ++data;
- if (data == end)
- break;
- if (!isASCIIHexDigit(*data))
- break;
- }
- if (number >= mantissaOverflowLowerBound)
- number = parseIntOverflow(firstDigitPosition, data - firstDigitPosition, 16);
- } else {
- // Decimal number.
-
- // Put into a null-terminated byte buffer.
- Vector<char, 32> byteBuffer;
- for (const UChar* characters = data; characters < end; ++characters) {
- UChar character = *characters;
- byteBuffer.append(isASCII(character) ? character : 0);
- }
- byteBuffer.append(0);
-
- char* byteBufferEnd;
- number = WTF::strtod(byteBuffer.data(), &byteBufferEnd);
- const UChar* pastNumber = data + (byteBufferEnd - byteBuffer.data());
-
- if ((number || pastNumber != data) && !isInfinity(number))
- data = pastNumber;
- else {
- // We used strtod() to do the conversion. However, strtod() handles
- // infinite values slightly differently than JavaScript in that it
- // converts the string "inf" with any capitalization to infinity,
- // whereas the ECMA spec requires that it be converted to NaN.
-
- double signedInfinity = Inf;
- if (data < end) {
- if (*data == '+')
- data++;
- else if (*data == '-') {
- signedInfinity = -Inf;
- data++;
- }
- }
- if (isInfinity(data, end)) {
- number = signedInfinity;
- data += 8;
- } else if (isInfinity(number) && data < end && (*data | 0x20) != 'i')
- data = pastNumber;
- else
- return NaN;
- }
- }
-
- // Look for trailing junk.
- if (!tolerateTrailingJunk) {
- // Allow trailing white space.
- for (; data < end; ++data) {
- if (!isStrWhiteSpace(*data))
- break;
- }
- if (data != end)
- return NaN;
- }
-
- return number;
-}
-
-double UString::toDouble(bool tolerateTrailingJunk) const
-{
- return toDouble(tolerateTrailingJunk, true);
-}
-
-double UString::toDouble() const
-{
- return toDouble(false, true);
-}
-
-uint32_t UString::toUInt32(bool* ok) const
-{
- double d = toDouble();
- bool b = true;
-
- if (d != static_cast<uint32_t>(d)) {
- b = false;
- d = 0;
- }
-
- if (ok)
- *ok = b;
-
- return static_cast<uint32_t>(d);
-}
-
-uint32_t UString::toUInt32(bool* ok, bool tolerateEmptyString) const
-{
- double d = toDouble(false, tolerateEmptyString);
- bool b = true;
-
- if (d != static_cast<uint32_t>(d)) {
- b = false;
- d = 0;
- }
+ // FIXME: We used to check against a limit of Heap::minExtraCost / sizeof(UChar).
- if (ok)
- *ok = b;
+ unsigned stringLength = this->length();
+ offset = min(offset, stringLength);
+ length = min(length, stringLength - offset);
- return static_cast<uint32_t>(d);
-}
-
-uint32_t UString::toStrictUInt32(bool* ok) const
-{
- if (ok)
- *ok = false;
-
- // Empty string is not OK.
- unsigned len = m_rep->length();
- if (len == 0)
- return 0;
- const UChar* p = m_rep->characters();
- unsigned short c = p[0];
-
- // If the first digit is 0, only 0 itself is OK.
- if (c == '0') {
- if (len == 1 && ok)
- *ok = true;
- return 0;
- }
-
- // Convert to UInt32, checking for overflow.
- uint32_t i = 0;
- while (1) {
- // Process character, turning it into a digit.
- if (c < '0' || c > '9')
- return 0;
- const unsigned d = c - '0';
-
- // Multiply by 10, checking for overflow out of 32 bits.
- if (i > 0xFFFFFFFFU / 10)
- return 0;
- i *= 10;
-
- // Add in the digit, checking for overflow out of 32 bits.
- const unsigned max = 0xFFFFFFFFU - d;
- if (i > max)
- return 0;
- i += d;
-
- // Handle end of string.
- if (--len == 0) {
- if (ok)
- *ok = true;
- return i;
- }
-
- // Get next character.
- c = *(++p);
- }
-}
-
-unsigned UString::find(const UString& f, unsigned pos) const
-{
- unsigned fsz = f.size();
-
- if (fsz == 1) {
- UChar ch = f[0];
- const UChar* end = data() + size();
- for (const UChar* c = data() + pos; c < end; c++) {
- if (*c == ch)
- return static_cast<unsigned>(c - data());
- }
- return NotFound;
- }
-
- unsigned sz = size();
- if (sz < fsz)
- return NotFound;
- if (fsz == 0)
- return pos;
- const UChar* end = data() + sz - fsz;
- unsigned fsizeminusone = (fsz - 1) * sizeof(UChar);
- const UChar* fdata = f.data();
- unsigned short fchar = fdata[0];
- ++fdata;
- for (const UChar* c = data() + pos; c <= end; c++) {
- if (c[0] == fchar && !memcmp(c + 1, fdata, fsizeminusone))
- return static_cast<unsigned>(c - data());
- }
-
- return NotFound;
-}
-
-unsigned UString::find(UChar ch, unsigned pos) const
-{
- const UChar* end = data() + size();
- for (const UChar* c = data() + pos; c < end; c++) {
- if (*c == ch)
- return static_cast<unsigned>(c - data());
- }
-
- return NotFound;
-}
-
-unsigned UString::rfind(const UString& f, unsigned pos) const
-{
- unsigned sz = size();
- unsigned fsz = f.size();
- if (sz < fsz)
- return NotFound;
- if (pos > sz - fsz)
- pos = sz - fsz;
- if (fsz == 0)
- return pos;
- unsigned fsizeminusone = (fsz - 1) * sizeof(UChar);
- const UChar* fdata = f.data();
- for (const UChar* c = data() + pos; c >= data(); c--) {
- if (*c == *fdata && !memcmp(c + 1, fdata + 1, fsizeminusone))
- return static_cast<unsigned>(c - data());
- }
-
- return NotFound;
-}
-
-unsigned UString::rfind(UChar ch, unsigned pos) const
-{
- if (isEmpty())
- return NotFound;
- if (pos + 1 >= size())
- pos = size() - 1;
- for (const UChar* c = data() + pos; c >= data(); c--) {
- if (*c == ch)
- return static_cast<unsigned>(c - data());
- }
-
- return NotFound;
-}
-
-UString UString::substr(unsigned pos, unsigned len) const
-{
- unsigned s = size();
-
- if (pos >= s)
- pos = s;
- unsigned limit = s - pos;
- if (len > limit)
- len = limit;
-
- if (pos == 0 && len == s)
+ if (!offset && length == stringLength)
return *this;
-
- return UString(Rep::create(m_rep, pos, len));
+ return UString(StringImpl::create(m_impl, offset, length));
}
bool operator==(const UString& s1, const char *s2)
@@ -560,8 +222,8 @@ bool operator==(const UString& s1, const char *s2)
if (s2 == 0)
return s1.isEmpty();
- const UChar* u = s1.data();
- const UChar* uend = u + s1.size();
+ const UChar* u = s1.characters();
+ const UChar* uend = u + s1.length();
while (u != uend && *s2) {
if (u[0] != (unsigned char)*s2)
return false;
@@ -574,11 +236,11 @@ bool operator==(const UString& s1, const char *s2)
bool operator<(const UString& s1, const UString& s2)
{
- const unsigned l1 = s1.size();
- const unsigned l2 = s2.size();
+ const unsigned l1 = s1.length();
+ const unsigned l2 = s2.length();
const unsigned lmin = l1 < l2 ? l1 : l2;
- const UChar* c1 = s1.data();
- const UChar* c2 = s2.data();
+ const UChar* c1 = s1.characters();
+ const UChar* c2 = s2.characters();
unsigned l = 0;
while (l < lmin && *c1 == *c2) {
c1++;
@@ -593,11 +255,11 @@ bool operator<(const UString& s1, const UString& s2)
bool operator>(const UString& s1, const UString& s2)
{
- const unsigned l1 = s1.size();
- const unsigned l2 = s2.size();
+ const unsigned l1 = s1.length();
+ const unsigned l2 = s2.length();
const unsigned lmin = l1 < l2 ? l1 : l2;
- const UChar* c1 = s1.data();
- const UChar* c2 = s2.data();
+ const UChar* c1 = s1.characters();
+ const UChar* c2 = s2.characters();
unsigned l = 0;
while (l < lmin && *c1 == *c2) {
c1++;
@@ -610,20 +272,94 @@ bool operator>(const UString& s1, const UString& s2)
return (l1 > l2);
}
-CString UString::UTF8String(bool strict) const
+CString UString::ascii() const
{
- // Allocate a buffer big enough to hold all the characters.
- const unsigned length = size();
- Vector<char, 1024> buffer(length * 3);
-
- // Convert to runs of 8-bit characters.
- char* p = buffer.data();
- const UChar* d = reinterpret_cast<const UChar*>(&data()[0]);
- ConversionResult result = convertUTF16ToUTF8(&d, d + length, &p, p + buffer.size(), strict);
- if (result != conversionOK)
+ // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
+ // preserved, characters outside of this range are converted to '?'.
+
+ unsigned length = this->length();
+ const UChar* characters = this->characters();
+
+ char* characterBuffer;
+ CString result = CString::newUninitialized(length, characterBuffer);
+
+ for (unsigned i = 0; i < length; ++i) {
+ UChar ch = characters[i];
+ characterBuffer[i] = ch && (ch < 0x20 || ch >= 0x7f) ? '?' : ch;
+ }
+
+ return result;
+}
+
+CString UString::latin1() const
+{
+ // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
+ // preserved, characters outside of this range are converted to '?'.
+
+ unsigned length = this->length();
+ const UChar* characters = this->characters();
+
+ char* characterBuffer;
+ CString result = CString::newUninitialized(length, characterBuffer);
+
+ for (unsigned i = 0; i < length; ++i) {
+ UChar ch = characters[i];
+ characterBuffer[i] = ch > 0xff ? '?' : ch;
+ }
+
+ return result;
+}
+
+// Helper to write a three-byte UTF-8 code point to the buffer, caller must check room is available.
+static inline void putUTF8Triple(char*& buffer, UChar ch)
+{
+ ASSERT(ch >= 0x0800);
+ *buffer++ = static_cast<char>(((ch >> 12) & 0x0F) | 0xE0);
+ *buffer++ = static_cast<char>(((ch >> 6) & 0x3F) | 0x80);
+ *buffer++ = static_cast<char>((ch & 0x3F) | 0x80);
+}
+
+CString UString::utf8(bool strict) const
+{
+ unsigned length = this->length();
+ const UChar* characters = this->characters();
+
+ // Allocate a buffer big enough to hold all the characters
+ // (an individual UTF-16 UChar can only expand to 3 UTF-8 bytes).
+ // Optimization ideas, if we find this function is hot:
+ // * We could speculatively create a CStringBuffer to contain 'length'
+ // characters, and resize if necessary (i.e. if the buffer contains
+ // non-ascii characters). (Alternatively, scan the buffer first for
+ // ascii characters, so we know this will be sufficient).
+ // * We could allocate a CStringBuffer with an appropriate size to
+ // have a good chance of being able to write the string into the
+ // buffer without reallocing (say, 1.5 x length).
+ Vector<char, 1024> bufferVector(length * 3);
+
+ char* buffer = bufferVector.data();
+ ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), strict);
+ ASSERT(result != targetExhausted); // (length * 3) should be sufficient for any conversion
+
+ // Only produced from strict conversion.
+ if (result == sourceIllegal)
return CString();
- return CString(buffer.data(), p - buffer.data());
+ // Check for an unconverted high surrogate.
+ if (result == sourceExhausted) {
+ if (strict)
+ return CString();
+ // This should be one unpaired high surrogate. Treat it the same
+ // was as an unpaired high surrogate would have been handled in
+ // the middle of a string with non-strict conversion - which is
+ // to say, simply encode it to UTF-8.
+ ASSERT((characters + 1) == (this->characters() + length));
+ ASSERT((*characters >= 0xD800) && (*characters <= 0xDBFF));
+ // There should be room left, since one UChar hasn't been converted.
+ ASSERT((buffer + 3) <= (buffer + bufferVector.size()));
+ putUTF8Triple(buffer, *characters);
+ }
+
+ return CString(bufferVector.data(), buffer - bufferVector.data());
}
} // namespace JSC
diff --git a/JavaScriptCore/runtime/UString.h b/JavaScriptCore/runtime/UString.h
index bae9265..cd73c28 100644
--- a/JavaScriptCore/runtime/UString.h
+++ b/JavaScriptCore/runtime/UString.h
@@ -1,678 +1,263 @@
/*
- * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * 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.
+ * 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 UString_h
#define UString_h
-#include "Collector.h"
-#include "UStringImpl.h"
-#include <stdint.h>
-#include <string.h>
-#include <wtf/Assertions.h>
-#include <wtf/CrossThreadRefCounted.h>
-#include <wtf/OwnFastMallocPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/CString.h>
-#include <wtf/unicode/Unicode.h>
+#include <wtf/text/StringImpl.h>
namespace JSC {
- using WTF::PlacementNewAdoptType;
- using WTF::PlacementNewAdopt;
+class UString {
+public:
+ // Construct a null string, distinguishable from an empty string.
+ UString() { }
- class UString {
- friend class JIT;
+ // Construct a string with UTF-16 data.
+ UString(const UChar* characters, unsigned length);
- public:
- typedef UStringImpl Rep;
-
- public:
- UString() {}
- UString(const char*); // Constructor for null-terminated string.
- UString(const char*, unsigned length);
- UString(const UChar*, unsigned length);
- UString(const Vector<UChar>& buffer);
-
- UString(const UString& s)
- : m_rep(s.m_rep)
- {
- }
-
- // Special constructor for cases where we overwrite an object in place.
- UString(PlacementNewAdoptType)
- : m_rep(PlacementNewAdopt)
- {
- }
-
- template<size_t inlineCapacity>
- static PassRefPtr<UStringImpl> adopt(Vector<UChar, inlineCapacity>& vector)
- {
- return Rep::adopt(vector);
- }
-
- static UString from(int);
- static UString from(long long);
- static UString from(unsigned);
- static UString from(long);
- static UString from(double);
-
- // NOTE: This method should only be used for *debugging* purposes as it
- // is neither Unicode safe nor free from side effects nor thread-safe.
- char* ascii() const;
-
- /**
- * Convert the string to UTF-8, assuming it is UTF-16 encoded.
- * In non-strict mode, this function is tolerant of badly formed UTF-16, it
- * can create UTF-8 strings that are invalid because they have characters in
- * the range U+D800-U+DDFF, U+FFFE, or U+FFFF, but the UTF-8 string is
- * guaranteed to be otherwise valid.
- * In strict mode, error is returned as null CString.
- */
- CString UTF8String(bool strict = false) const;
-
- const UChar* data() const
- {
- if (!m_rep)
- return 0;
- return m_rep->characters();
- }
-
- unsigned size() const
- {
- if (!m_rep)
- return 0;
- return m_rep->length();
- }
-
- bool isNull() const { return !m_rep; }
- bool isEmpty() const { return !m_rep || !m_rep->length(); }
-
- bool is8Bit() const;
-
- UChar operator[](unsigned pos) const;
-
- double toDouble(bool tolerateTrailingJunk, bool tolerateEmptyString) const;
- double toDouble(bool tolerateTrailingJunk) const;
- double toDouble() const;
-
- uint32_t toUInt32(bool* ok = 0) const;
- uint32_t toUInt32(bool* ok, bool tolerateEmptyString) const;
- uint32_t toStrictUInt32(bool* ok = 0) const;
-
- unsigned toArrayIndex(bool* ok = 0) const;
+ // Construct a string with UTF-16 data, from a null-terminated source.
+ UString(const UChar*);
- static const unsigned NotFound = 0xFFFFFFFFu;
- unsigned find(const UString& f, unsigned pos = 0) const;
- unsigned find(UChar, unsigned pos = 0) const;
- unsigned rfind(const UString& f, unsigned pos) const;
- unsigned rfind(UChar, unsigned pos) const;
+ // Construct a string with latin1 data.
+ UString(const char* characters, unsigned length);
- UString substr(unsigned pos = 0, unsigned len = 0xFFFFFFFF) const;
+ // Construct a string with latin1 data, from a null-terminated source.
+ UString(const char* characters);
- static const UString& null() { return *s_nullUString; }
+ // Construct a string referencing an existing StringImpl.
+ UString(StringImpl* impl) : m_impl(impl) { }
+ UString(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
+ UString(RefPtr<StringImpl> impl) : m_impl(impl) { }
- Rep* rep() const { return m_rep.get(); }
+ // Inline the destructor.
+ ALWAYS_INLINE ~UString() { }
- UString(PassRefPtr<Rep> r)
- : m_rep(r)
- {
- }
-
- size_t cost() const
- {
- if (!m_rep)
- return 0;
- return m_rep->cost();
- }
+ void swap(UString& o) { m_impl.swap(o.m_impl); }
- ALWAYS_INLINE ~UString() { }
- private:
- RefPtr<Rep> m_rep;
+ template<size_t inlineCapacity>
+ static UString adopt(Vector<UChar, inlineCapacity>& vector) { return StringImpl::adopt(vector); }
- static UString* s_nullUString;
+ bool isNull() const { return !m_impl; }
+ bool isEmpty() const { return !m_impl || !m_impl->length(); }
- friend void initializeUString();
- friend bool operator==(const UString&, const UString&);
- };
+ StringImpl* impl() const { return m_impl.get(); }
- ALWAYS_INLINE bool operator==(const UString& s1, const UString& s2)
+ unsigned length() const
{
- UString::Rep* rep1 = s1.rep();
- UString::Rep* rep2 = s2.rep();
- unsigned size1 = 0;
- unsigned size2 = 0;
-
- if (rep1 == rep2) // If they're the same rep, they're equal.
- return true;
-
- if (rep1)
- size1 = rep1->length();
-
- if (rep2)
- size2 = rep2->length();
-
- if (size1 != size2) // If the lengths are not the same, we're done.
- return false;
-
- if (!size1)
- return true;
-
- // At this point we know
- // (a) that the strings are the same length and
- // (b) that they are greater than zero length.
- const UChar* d1 = rep1->characters();
- const UChar* d2 = rep2->characters();
-
- if (d1 == d2) // Check to see if the data pointers are the same.
- return true;
-
- // Do quick checks for sizes 1 and 2.
- switch (size1) {
- case 1:
- return d1[0] == d2[0];
- case 2:
- return (d1[0] == d2[0]) & (d1[1] == d2[1]);
- default:
- return memcmp(d1, d2, size1 * sizeof(UChar)) == 0;
- }
- }
-
-
- inline bool operator!=(const UString& s1, const UString& s2)
- {
- return !JSC::operator==(s1, s2);
- }
-
- bool operator<(const UString& s1, const UString& s2);
- bool operator>(const UString& s1, const UString& s2);
-
- bool operator==(const UString& s1, const char* s2);
-
- inline bool operator!=(const UString& s1, const char* s2)
- {
- return !JSC::operator==(s1, s2);
- }
-
- inline bool operator==(const char *s1, const UString& s2)
- {
- return operator==(s2, s1);
- }
-
- inline bool operator!=(const char *s1, const UString& s2)
- {
- return !JSC::operator==(s1, s2);
- }
-
- inline int codePointCompare(const UString& s1, const UString& s2)
- {
- return codePointCompare(s1.rep(), s2.rep());
- }
-
- // Rule from ECMA 15.2 about what an array index is.
- // Must exactly match string form of an unsigned integer, and be less than 2^32 - 1.
- inline unsigned UString::toArrayIndex(bool* ok) const
- {
- unsigned i = toStrictUInt32(ok);
- if (ok && i >= 0xFFFFFFFFU)
- *ok = false;
- return i;
- }
-
- // We'd rather not do shared substring append for small strings, since
- // this runs too much risk of a tiny initial string holding down a
- // huge buffer.
- static const unsigned minShareSize = Heap::minExtraCost / sizeof(UChar);
-
- struct IdentifierRepHash : PtrHash<RefPtr<JSC::UString::Rep> > {
- static unsigned hash(const RefPtr<JSC::UString::Rep>& key) { return key->existingHash(); }
- static unsigned hash(JSC::UString::Rep* key) { return key->existingHash(); }
- };
-
- void initializeUString();
-
- template<typename StringType>
- class StringTypeAdapter {
- };
-
- template<>
- class StringTypeAdapter<char*> {
- public:
- StringTypeAdapter<char*>(char* buffer)
- : m_buffer((unsigned char*)buffer)
- , m_length(strlen(buffer))
- {
- }
-
- unsigned length() { return m_length; }
-
- void writeTo(UChar* destination)
- {
- for (unsigned i = 0; i < m_length; ++i)
- destination[i] = m_buffer[i];
- }
-
- private:
- const unsigned char* m_buffer;
- unsigned m_length;
- };
-
- template<>
- class StringTypeAdapter<const char*> {
- public:
- StringTypeAdapter<const char*>(const char* buffer)
- : m_buffer((unsigned char*)buffer)
- , m_length(strlen(buffer))
- {
- }
-
- unsigned length() { return m_length; }
-
- void writeTo(UChar* destination)
- {
- for (unsigned i = 0; i < m_length; ++i)
- destination[i] = m_buffer[i];
- }
-
- private:
- const unsigned char* m_buffer;
- unsigned m_length;
- };
-
- template<>
- class StringTypeAdapter<UString> {
- public:
- StringTypeAdapter<UString>(UString& string)
- : m_data(string.data())
- , m_length(string.size())
- {
- }
-
- unsigned length() { return m_length; }
-
- void writeTo(UChar* destination)
- {
- for (unsigned i = 0; i < m_length; ++i)
- destination[i] = m_data[i];
- }
-
- private:
- const UChar* m_data;
- unsigned m_length;
- };
-
- inline void sumWithOverflow(unsigned& total, unsigned addend, bool& overflow)
- {
- unsigned oldTotal = total;
- total = oldTotal + addend;
- if (total < oldTotal)
- overflow = true;
- }
-
- template<typename StringType1, typename StringType2>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2)
- {
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
-
- UChar* buffer;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- if (overflow)
+ if (!m_impl)
return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
- return 0;
-
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
-
- return resultImpl;
+ return m_impl->length();
}
- template<typename StringType1, typename StringType2, typename StringType3>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3)
+ const UChar* characters() const
{
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
- StringTypeAdapter<StringType3> adapter3(string3);
-
- UChar* buffer = 0;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- sumWithOverflow(length, adapter3.length(), overflow);
- if (overflow)
- return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
+ if (!m_impl)
return 0;
-
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
- result += adapter2.length();
- adapter3.writeTo(result);
-
- return resultImpl;
+ return m_impl->characters();
}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
+ CString ascii() const;
+ CString latin1() const;
+ CString utf8(bool strict = false) const;
+
+ UChar operator[](unsigned index) const
{
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
- StringTypeAdapter<StringType3> adapter3(string3);
- StringTypeAdapter<StringType4> adapter4(string4);
-
- UChar* buffer;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- sumWithOverflow(length, adapter3.length(), overflow);
- sumWithOverflow(length, adapter4.length(), overflow);
- if (overflow)
- return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
+ if (!m_impl || index >= m_impl->length())
return 0;
+ return m_impl->characters()[index];
+ }
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
- result += adapter2.length();
- adapter3.writeTo(result);
- result += adapter3.length();
- adapter4.writeTo(result);
-
- return resultImpl;
+ static UString number(int);
+ static UString number(unsigned);
+ static UString number(long);
+ static UString number(long long);
+ static UString number(double);
+
+ // Find a single character or string, also with match function & latin1 forms.
+ size_t find(UChar c, unsigned start = 0) const
+ { return m_impl ? m_impl->find(c, start) : notFound; }
+ size_t find(const UString& str, unsigned start = 0) const
+ { return m_impl ? m_impl->find(str.impl(), start) : notFound; }
+ size_t find(const char* str, unsigned start = 0) const
+ { return m_impl ? m_impl->find(str, start) : notFound; }
+
+ // Find the last instance of a single character or string.
+ size_t reverseFind(UChar c, unsigned start = UINT_MAX) const
+ { return m_impl ? m_impl->reverseFind(c, start) : notFound; }
+ size_t reverseFind(const UString& str, unsigned start = UINT_MAX) const
+ { return m_impl ? m_impl->reverseFind(str.impl(), start) : notFound; }
+
+ UString substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
+
+private:
+ RefPtr<StringImpl> m_impl;
+};
+
+ALWAYS_INLINE bool operator==(const UString& s1, const UString& s2)
+{
+ StringImpl* rep1 = s1.impl();
+ StringImpl* rep2 = s2.impl();
+ unsigned size1 = 0;
+ unsigned size2 = 0;
+
+ if (rep1 == rep2) // If they're the same rep, they're equal.
+ return true;
+
+ if (rep1)
+ size1 = rep1->length();
+
+ if (rep2)
+ size2 = rep2->length();
+
+ if (size1 != size2) // If the lengths are not the same, we're done.
+ return false;
+
+ if (!size1)
+ return true;
+
+ // At this point we know
+ // (a) that the strings are the same length and
+ // (b) that they are greater than zero length.
+ const UChar* d1 = rep1->characters();
+ const UChar* d2 = rep2->characters();
+
+ if (d1 == d2) // Check to see if the data pointers are the same.
+ return true;
+
+ // Do quick checks for sizes 1 and 2.
+ switch (size1) {
+ case 1:
+ return d1[0] == d2[0];
+ case 2:
+ return (d1[0] == d2[0]) & (d1[1] == d2[1]);
+ default:
+ return memcmp(d1, d2, size1 * sizeof(UChar)) == 0;
}
+}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
- {
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
- StringTypeAdapter<StringType3> adapter3(string3);
- StringTypeAdapter<StringType4> adapter4(string4);
- StringTypeAdapter<StringType5> adapter5(string5);
-
- UChar* buffer;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- sumWithOverflow(length, adapter3.length(), overflow);
- sumWithOverflow(length, adapter4.length(), overflow);
- sumWithOverflow(length, adapter5.length(), overflow);
- if (overflow)
- return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
- return 0;
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
- result += adapter2.length();
- adapter3.writeTo(result);
- result += adapter3.length();
- adapter4.writeTo(result);
- result += adapter4.length();
- adapter5.writeTo(result);
-
- return resultImpl;
- }
+inline bool operator!=(const UString& s1, const UString& s2)
+{
+ return !JSC::operator==(s1, s2);
+}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
- {
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
- StringTypeAdapter<StringType3> adapter3(string3);
- StringTypeAdapter<StringType4> adapter4(string4);
- StringTypeAdapter<StringType5> adapter5(string5);
- StringTypeAdapter<StringType6> adapter6(string6);
-
- UChar* buffer;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- sumWithOverflow(length, adapter3.length(), overflow);
- sumWithOverflow(length, adapter4.length(), overflow);
- sumWithOverflow(length, adapter5.length(), overflow);
- sumWithOverflow(length, adapter6.length(), overflow);
- if (overflow)
- return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
- return 0;
+bool operator<(const UString& s1, const UString& s2);
+bool operator>(const UString& s1, const UString& s2);
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
- result += adapter2.length();
- adapter3.writeTo(result);
- result += adapter3.length();
- adapter4.writeTo(result);
- result += adapter4.length();
- adapter5.writeTo(result);
- result += adapter5.length();
- adapter6.writeTo(result);
-
- return resultImpl;
- }
+bool operator==(const UString& s1, const char* s2);
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7)
- {
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
- StringTypeAdapter<StringType3> adapter3(string3);
- StringTypeAdapter<StringType4> adapter4(string4);
- StringTypeAdapter<StringType5> adapter5(string5);
- StringTypeAdapter<StringType6> adapter6(string6);
- StringTypeAdapter<StringType7> adapter7(string7);
-
- UChar* buffer;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- sumWithOverflow(length, adapter3.length(), overflow);
- sumWithOverflow(length, adapter4.length(), overflow);
- sumWithOverflow(length, adapter5.length(), overflow);
- sumWithOverflow(length, adapter6.length(), overflow);
- sumWithOverflow(length, adapter7.length(), overflow);
- if (overflow)
- return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
- return 0;
+inline bool operator!=(const UString& s1, const char* s2)
+{
+ return !JSC::operator==(s1, s2);
+}
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
- result += adapter2.length();
- adapter3.writeTo(result);
- result += adapter3.length();
- adapter4.writeTo(result);
- result += adapter4.length();
- adapter5.writeTo(result);
- result += adapter5.length();
- adapter6.writeTo(result);
- result += adapter6.length();
- adapter7.writeTo(result);
-
- return resultImpl;
- }
+inline bool operator==(const char *s1, const UString& s2)
+{
+ return operator==(s2, s1);
+}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7, typename StringType8>
- PassRefPtr<UStringImpl> tryMakeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7, StringType8 string8)
- {
- StringTypeAdapter<StringType1> adapter1(string1);
- StringTypeAdapter<StringType2> adapter2(string2);
- StringTypeAdapter<StringType3> adapter3(string3);
- StringTypeAdapter<StringType4> adapter4(string4);
- StringTypeAdapter<StringType5> adapter5(string5);
- StringTypeAdapter<StringType6> adapter6(string6);
- StringTypeAdapter<StringType7> adapter7(string7);
- StringTypeAdapter<StringType8> adapter8(string8);
-
- UChar* buffer;
- bool overflow = false;
- unsigned length = adapter1.length();
- sumWithOverflow(length, adapter2.length(), overflow);
- sumWithOverflow(length, adapter3.length(), overflow);
- sumWithOverflow(length, adapter4.length(), overflow);
- sumWithOverflow(length, adapter5.length(), overflow);
- sumWithOverflow(length, adapter6.length(), overflow);
- sumWithOverflow(length, adapter7.length(), overflow);
- sumWithOverflow(length, adapter8.length(), overflow);
- if (overflow)
- return 0;
- PassRefPtr<UStringImpl> resultImpl = UStringImpl::tryCreateUninitialized(length, buffer);
- if (!resultImpl)
- return 0;
+inline bool operator!=(const char *s1, const UString& s2)
+{
+ return !JSC::operator==(s1, s2);
+}
- UChar* result = buffer;
- adapter1.writeTo(result);
- result += adapter1.length();
- adapter2.writeTo(result);
- result += adapter2.length();
- adapter3.writeTo(result);
- result += adapter3.length();
- adapter4.writeTo(result);
- result += adapter4.length();
- adapter5.writeTo(result);
- result += adapter5.length();
- adapter6.writeTo(result);
- result += adapter6.length();
- adapter7.writeTo(result);
- result += adapter7.length();
- adapter8.writeTo(result);
-
- return resultImpl;
- }
+inline int codePointCompare(const UString& s1, const UString& s2)
+{
+ return codePointCompare(s1.impl(), s2.impl());
+}
- template<typename StringType1, typename StringType2>
- UString makeString(StringType1 string1, StringType2 string2)
+struct UStringHash {
+ static unsigned hash(StringImpl* key) { return key->hash(); }
+ static bool equal(const StringImpl* a, const StringImpl* b)
{
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2);
- if (!resultImpl)
- CRASH();
- return resultImpl;
- }
+ if (a == b)
+ return true;
+ if (!a || !b)
+ return false;
- template<typename StringType1, typename StringType2, typename StringType3>
- UString makeString(StringType1 string1, StringType2 string2, StringType3 string3)
- {
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2, string3);
- if (!resultImpl)
- CRASH();
- return resultImpl;
- }
+ unsigned aLength = a->length();
+ unsigned bLength = b->length();
+ if (aLength != bLength)
+ return false;
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4>
- UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4)
- {
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2, string3, string4);
- if (!resultImpl)
- CRASH();
- return resultImpl;
- }
+ // FIXME: perhaps we should have a more abstract macro that indicates when
+ // going 4 bytes at a time is unsafe
+#if CPU(ARM) || CPU(SH4)
+ const UChar* aChars = a->characters();
+ const UChar* bChars = b->characters();
+ for (unsigned i = 0; i != aLength; ++i) {
+ if (*aChars++ != *bChars++)
+ return false;
+ }
+ return true;
+#else
+ /* Do it 4-bytes-at-a-time on architectures where it's safe */
+ const uint32_t* aChars = reinterpret_cast<const uint32_t*>(a->characters());
+ const uint32_t* bChars = reinterpret_cast<const uint32_t*>(b->characters());
+
+ unsigned halfLength = aLength >> 1;
+ for (unsigned i = 0; i != halfLength; ++i)
+ if (*aChars++ != *bChars++)
+ return false;
+
+ if (aLength & 1 && *reinterpret_cast<const uint16_t*>(aChars) != *reinterpret_cast<const uint16_t*>(bChars))
+ return false;
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5>
- UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5)
- {
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5);
- if (!resultImpl)
- CRASH();
- return resultImpl;
+ return true;
+#endif
}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6>
- UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6)
+ static unsigned hash(const RefPtr<StringImpl>& key) { return key->hash(); }
+ static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
{
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5, string6);
- if (!resultImpl)
- CRASH();
- return resultImpl;
+ return equal(a.get(), b.get());
}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7>
- UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7)
+ static unsigned hash(const UString& key) { return key.impl()->hash(); }
+ static bool equal(const UString& a, const UString& b)
{
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5, string6, string7);
- if (!resultImpl)
- CRASH();
- return resultImpl;
+ return equal(a.impl(), b.impl());
}
- template<typename StringType1, typename StringType2, typename StringType3, typename StringType4, typename StringType5, typename StringType6, typename StringType7, typename StringType8>
- UString makeString(StringType1 string1, StringType2 string2, StringType3 string3, StringType4 string4, StringType5 string5, StringType6 string6, StringType7 string7, StringType8 string8)
- {
- PassRefPtr<UStringImpl> resultImpl = tryMakeString(string1, string2, string3, string4, string5, string6, string7, string8);
- if (!resultImpl)
- CRASH();
- return resultImpl;
- }
+ static const bool safeToCompareToEmptyOrDeleted = false;
+};
} // namespace JSC
namespace WTF {
- template<typename T> struct DefaultHash;
- template<typename T> struct StrHash;
-
- template<> struct StrHash<JSC::UString::Rep*> {
- static unsigned hash(const JSC::UString::Rep* key) { return key->hash(); }
- static bool equal(const JSC::UString::Rep* a, const JSC::UString::Rep* b) { return ::equal(a, b); }
- static const bool safeToCompareToEmptyOrDeleted = false;
- };
-
- template<> struct StrHash<RefPtr<JSC::UString::Rep> > : public StrHash<JSC::UString::Rep*> {
- using StrHash<JSC::UString::Rep*>::hash;
- static unsigned hash(const RefPtr<JSC::UString::Rep>& key) { return key->hash(); }
- using StrHash<JSC::UString::Rep*>::equal;
- static bool equal(const RefPtr<JSC::UString::Rep>& a, const RefPtr<JSC::UString::Rep>& b) { return ::equal(a.get(), b.get()); }
- static bool equal(const JSC::UString::Rep* a, const RefPtr<JSC::UString::Rep>& b) { return ::equal(a, b.get()); }
- static bool equal(const RefPtr<JSC::UString::Rep>& a, const JSC::UString::Rep* b) { return ::equal(a.get(), b); }
+// UStringHash is the default hash for UString
+template<typename T> struct DefaultHash;
+template<> struct DefaultHash<JSC::UString> {
+ typedef JSC::UStringHash Hash;
+};
- static const bool safeToCompareToEmptyOrDeleted = false;
- };
+template <> struct VectorTraits<JSC::UString> : SimpleClassVectorTraits
+{
+ static const bool canInitializeWithMemset = true;
+};
- template <> struct VectorTraits<JSC::UString> : SimpleClassVectorTraits
- {
- static const bool canInitializeWithMemset = true;
- };
-
} // namespace WTF
#endif
+
diff --git a/JavaScriptCore/runtime/UStringImpl.h b/JavaScriptCore/runtime/UStringImpl.h
deleted file mode 100644
index 6401d3b..0000000
--- a/JavaScriptCore/runtime/UStringImpl.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef UStringImpl_h
-#define UStringImpl_h
-
-// FIXME: Remove this redundant name!
-#include <wtf/text/StringImpl.h>
-namespace JSC { typedef StringImpl UStringImpl; }
-
-#endif
diff --git a/JavaScriptCore/wscript b/JavaScriptCore/wscript
index 8f62349..e50b18d 100644
--- a/JavaScriptCore/wscript
+++ b/JavaScriptCore/wscript
@@ -29,7 +29,7 @@ import commands
from settings import *
-jscore_excludes = ['jsc.cpp', 'ucptable.cpp','ProfilerServer.mm', 'ExecutableAllocatorPosix.cpp']
+jscore_excludes = ['chartables.c', 'jsc.cpp', 'ucptable.cpp','ProfilerServer.mm', 'ExecutableAllocatorPosix.cpp']
jscore_excludes.extend(get_excludes(jscore_dir, ['*Brew.cpp', '*CF.cpp', '*Symbian.cpp']))
sources = []
@@ -42,35 +42,6 @@ if building_on_win32:
else:
jscore_excludes.append('JSStringRefBSTR.cpp')
jscore_excludes.extend(get_excludes(jscore_dir, ['*Win.cpp']))
-
-def generate_jscore_derived_sources():
- # build the derived sources
- js_dir = jscore_dir
- if building_on_win32:
- js_dir = get_output('cygpath --unix "%s"' % js_dir)
- derived_sources_dir = os.path.join(jscore_dir, 'DerivedSources')
- if not os.path.exists(derived_sources_dir):
- os.mkdir(derived_sources_dir)
-
- olddir = os.getcwd()
- os.chdir(derived_sources_dir)
-
- # DerivedSources.make expects Cygwin (i.e. Unix-style) python, so use that instead.
- if building_on_win32:
- oldpath = os.environ["PATH"]
- os.environ["PATH"] = "/usr/bin" + os.pathsep + os.environ["PATH"]
- command = 'make -f %s/DerivedSources.make JavaScriptCore=%s BUILT_PRODUCTS_DIR=%s all FEATURE_DEFINES="%s"' % (js_dir, js_dir, js_dir, ' '.join(feature_defines))
- os.system(command)
- if building_on_win32:
- os.environ["PATH"] = oldpath
- os.chdir(olddir)
-
-def set_options(opt):
- common_set_options(opt)
-
-def configure(conf):
- common_configure(conf)
- generate_jscore_derived_sources()
def build(bld):
import Options
@@ -91,9 +62,8 @@ def build(bld):
uselib_local = '',
install_path = output_dir)
- jscore.find_sources_in_dirs(full_dirs, excludes = jscore_excludes)
-
-
+ jscore.find_sources_in_dirs(full_dirs, excludes = jscore_excludes)
+
obj = bld.new_task_gen(
features = 'cxx cprogram',
includes = '. .. assembler DerivedSources ForwardingHeaders ' + ' '.join(includes),
diff --git a/JavaScriptCore/wtf/ByteArray.cpp b/JavaScriptCore/wtf/ByteArray.cpp
index 526f147..910af59 100644
--- a/JavaScriptCore/wtf/ByteArray.cpp
+++ b/JavaScriptCore/wtf/ByteArray.cpp
@@ -25,12 +25,13 @@
#include "config.h"
#include "ByteArray.h"
+#include "StdLibExtras.h"
namespace WTF {
PassRefPtr<ByteArray> ByteArray::create(size_t size)
{
- unsigned char* buffer = new unsigned char[size + sizeof(ByteArray) - sizeof(size_t)];
+ unsigned char* buffer = new unsigned char[size + OBJECT_OFFSETOF(ByteArray, m_data)];
ASSERT((reinterpret_cast<size_t>(buffer) & 3) == 0);
return adoptRef(new (buffer) ByteArray(size));
}
diff --git a/JavaScriptCore/wtf/CMakeLists.txt b/JavaScriptCore/wtf/CMakeLists.txt
index 5cf108f..896794e 100644
--- a/JavaScriptCore/wtf/CMakeLists.txt
+++ b/JavaScriptCore/wtf/CMakeLists.txt
@@ -39,7 +39,9 @@ ADD_DEFINITIONS(-DBUILDING_WTF)
ADD_LIBRARY(${WTF_LIBRARY_NAME} ${WTF_LIBRARY_TYPE} ${WTF_SOURCES})
TARGET_LINK_LIBRARIES(${WTF_LIBRARY_NAME} ${WTF_LIBRARIES})
-ADD_TARGET_PROPERTIES(${WTF_LIBRARY_NAME} LINK_FLAGS ${WTF_LINK_FLAGS})
+IF (WTF_LINK_FLAGS)
+ ADD_TARGET_PROPERTIES(${WTF_LIBRARY_NAME} LINK_FLAGS "${WTF_LINK_FLAGS}")
+ENDIF ()
IF (SHARED_CORE)
SET_TARGET_PROPERTIES(${WTF_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
diff --git a/JavaScriptCore/wtf/FastMalloc.cpp b/JavaScriptCore/wtf/FastMalloc.cpp
index c440417..39cd324 100644
--- a/JavaScriptCore/wtf/FastMalloc.cpp
+++ b/JavaScriptCore/wtf/FastMalloc.cpp
@@ -82,6 +82,7 @@
#if ENABLE(JSC_MULTIPLE_THREADS)
#include <pthread.h>
#endif
+#include <wtf/StdLibExtras.h>
#ifndef NO_TCMALLOC_SAMPLES
#ifdef WTF_CHANGES
@@ -415,16 +416,18 @@ extern "C" const int jscore_fastmalloc_introspection = 0;
#include "TCSpinLock.h"
#include "TCSystemAlloc.h"
#include <algorithm>
-#include <errno.h>
#include <limits>
#include <pthread.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
+#if HAVE(ERRNO_H)
+#include <errno.h>
+#endif
#if OS(UNIX)
#include <unistd.h>
#endif
-#if COMPILER(MSVC)
+#if OS(WINDOWS)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
@@ -1015,7 +1018,7 @@ class PageHeapAllocator {
if (!new_allocation)
CRASH();
- *(void**)new_allocation = allocated_regions_;
+ *reinterpret_cast_ptr<void**>(new_allocation) = allocated_regions_;
allocated_regions_ = new_allocation;
free_area_ = new_allocation + kAlignedSize;
free_avail_ = kAllocIncrement - kAlignedSize;
@@ -2687,7 +2690,13 @@ ALWAYS_INLINE void TCMalloc_Central_FreeList::Populate() {
if (span) pageheap->RegisterSizeClass(span, size_class_);
}
if (span == NULL) {
+#if HAVE(ERRNO_H)
MESSAGE("allocation failed: %d\n", errno);
+#elif OS(WINDOWS)
+ MESSAGE("allocation failed: %d\n", ::GetLastError());
+#else
+ MESSAGE("allocation failed\n");
+#endif
lock_.Lock();
return;
}
@@ -2710,7 +2719,7 @@ ALWAYS_INLINE void TCMalloc_Central_FreeList::Populate() {
char* nptr;
while ((nptr = ptr + size) <= limit) {
*tail = ptr;
- tail = reinterpret_cast<void**>(ptr);
+ tail = reinterpret_cast_ptr<void**>(ptr);
ptr = nptr;
num++;
}
@@ -3054,7 +3063,7 @@ void TCMalloc_ThreadCache::BecomeIdle() {
if (heap->in_setspecific_) return; // Do not disturb the active caller
heap->in_setspecific_ = true;
- pthread_setspecific(heap_key, NULL);
+ setThreadHeap(NULL);
#ifdef HAVE_TLS
// Also update the copy in __thread
threadlocal_heap = NULL;
diff --git a/JavaScriptCore/wtf/Forward.h b/JavaScriptCore/wtf/Forward.h
index a2cc75b..32435c8 100644
--- a/JavaScriptCore/wtf/Forward.h
+++ b/JavaScriptCore/wtf/Forward.h
@@ -34,6 +34,7 @@ namespace WTF {
class AtomicString;
class AtomicStringImpl;
+ class CString;
class String;
class StringBuffer;
class StringImpl;
@@ -49,6 +50,7 @@ using WTF::Vector;
using WTF::AtomicString;
using WTF::AtomicStringImpl;
+using WTF::CString;
using WTF::String;
using WTF::StringBuffer;
using WTF::StringImpl;
diff --git a/JavaScriptCore/wtf/MD5.cpp b/JavaScriptCore/wtf/MD5.cpp
index e995102..375446e 100644
--- a/JavaScriptCore/wtf/MD5.cpp
+++ b/JavaScriptCore/wtf/MD5.cpp
@@ -54,6 +54,7 @@
#include "StringExtras.h"
#include "text/CString.h"
#endif
+#include <wtf/StdLibExtras.h>
namespace WTF {
@@ -103,7 +104,7 @@ static void reverseBytes(uint8_t* buf, unsigned longs)
do {
uint32_t t = static_cast<uint32_t>(buf[3] << 8 | buf[2]) << 16 | buf[1] << 8 | buf[0];
ASSERT_WITH_MESSAGE(!(reinterpret_cast<uintptr_t>(buf) % sizeof(t)), "alignment error of buf");
- *reinterpret_cast<uint32_t *>(buf) = t;
+ *reinterpret_cast_ptr<uint32_t *>(buf) = t;
buf += 4;
} while (--longs);
}
@@ -238,7 +239,7 @@ void MD5::addBytes(const uint8_t* input, size_t length)
}
memcpy(p, buf, t);
reverseBytes(m_in, 16);
- MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in)); // m_in is 4-byte aligned.
+ MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t*>(m_in)); // m_in is 4-byte aligned.
buf += t;
length -= t;
}
@@ -248,7 +249,7 @@ void MD5::addBytes(const uint8_t* input, size_t length)
while (length >= 64) {
memcpy(m_in, buf, 64);
reverseBytes(m_in, 16);
- MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in)); // m_in is 4-byte aligned.
+ MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t*>(m_in)); // m_in is 4-byte aligned.
buf += 64;
length -= 64;
}
@@ -275,7 +276,7 @@ void MD5::checksum(Vector<uint8_t, 16>& digest)
// Two lots of padding: Pad the first block to 64 bytes
memset(p, 0, count);
reverseBytes(m_in, 16);
- MD5Transform(m_buf, reinterpret_cast<uint32_t *>(m_in)); // m_in is 4-byte aligned.
+ MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t *>(m_in)); // m_in is 4-byte aligned.
// Now fill the next block with 56 bytes
memset(m_in, 0, 56);
@@ -287,10 +288,10 @@ void MD5::checksum(Vector<uint8_t, 16>& digest)
// Append length in bits and transform
// m_in is 4-byte aligned.
- (reinterpret_cast<uint32_t*>(m_in))[14] = m_bits[0];
- (reinterpret_cast<uint32_t*>(m_in))[15] = m_bits[1];
+ (reinterpret_cast_ptr<uint32_t*>(m_in))[14] = m_bits[0];
+ (reinterpret_cast_ptr<uint32_t*>(m_in))[15] = m_bits[1];
- MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in));
+ MD5Transform(m_buf, reinterpret_cast_ptr<uint32_t*>(m_in));
reverseBytes(reinterpret_cast<uint8_t*>(m_buf), 4);
// Now, m_buf contains checksum result.
diff --git a/JavaScriptCore/wtf/PassRefPtr.h b/JavaScriptCore/wtf/PassRefPtr.h
index 54fa14c..b43c5ba 100644
--- a/JavaScriptCore/wtf/PassRefPtr.h
+++ b/JavaScriptCore/wtf/PassRefPtr.h
@@ -67,8 +67,8 @@ namespace WTF {
// It somewhat breaks the type system to allow transfer of ownership out of
// a const PassRefPtr. However, it makes it much easier to work with PassRefPtr
// temporaries, and we don't have a need to use real const PassRefPtrs anyway.
- PassRefPtr(const PassRefPtr& o) : m_ptr(o.releaseRef()) { }
- template<typename U> PassRefPtr(const PassRefPtr<U>& o) : m_ptr(o.releaseRef()) { }
+ PassRefPtr(const PassRefPtr& o) : m_ptr(o.leakRef()) { }
+ template<typename U> PassRefPtr(const PassRefPtr<U>& o) : m_ptr(o.leakRef()) { }
ALWAYS_INLINE ~PassRefPtr() { derefIfNotNull(m_ptr); }
@@ -106,7 +106,7 @@ namespace WTF {
};
// NonNullPassRefPtr: Optimized for passing non-null pointers. A NonNullPassRefPtr
- // begins life non-null, and can only become null through a call to releaseRef()
+ // begins life non-null, and can only become null through a call to leakRef()
// or clear().
// FIXME: NonNullPassRefPtr could just inherit from PassRefPtr. However,
@@ -130,19 +130,19 @@ namespace WTF {
}
NonNullPassRefPtr(const NonNullPassRefPtr& o)
- : m_ptr(o.releaseRef())
+ : m_ptr(o.leakRef())
{
ASSERT(m_ptr);
}
template<typename U> NonNullPassRefPtr(const NonNullPassRefPtr<U>& o)
- : m_ptr(o.releaseRef())
+ : m_ptr(o.leakRef())
{
ASSERT(m_ptr);
}
template<typename U> NonNullPassRefPtr(const PassRefPtr<U>& o)
- : m_ptr(o.releaseRef())
+ : m_ptr(o.leakRef())
{
ASSERT(m_ptr);
}
@@ -207,7 +207,7 @@ namespace WTF {
template<typename T> inline PassRefPtr<T>& PassRefPtr<T>::operator=(const PassRefPtr<T>& ref)
{
T* ptr = m_ptr;
- m_ptr = ref.releaseRef();
+ m_ptr = ref.leakRef();
derefIfNotNull(ptr);
return *this;
}
@@ -215,7 +215,7 @@ namespace WTF {
template<typename T> template<typename U> inline PassRefPtr<T>& PassRefPtr<T>::operator=(const PassRefPtr<U>& ref)
{
T* ptr = m_ptr;
- m_ptr = ref.releaseRef();
+ m_ptr = ref.leakRef();
derefIfNotNull(ptr);
return *this;
}
@@ -278,12 +278,12 @@ namespace WTF {
template<typename T, typename U> inline PassRefPtr<T> static_pointer_cast(const PassRefPtr<U>& p)
{
- return adoptRef(static_cast<T*>(p.releaseRef()));
+ return adoptRef(static_cast<T*>(p.leakRef()));
}
template<typename T, typename U> inline PassRefPtr<T> const_pointer_cast(const PassRefPtr<U>& p)
{
- return adoptRef(const_cast<T*>(p.releaseRef()));
+ return adoptRef(const_cast<T*>(p.leakRef()));
}
template<typename T> inline T* getPtr(const PassRefPtr<T>& p)
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 95eb67f..727616f 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -541,7 +541,7 @@
#endif
-#if OS(WINCE) && PLATFORM(QT)
+#if OS(WINCE)
#include <ce_time.h>
#endif
@@ -1068,6 +1068,10 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define WTF_USE_ACCELERATED_COMPOSITING 1
#endif
+#if PLATFORM(QT)
+#define WTF_USE_ACCELERATED_COMPOSITING 1
+#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. */
diff --git a/JavaScriptCore/wtf/RefPtr.h b/JavaScriptCore/wtf/RefPtr.h
index f0c3091..8bd1ac3 100644
--- a/JavaScriptCore/wtf/RefPtr.h
+++ b/JavaScriptCore/wtf/RefPtr.h
@@ -32,19 +32,21 @@ namespace WTF {
enum PlacementNewAdoptType { PlacementNewAdopt };
- template <typename T> class PassRefPtr;
- template <typename T> class NonNullPassRefPtr;
+ template<typename T> class PassRefPtr;
+ template<typename T> class NonNullPassRefPtr;
enum HashTableDeletedValueType { HashTableDeletedValue };
- template <typename T> class RefPtr : public FastAllocBase {
+ template<typename T> class RefPtr : public FastAllocBase {
public:
ALWAYS_INLINE RefPtr() : m_ptr(0) { }
ALWAYS_INLINE RefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); }
- ALWAYS_INLINE RefPtr(const RefPtr& o) : m_ptr(o.m_ptr) { T* ptr = m_ptr; refIfNotNull(ptr); }
- // see comment in PassRefPtr.h for why this takes const reference
- template <typename U> RefPtr(const PassRefPtr<U>&);
- template <typename U> RefPtr(const NonNullPassRefPtr<U>&);
+ ALWAYS_INLINE RefPtr(const RefPtr& o) : m_ptr(o.m_ptr) { refIfNotNull(m_ptr); }
+ template<typename U> RefPtr(const RefPtr<U>& o) : m_ptr(o.get()) { refIfNotNull(m_ptr); }
+
+ // See comments in PassRefPtr.h for an explanation of why these takes const references.
+ template<typename U> RefPtr(const PassRefPtr<U>&);
+ template<typename U> RefPtr(const NonNullPassRefPtr<U>&);
// Special constructor for cases where we overwrite an object in place.
ALWAYS_INLINE RefPtr(PlacementNewAdoptType) { }
@@ -54,9 +56,7 @@ namespace WTF {
bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
ALWAYS_INLINE ~RefPtr() { derefIfNotNull(m_ptr); }
-
- template <typename U> RefPtr(const RefPtr<U>& o) : m_ptr(o.get()) { T* ptr = m_ptr; refIfNotNull(ptr); }
-
+
T* get() const { return m_ptr; }
void clear();
@@ -75,9 +75,9 @@ namespace WTF {
RefPtr& operator=(T*);
RefPtr& operator=(const PassRefPtr<T>&);
RefPtr& operator=(const NonNullPassRefPtr<T>&);
- template <typename U> RefPtr& operator=(const RefPtr<U>&);
- template <typename U> RefPtr& operator=(const PassRefPtr<U>&);
- template <typename U> RefPtr& operator=(const NonNullPassRefPtr<U>&);
+ template<typename U> RefPtr& operator=(const RefPtr<U>&);
+ template<typename U> RefPtr& operator=(const PassRefPtr<U>&);
+ template<typename U> RefPtr& operator=(const NonNullPassRefPtr<U>&);
void swap(RefPtr&);
@@ -87,24 +87,24 @@ namespace WTF {
T* m_ptr;
};
- template <typename T> template <typename U> inline RefPtr<T>::RefPtr(const PassRefPtr<U>& o)
- : m_ptr(o.releaseRef())
+ template<typename T> template<typename U> inline RefPtr<T>::RefPtr(const PassRefPtr<U>& o)
+ : m_ptr(o.leakRef())
{
}
- template <typename T> template <typename U> inline RefPtr<T>::RefPtr(const NonNullPassRefPtr<U>& o)
- : m_ptr(o.releaseRef())
+ template<typename T> template<typename U> inline RefPtr<T>::RefPtr(const NonNullPassRefPtr<U>& o)
+ : m_ptr(o.leakRef())
{
}
- template <typename T> inline void RefPtr<T>::clear()
+ template<typename T> inline void RefPtr<T>::clear()
{
T* ptr = m_ptr;
m_ptr = 0;
derefIfNotNull(ptr);
}
- template <typename T> inline RefPtr<T>& RefPtr<T>::operator=(const RefPtr<T>& o)
+ template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(const RefPtr<T>& o)
{
T* optr = o.get();
refIfNotNull(optr);
@@ -114,7 +114,7 @@ namespace WTF {
return *this;
}
- template <typename T> template <typename U> inline RefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& o)
+ template<typename T> template<typename U> inline RefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& o)
{
T* optr = o.get();
refIfNotNull(optr);
@@ -124,7 +124,7 @@ namespace WTF {
return *this;
}
- template <typename T> inline RefPtr<T>& RefPtr<T>::operator=(T* optr)
+ template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(T* optr)
{
refIfNotNull(optr);
T* ptr = m_ptr;
@@ -133,89 +133,89 @@ namespace WTF {
return *this;
}
- template <typename T> inline RefPtr<T>& RefPtr<T>::operator=(const PassRefPtr<T>& o)
+ template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(const PassRefPtr<T>& o)
{
T* ptr = m_ptr;
- m_ptr = o.releaseRef();
+ m_ptr = o.leakRef();
derefIfNotNull(ptr);
return *this;
}
- template <typename T> inline RefPtr<T>& RefPtr<T>::operator=(const NonNullPassRefPtr<T>& o)
+ template<typename T> inline RefPtr<T>& RefPtr<T>::operator=(const NonNullPassRefPtr<T>& o)
{
T* ptr = m_ptr;
- m_ptr = o.releaseRef();
+ m_ptr = o.leakRef();
derefIfNotNull(ptr);
return *this;
}
- template <typename T> template <typename U> inline RefPtr<T>& RefPtr<T>::operator=(const PassRefPtr<U>& o)
+ template<typename T> template<typename U> inline RefPtr<T>& RefPtr<T>::operator=(const PassRefPtr<U>& o)
{
T* ptr = m_ptr;
- m_ptr = o.releaseRef();
+ m_ptr = o.leakRef();
derefIfNotNull(ptr);
return *this;
}
- template <typename T> template <typename U> inline RefPtr<T>& RefPtr<T>::operator=(const NonNullPassRefPtr<U>& o)
+ template<typename T> template<typename U> inline RefPtr<T>& RefPtr<T>::operator=(const NonNullPassRefPtr<U>& o)
{
T* ptr = m_ptr;
- m_ptr = o.releaseRef();
+ m_ptr = o.leakRef();
derefIfNotNull(ptr);
return *this;
}
- template <class T> inline void RefPtr<T>::swap(RefPtr<T>& o)
+ template<class T> inline void RefPtr<T>::swap(RefPtr<T>& o)
{
std::swap(m_ptr, o.m_ptr);
}
- template <class T> inline void swap(RefPtr<T>& a, RefPtr<T>& b)
+ template<class T> inline void swap(RefPtr<T>& a, RefPtr<T>& b)
{
a.swap(b);
}
- template <typename T, typename U> inline bool operator==(const RefPtr<T>& a, const RefPtr<U>& b)
+ template<typename T, typename U> inline bool operator==(const RefPtr<T>& a, const RefPtr<U>& b)
{
return a.get() == b.get();
}
- template <typename T, typename U> inline bool operator==(const RefPtr<T>& a, U* b)
+ template<typename T, typename U> inline bool operator==(const RefPtr<T>& a, U* b)
{
return a.get() == b;
}
- template <typename T, typename U> inline bool operator==(T* a, const RefPtr<U>& b)
+ template<typename T, typename U> inline bool operator==(T* a, const RefPtr<U>& b)
{
return a == b.get();
}
- template <typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b)
+ template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a, const RefPtr<U>& b)
{
return a.get() != b.get();
}
- template <typename T, typename U> inline bool operator!=(const RefPtr<T>& a, U* b)
+ template<typename T, typename U> inline bool operator!=(const RefPtr<T>& a, U* b)
{
return a.get() != b;
}
- template <typename T, typename U> inline bool operator!=(T* a, const RefPtr<U>& b)
+ template<typename T, typename U> inline bool operator!=(T* a, const RefPtr<U>& b)
{
return a != b.get();
}
- template <typename T, typename U> inline RefPtr<T> static_pointer_cast(const RefPtr<U>& p)
+ template<typename T, typename U> inline RefPtr<T> static_pointer_cast(const RefPtr<U>& p)
{
return RefPtr<T>(static_cast<T*>(p.get()));
}
- template <typename T, typename U> inline RefPtr<T> const_pointer_cast(const RefPtr<U>& p)
+ template<typename T, typename U> inline RefPtr<T> const_pointer_cast(const RefPtr<U>& p)
{
return RefPtr<T>(const_cast<T*>(p.get()));
}
- template <typename T> inline T* getPtr(const RefPtr<T>& p)
+ template<typename T> inline T* getPtr(const RefPtr<T>& p)
{
return p.get();
}
diff --git a/JavaScriptCore/wtf/RetainPtr.h b/JavaScriptCore/wtf/RetainPtr.h
index f5a027e..68b5a04 100644
--- a/JavaScriptCore/wtf/RetainPtr.h
+++ b/JavaScriptCore/wtf/RetainPtr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -48,7 +48,7 @@ namespace WTF {
}
#endif
- template <typename T> class RetainPtr {
+ template<typename T> class RetainPtr {
public:
typedef typename RemovePointer<T>::Type ValueType;
typedef ValueType* PtrType;
@@ -67,12 +67,13 @@ namespace WTF {
~RetainPtr() { if (PtrType ptr = m_ptr) CFRelease(ptr); }
- template <typename U> RetainPtr(const RetainPtr<U>& o) : m_ptr(o.get()) { if (PtrType ptr = m_ptr) CFRetain(ptr); }
+ template<typename U> RetainPtr(const RetainPtr<U>&);
PtrType get() const { return m_ptr; }
-
- PtrType releaseRef() { PtrType tmp = m_ptr; m_ptr = 0; return tmp; }
-
+
+ void clear();
+ PtrType leakRef() WARN_UNUSED_RETURN;
+
PtrType operator->() const { return m_ptr; }
bool operator!() const { return !m_ptr; }
@@ -82,22 +83,47 @@ namespace WTF {
operator UnspecifiedBoolType() const { return m_ptr ? &RetainPtr::m_ptr : 0; }
RetainPtr& operator=(const RetainPtr&);
- template <typename U> RetainPtr& operator=(const RetainPtr<U>&);
+ template<typename U> RetainPtr& operator=(const RetainPtr<U>&);
RetainPtr& operator=(PtrType);
- template <typename U> RetainPtr& operator=(U*);
+ template<typename U> RetainPtr& operator=(U*);
void adoptCF(PtrType);
void adoptNS(PtrType);
void swap(RetainPtr&);
+ // FIXME: Remove releaseRef once we change all callers to call leakRef instead.
+ PtrType releaseRef() { return leakRef(); }
+
private:
static T* hashTableDeletedValue() { return reinterpret_cast<T*>(-1); }
PtrType m_ptr;
};
- template <typename T> inline RetainPtr<T>& RetainPtr<T>::operator=(const RetainPtr<T>& o)
+ template<typename T> template<typename U> inline RetainPtr<T>::RetainPtr(const RetainPtr<U>& o)
+ : m_ptr(o.get())
+ {
+ if (PtrType ptr = m_ptr)
+ CFRetain(ptr);
+ }
+
+ template<typename T> inline void RetainPtr<T>::clear()
+ {
+ if (PtrType ptr = m_ptr) {
+ m_ptr = 0;
+ CFRelease(ptr);
+ }
+ }
+
+ template<typename T> inline typename RetainPtr<T>::PtrType RetainPtr<T>::leakRef()
+ {
+ PtrType ptr = m_ptr;
+ m_ptr = 0;
+ return ptr;
+ }
+
+ template<typename T> inline RetainPtr<T>& RetainPtr<T>::operator=(const RetainPtr<T>& o)
{
PtrType optr = o.get();
if (optr)
@@ -109,7 +135,7 @@ namespace WTF {
return *this;
}
- template <typename T> template <typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(const RetainPtr<U>& o)
+ template<typename T> template<typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(const RetainPtr<U>& o)
{
PtrType optr = o.get();
if (optr)
@@ -121,7 +147,7 @@ namespace WTF {
return *this;
}
- template <typename T> inline RetainPtr<T>& RetainPtr<T>::operator=(PtrType optr)
+ template<typename T> inline RetainPtr<T>& RetainPtr<T>::operator=(PtrType optr)
{
if (optr)
CFRetain(optr);
@@ -132,7 +158,7 @@ namespace WTF {
return *this;
}
- template <typename T> inline void RetainPtr<T>::adoptCF(PtrType optr)
+ template<typename T> inline void RetainPtr<T>::adoptCF(PtrType optr)
{
PtrType ptr = m_ptr;
m_ptr = optr;
@@ -140,7 +166,7 @@ namespace WTF {
CFRelease(ptr);
}
- template <typename T> inline void RetainPtr<T>::adoptNS(PtrType optr)
+ template<typename T> inline void RetainPtr<T>::adoptNS(PtrType optr)
{
adoptNSReference(optr);
@@ -150,7 +176,7 @@ namespace WTF {
CFRelease(ptr);
}
- template <typename T> template <typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(U* optr)
+ template<typename T> template<typename U> inline RetainPtr<T>& RetainPtr<T>::operator=(U* optr)
{
if (optr)
CFRetain(optr);
@@ -161,42 +187,42 @@ namespace WTF {
return *this;
}
- template <class T> inline void RetainPtr<T>::swap(RetainPtr<T>& o)
+ template<typename T> inline void RetainPtr<T>::swap(RetainPtr<T>& o)
{
std::swap(m_ptr, o.m_ptr);
}
- template <class T> inline void swap(RetainPtr<T>& a, RetainPtr<T>& b)
+ template<typename T> inline void swap(RetainPtr<T>& a, RetainPtr<T>& b)
{
a.swap(b);
}
- template <typename T, typename U> inline bool operator==(const RetainPtr<T>& a, const RetainPtr<U>& b)
+ template<typename T, typename U> inline bool operator==(const RetainPtr<T>& a, const RetainPtr<U>& b)
{
return a.get() == b.get();
}
- template <typename T, typename U> inline bool operator==(const RetainPtr<T>& a, U* b)
+ template<typename T, typename U> inline bool operator==(const RetainPtr<T>& a, U* b)
{
return a.get() == b;
}
- template <typename T, typename U> inline bool operator==(T* a, const RetainPtr<U>& b)
+ template<typename T, typename U> inline bool operator==(T* a, const RetainPtr<U>& b)
{
return a == b.get();
}
- template <typename T, typename U> inline bool operator!=(const RetainPtr<T>& a, const RetainPtr<U>& b)
+ template<typename T, typename U> inline bool operator!=(const RetainPtr<T>& a, const RetainPtr<U>& b)
{
return a.get() != b.get();
}
- template <typename T, typename U> inline bool operator!=(const RetainPtr<T>& a, U* b)
+ template<typename T, typename U> inline bool operator!=(const RetainPtr<T>& a, U* b)
{
return a.get() != b;
}
- template <typename T, typename U> inline bool operator!=(T* a, const RetainPtr<U>& b)
+ template<typename T, typename U> inline bool operator!=(T* a, const RetainPtr<U>& b)
{
return a != b.get();
}
diff --git a/JavaScriptCore/wtf/StdLibExtras.h b/JavaScriptCore/wtf/StdLibExtras.h
index 96a929c..d594c17 100644
--- a/JavaScriptCore/wtf/StdLibExtras.h
+++ b/JavaScriptCore/wtf/StdLibExtras.h
@@ -51,6 +51,40 @@
#define STRINGIZE(exp) #exp
#define STRINGIZE_VALUE_OF(exp) STRINGIZE(exp)
+/*
+ * The reinterpret_cast<Type1*>([pointer to Type2]) expressions - where
+ * sizeof(Type1) > sizeof(Type2) - cause the following warning on ARM with GCC:
+ * increases required alignment of target type.
+ *
+ * An implicit or an extra static_cast<void*> bypasses the warning.
+ * For more info see the following bugzilla entries:
+ * - https://bugs.webkit.org/show_bug.cgi?id=38045
+ * - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43976
+ */
+#if CPU(ARM) && COMPILER(GCC)
+template<typename Type>
+bool isPointerTypeAlignmentOkay(Type* ptr)
+{
+ return !(reinterpret_cast<intptr_t>(ptr) % __alignof__(Type));
+}
+
+template<typename TypePtr>
+TypePtr reinterpret_cast_ptr(void* ptr)
+{
+ ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast<TypePtr>(ptr)));
+ return reinterpret_cast<TypePtr>(ptr);
+}
+
+template<typename TypePtr>
+TypePtr reinterpret_cast_ptr(const void* ptr)
+{
+ ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast<TypePtr>(ptr)));
+ return reinterpret_cast<TypePtr>(ptr);
+}
+#else
+#define reinterpret_cast_ptr reinterpret_cast
+#endif
+
namespace WTF {
/*
diff --git a/JavaScriptCore/wtf/Vector.h b/JavaScriptCore/wtf/Vector.h
index c60de15..f73793f 100644
--- a/JavaScriptCore/wtf/Vector.h
+++ b/JavaScriptCore/wtf/Vector.h
@@ -24,6 +24,7 @@
#include "FastAllocBase.h"
#include "Noncopyable.h"
#include "NotFound.h"
+#include "StdLibExtras.h"
#include "ValueCheck.h"
#include "VectorTraits.h"
#include <limits>
@@ -481,7 +482,7 @@ namespace WTF {
using Base::m_capacity;
static const size_t m_inlineBufferSize = inlineCapacity * sizeof(T);
- T* inlineBuffer() { return reinterpret_cast<T*>(m_inlineBuffer.buffer); }
+ T* inlineBuffer() { return reinterpret_cast_ptr<T*>(m_inlineBuffer.buffer); }
AlignedBuffer<m_inlineBufferSize, WTF_ALIGN_OF(T)> m_inlineBuffer;
};
diff --git a/JavaScriptCore/wtf/dtoa.cpp b/JavaScriptCore/wtf/dtoa.cpp
index 2c478a0..f7e19bf 100644
--- a/JavaScriptCore/wtf/dtoa.cpp
+++ b/JavaScriptCore/wtf/dtoa.cpp
@@ -88,21 +88,6 @@
* #define Bad_float_h if your system lacks a float.h or if it does not
* define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
* FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
- * #define INFNAN_CHECK on IEEE systems to cause strtod to check for
- * Infinity and NaN (case insensitively). On some systems (e.g.,
- * some HP systems), it may be necessary to #define NAN_WORD0
- * appropriately -- to the most significant word of a quiet NaN.
- * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.)
- * When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined,
- * strtod also accepts (case insensitively) strings of the form
- * NaN(x), where x is a string of hexadecimal digits and spaces;
- * if there is only one string of hexadecimal digits, it is taken
- * for the 52 fraction bits of the resulting NaN; if there are two
- * or more strings of hex digits, the first is for the high 20 bits,
- * the second and subsequent for the low 32 bits, with intervening
- * white space ignored; but if this results in none of the 52
- * fraction bits being on (an IEEE Infinity symbol), then NAN_WORD0
- * and NAN_WORD1 are used instead.
* #define NO_IEEE_Scale to disable new (Feb. 1997) logic in strtod that
* avoids underflows on inputs whose result does not underflow.
* If you #define NO_IEEE_Scale on a machine that uses IEEE-format
@@ -166,9 +151,6 @@
#define IEEE_8087
#endif
-#define INFNAN_CHECK
-#define No_Hex_NaN
-
#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(IEEE_ARM) != 1
Exactly one of IEEE_8087, IEEE_ARM or IEEE_MC68k should be defined.
#endif
@@ -1040,78 +1022,6 @@ static const double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
#define Scale_Bit 0x10
#define n_bigtens 5
-#if defined(INFNAN_CHECK)
-
-#ifndef NAN_WORD0
-#define NAN_WORD0 0x7ff80000
-#endif
-
-#ifndef NAN_WORD1
-#define NAN_WORD1 0
-#endif
-
-static int match(const char** sp, const char* t)
-{
- int c, d;
- const char* s = *sp;
-
- while ((d = *t++)) {
- if ((c = *++s) >= 'A' && c <= 'Z')
- c += 'a' - 'A';
- if (c != d)
- return 0;
- }
- *sp = s + 1;
- return 1;
-}
-
-#ifndef No_Hex_NaN
-static void hexnan(U* rvp, const char** sp)
-{
- uint32_t c, x[2];
- const char* s;
- int havedig, udx0, xshift;
-
- x[0] = x[1] = 0;
- havedig = xshift = 0;
- udx0 = 1;
- s = *sp;
- while ((c = *(const unsigned char*)++s)) {
- if (c >= '0' && c <= '9')
- c -= '0';
- else if (c >= 'a' && c <= 'f')
- c += 10 - 'a';
- else if (c >= 'A' && c <= 'F')
- c += 10 - 'A';
- else if (c <= ' ') {
- if (udx0 && havedig) {
- udx0 = 0;
- xshift = 1;
- }
- continue;
- } else if (/*(*/ c == ')' && havedig) {
- *sp = s + 1;
- break;
- } else
- return; /* invalid form: don't change *sp */
- havedig = 1;
- if (xshift) {
- xshift = 0;
- x[0] = x[1];
- x[1] = 0;
- }
- if (udx0)
- x[0] = (x[0] << 4) | (x[1] >> 28);
- x[1] = (x[1] << 4) | c;
- }
- if ((x[0] &= 0xfffff) || x[1]) {
- word0(rvp) = Exp_mask | x[0];
- word1(rvp) = x[1];
- }
-}
-#endif /*No_Hex_NaN*/
-#endif /* INFNAN_CHECK */
-
double strtod(const char* s00, char** se)
{
#ifdef Avoid_Underflow
@@ -1236,33 +1146,6 @@ digDone:
}
if (!nd) {
if (!nz && !nz0) {
-#ifdef INFNAN_CHECK
- /* Check for Nan and Infinity */
- switch (c) {
- case 'i':
- case 'I':
- if (match(&s, "nf")) {
- --s;
- if (!match(&s, "inity"))
- ++s;
- word0(&rv) = 0x7ff00000;
- word1(&rv) = 0;
- goto ret;
- }
- break;
- case 'n':
- case 'N':
- if (match(&s, "an")) {
- word0(&rv) = NAN_WORD0;
- word1(&rv) = NAN_WORD1;
-#ifndef No_Hex_NaN
- if (*s == '(') /*)*/
- hexnan(&rv, &s);
-#endif
- goto ret;
- }
- }
-#endif /* INFNAN_CHECK */
ret0:
s = s00;
sign = 0;
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.cpp b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
index e7cf34b..9d16cb5 100644
--- a/JavaScriptCore/wtf/gobject/GRefPtr.cpp
+++ b/JavaScriptCore/wtf/gobject/GRefPtr.cpp
@@ -35,4 +35,18 @@ template <> void derefGPtr(GHashTable* ptr)
g_hash_table_unref(ptr);
}
+#if GLIB_CHECK_VERSION(2, 24, 0)
+template <> GVariant* refGPtr(GVariant* ptr)
+{
+ if (ptr)
+ g_variant_ref(ptr);
+ return ptr;
+}
+
+template <> void derefGPtr(GVariant* ptr)
+{
+ g_variant_unref(ptr);
+}
+#endif
+
} // namespace WTF
diff --git a/JavaScriptCore/wtf/gobject/GRefPtr.h b/JavaScriptCore/wtf/gobject/GRefPtr.h
index c4d4107..9a07d93 100644
--- a/JavaScriptCore/wtf/gobject/GRefPtr.h
+++ b/JavaScriptCore/wtf/gobject/GRefPtr.h
@@ -25,11 +25,7 @@
#include "AlwaysInline.h"
#include <algorithm>
-
-typedef struct _GHashTable GHashTable;
-typedef void* gpointer;
-extern "C" void g_object_unref(gpointer object);
-extern "C" gpointer g_object_ref_sink(gpointer object);
+#include <glib.h>
namespace WTF {
@@ -41,6 +37,11 @@ template <typename T> GRefPtr<T> adoptGRef(T*);
template <> GHashTable* refGPtr(GHashTable* ptr);
template <> void derefGPtr(GHashTable* ptr);
+#if GLIB_CHECK_VERSION(2, 24, 0)
+template <> GVariant* refGPtr(GVariant* ptr);
+template <> void derefGPtr(GVariant* ptr);
+#endif
+
template <typename T> class GRefPtr {
public:
GRefPtr() : m_ptr(0) { }
diff --git a/JavaScriptCore/wtf/qt/StringQt.cpp b/JavaScriptCore/wtf/qt/StringQt.cpp
index c02505a..16dd439 100644
--- a/JavaScriptCore/wtf/qt/StringQt.cpp
+++ b/JavaScriptCore/wtf/qt/StringQt.cpp
@@ -25,6 +25,7 @@
#include "config.h"
+#include <wtf/StdLibExtras.h>
#include <wtf/text/WTFString.h>
#include <QString>
@@ -36,14 +37,14 @@ String::String(const QString& qstr)
{
if (qstr.isNull())
return;
- m_impl = StringImpl::create(reinterpret_cast<const UChar*>(qstr.constData()), qstr.length());
+ m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(qstr.constData()), qstr.length());
}
String::String(const QStringRef& ref)
{
if (!ref.string())
return;
- m_impl = StringImpl::create(reinterpret_cast<const UChar*>(ref.unicode()), ref.length());
+ m_impl = StringImpl::create(reinterpret_cast_ptr<const UChar*>(ref.unicode()), ref.length());
}
String::operator QString() const
diff --git a/JavaScriptCore/wtf/text/AtomicString.h b/JavaScriptCore/wtf/text/AtomicString.h
index d29981a..cfabde7 100644
--- a/JavaScriptCore/wtf/text/AtomicString.h
+++ b/JavaScriptCore/wtf/text/AtomicString.h
@@ -32,14 +32,10 @@
#define ATOMICSTRING_CONVERSION
#endif
-// FIXME: this should be in WTF, too!
-namespace WebCore {
-struct AtomicStringHash;
-}
-using WebCore::AtomicStringHash;
-
namespace WTF {
+struct AtomicStringHash;
+
class AtomicString {
public:
static void init();
@@ -75,10 +71,10 @@ public:
bool contains(const String& s, bool caseSensitive = true) const
{ return m_string.contains(s, caseSensitive); }
- int find(UChar c, int start = 0) const { return m_string.find(c, start); }
- int find(const char* s, int start = 0, bool caseSentitive = true) const
+ size_t find(UChar c, size_t start = 0) const { return m_string.find(c, start); }
+ size_t find(const char* s, size_t start = 0, bool caseSentitive = true) const
{ return m_string.find(s, start, caseSentitive); }
- int find(const String& s, int start = 0, bool caseSentitive = true) const
+ size_t find(const String& s, size_t start = 0, bool caseSentitive = true) const
{ return m_string.find(s, start, caseSentitive); }
bool startsWith(const String& s, bool caseSensitive = true) const
diff --git a/WebCore/platform/text/AtomicStringHash.h b/JavaScriptCore/wtf/text/AtomicStringHash.h
index d13332b..f6e4ad1 100644
--- a/WebCore/platform/text/AtomicStringHash.h
+++ b/JavaScriptCore/wtf/text/AtomicStringHash.h
@@ -29,10 +29,10 @@
#ifndef AtomicStringHash_h
#define AtomicStringHash_h
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
#include <wtf/HashTraits.h>
-namespace WebCore {
+namespace WTF {
struct AtomicStringHash {
static unsigned hash(const AtomicString& key)
@@ -48,11 +48,7 @@ namespace WebCore {
static const bool safeToCompareToEmptyOrDeleted = false;
};
-}
-
-namespace WTF {
-
- // WebCore::AtomicStringHash is the default hash for AtomicString
+ // AtomicStringHash is the default hash for AtomicString
template<> struct HashTraits<WTF::AtomicString> : GenericHashTraits<WTF::AtomicString> {
static const bool emptyValueIsZero = true;
static void constructDeletedValue(WTF::AtomicString& slot) { new (&slot) WTF::AtomicString(HashTableDeletedValue); }
@@ -61,4 +57,6 @@ namespace WTF {
}
+using WTF::AtomicStringHash;
+
#endif
diff --git a/JavaScriptCore/wtf/text/StringImpl.cpp b/JavaScriptCore/wtf/text/StringImpl.cpp
index 3669628..ab0f009 100644
--- a/JavaScriptCore/wtf/text/StringImpl.cpp
+++ b/JavaScriptCore/wtf/text/StringImpl.cpp
@@ -498,175 +498,250 @@ int codePointCompare(const StringImpl* s1, const StringImpl* s2)
return (l1 > l2) ? 1 : -1;
}
-int StringImpl::find(const char* chs, int index, bool caseSensitive)
+size_t StringImpl::find(UChar c, unsigned start)
{
- if (!chs || index < 0)
- return -1;
+ return WTF::find(m_data, m_length, c, start);
+}
- int chsLength = strlen(chs);
- int n = m_length - index;
- if (n < 0)
- return -1;
- n -= chsLength - 1;
- if (n <= 0)
- return -1;
+size_t StringImpl::find(CharacterMatchFunctionPtr matchFunction, unsigned start)
+{
+ return WTF::find(m_data, m_length, matchFunction, start);
+}
- const char* chsPlusOne = chs + 1;
- int chsLengthMinusOne = chsLength - 1;
-
- const UChar* ptr = m_data + index - 1;
- if (caseSensitive) {
- UChar c = *chs;
- do {
- if (*++ptr == c && equal(ptr + 1, chsPlusOne, chsLengthMinusOne))
- return m_length - chsLength - n + 1;
- } while (--n);
- } else {
- UChar lc = Unicode::foldCase(*chs);
- do {
- if (Unicode::foldCase(*++ptr) == lc && equalIgnoringCase(ptr + 1, chsPlusOne, chsLengthMinusOne))
- return m_length - chsLength - n + 1;
- } while (--n);
+size_t StringImpl::find(const char* matchString, unsigned index)
+{
+ // Check for null or empty string to match against
+ if (!matchString)
+ return notFound;
+ unsigned matchLength = strlen(matchString);
+ if (!matchLength)
+ return min(index, length());
+
+ // Optimization 1: fast case for strings of length 1.
+ if (matchLength == 1)
+ return WTF::find(characters(), length(), *(const unsigned char*)matchString, index);
+
+ // Check index & matchLength are in range.
+ if (index > length())
+ return notFound;
+ unsigned searchLength = length() - index;
+ if (matchLength > searchLength)
+ return notFound;
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = searchLength - matchLength;
+
+ const UChar* searchCharacters = characters() + index;
+ const unsigned char* matchCharacters = (const unsigned char*)matchString;
+
+ // Optimization 2: keep a running hash of the strings,
+ // only call memcmp if the hashes match.
+ unsigned searchHash = 0;
+ unsigned matchHash = 0;
+ for (unsigned i = 0; i < matchLength; ++i) {
+ searchHash += searchCharacters[i];
+ matchHash += matchCharacters[i];
}
- return -1;
+ unsigned i = 0;
+ // keep looping until we match
+ while (searchHash != matchHash || !equal(searchCharacters + i, matchString, matchLength)) {
+ if (i == delta)
+ return notFound;
+ searchHash += searchCharacters[i + matchLength];
+ searchHash -= searchCharacters[i];
+ ++i;
+ }
+ return index + i;
}
-int StringImpl::find(UChar c, int start)
+size_t StringImpl::findIgnoringCase(const char* matchString, unsigned index)
{
- return WTF::find(m_data, m_length, c, start);
+ // Check for null or empty string to match against
+ if (!matchString)
+ return notFound;
+ unsigned matchLength = strlen(matchString);
+ if (!matchLength)
+ return min(index, length());
+
+ // Check index & matchLength are in range.
+ if (index > length())
+ return notFound;
+ unsigned searchLength = length() - index;
+ if (matchLength > searchLength)
+ return notFound;
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = searchLength - matchLength;
+
+ const UChar* searchCharacters = characters() + index;
+
+ unsigned i = 0;
+ // keep looping until we match
+ while (!equalIgnoringCase(searchCharacters + i, matchString, matchLength)) {
+ if (i == delta)
+ return notFound;
+ ++i;
+ }
+ return index + i;
}
-int StringImpl::find(CharacterMatchFunctionPtr matchFunction, int start)
+size_t StringImpl::find(StringImpl* matchString, unsigned index)
{
- return WTF::find(m_data, m_length, matchFunction, start);
+ // Check for null or empty string to match against
+ if (!matchString)
+ return notFound;
+ unsigned matchLength = matchString->length();
+ if (!matchLength)
+ return min(index, length());
+
+ // Optimization 1: fast case for strings of length 1.
+ if (matchLength == 1)
+ return WTF::find(characters(), length(), matchString->characters()[0], index);
+
+ // Check index & matchLength are in range.
+ if (index > length())
+ return notFound;
+ unsigned searchLength = length() - index;
+ if (matchLength > searchLength)
+ return notFound;
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = searchLength - matchLength;
+
+ const UChar* searchCharacters = characters() + index;
+ const UChar* matchCharacters = matchString->characters();
+
+ // Optimization 2: keep a running hash of the strings,
+ // only call memcmp if the hashes match.
+ unsigned searchHash = 0;
+ unsigned matchHash = 0;
+ for (unsigned i = 0; i < matchLength; ++i) {
+ searchHash += searchCharacters[i];
+ matchHash += matchCharacters[i];
+ }
+
+ unsigned i = 0;
+ // keep looping until we match
+ while (searchHash != matchHash || memcmp(searchCharacters + i, matchCharacters, matchLength * sizeof(UChar))) {
+ if (i == delta)
+ return notFound;
+ searchHash += searchCharacters[i + matchLength];
+ searchHash -= searchCharacters[i];
+ ++i;
+ }
+ return index + i;
}
-int StringImpl::find(StringImpl* str, int index, bool caseSensitive)
-{
- /*
- We use a simple trick for efficiency's sake. Instead of
- comparing strings, we compare the sum of str with that of
- a part of this string. Only if that matches, we call memcmp
- or ucstrnicmp.
- */
- ASSERT(str);
- if (index < 0)
- index += m_length;
- int lstr = str->m_length;
- int lthis = m_length - index;
- if ((unsigned)lthis > m_length)
- return -1;
- int delta = lthis - lstr;
- if (delta < 0)
- return -1;
-
- const UChar* uthis = m_data + index;
- const UChar* ustr = str->m_data;
- unsigned hthis = 0;
- unsigned hstr = 0;
- if (caseSensitive) {
- for (int i = 0; i < lstr; i++) {
- hthis += uthis[i];
- hstr += ustr[i];
- }
- int i = 0;
- while (1) {
- if (hthis == hstr && memcmp(uthis + i, ustr, lstr * sizeof(UChar)) == 0)
- return index + i;
- if (i == delta)
- return -1;
- hthis += uthis[i + lstr];
- hthis -= uthis[i];
- i++;
- }
- } else {
- for (int i = 0; i < lstr; i++ ) {
- hthis += toASCIILower(uthis[i]);
- hstr += toASCIILower(ustr[i]);
- }
- int i = 0;
- while (1) {
- if (hthis == hstr && equalIgnoringCase(uthis + i, ustr, lstr))
- return index + i;
- if (i == delta)
- return -1;
- hthis += toASCIILower(uthis[i + lstr]);
- hthis -= toASCIILower(uthis[i]);
- i++;
- }
+size_t StringImpl::findIgnoringCase(StringImpl* matchString, unsigned index)
+{
+ // Check for null or empty string to match against
+ if (!matchString)
+ return notFound;
+ unsigned matchLength = matchString->length();
+ if (!matchLength)
+ return min(index, length());
+
+ // Check index & matchLength are in range.
+ if (index > length())
+ return notFound;
+ unsigned searchLength = length() - index;
+ if (matchLength > searchLength)
+ return notFound;
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = searchLength - matchLength;
+
+ const UChar* searchCharacters = characters() + index;
+ const UChar* matchCharacters = matchString->characters();
+
+ unsigned i = 0;
+ // keep looping until we match
+ while (!equalIgnoringCase(searchCharacters + i, matchCharacters, matchLength)) {
+ if (i == delta)
+ return notFound;
+ ++i;
}
+ return index + i;
}
-int StringImpl::reverseFind(UChar c, int index)
+size_t StringImpl::reverseFind(UChar c, unsigned index)
{
return WTF::reverseFind(m_data, m_length, c, index);
}
-int StringImpl::reverseFind(StringImpl* str, int index, bool caseSensitive)
+size_t StringImpl::reverseFind(StringImpl* matchString, unsigned index)
{
- /*
- See StringImpl::find() for explanations.
- */
- ASSERT(str);
- int lthis = m_length;
- if (index < 0)
- index += lthis;
-
- int lstr = str->m_length;
- int delta = lthis - lstr;
- if ( index < 0 || index > lthis || delta < 0 )
- return -1;
- if ( index > delta )
- index = delta;
-
- const UChar *uthis = m_data;
- const UChar *ustr = str->m_data;
- unsigned hthis = 0;
- unsigned hstr = 0;
- int i;
- if (caseSensitive) {
- for ( i = 0; i < lstr; i++ ) {
- hthis += uthis[index + i];
- hstr += ustr[i];
- }
- i = index;
- while (1) {
- if (hthis == hstr && memcmp(uthis + i, ustr, lstr * sizeof(UChar)) == 0)
- return i;
- if (i == 0)
- return -1;
- i--;
- hthis -= uthis[i + lstr];
- hthis += uthis[i];
- }
- } else {
- for (i = 0; i < lstr; i++) {
- hthis += toASCIILower(uthis[index + i]);
- hstr += toASCIILower(ustr[i]);
- }
- i = index;
- while (1) {
- if (hthis == hstr && equalIgnoringCase(uthis + i, ustr, lstr) )
- return i;
- if (i == 0)
- return -1;
- i--;
- hthis -= toASCIILower(uthis[i + lstr]);
- hthis += toASCIILower(uthis[i]);
- }
+ // Check for null or empty string to match against
+ if (!matchString)
+ return notFound;
+ unsigned matchLength = matchString->length();
+ if (!matchLength)
+ return min(index, length());
+
+ // Optimization 1: fast case for strings of length 1.
+ if (matchLength == 1)
+ return WTF::reverseFind(characters(), length(), matchString->characters()[0], index);
+
+ // Check index & matchLength are in range.
+ if (matchLength > length())
+ return notFound;
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = min(index, length() - matchLength);
+
+ const UChar *searchCharacters = characters();
+ const UChar *matchCharacters = matchString->characters();
+
+ // Optimization 2: keep a running hash of the strings,
+ // only call memcmp if the hashes match.
+ unsigned searchHash = 0;
+ unsigned matchHash = 0;
+ for (unsigned i = 0; i < matchLength; ++i) {
+ searchHash += searchCharacters[delta + i];
+ matchHash += matchCharacters[i];
+ }
+
+ // keep looping until we match
+ while (searchHash != matchHash || memcmp(searchCharacters + delta, matchCharacters, matchLength * sizeof(UChar))) {
+ if (!delta)
+ return notFound;
+ delta--;
+ searchHash -= searchCharacters[delta + matchLength];
+ searchHash += searchCharacters[delta];
}
+ return delta;
+}
+
+size_t StringImpl::reverseFindIgnoringCase(StringImpl* matchString, unsigned index)
+{
+ // Check for null or empty string to match against
+ if (!matchString)
+ return notFound;
+ unsigned matchLength = matchString->length();
+ if (!matchLength)
+ return min(index, length());
+
+ // Check index & matchLength are in range.
+ if (matchLength > length())
+ return notFound;
+ // delta is the number of additional times to test; delta == 0 means test only once.
+ unsigned delta = min(index, length() - matchLength);
- // Should never get here.
- return -1;
+ const UChar *searchCharacters = characters();
+ const UChar *matchCharacters = matchString->characters();
+
+ // keep looping until we match
+ while (!equalIgnoringCase(searchCharacters + delta, matchCharacters, matchLength)) {
+ if (!delta)
+ return notFound;
+ delta--;
+ }
+ return delta;
}
bool StringImpl::endsWith(StringImpl* m_data, bool caseSensitive)
{
ASSERT(m_data);
- int start = m_length - m_data->m_length;
- if (start >= 0)
- return (find(m_data, start, caseSensitive) == start);
+ if (m_length >= m_data->m_length) {
+ unsigned start = m_length - m_data->m_length;
+ return (caseSensitive ? find(m_data, start) : findIgnoringCase(m_data, start)) == start;
+ }
return false;
}
@@ -716,12 +791,12 @@ PassRefPtr<StringImpl> StringImpl::replace(UChar pattern, StringImpl* replacemen
if (!replacement)
return this;
- int repStrLength = replacement->length();
- int srcSegmentStart = 0;
- int matchCount = 0;
+ unsigned repStrLength = replacement->length();
+ size_t srcSegmentStart = 0;
+ unsigned matchCount = 0;
// Count the matches
- while ((srcSegmentStart = find(pattern, srcSegmentStart)) >= 0) {
+ while ((srcSegmentStart = find(pattern, srcSegmentStart)) != notFound) {
++matchCount;
++srcSegmentStart;
}
@@ -735,12 +810,12 @@ PassRefPtr<StringImpl> StringImpl::replace(UChar pattern, StringImpl* replacemen
createUninitialized(m_length - matchCount + (matchCount * repStrLength), data);
// Construct the new data
- int srcSegmentEnd;
- int srcSegmentLength;
+ size_t srcSegmentEnd;
+ unsigned srcSegmentLength;
srcSegmentStart = 0;
- int dstOffset = 0;
+ unsigned dstOffset = 0;
- while ((srcSegmentEnd = find(pattern, srcSegmentStart)) >= 0) {
+ while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) {
srcSegmentLength = srcSegmentEnd - srcSegmentStart;
memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
dstOffset += srcSegmentLength;
@@ -752,7 +827,7 @@ PassRefPtr<StringImpl> StringImpl::replace(UChar pattern, StringImpl* replacemen
srcSegmentLength = m_length - srcSegmentStart;
memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
- ASSERT(dstOffset + srcSegmentLength == static_cast<int>(newImpl->length()));
+ ASSERT(dstOffset + srcSegmentLength == newImpl->length());
return newImpl;
}
@@ -762,16 +837,16 @@ PassRefPtr<StringImpl> StringImpl::replace(StringImpl* pattern, StringImpl* repl
if (!pattern || !replacement)
return this;
- int patternLength = pattern->length();
+ unsigned patternLength = pattern->length();
if (!patternLength)
return this;
- int repStrLength = replacement->length();
- int srcSegmentStart = 0;
- int matchCount = 0;
+ unsigned repStrLength = replacement->length();
+ size_t srcSegmentStart = 0;
+ unsigned matchCount = 0;
// Count the matches
- while ((srcSegmentStart = find(pattern, srcSegmentStart)) >= 0) {
+ while ((srcSegmentStart = find(pattern, srcSegmentStart)) != notFound) {
++matchCount;
srcSegmentStart += patternLength;
}
@@ -785,12 +860,12 @@ PassRefPtr<StringImpl> StringImpl::replace(StringImpl* pattern, StringImpl* repl
createUninitialized(m_length + matchCount * (repStrLength - patternLength), data);
// Construct the new data
- int srcSegmentEnd;
- int srcSegmentLength;
+ size_t srcSegmentEnd;
+ unsigned srcSegmentLength;
srcSegmentStart = 0;
- int dstOffset = 0;
+ unsigned dstOffset = 0;
- while ((srcSegmentEnd = find(pattern, srcSegmentStart)) >= 0) {
+ while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) {
srcSegmentLength = srcSegmentEnd - srcSegmentStart;
memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
dstOffset += srcSegmentLength;
@@ -802,7 +877,7 @@ PassRefPtr<StringImpl> StringImpl::replace(StringImpl* pattern, StringImpl* repl
srcSegmentLength = m_length - srcSegmentStart;
memcpy(data + dstOffset, m_data + srcSegmentStart, srcSegmentLength * sizeof(UChar));
- ASSERT(dstOffset + srcSegmentLength == static_cast<int>(newImpl->length()));
+ ASSERT(dstOffset + srcSegmentLength == newImpl->length());
return newImpl;
}
@@ -883,20 +958,6 @@ bool equalIgnoringNullity(StringImpl* a, StringImpl* b)
return false;
}
-Vector<char> StringImpl::ascii()
-{
- Vector<char> buffer(m_length + 1);
- for (unsigned i = 0; i != m_length; ++i) {
- UChar c = m_data[i];
- if ((c >= 0x20 && c < 0x7F) || c == 0x00)
- buffer[i] = static_cast<char>(c);
- else
- buffer[i] = '?';
- }
- buffer[m_length] = '\0';
- return buffer;
-}
-
WTF::Unicode::Direction StringImpl::defaultWritingDirection()
{
for (unsigned i = 0; i < m_length; ++i) {
diff --git a/JavaScriptCore/wtf/text/StringImpl.h b/JavaScriptCore/wtf/text/StringImpl.h
index 6080474..cec0b80 100644
--- a/JavaScriptCore/wtf/text/StringImpl.h
+++ b/JavaScriptCore/wtf/text/StringImpl.h
@@ -290,15 +290,18 @@ public:
PassRefPtr<StringImpl> removeCharacters(CharacterMatchFunctionPtr);
- int find(const char*, int index = 0, bool caseSensitive = true);
- int find(UChar, int index = 0);
- int find(CharacterMatchFunctionPtr, int index = 0);
- int find(StringImpl*, int index, bool caseSensitive = true);
-
- int reverseFind(UChar, int index);
- int reverseFind(StringImpl*, int index, bool caseSensitive = true);
-
- bool startsWith(StringImpl* str, bool caseSensitive = true) { return reverseFind(str, 0, caseSensitive) == 0; }
+ size_t find(UChar, unsigned index = 0);
+ size_t find(CharacterMatchFunctionPtr, unsigned index = 0);
+ size_t find(const char*, unsigned index = 0);
+ size_t find(StringImpl*, unsigned index = 0);
+ size_t findIgnoringCase(const char*, unsigned index = 0);
+ size_t findIgnoringCase(StringImpl*, unsigned index = 0);
+
+ size_t reverseFind(UChar, unsigned index = UINT_MAX);
+ size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
+ size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX);
+
+ bool startsWith(StringImpl* str, bool caseSensitive = true) { return (caseSensitive ? reverseFind(str, 0) : reverseFindIgnoringCase(str, 0)) == 0; }
bool endsWith(StringImpl*, bool caseSensitive = true);
PassRefPtr<StringImpl> replace(UChar, UChar);
@@ -306,8 +309,6 @@ public:
PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
- Vector<char> ascii();
-
WTF::Unicode::Direction defaultWritingDirection();
#if PLATFORM(CF)
diff --git a/JavaScriptCore/wtf/text/WTFString.cpp b/JavaScriptCore/wtf/text/WTFString.cpp
index 6c4de6e..7d44d21 100644
--- a/JavaScriptCore/wtf/text/WTFString.cpp
+++ b/JavaScriptCore/wtf/text/WTFString.cpp
@@ -36,6 +36,13 @@ namespace WTF {
using namespace Unicode;
+// Construct a string with UTF-16 data.
+String::String(const UChar* characters, unsigned length)
+ : m_impl(characters ? StringImpl::create(characters, length) : 0)
+{
+}
+
+// Construct a string with UTF-16 data, from a null-terminated source.
String::String(const UChar* str)
{
if (!str)
@@ -48,6 +55,18 @@ String::String(const UChar* str)
m_impl = StringImpl::create(str, len);
}
+// Construct a string with latin1 data.
+String::String(const char* characters, unsigned length)
+ : m_impl(characters ? StringImpl::create(characters, length) : 0)
+{
+}
+
+// Construct a string with latin1 data, from a null-terminated source.
+String::String(const char* characters)
+ : m_impl(characters ? StringImpl::create(characters) : 0)
+{
+}
+
void String::append(const String& str)
{
if (str.isEmpty())
@@ -226,6 +245,19 @@ String String::substring(unsigned pos, unsigned len) const
return m_impl->substring(pos, len);
}
+String String::substringSharingImpl(unsigned offset, unsigned length) const
+{
+ // FIXME: We used to check against a limit of Heap::minExtraCost / sizeof(UChar).
+
+ unsigned stringLength = this->length();
+ offset = min(offset, stringLength);
+ length = min(length, stringLength - offset);
+
+ if (!offset && length == stringLength)
+ return *this;
+ return String(StringImpl::create(m_impl, offset, length));
+}
+
String String::lower() const
{
if (!m_impl)
@@ -557,14 +589,14 @@ void String::split(const String& separator, bool allowEmptyEntries, Vector<Strin
{
result.clear();
- int startPos = 0;
- int endPos;
- while ((endPos = find(separator, startPos)) != -1) {
+ unsigned startPos = 0;
+ size_t endPos;
+ while ((endPos = find(separator, startPos)) != notFound) {
if (allowEmptyEntries || startPos != endPos)
result.append(substring(startPos, endPos - startPos));
startPos = endPos + separator.length();
}
- if (allowEmptyEntries || startPos != static_cast<int>(length()))
+ if (allowEmptyEntries || startPos != length())
result.append(substring(startPos));
}
@@ -577,14 +609,14 @@ void String::split(UChar separator, bool allowEmptyEntries, Vector<String>& resu
{
result.clear();
- int startPos = 0;
- int endPos;
- while ((endPos = find(separator, startPos)) != -1) {
+ unsigned startPos = 0;
+ size_t endPos;
+ while ((endPos = find(separator, startPos)) != notFound) {
if (allowEmptyEntries || startPos != endPos)
result.append(substring(startPos, endPos - startPos));
startPos = endPos + 1;
}
- if (allowEmptyEntries || startPos != static_cast<int>(length()))
+ if (allowEmptyEntries || startPos != length())
result.append(substring(startPos));
}
@@ -593,18 +625,23 @@ void String::split(UChar separator, Vector<String>& result) const
return split(String(&separator, 1), false, result);
}
-Vector<char> String::ascii() const
+CString String::ascii() const
{
- if (m_impl)
- return m_impl->ascii();
-
- const char* nullMsg = "(null impl)";
- Vector<char, 2048> buffer;
- for (int i = 0; nullMsg[i]; ++i)
- buffer.append(nullMsg[i]);
-
- buffer.append('\0');
- return buffer;
+ // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
+ // preserved, characters outside of this range are converted to '?'.
+
+ unsigned length = this->length();
+ const UChar* characters = this->characters();
+
+ char* characterBuffer;
+ CString result = CString::newUninitialized(length, characterBuffer);
+
+ for (unsigned i = 0; i < length; ++i) {
+ UChar ch = characters[i];
+ characterBuffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch;
+ }
+
+ return result;
}
CString String::latin1() const
@@ -620,7 +657,7 @@ CString String::latin1() const
for (unsigned i = 0; i < length; ++i) {
UChar ch = characters[i];
- characterBuffer[i] = ch > 255 ? '?' : ch;
+ characterBuffer[i] = ch > 0xff ? '?' : ch;
}
return result;
@@ -635,7 +672,7 @@ static inline void putUTF8Triple(char*& buffer, UChar ch)
*buffer++ = static_cast<char>((ch & 0x3F) | 0x80);
}
-CString String::utf8() const
+CString String::utf8(bool strict) const
{
unsigned length = this->length();
const UChar* characters = this->characters();
@@ -653,15 +690,21 @@ CString String::utf8() const
Vector<char, 1024> bufferVector(length * 3);
char* buffer = bufferVector.data();
- ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), false);
- ASSERT(result != sourceIllegal); // Only produced from strict conversion.
+ ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), strict);
ASSERT(result != targetExhausted); // (length * 3) should be sufficient for any conversion
- // If a high surrogate is left unconverted, treat it the same was as an unpaired high surrogate
- // would have been handled in the middle of a string with non-strict conversion - which is to say,
- // simply encode it to UTF-8.
+ // Only produced from strict conversion.
+ if (result == sourceIllegal)
+ return CString();
+
+ // Check for an unconverted high surrogate.
if (result == sourceExhausted) {
- // This should be one unpaired high surrogate.
+ if (strict)
+ return CString();
+ // This should be one unpaired high surrogate. Treat it the same
+ // was as an unpaired high surrogate would have been handled in
+ // the middle of a string with non-strict conversion - which is
+ // to say, simply encode it to UTF-8.
ASSERT((characters + 1) == (this->characters() + length));
ASSERT((*characters >= 0xD800) && (*characters <= 0xDBFF));
// There should be room left, since one UChar hasn't been converted.
diff --git a/JavaScriptCore/wtf/text/WTFString.h b/JavaScriptCore/wtf/text/WTFString.h
index 6af519c..fafef12 100644
--- a/JavaScriptCore/wtf/text/WTFString.h
+++ b/JavaScriptCore/wtf/text/WTFString.h
@@ -1,6 +1,6 @@
/*
* (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -72,45 +72,43 @@ intptr_t charactersToIntPtr(const UChar*, size_t, bool* ok = 0); // ignores trai
double charactersToDouble(const UChar*, size_t, bool* ok = 0);
float charactersToFloat(const UChar*, size_t, bool* ok = 0);
-int find(const UChar*, size_t, UChar, int startPosition = 0);
-int reverseFind(const UChar*, size_t, UChar, int startPosition = -1);
-
class String {
public:
- String() { } // gives null string, distinguishable from an empty string
- String(const UChar* str, unsigned len)
- {
- if (!str)
- return;
- m_impl = StringImpl::create(str, len);
- }
- String(const char* str)
- {
- if (!str)
- return;
- m_impl = StringImpl::create(str);
- }
- String(const char* str, unsigned length)
- {
- if (!str)
- return;
- m_impl = StringImpl::create(str, length);
- }
- String(const UChar*); // Specifically for null terminated UTF-16
- String(StringImpl* i) : m_impl(i) { }
- String(PassRefPtr<StringImpl> i) : m_impl(i) { }
- String(RefPtr<StringImpl> i) : m_impl(i) { }
+ // Construct a null string, distinguishable from an empty string.
+ String() { }
- void swap(String& o) { m_impl.swap(o.m_impl); }
+ // Construct a string with UTF-16 data.
+ String(const UChar* characters, unsigned length);
- // Hash table deleted values, which are only constructed and never copied or destroyed.
- String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
- bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
+ // Construct a string with UTF-16 data, from a null-terminated source.
+ String(const UChar*);
+
+ // Construct a string with latin1 data.
+ String(const char* characters, unsigned length);
+
+ // Construct a string with latin1 data, from a null-terminated source.
+ String(const char* characters);
+
+ // Construct a string referencing an existing StringImpl.
+ String(StringImpl* impl) : m_impl(impl) { }
+ String(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
+ String(RefPtr<StringImpl> impl) : m_impl(impl) { }
+
+ // Inline the destructor.
+ ALWAYS_INLINE ~String() { }
+
+ void swap(String& o) { m_impl.swap(o.m_impl); }
static String adopt(StringBuffer& buffer) { return StringImpl::adopt(buffer); }
- static String adopt(Vector<UChar>& vector) { return StringImpl::adopt(vector); }
+ template<size_t inlineCapacity>
+ static String adopt(Vector<UChar, inlineCapacity>& vector) { return StringImpl::adopt(vector); }
- ALWAYS_INLINE unsigned length() const
+ bool isNull() const { return !m_impl; }
+ bool isEmpty() const { return !m_impl || !m_impl->length(); }
+
+ StringImpl* impl() const { return m_impl.get(); }
+
+ unsigned length() const
{
if (!m_impl)
return 0;
@@ -124,34 +122,67 @@ public:
return m_impl->characters();
}
- const UChar* charactersWithNullTermination();
-
- UChar operator[](unsigned i) const // if i >= length(), returns 0
+ CString ascii() const;
+ CString latin1() const;
+ CString utf8(bool strict = false) const;
+
+ UChar operator[](unsigned index) const
{
- if (!m_impl || i >= m_impl->length())
+ if (!m_impl || index >= m_impl->length())
return 0;
- return m_impl->characters()[i];
+ return m_impl->characters()[index];
}
- UChar32 characterStartingAt(unsigned) const; // Ditto.
+
+ static String number(short);
+ static String number(unsigned short);
+ static String number(int);
+ static String number(unsigned);
+ static String number(long);
+ static String number(unsigned long);
+ static String number(long long);
+ static String number(unsigned long long);
+ static String number(double);
+
+ // Find a single character or string, also with match function & latin1 forms.
+ size_t find(UChar c, unsigned start = 0) const
+ { return m_impl ? m_impl->find(c, start) : notFound; }
+ size_t find(const String& str, unsigned start = 0) const
+ { return m_impl ? m_impl->find(str.impl(), start) : notFound; }
+ size_t find(CharacterMatchFunctionPtr matchFunction, unsigned start = 0) const
+ { return m_impl ? m_impl->find(matchFunction, start) : notFound; }
+ size_t find(const char* str, unsigned start = 0) const
+ { return m_impl ? m_impl->find(str, start) : notFound; }
+
+ // Find the last instance of a single character or string.
+ size_t reverseFind(UChar c, unsigned start = UINT_MAX) const
+ { return m_impl ? m_impl->reverseFind(c, start) : notFound; }
+ size_t reverseFind(const String& str, unsigned start = UINT_MAX) const
+ { return m_impl ? m_impl->reverseFind(str.impl(), start) : notFound; }
+
+ // Case insensitive string matching.
+ size_t findIgnoringCase(const char* str, unsigned start = 0) const
+ { return m_impl ? m_impl->findIgnoringCase(str, start) : notFound; }
+ size_t findIgnoringCase(const String& str, unsigned start = 0) const
+ { return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : notFound; }
+ size_t reverseFindIgnoringCase(const String& str, unsigned start = UINT_MAX) const
+ { return m_impl ? m_impl->reverseFindIgnoringCase(str.impl(), start) : notFound; }
+
+ // Wrappers for find & reverseFind adding dynamic sensitivity check.
+ size_t find(const char* str, unsigned start, bool caseSensitive) const
+ { return caseSensitive ? find(str, start) : findIgnoringCase(str, start); }
+ size_t find(const String& str, unsigned start, bool caseSensitive) const
+ { return caseSensitive ? find(str, start) : findIgnoringCase(str, start); }
+ size_t reverseFind(const String& str, unsigned start, bool caseSensitive) const
+ { return caseSensitive ? reverseFind(str, start) : reverseFindIgnoringCase(str, start); }
+
+ const UChar* charactersWithNullTermination();
- bool contains(UChar c) const { return find(c) != -1; }
- bool contains(const char* str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != -1; }
- bool contains(const String& str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != -1; }
-
- int find(UChar c, int start = 0) const
- { return m_impl ? m_impl->find(c, start) : -1; }
- int find(CharacterMatchFunctionPtr matchFunction, int start = 0) const
- { return m_impl ? m_impl->find(matchFunction, start) : -1; }
- int find(const char* str, int start = 0, bool caseSensitive = true) const
- { return m_impl ? m_impl->find(str, start, caseSensitive) : -1; }
- int find(const String& str, int start = 0, bool caseSensitive = true) const
- { return m_impl ? m_impl->find(str.impl(), start, caseSensitive) : -1; }
-
- int reverseFind(UChar c, int start = -1) const
- { return m_impl ? m_impl->reverseFind(c, start) : -1; }
- int reverseFind(const String& str, int start = -1, bool caseSensitive = true) const
- { return m_impl ? m_impl->reverseFind(str.impl(), start, caseSensitive) : -1; }
+ UChar32 characterStartingAt(unsigned) const; // Ditto.
+ bool contains(UChar c) const { return find(c) != notFound; }
+ bool contains(const char* str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != notFound; }
+ bool contains(const String& str, bool caseSensitive = true) const { return find(str, 0, caseSensitive) != notFound; }
+
bool startsWith(const String& s, bool caseSensitive = true) const
{ return m_impl ? m_impl->startsWith(s.impl(), caseSensitive) : s.isEmpty(); }
bool endsWith(const String& s, bool caseSensitive = true) const
@@ -177,6 +208,7 @@ public:
void remove(unsigned pos, int len = 1);
String substring(unsigned pos, unsigned len = UINT_MAX) const;
+ String substringSharingImpl(unsigned pos, unsigned len = UINT_MAX) const;
String left(unsigned len) const { return substring(0, len); }
String right(unsigned len) const { return substring(length() - len, len); }
@@ -192,17 +224,11 @@ public:
// Return the string with case folded for case insensitive comparison.
String foldCase() const;
- static String number(short);
- static String number(unsigned short);
- static String number(int);
- static String number(unsigned);
- static String number(long);
- static String number(unsigned long);
- static String number(long long);
- static String number(unsigned long long);
- static String number(double);
-
+#if !PLATFORM(QT)
static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
+#else
+ static String format(const char *, ...);
+#endif
// Returns an uninitialized string. The characters needs to be written
// into the buffer returned in data before the returned string is used.
@@ -238,11 +264,6 @@ public:
// to ever prefer copy() over plain old assignment.
String threadsafeCopy() const;
- bool isNull() const { return !m_impl; }
- ALWAYS_INLINE bool isEmpty() const { return !m_impl || !m_impl->length(); }
-
- StringImpl* impl() const { return m_impl.get(); }
-
#if PLATFORM(CF)
String(CFStringRef);
CFStringRef createCFString() const;
@@ -272,11 +293,6 @@ public:
operator BString() const;
#endif
- Vector<char> ascii() const;
-
- CString latin1() const;
- CString utf8() const;
-
static String fromUTF8(const char*, size_t);
static String fromUTF8(const char*);
@@ -288,6 +304,10 @@ public:
bool containsOnlyASCII() const { return charactersAreAllASCII(characters(), length()); }
+ // Hash table deleted values, which are only constructed and never copied or destroyed.
+ String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
+ bool isHashTableDeletedValue() const { return m_impl.isHashTableDeletedValue(); }
+
private:
RefPtr<StringImpl> m_impl;
};
@@ -345,43 +365,37 @@ inline bool charactersAreAllASCII(const UChar* characters, size_t length)
int codePointCompare(const String&, const String&);
-inline int find(const UChar* characters, size_t length, UChar character, int startPosition)
+inline size_t find(const UChar* characters, unsigned length, UChar matchCharacter, unsigned index = 0)
{
- if (startPosition >= static_cast<int>(length))
- return -1;
- for (size_t i = startPosition; i < length; ++i) {
- if (characters[i] == character)
- return static_cast<int>(i);
+ while (index < length) {
+ if (characters[index] == matchCharacter)
+ return index;
+ ++index;
}
- return -1;
+ return notFound;
}
-inline int find(const UChar* characters, size_t length, CharacterMatchFunctionPtr matchFunction, int startPosition)
+inline size_t find(const UChar* characters, unsigned length, CharacterMatchFunctionPtr matchFunction, unsigned index = 0)
{
- if (startPosition >= static_cast<int>(length))
- return -1;
- for (size_t i = startPosition; i < length; ++i) {
- if (matchFunction(characters[i]))
- return static_cast<int>(i);
+ while (index < length) {
+ if (matchFunction(characters[index]))
+ return index;
+ ++index;
}
- return -1;
+ return notFound;
}
-inline int reverseFind(const UChar* characters, size_t length, UChar character, int startPosition)
+inline size_t reverseFind(const UChar* characters, unsigned length, UChar matchCharacter, unsigned index = UINT_MAX)
{
- if (startPosition >= static_cast<int>(length) || !length)
- return -1;
- if (startPosition < 0)
- startPosition += static_cast<int>(length);
- while (true) {
- if (characters[startPosition] == character)
- return startPosition;
- if (!startPosition)
- return -1;
- startPosition--;
+ if (!length)
+ return notFound;
+ if (index >= length)
+ index = length - 1;
+ while (characters[index] != matchCharacter) {
+ if (!index--)
+ return notFound;
}
- ASSERT_NOT_REACHED();
- return -1;
+ return index;
}
inline void append(Vector<UChar>& vector, const String& string)
@@ -417,6 +431,11 @@ template<> struct DefaultHash<String> {
typedef StringHash Hash;
};
+template <> struct VectorTraits<String> : SimpleClassVectorTraits
+{
+ static const bool canInitializeWithMemset = true;
+};
+
}
using WTF::CString;
@@ -433,6 +452,5 @@ using WTF::charactersAreAllASCII;
using WTF::charactersToInt;
using WTF::charactersToFloat;
using WTF::charactersToDouble;
-using WTF::operator+;
#endif
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index 5a53ced..4c21547 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -1416,6 +1416,9 @@ class RegexGenerator : private MacroAssembler {
push(ARMRegisters::r4);
push(ARMRegisters::r5);
push(ARMRegisters::r6);
+#if CPU(ARM_TRADITIONAL)
+ push(ARMRegisters::r8); // scratch register
+#endif
move(ARMRegisters::r3, output);
#elif CPU(MIPS)
// Do nothing.
@@ -1433,6 +1436,9 @@ class RegexGenerator : private MacroAssembler {
pop(X86Registers::ebx);
pop(X86Registers::ebp);
#elif CPU(ARM)
+#if CPU(ARM_TRADITIONAL)
+ pop(ARMRegisters::r8); // scratch register
+#endif
pop(ARMRegisters::r6);
pop(ARMRegisters::r5);
pop(ARMRegisters::r4);
@@ -1511,7 +1517,7 @@ void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const
JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine;
- jitObject.setFallback(jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.data()), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error));
+ jitObject.setFallback(jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.characters()), patternString.length(), ignoreCaseOption, multilineOption, &numSubpatterns, &error));
}
}}
diff --git a/JavaScriptCore/yarr/RegexParser.h b/JavaScriptCore/yarr/RegexParser.h
index c946c2e..8a5eeba 100644
--- a/JavaScriptCore/yarr/RegexParser.h
+++ b/JavaScriptCore/yarr/RegexParser.h
@@ -193,8 +193,8 @@ private:
: m_delegate(delegate)
, m_backReferenceLimit(backReferenceLimit)
, m_err(NoError)
- , m_data(pattern.data())
- , m_size(pattern.size())
+ , m_data(pattern.characters())
+ , m_size(pattern.length())
, m_index(0)
, m_parenthesesNestingDepth(0)
{
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index 9301542..3b56156 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamps by Darin Adler & Sam Weinig.
+
+ Bug 43867 - Some UString cleanup
+
+ Change JSC::UString data(), size(), and from(), to characters(), length(), and number() to match WTF::String.
+ Move string concatenation methods to a new header to simplify down UString.h. Remove is8Bit().
+
+ * JSUtils.cpp:
+ (UStringToCFString):
+ (KJSValueToCFTypeInternal):
+ * JavaScriptGlue.xcodeproj/project.pbxproj:
+
2010-08-04 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
diff --git a/JavaScriptGlue/JSUtils.cpp b/JavaScriptGlue/JSUtils.cpp
index b83ac52..5c85475 100644
--- a/JavaScriptGlue/JSUtils.cpp
+++ b/JavaScriptGlue/JSUtils.cpp
@@ -74,7 +74,7 @@ UString CFStringToUString(CFStringRef inCFString)
// Caller is responsible for releasing the returned CFStringRef
CFStringRef UStringToCFString(const UString& inUString)
{
- return CFStringCreateWithCharacters(0, (const UniChar*)inUString.data(), inUString.size());
+ return CFStringCreateWithCharacters(0, (const UniChar*)inUString.characters(), inUString.length());
}
@@ -284,8 +284,8 @@ CFTypeRef KJSValueToCFTypeInternal(JSValue inValue, ExecState *exec, ObjectImpLi
{
Identifier propName = *iter;
UString ustr = propName.ustring();
- const UniChar* uniChars = (const UniChar*)ustr.data();
- int size = ustr.size();
+ const UniChar* uniChars = (const UniChar*)ustr.characters();
+ int size = ustr.length();
while (size--) {
if (uniChars[size] < '0' || uniChars[size] > '9') {
isArray = false;
diff --git a/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj b/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
index f33bf97..cec8b14 100644
--- a/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
+++ b/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
@@ -287,7 +287,14 @@
isa = PBXProject;
buildConfigurationList = 14AC662B08CE7791006915A8 /* Build configuration list for PBXProject "JavaScriptGlue" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 0867D691FE84028FC02AAC07 /* JavaScriptGlue */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
diff --git a/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt
new file mode 100644
index 0000000..f2e7f90
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash-expected.txt
@@ -0,0 +1 @@
+TEST COMPLETE
diff --git a/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html
new file mode 100644
index 0000000..bf492ec
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/clear-watch-invalid-id-crash.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt
new file mode 100644
index 0000000..137f495
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests-expected.txt
@@ -0,0 +1,11 @@
+Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is allowed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Success callback invoked
+PASS Success callback invoked
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html
new file mode 100644
index 0000000..421a026
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/delayed-permission-allowed-for-multiple-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt
new file mode 100644
index 0000000..8ede03c
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests-expected.txt
@@ -0,0 +1,13 @@
+Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is denied.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+PASS error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html
new file mode 100644
index 0000000..2143094
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/delayed-permission-denied-for-multiple-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt
new file mode 100644
index 0000000..12699cc
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already-expected.txt
@@ -0,0 +1,10 @@
+Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Method called on Geolocation object with disconnected Frame.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html
new file mode 100644
index 0000000..6c7a7e9
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/disconnected-frame-already.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt b/LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt
new file mode 100644
index 0000000..33c17d3
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-expected.txt
@@ -0,0 +1,12 @@
+frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)
+Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS error.code is 2
+PASS error.message is "Geolocation cannot be used in frameless documents"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt
new file mode 100644
index 0000000..74c0521
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied-expected.txt
@@ -0,0 +1,16 @@
+frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)
+Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_DENIED.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+
+PASS error.code is error.PERMISSION_DENIED
+PASS error.message is "User denied Geolocation"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html
new file mode 100644
index 0000000..d9b51c1
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/disconnected-frame-permission-denied.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/disconnected-frame.html b/LayoutTests/fast/dom/Geolocation/disconnected-frame.html
new file mode 100644
index 0000000..b91eade
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/disconnected-frame.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/disconnected-frame.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt b/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt
new file mode 100644
index 0000000..66cbe1b
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt
@@ -0,0 +1,16 @@
+Tests that pages that use Geolocation are not put in the page cache.
+
+Currently, Geolocation does not work with the page cache so pages that use Geolocation are explicitly prevented from entering the cache. This test checks for accidental enabling of the page Cache for Geolocation. See https://bugs.webkit.org/show_bug.cgi?id=43956 for details.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Main page opening resources/cached-page-1.html
+resources/cached-page-1.html fired, count = 1
+resources/cached-page-1.html about to navigate to resources/cached-page-2.html
+resources/cached-page-2.html about to go back to resources/cached-page-1.html
+resources/cached-page-1.html fired, count = 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/no-page-cache.html b/LayoutTests/fast/dom/Geolocation/no-page-cache.html
new file mode 100644
index 0000000..36975b4
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/no-page-cache.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/no-page-cache.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html b/LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html
new file mode 100644
index 0000000..f7ec397
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html
@@ -0,0 +1,11 @@
+<script>
+function loadNext() {
+ var geolocation = navigator.geolocation;
+ if (window.opener.reportPageOneOnload() == 1) {
+ window.opener.debug('resources/cached-page-1.html about to navigate to resources/cached-page-2.html')
+ // Location changes need to happen outside the onload handler to generate history entries.
+ setTimeout(function() {location.href = 'cached-page-2.html';}, 0);
+ }
+}
+</script>
+<body onload="loadNext()"></body>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html b/LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html
new file mode 100644
index 0000000..5478f9c
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/cached-page-2.html
@@ -0,0 +1,8 @@
+<script>
+function init() {
+ window.opener.pageTwoLoaded = true;
+ window.opener.debug('resources/cached-page-2.html about to go back to resources/cached-page-1.html');
+ history.back();
+}
+</script>
+<body onload="init()"></body>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html
new file mode 100644
index 0000000..2cb7e80
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner1.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onFirstIframeLoaded()">
+ <p>This frame should be replaced before the test ends</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html
new file mode 100644
index 0000000..fb48795
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-already-inner2.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onSecondIframeLoaded()">
+ <p>This frame should be visible when the test completes</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html
new file mode 100644
index 0000000..4819351
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/disconnected-frame-inner.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onIframeLoaded()", onunload="window.parent.onIframeUnloaded();">
+ <p>This frame should be replaced before the test ends</p>
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
new file mode 100644
index 0000000..6176da0
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js
@@ -0,0 +1,14 @@
+description("Tests for a crash when clearWatch() is called with a zero ID.<br><br>We call clearWatch() with a request in progress then navigate the page. This accesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes.");
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+} else
+ debug('This test can not be run without the LayoutTestController');
+
+navigator.geolocation.watchPosition(function() {});
+navigator.geolocation.clearWatch(0);
+location = "data:text/html,TEST COMPLETE<script>layoutTestController.notifyDone();</script>";
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js
new file mode 100644
index 0000000..8b02a82
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js
@@ -0,0 +1,51 @@
+description("Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is allowed.");
+
+if (window.layoutTestController)
+ window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+
+function allowPermission() {
+ permissionSet = true;
+ if (window.layoutTestController)
+ layoutTestController.setGeolocationPermission(true);
+}
+
+var watchCallbackInvoked = false;
+var oneShotCallbackInvoked = false;
+
+navigator.geolocation.watchPosition(function() {
+ if (permissionSet) {
+ testPassed('Success callback invoked');
+ watchCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(err) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+navigator.geolocation.getCurrentPosition(function() {
+ if (permissionSet) {
+ testPassed('Success callback invoked');
+ oneShotCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(err) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+window.setTimeout(allowPermission, 100);
+
+function maybeFinishTest() {
+ if (watchCallbackInvoked && oneShotCallbackInvoked)
+ finishJSTest();
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js
new file mode 100644
index 0000000..f230091
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js
@@ -0,0 +1,55 @@
+description("Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is denied.");
+
+if (window.layoutTestController)
+ window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+
+function denyPermission() {
+ permissionSet = true;
+ if (window.layoutTestController)
+ layoutTestController.setGeolocationPermission(false);
+}
+
+var watchCallbackInvoked = false;
+var oneShotCallbackInvoked = false;
+var error;
+
+navigator.geolocation.watchPosition(function() {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ if (permissionSet) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ watchCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+
+navigator.geolocation.getCurrentPosition(function() {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+}, function(e) {
+ if (permissionSet) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ oneShotCallbackInvoked = true;
+ maybeFinishTest();
+ return;
+ }
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+});
+window.setTimeout(denyPermission, 100);
+
+function maybeFinishTest() {
+ if (watchCallbackInvoked && oneShotCallbackInvoked)
+ finishJSTest();
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
new file mode 100644
index 0000000..b217641
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js
@@ -0,0 +1,35 @@
+description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs.");
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+}
+
+function onFirstIframeLoaded() {
+ iframeGeolocation = iframe.contentWindow.navigator.geolocation;
+ iframe.src = 'resources/disconnected-frame-already-inner2.html';
+}
+
+var error;
+function onSecondIframeLoaded() {
+ iframeGeolocation.getCurrentPosition(function () {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+ });
+ setTimeout(finishTest, 1000);
+}
+
+function finishTest() {
+ debug('Method called on Geolocation object with disconnected Frame.');
+ finishJSTest();
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/disconnected-frame-already-inner1.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js
new file mode 100644
index 0000000..a3f9eca
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js
@@ -0,0 +1,45 @@
+description("Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_DENIED.");
+
+// Prime the Geolocation instance by denying permission. This makes sure that we execute the
+// same code path for both preemptive and non-preemtive permissions policies.
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(false);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+} else
+ debug('This test can not be run without the LayoutTestController');
+
+var error;
+function onIframeLoaded() {
+ iframeGeolocation = iframe.contentWindow.navigator.geolocation;
+ iframeGeolocation.getCurrentPosition(function() {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ debug('');
+ iframe.src = 'data:text/html,This frame should be visible when the test completes';
+ });
+}
+
+function onIframeUnloaded() {
+ // Make another request, with permission already denied.
+ iframeGeolocation.getCurrentPosition(function () {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ debug('');
+ finishJSTest();
+ });
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/disconnected-frame-inner.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js
new file mode 100644
index 0000000..50d377a
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js
@@ -0,0 +1,31 @@
+description("Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message.");
+
+if (window.layoutTestController) {
+ layoutTestController.setGeolocationPermission(true);
+ layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100);
+}
+
+function onIframeLoaded() {
+ iframeGeolocation = iframe.contentWindow.navigator.geolocation;
+ iframe.src = 'data:text/html,This frame should be visible when the test completes';
+}
+
+var error;
+function onIframeUnloaded() {
+ iframeGeolocation.getCurrentPosition(function () {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', '2');
+ shouldBe('error.message', '"Geolocation cannot be used in frameless documents"');
+ finishJSTest();
+ });
+}
+
+var iframe = document.createElement('iframe');
+iframe.src = 'resources/disconnected-frame-inner.html';
+document.body.appendChild(iframe);
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js b/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js
new file mode 100644
index 0000000..76afbce
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js
@@ -0,0 +1,24 @@
+description("Tests that pages that use Geolocation are not put in the page cache.<br><br>Currently, Geolocation does not work with the page cache so pages that use Geolocation are explicitly prevented from entering the cache. This test checks for accidental enabling of the page Cache for Geolocation. See https://bugs.webkit.org/show_bug.cgi?id=43956 for details.");
+
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.setCanOpenWindows();
+ layoutTestController.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+} else
+ debug('This test can not be run without the LayoutTestController');
+
+var pageOneOnloadCount = 0;
+function reportPageOneOnload() {
+ ++pageOneOnloadCount;
+ debug('resources/cached-page-1.html fired, count = ' + pageOneOnloadCount);
+ if (pageOneOnloadCount == 2) {
+ finishJSTest();
+ }
+ return pageOneOnloadCount;
+}
+
+debug("Main page opening resources/cached-page-1.html");
+window.open("resources/cached-page-1.html");
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
index 4f789f6..8109bd0 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
@@ -3,7 +3,7 @@ description("Tests that no timers will trigger for navigator.geolocation object
if (window.layoutTestController) layoutTestController.setGeolocationPermission(true);
document.body.onload = function() {
- location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.layoutTestController) layoutTestController.notifyDone();', 100);</" + "script>";
+ location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.layoutTestController) layoutTestController.notifyDone();', 100);</script>";
}
document.body.onunload = function() {
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index bd93563..94ed500 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -261,7 +261,6 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/html/%.cpp : $(intermediates)/htm
GEN := \
$(intermediates)/html/canvas/JSArrayBuffer.h \
$(intermediates)/html/canvas/JSCanvasGradient.h \
- $(intermediates)/html/canvas/JSCanvasNumberArray.h \
$(intermediates)/html/canvas/JSCanvasPattern.h \
$(intermediates)/html/canvas/JSCanvasRenderingContext.h \
$(intermediates)/html/canvas/JSCanvasRenderingContext2D.h \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 532d343..d1d737b 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -245,7 +245,6 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
GEN := \
$(intermediates)/bindings/V8ArrayBuffer.h \
$(intermediates)/bindings/V8CanvasGradient.h \
- $(intermediates)/bindings/V8CanvasNumberArray.h \
$(intermediates)/bindings/V8CanvasPattern.h \
$(intermediates)/bindings/V8CanvasPixelArray.h \
$(intermediates)/bindings/V8CanvasRenderingContext.h \
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index 20e9161..74e7350 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -70,7 +70,6 @@ LOCAL_SRC_FILES += \
bindings/js/JSCSSStyleDeclarationCustom.cpp \
bindings/js/JSCSSValueCustom.cpp \
bindings/js/JSCallbackData.cpp \
- bindings/js/JSCanvasNumberArrayCustom.cpp \
bindings/js/JSCanvasRenderingContext2DCustom.cpp \
bindings/js/JSCanvasRenderingContextCustom.cpp \
bindings/js/JSClipboardCustom.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 56f3055..b2ab7c5 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -264,7 +264,11 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
\
html/AsyncImageResizer.cpp \
html/Blob.cpp \
+<<<<<<< HEAD
html/BlobBuilder.cpp \
+=======
+ html/BlobURL.cpp \
+>>>>>>> WebKit at r65615
html/CollectionCache.cpp \
html/CSSPreloadScanner.cpp \
html/DOMFormData.cpp \
@@ -298,18 +302,22 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLParserScheduler.cpp \
html/HTMLTableRowsCollection.cpp \
html/HTMLViewSourceDocument.cpp \
+ html/HTMLViewSourceParser.cpp \
html/ImageData.cpp \
html/ImageResizerThread.cpp \
+<<<<<<< HEAD
html/LabelsNodeList.cpp \
html/LegacyHTMLTreeBuilder.cpp \
html/StepRange.cpp \
html/LegacyHTMLDocumentParser.cpp \
html/LegacyPreloadScanner.cpp \
+=======
+ html/ThreadableBlobRegistry.cpp \
+>>>>>>> WebKit at r65615
html/TimeRanges.cpp \
html/ValidityState.cpp \
\
html/canvas/CanvasGradient.cpp \
- html/canvas/CanvasNumberArray.cpp \
html/canvas/WebGLObject.cpp \
html/canvas/CanvasPattern.cpp \
html/canvas/CanvasPixelArray.cpp \
@@ -391,6 +399,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
page/FrameView.cpp \
page/Geolocation.cpp \
page/GeolocationPositionCache.cpp \
+ page/GroupSettings.cpp \
page/History.cpp \
page/Location.cpp \
page/MemoryInfo.cpp \
@@ -436,6 +445,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/DragData.cpp \
platform/DragImage.cpp \
platform/FileChooser.cpp \
+ platform/FileSystem.cpp \
platform/GeolocationService.cpp \
platform/KURL.cpp \
platform/KURLGoogle.cpp \
@@ -575,6 +585,8 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/mock/SpeechInputClientMock.cpp \
\
platform/network/AuthenticationChallengeBase.cpp \
+ platform/network/BlobData.cpp \
+ platform/network/BlobRegistryImpl.cpp \
platform/network/Credential.cpp \
platform/network/CredentialStorage.cpp \
platform/network/FormData.cpp \
@@ -755,6 +767,7 @@ ifeq ($(ENABLE_SVG), true)
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/SVGCharacterData.cpp \
rendering/SVGCharacterLayoutInfo.cpp \
+ rendering/SVGImageBufferTools.cpp \
rendering/SVGInlineFlowBox.cpp \
rendering/SVGInlineTextBox.cpp \
rendering/SVGMarkerLayoutInfo.cpp \
@@ -940,6 +953,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
svg/SVGNumberList.cpp \
svg/SVGPaint.cpp \
svg/SVGParserUtilities.cpp \
+ svg/SVGPathBlender.cpp \
svg/SVGPathBuilder.cpp \
svg/SVGPathByteStreamBuilder.cpp \
svg/SVGPathByteStreamSource.cpp \
@@ -962,6 +976,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
svg/SVGPathSegMoveto.cpp \
svg/SVGPathStringBuilder.cpp \
svg/SVGPathStringSource.cpp \
+ svg/SVGPathTraversalStateBuilder.cpp \
svg/SVGPatternElement.cpp \
svg/SVGPointList.cpp \
svg/SVGPolyElement.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 0d4625c..2940015 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -334,6 +334,17 @@ SET(WebCore_IDL_FILES
storage/Database.idl
storage/DatabaseCallback.idl
storage/DatabaseSync.idl
+ storage/DirectoryEntry.idl
+ storage/DirectoryReader.idl
+ storage/DOMFileSystem.idl
+ storage/EntriesCallback.idl
+ storage/Entry.idl
+ storage/EntryArray.idl
+ storage/EntryCallback.idl
+ storage/ErrorCallback.idl
+ storage/FileEntry.idl
+ storage/FileSystemCallback.idl
+ storage/Flags.idl
storage/IDBAny.idl
storage/IDBCursor.idl
storage/IDBDatabaseError.idl
@@ -349,6 +360,8 @@ SET(WebCore_IDL_FILES
storage/IDBRequest.idl
storage/IDBSuccessEvent.idl
storage/IDBTransaction.idl
+ storage/Metadata.idl
+ storage/MetadataCallback.idl
storage/SQLError.idl
storage/SQLException.idl
storage/SQLResultSet.idl
@@ -528,9 +541,8 @@ IF (ENABLE_SVG)
ENDIF()
SET(WebCore_SOURCES
- ${DERIVED_SOURCES_DIR}/CSSGrammar.cpp
${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp
- ${DERIVED_SOURCES_DIR}/HTMLEntityNames.cpp
+ ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp
${DERIVED_SOURCES_DIR}/HTMLNames.cpp
${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
${DERIVED_SOURCES_DIR}/MathMLElementFactory.cpp
@@ -538,7 +550,6 @@ SET(WebCore_SOURCES
${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
${DERIVED_SOURCES_DIR}/XMLNames.cpp
${DERIVED_SOURCES_DIR}/XMLNSNames.cpp
- ${DERIVED_SOURCES_DIR}/XPathGrammar.cpp
${DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.cpp
accessibility/AXObjectCache.cpp
@@ -931,6 +942,7 @@ SET(WebCore_SOURCES
html/AsyncImageResizer.cpp
html/Blob.cpp
html/BlobBuilder.cpp
+ html/BlobURL.cpp
html/CollectionCache.cpp
html/CSSPreloadScanner.cpp
html/DOMDataGridDataSource.cpp
@@ -971,6 +983,7 @@ SET(WebCore_SOURCES
html/HTMLDocument.cpp
html/HTMLElement.cpp
html/HTMLElementStack.cpp
+ html/HTMLEntitySearch.cpp
html/HTMLEmbedElement.cpp
html/HTMLFieldSetElement.cpp
html/HTMLFormattingElementList.cpp
@@ -1031,14 +1044,14 @@ SET(WebCore_SOURCES
html/HTMLTableSectionElement.cpp
html/HTMLTextAreaElement.cpp
html/HTMLTitleElement.cpp
- html/LegacyHTMLDocumentParser.cpp
html/HTMLUListElement.cpp
html/HTMLViewSourceDocument.cpp
+ html/HTMLViewSourceParser.cpp
html/ImageData.cpp
html/ImageResizerThread.cpp
html/LabelsNodeList.cpp
- html/LegacyPreloadScanner.cpp
html/StepRange.cpp
+ html/ThreadableBlobRegistry.cpp
html/ValidityState.cpp
html/canvas/CanvasGradient.cpp
html/canvas/CanvasPattern.cpp
@@ -1162,6 +1175,7 @@ SET(WebCore_SOURCES
page/Geolocation.cpp
page/GeolocationController.cpp
page/GeolocationPositionCache.cpp
+ page/GroupSettings.cpp
page/History.cpp
page/Location.cpp
page/MemoryInfo.cpp
@@ -1202,6 +1216,7 @@ SET(WebCore_SOURCES
platform/DragData.cpp
platform/DragImage.cpp
platform/FileChooser.cpp
+ platform/FileSystem.cpp
platform/GeolocationService.cpp
platform/KURL.cpp
platform/KillRingNone.cpp
@@ -1289,6 +1304,8 @@ SET(WebCore_SOURCES
platform/mock/GeolocationServiceMock.cpp
platform/network/AuthenticationChallengeBase.cpp
+ platform/network/BlobData.cpp
+ platform/network/BlobRegistryImpl.cpp
platform/network/Credential.cpp
platform/network/FormData.cpp
platform/network/FormDataBuilder.cpp
@@ -1301,13 +1318,6 @@ SET(WebCore_SOURCES
platform/network/ResourceRequestBase.cpp
platform/network/ResourceResponseBase.cpp
- platform/sql/SQLValue.cpp
- platform/sql/SQLiteAuthorizer.cpp
- platform/sql/SQLiteDatabase.cpp
- platform/sql/SQLiteFileSystem.cpp
- platform/sql/SQLiteStatement.cpp
- platform/sql/SQLiteTransaction.cpp
-
platform/text/Base64.cpp
platform/text/BidiContext.cpp
platform/text/LineEnding.cpp
@@ -1443,6 +1453,12 @@ SET(WebCore_SOURCES
storage/DatabaseTask.cpp
storage/DatabaseThread.cpp
storage/DatabaseTracker.cpp
+ storage/DirectoryEntry.cpp
+ storage/DirectoryReader.cpp
+ storage/DOMFileSystem.cpp
+ storage/Entry.cpp
+ storage/EntryArray.cpp
+ storage/FileEntry.cpp
storage/IDBAny.cpp
storage/IDBDatabase.cpp
storage/IDBDatabaseBackendImpl.cpp
@@ -1534,6 +1550,18 @@ SET(WebCore_SOURCES
xml/XSLTUnicodeSort.cpp
)
+
+IF (ENABLE_DATABASE)
+ LIST(APPEND WebCore_SOURCES
+ platform/sql/SQLValue.cpp
+ platform/sql/SQLiteAuthorizer.cpp
+ platform/sql/SQLiteDatabase.cpp
+ platform/sql/SQLiteFileSystem.cpp
+ platform/sql/SQLiteStatement.cpp
+ platform/sql/SQLiteTransaction.cpp
+ )
+ENDIF ()
+
IF (ENABLE_SVG)
LIST(APPEND WebCore_SOURCES
${DERIVED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
@@ -1579,6 +1607,7 @@ IF (ENABLE_SVG)
rendering/RenderSVGViewportContainer.cpp
rendering/SVGCharacterData.cpp
rendering/SVGCharacterLayoutInfo.cpp
+ rendering/SVGImageBufferTools.cpp
rendering/SVGInlineFlowBox.cpp
rendering/SVGInlineTextBox.cpp
rendering/SVGMarkerLayoutInfo.cpp
@@ -1676,6 +1705,7 @@ IF (ENABLE_SVG)
svg/SVGNumberList.cpp
svg/SVGPaint.cpp
svg/SVGParserUtilities.cpp
+ svg/SVGPathBlender.cpp
svg/SVGPathBuilder.cpp
svg/SVGPathByteStreamBuilder.cpp
svg/SVGPathByteStreamSource.cpp
@@ -1698,6 +1728,7 @@ IF (ENABLE_SVG)
svg/SVGPathSegMoveto.cpp
svg/SVGPathStringBuilder.cpp
svg/SVGPathStringSource.cpp
+ svg/SVGPathTraversalStateBuilder.cpp
svg/SVGPatternElement.cpp
svg/SVGPointList.cpp
svg/SVGPolyElement.cpp
@@ -1759,6 +1790,22 @@ IF (ENABLE_SVG)
)
ENDIF()
+IF (ENABLE_VIDEO)
+ LIST(APPEND WebCore_SOURCES
+ ${DERIVED_SOURCES_DIR}/JSTimeRanges.cpp
+ bindings/js/JSAudioConstructor.cpp
+ html/HTMLAudioElement.cpp
+ html/HTMLMediaElement.cpp
+ html/HTMLSourceElement.cpp
+ html/HTMLVideoElement.cpp
+ html/TimeRanges.cpp
+ platform/graphics/MediaPlayer.cpp
+ rendering/MediaControlElements.cpp
+ rendering/RenderMedia.cpp
+ rendering/RenderVideo.cpp
+ )
+ENDIF()
+
IF (ENABLE_WML)
LIST(APPEND WebCore_SOURCES
${DERIVED_SOURCES_DIR}/WMLElementFactory.cpp
@@ -1819,27 +1866,38 @@ GENERATE_INSPECTOR_FROM_IDL(inspector/Inspector.idl)
LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES} ${Inspector_IDL_FILES})
-GENERATE_GPERF(${WEBCORE_DIR}/html/HTMLEntityNames.gperf)
-GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf)
-GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf)
+
+GENERATE_JSON(${WEBCORE_DIR}/html/HTMLEntityNames.json ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp ${WEBCORE_DIR}/../WebKitTools/Scripts/create-html-entity-table)
+
+
+GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf ${DERIVED_SOURCES_DIR}/ColorData.cpp findColor "")
+ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.cpp)
+
+
+GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp findDoctypeEntry "-F,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards")
+ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLDocument.cpp DocTypeStrings.cpp)
+
GENERATE_TOKENIZER()
GENERATE_USER_AGENT_STYLES()
-GENERATE_GRAMMAR(cssyy ${WEBCORE_DIR}/css/CSSGrammar.y)
-GENERATE_GRAMMAR(xpathyy ${WEBCORE_DIR}/xml/XPathGrammar.y)
+
+GENERATE_GRAMMAR(cssyy ${WEBCORE_DIR}/css/CSSGrammar.y ${DERIVED_SOURCES_DIR}/CSSGrammar.h ${DERIVED_SOURCES_DIR}/CSSGrammar.cpp)
+LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/CSSGrammar.cpp)
+
+
+GENERATE_GRAMMAR(xpathyy ${WEBCORE_DIR}/xml/XPathGrammar.y ${DERIVED_SOURCES_DIR}/XPathGrammar.h ${DERIVED_SOURCES_DIR}/XPathGrammar.cpp)
+LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/XPathGrammar.cpp)
+
GENERATE_CSS_PROPERTY_NAMES()
GENERATE_CSS_VALUE_KEYWORDS()
+
ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSValueKeywords.h)
ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSPrimitiveValueMappings.h CSSValueKeywords.h)
-ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLDocument.cpp DocTypeStrings.cpp)
-ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp tokenizer.cpp)
-ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/LegacyPreloadScanner.cpp HTMLEntityNames.cpp)
-ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLEntityParser.cpp HTMLEntityNames.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLTreeBuilder.cpp MathMLNames.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSStyleSelector.cpp UserAgentStyleSheetsData.cpp UserAgentStyleSheets.h)
@@ -1896,8 +1954,10 @@ ADD_DEFINITIONS(-DBUILDING_WebCore)
INCLUDE_DIRECTORIES(${WebCore_INCLUDE_DIRECTORIES})
ADD_LIBRARY(${WebCore_LIBRARY_NAME} ${WebCore_LIBRARY_TYPE} ${WebCore_SOURCES})
TARGET_LINK_LIBRARIES(${WebCore_LIBRARY_NAME} ${WebCore_LIBRARIES})
-ADD_TARGET_PROPERTIES(${WebCore_LIBRARY_NAME} LINK_FLAGS ${WebCore_LINK_FLAGS})
+IF (WebCore_LINK_FLAGS)
+ ADD_TARGET_PROPERTIES(${WebCore_LIBRARY_NAME} LINK_FLAGS "${WebCore_LINK_FLAGS}")
+ENDIF ()
IF (SHARED_CORE)
SET_TARGET_PROPERTIES(${WebCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index 0837b02..5c8cdf2 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -70,6 +70,7 @@ IF (WTF_PLATFORM_CAIRO)
platform/graphics/cairo/FontCustomPlatformData.cpp
platform/graphics/cairo/FontPlatformDataCairo.cpp
platform/graphics/cairo/GOwnPtrCairo.cpp
+ platform/graphics/cairo/GRefPtrCairo.cpp
platform/graphics/cairo/GlyphPageTreeNodeCairo.cpp
platform/graphics/cairo/GradientCairo.cpp
platform/graphics/cairo/GraphicsContextCairo.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 85e6aa8..a107c10 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,5622 @@
+2010-08-18 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ CanvasStyle method naming cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=44184
+
+ Renamed the various create() overloads to reflect what they're
+ constructing the CanvasStyle from.
+
+ The unused CanvasStyle::create(grayLevel) and accompanying constructor
+ were removed.
+
+ Also renamed the isEquivalentColor overloads to isEquivalent{RGBA,CMYKA}
+
+ * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+ (WebCore::toHTMLCanvasStyle):
+ * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
+ (WebCore::toCanvasStyle):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::State::State):
+ (WebCore::CanvasRenderingContext2D::setStrokeColor):
+ (WebCore::CanvasRenderingContext2D::setFillColor):
+ * html/canvas/CanvasStyle.cpp:
+ (WebCore::CanvasStyle::createFromString):
+ (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
+ (WebCore::CanvasStyle::createFromGradient):
+ (WebCore::CanvasStyle::createFromPattern):
+ (WebCore::CanvasStyle::isEquivalentRGBA):
+ (WebCore::CanvasStyle::isEquivalentCMYKA):
+ * html/canvas/CanvasStyle.h:
+ (WebCore::CanvasStyle::createFromRGBA):
+ (WebCore::CanvasStyle::createFromGrayLevelWithAlpha):
+ (WebCore::CanvasStyle::createFromRGBAChannels):
+ (WebCore::CanvasStyle::createFromCMYKAChannels):
+
+2010-08-18 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement Maemo5 local rendering NPAPI extension. See
+ https://wiki.mozilla.org/Plugins:NokiaMaemoImageSurface for details.
+
+ With the local rendering extension, Flash will paint into a 16-bit surface.
+ For wmode=transparent, Flash expects the surface to contain the contents
+ beneath it. As it is tricky to implement the content propagation across all
+ graphics systems, transparent Flash is not supported. We just fill the surface
+ with white and wmode=transparent behaves the same as wmode=opaque with a white
+ background.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * WebCore.pro:
+ * plugins/PluginView.cpp:
+ (WebCore::PluginView::setValue):
+ (WebCore::PluginView::PluginView):
+ * plugins/PluginView.h:
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+ (WebCore::PluginView::paintUsingImageSurfaceExtension):
+ (WebCore::PluginView::paint):
+ (WebCore::PluginView::platformGetValueStatic):
+
+2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65603.
+ http://trac.webkit.org/changeset/65603
+ https://bugs.webkit.org/show_bug.cgi?id=44179
+
+ 4 tests crash on Qt bot (Requested by Ossy on #webkit).
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::handlePendingPermissionNotifiers):
+
+2010-08-18 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Unreviewed. Attempted build fix for EFL
+
+ [EFL]REGRESSION(65530) need to fix build break
+ https://bugs.webkit.org/show_bug.cgi?id=44154
+
+ * CMakeListsEfl.txt:
+
+2010-08-18 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Unreviewed qt build fix.
+
+ * WebCore.pri:
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js with generated one.
+ New command-line flag was added to combine-javascript-resources.
+ It specifies the location of generated scripts.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * combine-javascript-resources:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/front-end/InspectorBackendStub.js: Removed.
+ * inspector/front-end/WebKit.qrc:
+
+2010-08-18 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: extension panels do not occupy entire panel client area.
+ https://bugs.webkit.org/show_bug.cgi?id=44167
+
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onCreatePanel):
+ (WebInspector.ExtensionServer.prototype._createClientIframe):
+
+2010-08-18 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Use SVGPathParser logic to traverse states of a Path
+ https://bugs.webkit.org/show_bug.cgi?id=44009
+
+ Move the getPathSegAtLength logic from SVGPathSegList into a new SVGPathConsumer
+ class: SVGPathTraversalStateBuilder.
+ This allows us to get a SVGPathSeg at a given length for SVGPathByteStreams and SVGPathSegLists.
+ It is also possible to use unaltered SVG path data, instead of just normalized path data.
+ This is the final preparation to provide normalized and unaltered SVGPathSegLists
+ on SVGPathElement.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * svg/SVGAllInOne.cpp:
+ * svg/SVGPathBuilder.h:
+ (WebCore::SVGPathBuilder::nextPathSegment):
+ (WebCore::SVGPathBuilder::quitEarlier):
+ * svg/SVGPathByteStreamBuilder.h:
+ (WebCore::SVGPathByteStreamBuilder::nextPathSegment):
+ (WebCore::SVGPathByteStreamBuilder::quitEarlier):
+ * svg/SVGPathConsumer.h:
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::getPathSegAtLength):
+ * svg/SVGPathElement.h:
+ * svg/SVGPathElement.idl:
+ * svg/SVGPathParser.cpp:
+ (WebCore::SVGPathParser::parsePathDataFromSource):
+ * svg/SVGPathParserFactory.cpp:
+ (WebCore::globalSVGPathTraversalStateBuilder):
+ (WebCore::SVGPathParserFactory::getSVGPathSegAtLengthFromSVGPathSegList):
+ * svg/SVGPathParserFactory.h:
+ * svg/SVGPathSegList.cpp:
+ * svg/SVGPathSegList.h:
+ * svg/SVGPathSegListBuilder.h:
+ (WebCore::SVGPathSegListBuilder::nextPathSegment):
+ (WebCore::SVGPathSegListBuilder::quitEarlier):
+ * svg/SVGPathStringBuilder.h:
+ (WebCore::SVGPathStringBuilder::nextPathSegment):
+ (WebCore::SVGPathStringBuilder::quitEarlier):
+ * svg/SVGPathTraversalStateBuilder.cpp: Added. New Consumer for SVGPathParser.
+ (WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
+ (WebCore::SVGPathTraversalStateBuilder::moveTo):
+ (WebCore::SVGPathTraversalStateBuilder::lineTo):
+ (WebCore::SVGPathTraversalStateBuilder::curveToCubic):
+ (WebCore::SVGPathTraversalStateBuilder::closePath):
+ (WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
+ (WebCore::SVGPathTraversalStateBuilder::quitEarlier):
+ (WebCore::SVGPathTraversalStateBuilder::nextPathSegment):
+ (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex):
+ * svg/SVGPathTraversalStateBuilder.h: Added.
+ (WebCore::SVGPathTraversalStateBuilder::setCurrentTraversalState):
+ (WebCore::SVGPathTraversalStateBuilder::cleanup):
+ (WebCore::SVGPathTraversalStateBuilder::lineToHorizontal):
+ (WebCore::SVGPathTraversalStateBuilder::lineToVertical):
+ (WebCore::SVGPathTraversalStateBuilder::curveToCubicSmooth):
+ (WebCore::SVGPathTraversalStateBuilder::curveToQuadratic):
+ (WebCore::SVGPathTraversalStateBuilder::curveToQuadraticSmooth):
+ (WebCore::SVGPathTraversalStateBuilder::arcTo):
+
+2010-08-18 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Steve Block.
+
+ [Qt] Request for permission before starting Geolocation service
+ https://bugs.webkit.org/show_bug.cgi?id=42027
+
+ Handles starting location acquisition when request is granted for ports using
+ "!CLIENT_BASED_GEOLOCATION and PREEMPT_GEOLOCATION_PERMISSION" policy
+ Only Qt port as of today uses the above combination. Enable
+ PREEMPT_GEOLOCATION_PERMISSION for qt port.
+
+ Below tests cover these changes on platform using PREEMPT_GEOLOCATION_PERMISSION
+ - fast/dom/Geolocation/delayed-permission-allowed.html
+ - fast/dom/Geolocation/delayed-permission-denied.html
+ - fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html
+ - fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::handlePendingPermissionNotifiers):
+
+2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65595.
+ http://trac.webkit.org/changeset/65595
+ https://bugs.webkit.org/show_bug.cgi?id=44161
+
+ qt build failed (Requested by loislo on #webkit).
+
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/copyInspectorFiles.cmd:
+ * WebCore.xcodeproj/project.pbxproj:
+ * combine-javascript-resources:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/front-end/InspectorBackendStub.js: Added.
+ (WebInspector.InspectorBackendStub):
+ (WebInspector.InspectorBackendStub.prototype._registerDelegate):
+ (WebInspector.InspectorBackendStub.prototype.sendMessageToBackend):
+ * inspector/front-end/InspectorBackendStub.qrc: Removed.
+ * inspector/front-end/WebKit.qrc:
+
+2010-08-18 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: make objectId of string type instead of object.
+ https://bugs.webkit.org/show_bug.cgi?id=44160
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor.):
+ * inspector/front-end/InjectedScriptAccess.js:
+ (get InjectedScriptAccess.getForObjectId):
+ * inspector/front-end/RemoteObject.js:
+ (WebInspector.RemoteObject.prototype.getProperties):
+ (WebInspector.RemoteObject.prototype.setPropertyValue):
+ (WebInspector.RemoteObject.prototype.pushNodeToFrontend):
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js by generated one.
+ New command-line flag was added to combine-javascript-resources.
+ It specifies the location of generated scripts.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * combine-javascript-resources:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/front-end/InspectorBackendStub.js: Removed.
+ * inspector/front-end/WebKit.qrc:
+
+2010-08-18 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Printer font is different from screen font
+ https://bugs.webkit.org/show_bug.cgi?id=43340
+
+ Not testable because PNG output in layoutTestController.setPrinting
+ for chromium isn't implemented yet.
+
+ * platform/graphics/FontDescription.h: Use screen font even for printing on Mac Chromium
+ (WebCore::FontDescription::setUsePrinterFont):
+
+2010-08-18 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ Fix displaying problem of feTurbulence.
+ https://bugs.webkit.org/show_bug.cgi?id=44111
+
+ Change the order of calculating turbulenceFunctionResult
+ and clamping it. Furthermore remove the unnecessary rounding of m_seed.
+ Add a new test for checking the change of seed's value.
+
+ Test: svg/W3C-SVG-1.1/filters-turb-02-f.svg
+
+ * svg/graphics/filters/SVGFETurbulence.cpp:
+ (WebCore::FETurbulence::initPaint):
+ (WebCore::FETurbulence::calculateTurbulenceValueForPoint):
+ (WebCore::FETurbulence::apply):
+
+2010-08-17 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Bug 44146 - Remove toDouble/toUInt32 methods from UString.
+
+ These methods all implement JavaScript language specific behaviour, and as such
+ are not suited to being on a generic string object. They are also inefficient
+ and incorrectly used, refactor & cleanup. Uses of these methods really divide
+ out into two cases.
+
+ ToNumber:
+ Uses of toDouble from JSString and from parseFloat are implementing ecma's
+ ToNumber conversion from strings (see ecma-262 9.3.1), so UString::toDouble
+ should largely just be moved out to a global jsToNumber function. ToNumber is
+ capable of recognizing either decimal or hexadecimal numbers, but parseFloat
+ should only recognize decimal values. This is currently handled by testing for
+ hexadecimal before calling toDouble, which should unnecessary - instead we can
+ just split out the two parts to the grammar into separate functions. Also,
+ strtod recognizes a set of literals (nan, inf, and infinity - all with any
+ capitalization) - which are not defined by any of the specs we are implementing.
+ To handle this we need to perform additional work in toDouble to convert the
+ unsupported cases of infinities back to NaNs. Instead we should simply remove
+ support for this literals from strtod. This should provide a more desirable
+ behaviour for all clients of strtod.
+
+ Indexed properties:
+ Uses of the toStrictUInt32 methods are were all converting property names to
+ indices, and all uses of toUInt32 were incorrect; in all cases we should have
+ been calling toUInt32. This error results in some incorrect behaviour in the
+ DOM (accessing property "0 " of a NodeList should fail; it currently does not).
+ Move this method onto Identifier (our canonical property name), and make it
+ always perform a strict conversion. Add a layout test to check NodeList does
+ convert indexed property names correctly.
+
+ Test: fast/dom/NodeList/nodelist-item-with-index.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
+ * bindings/js/JSHTMLAllCollectionCustom.cpp:
+ (WebCore::callHTMLAllCollection):
+ (WebCore::JSHTMLAllCollection::item):
+ * bindings/js/JSHTMLCollectionCustom.cpp:
+ (WebCore::callHTMLCollection):
+ (WebCore::JSHTMLCollection::item):
+ * bindings/js/JSNodeListCustom.cpp:
+ (WebCore::callNodeList):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bridge/runtime_array.cpp:
+ (JSC::RuntimeArray::getOwnPropertySlot):
+ (JSC::RuntimeArray::getOwnPropertyDescriptor):
+ (JSC::RuntimeArray::put):
+
+2010-08-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Adele Peterson.
+
+ Null dereference in DOMSelection::deleteFromDocument
+ https://bugs.webkit.org/show_bug.cgi?id=44153
+
+ deleteFromDocument checks selection->isNone() before calling
+ selection->selection().toNormalizedRange(), but toNormalizedRange()
+ notes that it needs to updateLayout(), which can make the selection
+ isNone() again. In that case, we crash on a NULL pointer in
+ deleteFromDocument. I don't know how to trigger that situation in a
+ test, but cross_fuzz was able to hit it, so we should fix it.
+
+ * page/DOMSelection.cpp:
+ (WebCore::DOMSelection::deleteFromDocument):
+
+2010-08-17 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] On Maemo5, there is no libgdk-x11-2.0.so symlink. Look for
+ libgdk-x11-2.0.so.0 instead on X11 and Maemo5.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::getPluginDisplay):
+
+2010-08-17 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Remove unused ContextShadowParameter class in GraphicsContextQt
+ https://bugs.webkit.org/show_bug.cgi?id=44142
+
+ The class is not needed anymore after r65425.
+ We know have dedicated ContextShadow in its own file.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * GNUmakefile.am: Added new files.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+ * loader/FrameNetworkingContext.h: Added.
+ * platform/network/NetworkingContext.h: Added.
+ Placeholders with tentative code that might be changed when landing
+ the rest of it.
+
+2010-08-17 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Back button after Google search result click broken
+ https://bugs.webkit.org/show_bug.cgi?id=44086
+
+ Test: fast/history/redirect-via-iframe.html
+
+ isLoadingInAPISense doesn't quite map to onload (it also returns true
+ if frames are loading, even after the parent frame has fired its onload
+ handler). Instead, add a flag for the onload event being fired, and
+ use that.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::DocumentLoader):
+ * loader/DocumentLoader.h:
+ (WebCore::DocumentLoader::handledOnloadEvents):
+ (WebCore::DocumentLoader::wasOnloadHandled):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::handledOnloadEvents):
+ * loader/RedirectScheduler.cpp:
+ (WebCore::RedirectScheduler::mustLockBackForwardList):
+
+2010-08-17 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Geolocation clearWatch() needs to protect against invalid IDs
+ https://bugs.webkit.org/show_bug.cgi?id=44096
+
+ If the ID passed to clearWatch() is invalid, we early-out.
+
+ Test: fast/dom/Geolocation/clear-watch-invalid-id-crash.html
+
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::Watchers::set):
+ (WebCore::Geolocation::Watchers::remove):
+ (WebCore::Geolocation::watchPosition):
+ (WebCore::Geolocation::clearWatch):
+
+2010-08-17 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Allow non-Skia ports to compile with ENABLE(ACCELERATED_2D_CANVAS).
+ https://bugs.webkit.org/show_bug.cgi?id=44130
+
+ No tests; if it compiles, it's good.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
+ Fix a warning (treated as error).
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::setGraphicsContext3D):
+ (WebCore::GraphicsContext::syncSoftwareCanvas):
+ * platform/graphics/GraphicsContext.h:
+ Make setGraphicsContext3D() and syncSoftwareCanvas() stubbed out,
+ but still present in non-Skia ports. This allows Chrome Mac to
+ compile with ENABLE(ACCELERATED_2D_CANVAS) (although it isn't hooked
+ up yet, it should at least compile).
+
+2010-08-17 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Navigating back/forward during a modal dialog causes a crash when the modal dialog is dismissed.
+ <rdar://problem/8313579> and https://bugs.webkit.org/show_bug.cgi?id=44131
+
+ No new tests. (Especially since DRT doesn't spin inner run loops at all, it would be a significant
+ effort to give it the ability to perform the back/forward navigation in the background to reproduce
+ this bug)
+
+ Manual tests in place of layout tests:
+ * manual-tests/back-forward-during-alert-1.html: Added.
+ * manual-tests/back-forward-during-alert-2.html: Added.
+
+ * page/Page.cpp:
+ (WebCore::Page::goToItem):
+
+2010-08-17 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ selectionStart clobbered if textarea isn't focused
+ https://bugs.webkit.org/show_bug.cgi?id=43814
+
+ If a text control is blurred, setting selectionStart/end should use
+ the cached selection value, which is currently stored on the form
+ control element.
+
+ Test: fast/forms/text-control-select-blurred.html
+
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::setSelectionStart):
+ (WebCore::RenderTextControl::setSelectionEnd):
+
+2010-08-17 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by David Levin.
+
+ MessagePort.close() crashes if the owning context was destroyed.
+ https://bugs.webkit.org/show_bug.cgi?id=43140
+
+ Test: fast/events/message-port-context-destroyed.html
+
+ * dom/MessagePort.cpp:
+ (WebCore::MessagePort::postMessage):
+ (WebCore::MessagePort::start):
+ (WebCore::MessagePort::close):
+ (WebCore::MessagePort::contextDestroyed):
+ Use isEntangled() method to gate various operations on MessagePort. This method also takes into account m_closed bit.
+
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
+ (WebCore::ScriptExecutionContext::closeMessagePorts):
+ * dom/ScriptExecutionContext.h:
+ Add closeMessagePorts() method that closes message ports at the same moments when other ActiveDOMObjects are stopped.
+
+2010-08-17 Fady Samuel <fsamuel@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Updated table cell hit testing and painting to use binary search instead of linear scan.
+
+ Improved Table Hit Testing and Painting Performance
+ https://bugs.webkit.org/show_bug.cgi?id=43933
+
+ Tests: fast/table/simple_paint.html
+ tables/hittesting/filltable-emptycells.html
+ tables/hittesting/filltable-levels.html
+ tables/hittesting/filltable-outline.html
+ tables/hittesting/filltable-rtl.html
+ tables/hittesting/filltable-stress.html
+
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::paintObject): Dirty rect determined using binary search.
+ (WebCore::RenderTableSection::nodeAtPoint): Cell hit determined using binary search
+
+2010-08-17 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ Only destroy empty anonymous block when it is columns or column span block
+ in RenderBlock::removeChild.
+ https://bugs.webkit.org/show_bug.cgi?id=44035
+
+ Test: fast/block/basic/empty-anonymous-block-remove-crash.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::removeChild):
+
+2010-08-17 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ [Chromium] REGRESSION: Incorrect repaint on scrolling with position:fixed elements
+ https://bugs.webkit.org/show_bug.cgi?id=42949
+
+ This is a partial revert of http://trac.webkit.org/changeset/63907
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollPositionChangedViaPlatformWidget):
+ (WebCore::FrameView::scrollPositionChanged):
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::valueChanged):
+
+2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65528.
+ http://trac.webkit.org/changeset/65528
+ https://bugs.webkit.org/show_bug.cgi?id=44123
+
+ "Broke a bunch of canvas tests on Chrome win/linux."
+ (Requested by senorblanco on #webkit).
+
+ * platform/graphics/skia/BitmapImageSingleFrameSkia.h:
+ (WebCore::BitmapImageSingleFrameSkia::BitmapImageSingleFrameSkia):
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ (WebCore::ImageBuffer::copyImage):
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+ * platform/graphics/skia/ImageSkia.cpp:
+ (WebCore::BitmapImageSingleFrameSkia::create):
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ * platform/graphics/skia/NativeImageSkia.h:
+
+2010-08-17 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by David Hyatt.
+
+ [Cairo] Remove unnecessary full-surface copies from ImageCairo and GraphicsContextCairo
+ https://bugs.webkit.org/show_bug.cgi?id=44076
+
+ No new tests as functionality has not changed.
+
+ * GNUmakefile.am: Added GRefPtrCairo to the sources list.
+ * platform/graphics/cairo/GRefPtrCairo.cpp: Added.
+ (WTF::refGPtr): Added specializations for cairo_t and cairo_surface_t.
+ (WTF::derefGPtr):
+ * platform/graphics/cairo/GRefPtrCairo.h: Added.
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::createPlatformShadow): Access the image surface directly
+ from the ImageBuffer instead of wrapping it in an Image.
+ * platform/graphics/cairo/ImageCairo.cpp:
+ (WebCore::Image::drawPattern): Create the temporary surface using cairo primitives
+ instead of through the platform-independent WebCore code.
+
+2010-08-17 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK] Clean up WebCore/platform/graphics/gtk/ImageGtk.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=44069
+
+ No new tests as functionality has not changed.
+
+ * GNUmakefile.am: Add WEBKITGTK_API_VERSION_STRING definition, which
+ allows WebCore to use this as well.
+ * platform/graphics/gtk/ImageGtk.cpp:
+ (getWebKitDataDirectory): Added this helper.
+ (WebCore::Image::loadPlatformResource): Use GOwnPtr for gchar pointers and
+ use the new getWebKitDataDirectory helper.
+ * platform/gtk/GOwnPtrGtk.cpp: Move the GtkIconInfo template specialization to this file.
+ (WTF::GtkIconInfo): Added this forward declaration.
+ * platform/gtk/GOwnPtrGtk.h: Declaration for new template specialization.
+
+2010-08-17 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [CHROMIUM] Eliminate a memcpy() from the canvas.drawImage(canvas, ...) path.
+ This is the Skia followup to Dave Hyatt's patch in r65449.
+ https://bugs.webkit.org/show_bug.cgi?id=44115
+
+ Covered by canvas layout tests.
+
+ * platform/graphics/skia/BitmapImageSingleFrameSkia.h:
+ Add a "copyPixels" argument to the create() static to indicate if
+ the caller wants the pixels to be copied or ref'ed.
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ We don't use the always-copy path anymore, so return false.
+ (WebCore::ImageBuffer::copyImage):
+ Shouldn't get here anymore, so ASSERT_NOT_REACHED.
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+ Create a temporary BitampImageSingleFrameSkia wrapped around the
+ canvas's bitmap, and draw with it immediately. If drawing to our own
+ canvas, copy the pixels, otherwise just shallow copy.
+ * platform/graphics/skia/ImageSkia.cpp:
+ (WebCore::BitmapImageSingleFrameSkia::BitmapImageSingleFrameSkia):
+ Make the constructor take an SkBitmap to be wrapped.
+ (WebCore::BitmapImageSingleFrameSkia::create):
+ Implement the "copyPixels" flag: if true, do a deep copy, otherwise
+ do a shallow copy.
+ * platform/graphics/skia/NativeImageSkia.cpp:
+ (WebCore::NativeImageSkia::NativeImageSkia):
+ * platform/graphics/skia/NativeImageSkia.h:
+ Implement a new constructor that shallow-copies the given SkBitmap.
+
+2010-08-17 Jian Li <jianli@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Move BlobRegistry interface and implementation to platform/network
+ https://bugs.webkit.org/show_bug.cgi?id=44116
+
+ Also move BlobData and BlobStorageData since they're part of BlobRegistry
+ implementation.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/network/BlobData.cpp: Renamed from WebCore/platform/BlobData.cpp.
+ * platform/network/BlobData.h: Renamed from WebCore/platform/BlobData.h.
+ * platform/network/BlobRegistry.h: Renamed from WebCore/platform/BlobRegistry.h.
+ * platform/network/BlobRegistryImpl.cpp: Renamed from WebCore/html/BlobRegistryImpl.cpp.
+ * platform/network/BlobRegistryImpl.h: Renamed from WebCore/html/BlobRegistryImpl.h.
+ * platform/network/BlobStorageData.h: Renamed from WebCore/html/BlobStorageData.h.
+
+2010-08-17 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Path: Fast approximation of stroke bounding rects
+ https://bugs.webkit.org/show_bug.cgi?id=44014
+
+ In canvas's stroke(), use QPainterPath::controlPointRect() to calculate
+ a slightly larger bounding rect in a fraction of the time.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::stroke):
+
+2010-08-17 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Kenneth Rohde Christiansen.
+ Set PluginQuirkRequiresDefaultScreenDepth for all Flash versions and not
+ just Flash 10.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44043
+
+ * plugins/PluginPackage.cpp:
+ (WebCore::PluginPackage::determineQuirks):
+
+2010-08-17 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Change FileStream implementation to prepare for blob resource handling.
+ https://bugs.webkit.org/show_bug.cgi?id=43985
+
+ Change FileStream to support synchronous usage only. All the asychronous
+ logics are moved to FileStreamProxy. Update the existing FileReader code
+ to adapt to this change.
+
+ * html/FileReader.cpp: Account for FileStreamProxy changes.
+ (WebCore::FileReader::didStart):
+ (WebCore::FileReader::didGetSize):
+ (WebCore::FileReader::didOpen):
+ (WebCore::FileReader::didRead):
+ * html/FileReader.h:
+ * html/FileStream.cpp: Remove m_client and make all calls synchronous only.
+ (WebCore::FileStream::FileStream):
+ (WebCore::FileStream::start):
+ (WebCore::FileStream::stop):
+ (WebCore::FileStream::getSize):
+ (WebCore::FileStream::openForRead):
+ (WebCore::FileStream::openForWrite):
+ (WebCore::FileStream::close):
+ (WebCore::FileStream::read):
+ (WebCore::FileStream::write):
+ (WebCore::FileStream::truncate):
+ * html/FileStream.h: Add getSize() and make all calls synchronous by adding return values.
+ (WebCore::FileStream::create):
+ * html/FileStreamClient.h: Account for FileStreamProxy changes.
+ (WebCore::FileStreamClient::didRead):
+ (WebCore::FileStreamClient::didTruncate):
+ (WebCore::FileStreamClient::didOpen):
+ * html/FileStreamProxy.cpp: All the logics to handle asynchronous calls are wrapped here.
+ (WebCore::FileStreamProxy::FileStreamProxy):
+ (WebCore::FileStreamProxy::create):
+ (WebCore::FileStreamProxy::fileThread):
+ (WebCore::didStart):
+ (WebCore::FileStreamProxy::startOnFileThread):
+ (WebCore::FileStreamProxy::stop):
+ (WebCore::derefProxyOnContext):
+ (WebCore::FileStreamProxy::stopOnFileThread):
+ (WebCore::didGetSize):
+ (WebCore::FileStreamProxy::getSize):
+ (WebCore::FileStreamProxy::getSizeOnFileThread):
+ (WebCore::didOpen):
+ (WebCore::FileStreamProxy::openForRead):
+ (WebCore::FileStreamProxy::openForReadOnFileThread):
+ (WebCore::FileStreamProxy::openForWrite):
+ (WebCore::FileStreamProxy::openForWriteOnFileThread):
+ (WebCore::FileStreamProxy::close):
+ (WebCore::FileStreamProxy::closeOnFileThread):
+ (WebCore::didRead):
+ (WebCore::FileStreamProxy::read):
+ (WebCore::FileStreamProxy::readOnFileThread):
+ (WebCore::didWrite):
+ (WebCore::FileStreamProxy::write):
+ (WebCore::FileStreamProxy::writeOnFileThread):
+ (WebCore::didTruncate):
+ (WebCore::FileStreamProxy::truncate):
+ (WebCore::FileStreamProxy::truncateOnFileThread):
+ * html/FileStreamProxy.h:
+ * html/FileThreadTask.h: Change all methods to return void since return value is not needed now.
+
+2010-08-17 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Returned WebCore.xcodeproj to default settings after http://trac.webkit.org/changeset/65468/trunk/WebCore/WebCore.xcodeproj/project.pbxproj.
+
+ * WebCore.xcodeproj/project.pbxproj: Removed developmentRegion = English line.
+
+2010-08-17 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Eliminate extra traversal of the tree when determining ability to lazy-attach a Node.
+ https://bugs.webkit.org/show_bug.cgi?id=43749
+
+ Land the actual change that I intended to land in http://trac.webkit.org/changeset/65508.
+
+ Neither SVG nor inputs/counters shadow DOM are traveling down this path (they home-bake their attachment),
+ so the check for shadow tree existence isn't needed.
+ Gives a small, but consistent win in Dromaeo's DOM Modification test.
+
+ * dom/Node.h:
+ (WebCore::Node::canLazyAttach): Changed to always return true.
+
+2010-08-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Carlson.
+
+ Restore intrinsic size of video elements after loading poster
+
+ The element might already have the instrinsic size of the video, in
+ which case we don't want to override it witht that of the image.
+
+ * rendering/RenderVideo.cpp: call updateIntrinsicSize() to restore size
+
+2010-08-17 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
+
+ Reviewed by Steve Block.
+
+ Geolocation preemptive permissions policy is buggy
+ https://bugs.webkit.org/show_bug.cgi?id=42811
+
+ While waiting for permission, m_startRequestPermissionNotifier was
+ used to consider only one pending request. This patch implements a set
+ m_pendingForPermissionNotifiers to maintain set of pending requests.
+ When user grants/denies permission all listeners will be notified.
+ Also fixed issue with hasZeroTimeout() where startTimerIfNeeded() has
+ to start irrespective of permission state
+
+ Tests: fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html
+ fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::startRequest):
+ (WebCore::Geolocation::setIsAllowed):
+ (WebCore::Geolocation::startUpdating):
+ (WebCore::Geolocation::handlePendingPermissionNotifiers):
+ * page/Geolocation.h:
+
+2010-08-11 Jeremy Orlow <jorlow@chromium.org>
+
+ Beginnings of IndexedDB persistance + IDBDatabase.description fleshed out
+ https://bugs.webkit.org/show_bug.cgi?id=43744
+
+ The beginnings of a SQLite backend for IndexedDB. Right now, only persists
+ meta-data for the database. The rest is coming in future patches. Adds
+ a manual test to verify persistance.
+
+ Test: storage/indexeddb/database-description.html
+ + a manual test
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * manual-tests/indexed-database.html: Added.
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::databaseIdentifier):
+ * platform/FileSystem.cpp: Added.
+ (WebCore::):
+ (WebCore::shouldEscapeUChar):
+ (WebCore::encodeForFileName):
+ * platform/FileSystem.h:
+ * storage/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::IDBDatabase):
+ * storage/IDBDatabase.h:
+ (WebCore::IDBDatabase::description):
+ * storage/IDBDatabaseBackendImpl.cpp:
+ (WebCore::extractMetaData):
+ (WebCore::setMetaData):
+ (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
+ (WebCore::IDBDatabaseBackendImpl::setDescription):
+ * storage/IDBDatabaseBackendImpl.h:
+ (WebCore::IDBDatabaseBackendImpl::create):
+ * storage/IDBFactory.h:
+ * storage/IDBFactory.idl:
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::IDBFactoryBackendImpl::IDBFactoryBackendImpl):
+ (WebCore::IDBFactoryBackendImpl::~IDBFactoryBackendImpl):
+ (WebCore::openSQLiteDatabase):
+ (WebCore::createTables):
+ (WebCore::IDBFactoryBackendImpl::open):
+ * storage/IDBFactoryBackendImpl.h:
+ (WebCore::IDBFactoryBackendImpl::create):
+
+2010-08-17 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Eliminate extra traversal of the tree when determining ability to lazy-attach a Node.
+ https://bugs.webkit.org/show_bug.cgi?id=43749
+
+ Neither SVG nor inputs/counters shadow DOM are traveling down this path (they home-bake their attachment),
+ so the check for shadow tree existence isn't needed.
+
+ Gives a small, but consisten win in Dromaeo's DOM Modification test.
+
+ * dom/Node.cpp: Removed canLazyAttach declaration.
+ * dom/Node.h:
+ (WebCore::Node::canLazyAttach): Changed to always return true.
+
+2010-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [CRASH] Console formatting crashes after cross-domain navigation.
+ https://bugs.webkit.org/show_bug.cgi?id=44103
+
+ * bindings/js/JSInjectedScriptHostCustom.cpp:
+ (WebCore::InjectedScriptHost::injectedScriptFor):
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ (WebCore::InjectedScriptHost::injectedScriptFor):
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::addToFrontend):
+
+2010-08-17 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: upstream Chromium debugger step tests
+ https://bugs.webkit.org/show_bug.cgi?id=44106
+
+ Tests: inspector/debugger-step-in.html
+ inspector/debugger-step-out.html
+ inspector/debugger-step-over.html
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::returnEvent): check that debugger is still attached after continue to ensure
+ that current call frame is not 0.
+
+2010-08-17 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
+
+ Reviewed by David Levin.
+
+ Trivial fix removing the self-inclusion of a couple of header files.
+
+ Self inclusion in Document.h and RenderTheme.h
+ https://bugs.webkit.org/show_bug.cgi?id=44065
+
+ * dom/Document.h:
+ * rendering/RenderTheme.h:
+
+2010-08-17 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Move the accelerated compositing build flag to the right place
+ https://bugs.webkit.org/show_bug.cgi?id=43882
+
+ No new tests: build fix.
+
+ * WebCore.pro:
+
+2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65500.
+ http://trac.webkit.org/changeset/65500
+ https://bugs.webkit.org/show_bug.cgi?id=44108
+
+ Qt bots failed to compile. (Requested by loislo on #webkit).
+
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/copyInspectorFiles.cmd:
+ * WebCore.xcodeproj/project.pbxproj:
+ * combine-javascript-resources:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/front-end/InspectorBackendStub.js: Added.
+ (WebInspector.InspectorBackendStub):
+ (WebInspector.InspectorBackendStub.prototype._registerDelegate):
+ (WebInspector.InspectorBackendStub.prototype.sendMessageToBackend):
+ * inspector/front-end/InspectorBackendStub.qrc: Removed.
+ * inspector/front-end/WebKit.qrc:
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js by generated one.
+ New command-line flag was added to combine-javascript-resources.
+ It specifies the location of generated scripts.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * GNUmakefile.am:
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * combine-javascript-resources:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/front-end/InspectorBackendStub.js: Removed.
+ * inspector/front-end/WebKit.qrc:
+
+2010-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: get rid of node and scoped object-specific ids.
+ https://bugs.webkit.org/show_bug.cgi?id=44097
+
+ * inspector/front-end/ConsoleView.js:
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._createTooltipForNode):
+ * inspector/front-end/EventListenersSidebarPane.js:
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor.):
+ (injectedScriptConstructor):
+ * inspector/front-end/InjectedScriptAccess.js:
+ (InjectedScriptAccess):
+ (InjectedScriptAccess.getForNode):
+ (InjectedScriptAccess._installHandler.InjectedScriptAccess.prototype.methodName):
+ (InjectedScriptAccess._installHandler):
+ * inspector/front-end/PropertiesSidebarPane.js:
+ (WebInspector.PropertiesSidebarPane.prototype.update):
+ * inspector/front-end/RemoteObject.js:
+ (WebInspector.RemoteObjectId):
+ (WebInspector.RemoteObject.resolveNode):
+ * inspector/front-end/ScriptsPanel.js:
+
+2010-08-17 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] Fix wrapping of core Events in the bindings
+ https://bugs.webkit.org/show_bug.cgi?id=44095
+
+ Return the proper GObject type instead of hardcoding
+ WebKitDOMEvent for all Event types.
+
+ * bindings/gobject/GObjectEventListener.cpp:
+ (WebCore::GObjectEventListener::handleEvent):
+ * bindings/gobject/WebKitDOMBinding.cpp:
+ (WebKit::kit):
+
+2010-08-17 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Revert supposed build-fix which was in fact reverting a previous
+ build fix which was correct (oh dear).
+
+ * GNUmakefile.am:
+
+2010-08-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Add media element support for preload=none
+
+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+ * platform/graphics/qt/MediaPlayerPrivateQt.h:
+
+2010-08-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Pre-roll media when loading media elements
+
+ This ensures we get correct size-hints from QtMultimedia, as well as
+ the media states Buffering and Buffered instead of Loading and Loaded,
+ which we use to transition into MediaPlayer::HaveEnoughData.
+
+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+ * platform/graphics/qt/MediaPlayerPrivateQt.h:
+
+2010-08-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix missing default controls for stand-alone media elements
+
+ https://bugs.webkit.org/show_bug.cgi?id=35427
+
+ * css/mediaControlsQt.css:
+
+2010-08-17 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Reduce the size of the shadow buffer to the clip region
+ https://bugs.webkit.org/show_bug.cgi?id=44091
+
+ Instead of allocating the buffer image (for the blur support) as big
+ as the rectangle which casts the shadow, we limit the size to the
+ current clip region.
+
+ * platform/graphics/qt/ContextShadow.cpp:
+ (WebCore::ContextShadow::drawShadowRect):
+
+2010-08-17 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GStreamer] media/invalid-media-url-crash.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=42960
+
+ Implemented two ResourceHandleClient callbacks that need to notify
+ downstream GStreamer elements of errors while accessing the
+ resource.
+
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (StreamingClient::wasBlocked):
+ (StreamingClient::cannotShowURL):
+
+2010-08-16 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig
+
+ Remove unnecessary includes from UString.h, add new includes as necessary.
+
+ * dom/ScriptExecutionContext.h:
+ * loader/appcache/ApplicationCache.cpp:
+
+2010-08-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ CSS: Add fast-path for rgba() color parsing
+ https://bugs.webkit.org/show_bug.cgi?id=42965
+
+ Test: fast/canvas/rgba-parsing.html
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseColor): Extended with support for rgba().
+ (WebCore::parseAlphaValue): Added, parses an alpha value using
+ WTF::strtod() (if necessary) and clamps between 0 and 1.
+ (WebCore::isTenthAlpha):
+
+2010-08-16 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Add idl and mock classes for FileSystem API's {File,Directory}Entry and related interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=43993
+
+ Adding DirectoryEntry, DirectoryReader, EntriesCallback and FileEntry as defined in HTML5 FileSystem API.
+ http://dev.w3.org/2009/dap/file-system/file-dir-sys.html
+
+ Also adding Makefile entries for idl and mock classes added in changeset 64414 (except for Android platforms).
+
+ Tests will be added when we add underlying implementation.
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * storage/DOMFileSystem.cpp:
+ (WebCore::DOMFileSystem::root):
+ * storage/DOMFileSystem.h:
+ * storage/DOMFileSystem.idl:
+ * storage/DirectoryEntry.cpp: Added.
+ * storage/DirectoryEntry.h: Added.
+ * storage/DirectoryEntry.idl: Added.
+ * storage/DirectoryReader.cpp: Added.
+ * storage/DirectoryReader.h: Added.
+ * storage/DirectoryReader.idl: Added.
+ * storage/EntriesCallback.h: Added.
+ * storage/EntriesCallback.idl: Added.
+ * storage/EntryArray.cpp: Added.
+ * storage/EntryArray.h: Added.
+ * storage/EntryArray.idl: Added.
+ * storage/Entry.cpp:
+ (WebCore::Entry::Entry):
+ (WebCore::Entry::getMetadata):
+ (WebCore::Entry::moveTo):
+ (WebCore::Entry::copyTo):
+ (WebCore::Entry::remove):
+ (WebCore::Entry::getParent):
+ * storage/Entry.h:
+ (WebCore::Entry::isFile):
+ (WebCore::Entry::isDirectory):
+ * storage/Entry.idl:
+ * storage/FileEntry.cpp: Added.
+ * storage/FileEntry.h: Added.
+ * storage/FileEntry.idl: Added.
+
+2010-08-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Path::closeSubpath() should only close the last subpath if it has >1 point
+ https://bugs.webkit.org/show_bug.cgi?id=44061
+
+ Spec link:
+ http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-closepath
+
+ Test: fast/canvas/canvas-closePath-single-point.html
+
+ * platform/graphics/Path.h: Add a Qt-only member to track the last subpath.
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::closeSubpath): Only close the last subpath if it
+ has more than 1 point. Otherwise behave as moveTo(first point in last subpath)
+ (WebCore::Path::Path):
+ (WebCore::Path::operator=):
+ (WebCore::Path::moveTo):
+ (WebCore::Path::transform):
+
+2010-08-16 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, Chromium mac build fix (with help from jamesr).
+
+ * platform/chromium/ScrollbarThemeChromiumMac.mm:
+ (WebCore::ScrollbarThemeChromiumMac::paint):
+
+2010-08-16 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Bug 44080 - String find/reverseFind methods need tidying up
+ These methods have a couple of problems with their interface, and implementation.
+
+ These methods take and int index, and return an int - however this is problematic
+ since on 64-bit string indices may have a full 32-bit range. This spills out into
+ surrounding code, which unsafely casts string indices from unsigned to int. Code
+ checking the result of these methods check for a mix of "== -1", "< 0", and
+ "== notFound". Clean this up by changing these methods to take an unsigned
+ starting index, and return a size_t. with a failed match indicated by notFound.
+ reverseFind also has a special meaning for the starting index argument, in that a
+ negative index is interpreted as an offset back from the end of the string. Remove
+ this functionality, in the (1!) case where it is used we should just calculate the
+ offset by subtracting from the string's length.
+
+ The implementation has a few problems too. The code is not in webkit style, in
+ using assorted abbreviations in variable names, and implementations of similar
+ find methods with differing argument types were unnecessarily inconsistent. When
+ find is passed const char* data the string would be handled as latin1 (zero
+ extended to UTF-16) for all characters but the first; this is sign extended.
+ Case-insensitive find is broken for unicode strings; the hashing optimization is
+ not unicode safe, and could result in false negatives.
+
+ Unify UString find methods to match String.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::RareData::parseNth):
+ * css/CSSStyleDeclaration.cpp:
+ (WebCore::CSSStyleDeclaration::setProperty):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+ * dom/Document.cpp:
+ (WebCore::Document::getImageMap):
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::inputText):
+ * editing/InsertTextCommand.cpp:
+ (WebCore::InsertTextCommand::input):
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::handleTextBox):
+ * editing/TypingCommand.cpp:
+ (WebCore::TypingCommand::insertText):
+ * editing/markup.cpp:
+ (WebCore::fillContainerFromString):
+ (WebCore::createFragmentFromText):
+ * html/File.cpp:
+ (WebCore::File::Init):
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::setHost):
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::parseMappedAttribute):
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::isPlaceholderEmpty):
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::parseMappedAttribute):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::performSearch):
+ * loader/CrossOriginPreflightResultCache.cpp:
+ (WebCore::parseAccessControlAllowList):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::substituteMIMETypeFromPluginDatabase):
+ * loader/appcache/ApplicationCacheStorage.cpp:
+ (WebCore::parseHeader):
+ (WebCore::parseHeaders):
+ * loader/icon/IconFetcher.cpp:
+ (WebCore::parseIconLink):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::parseModalDialogFeatures):
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::createFromDatabaseIdentifier):
+ * page/UserContentURLPattern.cpp:
+ (WebCore::UserContentURLPattern::parse):
+ * page/XSSAuditor.cpp:
+ (WebCore::XSSAuditor::findInRequest):
+ * platform/ContentType.cpp:
+ (WebCore::ContentType::parameter):
+ (WebCore::ContentType::type):
+ * platform/KURL.cpp:
+ (WebCore::KURL::lastPathComponent):
+ (WebCore::KURL::setProtocol):
+ (WebCore::decodeURLEscapeSequences):
+ (WebCore::substituteBackslashes):
+ (WebCore::mimeTypeFromDataURL):
+ * platform/Length.cpp:
+ (WebCore::newCoordsArray):
+ (WebCore::newLengthArray):
+ * platform/LinkHash.cpp:
+ (WebCore::findSlashDotDotSlash):
+ (WebCore::findSlashSlash):
+ (WebCore::findSlashDotSlash):
+ (WebCore::cleanPath):
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::MIMETypeRegistry::getMIMETypeForPath):
+ * platform/SchemeRegistry.cpp:
+ (WebCore::SchemeRegistry::shouldTreatURLAsLocal):
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::load):
+ * platform/mac/DragImageMac.mm:
+ (WebCore::createDragImageIconForCachedImage):
+ * platform/network/CredentialStorage.cpp:
+ (WebCore::protectionSpaceMapKeyFromURL):
+ (WebCore::findDefaultProtectionSpaceForURL):
+ * platform/network/HTTPParsers.cpp:
+ (WebCore::skipWhiteSpace):
+ (WebCore::skipToken):
+ (WebCore::parseHTTPRefresh):
+ (WebCore::filenameFromHTTPContentDisposition):
+ (WebCore::findCharsetInMediaType):
+ (WebCore::parseXSSProtectionHeader):
+ (WebCore::extractReasonPhraseFromHTTPStatusLine):
+ * platform/network/ResourceResponseBase.cpp:
+ (WebCore::ResourceResponseBase::isAttachment):
+ (WebCore::parseCacheHeader):
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::updateWidget):
+ * storage/Entry.cpp:
+ (WebCore::Entry::Entry):
+ * svg/SVGFont.cpp:
+ (WebCore::isCompatibleGlyph):
+ * svg/SVGURIReference.cpp:
+ (WebCore::SVGURIReference::getTarget):
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::parseClockValue):
+ (WebCore::SVGSMILElement::parseCondition):
+ * xml/XPathFunctions.cpp:
+ (WebCore::XPath::FunSubstringBefore::evaluate):
+ (WebCore::XPath::FunSubstringAfter::evaluate):
+ (WebCore::XPath::FunTranslate::evaluate):
+ (WebCore::XPath::FunLang::evaluate):
+ * xml/XPathParser.cpp:
+ (WebCore::XPath::Parser::expandQName):
+
+2010-08-16 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ REGRESSION(r65208): editing/pasteboard/smart-paste-003.html and smart-paste-004.html crash on Windows Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=44070
+
+ The crash was caused by start or end node being removed in pushDownInlineStyleAroundNode.
+ It made start and end orphaned, and caused s.node() to be detached from the document.
+ Fixed the crash by using nodes passed to pushDownInlineStyleAroundNode for start and end if the original
+ start and end are orphaned because pushDownInlineStyleAroundNode won't prune targetNode.
+
+ Test: editing/pasteboard/smart-paste-003-trailing-whitespace.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::removeInlineStyle):
+
+2010-08-16 James Robinson <jamesr@chromium.org>
+
+ Compile fix. Remove ANGLEWebKitBridge classes from Chromium build. They are unused.
+
+ * WebCore.gypi:
+
+2010-08-16 Vincent Scheib <scheib@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Canvas2D does not support images larger than system's GPU max texture size
+ https://bugs.webkit.org/show_bug.cgi?id=43864
+
+ A new class "TilingData" has been created that provides logic for
+ splitting a large image into a series of smaller tiles.
+
+ GLES2Texture and CLES2Canvas are modified to use the TilingData to
+ split images on texture upload and render one logical image as many smaller
+ images.
+
+ TilingData is tested via unit tests in WebKit/chromium/tests/TilingDataTest.cpp
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/GLES2Canvas.cpp:
+ (WebCore::GLES2Canvas::drawTexturedRect):
+ (WebCore::GLES2Canvas::drawTexturedRectTile):
+ * platform/graphics/chromium/GLES2Canvas.h:
+ * platform/graphics/chromium/GLES2Texture.cpp:
+ (WebCore::GLES2Texture::GLES2Texture):
+ (WebCore::GLES2Texture::~GLES2Texture):
+ (WebCore::GLES2Texture::create):
+ (WebCore::copySubRect):
+ (WebCore::GLES2Texture::load):
+ (WebCore::GLES2Texture::bindTile):
+ * platform/graphics/chromium/GLES2Texture.h:
+ (WebCore::GLES2Texture::tiles):
+ * platform/graphics/chromium/TilingData.cpp: Added.
+ (WebCore::computeNumTiles):
+ (WebCore::TilingData::TilingData):
+ (WebCore::TilingData::tileXIndexFromSrcCoord):
+ (WebCore::TilingData::tileYIndexFromSrcCoord):
+ (WebCore::TilingData::tileBounds):
+ (WebCore::TilingData::tileBoundsWithBorder):
+ (WebCore::TilingData::tileBoundsNormalized):
+ (WebCore::TilingData::tilePositionX):
+ (WebCore::TilingData::tilePositionY):
+ (WebCore::TilingData::tileSizeX):
+ (WebCore::TilingData::tileSizeY):
+ (WebCore::TilingData::overlappedTileIndices):
+ (WebCore::TilingData::intersectDrawQuad):
+ * platform/graphics/chromium/TilingData.h: Added.
+ (WebCore::TilingData::maxTextureSize):
+ (WebCore::TilingData::totalSizeX):
+ (WebCore::TilingData::totalSizeY):
+ (WebCore::TilingData::numTiles):
+ (WebCore::TilingData::numTilesX):
+ (WebCore::TilingData::numTilesY):
+ (WebCore::TilingData::tileIndex):
+ (WebCore::TilingData::tileXIndex):
+ (WebCore::TilingData::tileYIndex):
+ (WebCore::TilingData::TilingData):
+ (WebCore::TilingData::assertTile):
+ * platform/graphics/skia/ImageSkia.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::uploadSoftwareToHardware):
+
+2010-08-16 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43507, stop ImageBuffer from copying its data when rendering after canvas changes happen.
+
+ This patch renames ImageBuffer::image() to ImageBuffer::copyImage(). The new method always returns a new copy that is a current
+ snapshot of the ImageBuffer.
+
+ To draw an ImageBuffer, you now use new GraphicsContext calls: drawImageBuffer. Platforms can then optimize these calls to draw
+ efficiently without having to copy the bits of the ImageBuffer into an Image.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSCanvasValue.cpp:
+ (WebCore::CSSCanvasValue::image):
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::willDraw):
+ (WebCore::HTMLCanvasElement::reset):
+ (WebCore::HTMLCanvasElement::paint):
+ (WebCore::HTMLCanvasElement::setSurfaceSize):
+ (WebCore::HTMLCanvasElement::copiedImage):
+ (WebCore::HTMLCanvasElement::clearCopiedImage):
+ * html/HTMLCanvasElement.h:
+ * html/canvas/CanvasPattern.cpp:
+ (WebCore::CanvasPattern::CanvasPattern):
+ * html/canvas/CanvasPattern.h:
+ (WebCore::CanvasPattern::create):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::drawImage):
+ (WebCore::CanvasRenderingContext2D::createPattern):
+ (WebCore::CanvasRenderingContext2D::drawTextInternal):
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::paintRenderingResultsToCanvas):
+ (WebCore::WebGLRenderingContext::reshape):
+ (WebCore::WebGLRenderingContext::texImage2D):
+ (WebCore::WebGLRenderingContext::texSubImage2D):
+ * html/canvas/WebGLRenderingContext.h:
+ (WebCore::WebGLRenderingContext::paintsIntoCanvasBuffer):
+ * platform/graphics/GeneratedImage.cpp:
+ (WebCore::GeneratedImage::drawPattern):
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::drawImageBuffer):
+ (WebCore::GraphicsContext::clipToImageBuffer):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):
+ * platform/graphics/Image.h:
+ * platform/graphics/ImageBuffer.h:
+ (WebCore::ImageBuffer::width):
+ (WebCore::ImageBuffer::height):
+ * platform/graphics/Pattern.cpp:
+ (WebCore::Pattern::Pattern):
+ * platform/graphics/Pattern.h:
+ (WebCore::Pattern::create):
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ * platform/graphics/cairo/ImageBufferCairo.cpp:
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ (WebCore::ImageBuffer::copyImage):
+ (WebCore::ImageBuffer::clip):
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ (WebCore::ImageBuffer::ImageBuffer):
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ (WebCore::ImageBuffer::copyImage):
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+ (WebCore::ImageBuffer::clip):
+ * platform/graphics/cg/ImageBufferData.h:
+ * platform/graphics/filters/FEColorMatrix.cpp:
+ (WebCore::FEColorMatrix::apply):
+ * platform/graphics/filters/FEComposite.cpp:
+ (WebCore::FEComposite::apply):
+ * platform/graphics/filters/SourceAlpha.cpp:
+ (WebCore::SourceAlpha::apply):
+ * platform/graphics/filters/SourceGraphic.cpp:
+ (WebCore::SourceGraphic::apply):
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ * platform/graphics/qt/ImageBufferData.h:
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::ImageBufferData::ImageBufferData):
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ (WebCore::ImageBuffer::copyImage):
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+ (WebCore::ImageBuffer::clip):
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ (WebCore::ImageBuffer::copyImage):
+ (WebCore::ImageBuffer::clip):
+ (WebCore::):
+ * platform/graphics/wx/GraphicsContextWx.cpp:
+ * platform/graphics/wx/ImageBufferWx.cpp:
+ (WebCore::ImageBuffer::drawsUsingCopy):
+ (WebCore::ImageBuffer::copyImage):
+ (WebCore::ImageBuffer::clip):
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+ * platform/mac/ScrollbarThemeMac.mm:
+ (WebCore::ScrollbarThemeMac::paint):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+ * rendering/RenderSVGResourceClipper.cpp:
+ (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::postApplyResource):
+ * rendering/RenderSVGResourceGradient.cpp:
+ (WebCore::clipToTextMask):
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::applyResource):
+ * rendering/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::buildPattern):
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::paintProgressBar):
+ * svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::build):
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::nativeImageForCurrentFrame):
+ * svg/graphics/SVGImage.h:
+ * svg/graphics/filters/SVGFEMerge.cpp:
+ (WebCore::FEMerge::apply):
+ * svg/graphics/filters/SVGFEOffset.cpp:
+ (WebCore::FEOffset::apply):
+ * svg/graphics/filters/SVGFETile.cpp:
+ (WebCore::FETile::apply):
+
+2010-08-16 Paul Sawaya <psawaya@apple.com>
+
+ Reviewed by Chris Marrin.
+
+ Added shader validation via ANGLE
+ https://bugs.webkit.org/show_bug.cgi?id=42405
+
+ Added validation to WebGL via ANGLE
+
+ * Configurations/WebCore.xcconfig:
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/ANGLEWebKitBridge.cpp: Added.
+ (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
+ (WebCore::ANGLEWebKitBridge::~ANGLEWebKitBridge):
+ (WebCore::ANGLEWebKitBridge::validateShaderSource):
+ * platform/graphics/ANGLEWebKitBridge.h: Added.
+ (WebCore::):
+ (WebCore::ANGLEWebKitBridge::setResources):
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::):
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+ (WebCore::GraphicsContext3D::compileShader):
+ (WebCore::GraphicsContext3D::shaderSource):
+ (WebCore::GraphicsContext3D::getShaderiv):
+ (WebCore::GraphicsContext3D::getShaderInfoLog):
+ (WebCore::GraphicsContext3D::getShaderSource):
+
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, do not build WebCore as a convenience library as this leads to
+ errors in the Win build w/export symbols and causes problems with DOM bindings
+ debugging in gdb.
+
+ * wscript: Removed.
+
+2010-08-16 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ Current implementation of WebCore post-build step on windows platform is error prone.
+ It would be better to extract the script into external file.
+ https://bugs.webkit.org/show_bug.cgi?id=44058
+
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.vcproj/copyForwardingHeaders.cmd: Added.
+ * WebCore.vcproj/copyInspectorFiles.cmd: Added.
+
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Fix typo in previous build fix.
+
+ * platform/graphics/WOFFFileFormat.cpp:
+
+2010-08-16 Alex Milowski <alex@milowski.com>
+
+ Reviewed by David Levin.
+
+ Added the configuration of the MathML related files.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: fix Leopard Release inspector tests.
+
+ * inspector/front-end/inspector.js:
+
+2010-08-16 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Implements IDBKeyPath extractor.
+ https://bugs.webkit.org/show_bug.cgi?id=43276
+
+ Unit-test IDBKeyPathExtractorTest.cpp.
+ LayoutTests will arrive as IndexedDB infrastructure is fleshed out.
+
+ * bindings/v8/IDBBindingUtilities.cpp:
+ (WebCore::getValueFrom):
+ (WebCore::createIDBKeyFromSerializedValueAndKeyPath):
+ * bindings/v8/IDBBindingUtilities.h:
+
+2010-08-13 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Kenneth Rohde Christiansen and Martin Robinson.
+
+ [GTK] GTK+ drawing idle starved
+ https://bugs.webkit.org/show_bug.cgi?id=43994
+
+ Tune down the priority of the shared timers to guarantee GTK+ has
+ an opportunity to redraw.
+
+ * platform/gtk/SharedTimerGtk.cpp:
+ (WebCore::setSharedTimerFireTime):
+
+2010-08-16 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Build fix after r65366.
+
+ EFL port does not support automated tests yet.
+
+ * CMakeLists.txt: Use if (VAR) instead of if (${VAR}) to check if
+ they're empty.
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Make InjectedScript proto-based.
+ https://bugs.webkit.org/show_bug.cgi?id=44028
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+
+2010-08-16 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Fix warning in WebCore/plugins/win/PluginPackageWin.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=43920
+
+ * plugins/win/PluginPackageWin.cpp:
+ (WebCore::PluginPackage::fetchInfo):
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Touch inspector file to force frontend deployment.
+
+ * inspector/InspectorController.cpp:
+
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix for non-Win ports on Windows.
+
+ * platform/graphics/WOFFFileFormat.cpp:
+
+2010-08-16 Adam Langley <agl@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ [chromium] Improve spacing support for complex text on Linux
+
+ https://bugs.webkit.org/show_bug.cgi?id=39014
+
+ Previously, our complex text support ignored word-spacing,
+ justification and letter-spacing. This fixes the first two issues and
+ allows us to render Scribd's HTML5 documents much better.
+
+ Test: fast/text/atsui-spacing-features.html
+
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::TextRunWalker::TextRunWalker):
+ (WebCore::TextRunWalker::setWordSpacingAdjustment):
+ (WebCore::TextRunWalker::setLetterSpacingAdjustment):
+ (WebCore::TextRunWalker::setPadding):
+ (WebCore::TextRunWalker::setGlyphXPositions):
+ (WebCore::TextRunWalker::isCodepointSpace):
+ (WebCore::Font::drawComplexText):
+ (WebCore::Font::floatWidthForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+
+2010-08-16 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix warnings: unknown conversion type character 'l' in format
+ https://bugs.webkit.org/show_bug.cgi?id=43359
+
+ * loader/icon/IconDatabase.cpp:
+ (WebCore::IconDatabase::performURLImport): Replace %zu with %lu, because Windows doesn't understand z modifier.
+ (WebCore::IconDatabase::pruneUnretainedIcons): Use %I64i intsead of %lli on Windows.
+ * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
+ (WebCore::MediaPlayerPrivate::totalTimeChanged): Use %I64d intsead of %lld on Windows.
+ * platform/sql/SQLiteDatabase.cpp:
+ (WebCore::SQLiteDatabase::setMaximumSize): Use %I64i intsead of %lli on Windows.
+ * storage/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::setQuota): Use %I64u intsead of %llu on Windows.
+
+2010-08-16 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix warnings: unknown conversion type character 'l' in format
+ https://bugs.webkit.org/show_bug.cgi?id=43359
+
+ * loader/FTPDirectoryParser.cpp: Use %I64u format specifier instead of %llu on Windows.
+ (WebCore::parseOneFTPLine):
+
+2010-08-16 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Shadow blur for rectangle fill
+ https://bugs.webkit.org/show_bug.cgi?id=44025
+
+ The blur implementation follows the approximation of Gaussian blur
+ with three successive box blurs, working on the alpha channel only.
+ (see http://www.w3.org/TR/SVG/filters.html#feGaussianBlur).
+
+ * WebCore.pro: Refer to ContexShadow.* files.
+ * platform/graphics/qt/ContextShadow.cpp: Added.
+ (WebCore::ContextShadow::ContextShadow):
+ (WebCore::ContextShadow::clear):
+ (WebCore::blurHorizontal): Box blurs in horizontal direction, working
+ on QImage (in-place).
+ (WebCore::shadowBlur): Main blur function which just calls the
+ above blurHorizontal function twice, once with transposed image
+ (equivalent as it would have done vertical box blurs).
+ (WebCore::ContextShadow::drawShadowRect):
+ * platform/graphics/qt/ContextShadow.h: Added.
+ (WebCore::ContextShadow::):
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow):
+ (WebCore::GraphicsContext::restorePlatformState):
+ (WebCore::GraphicsContext::fillRect): Use ContextShadow for the shadow.
+ (WebCore::GraphicsContext::setPlatformShadow):
+
+2010-08-16 Andras Becsi <abecsi@webkit.org>
+
+ Rubber-stamped by Gustavo Noronha Silva.
+
+ [GTK] Build fix for MathML code generation.
+
+ No new tests needed.
+
+ * GNUmakefile.am:
+
+2010-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65414.
+ http://trac.webkit.org/changeset/65414
+ https://bugs.webkit.org/show_bug.cgi?id=44055
+
+ GTL & QT tests failing. (Requested by pfeldman on #webkit).
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+
+2010-08-16 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Save and restore shadow state in GraphicsContextQt
+ https://bugs.webkit.org/show_bug.cgi?id=44031
+
+ This is needed after r65362.
+ Use a new class ContextShadowParameter to track and keep the shadow
+ state. We use this rather than using GraphicsContextState to allow
+ possible optimizations (right now only to determine the shadow type,
+ but in future it might cover things like cached scratch image,
+ persistent shader, etc).
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::ContextShadowParameter::):
+ (WebCore::ContextShadowParameter::ContextShadowParameter):
+ (WebCore::ContextShadowParameter::clear):
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow):
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::savePlatformState):
+ (WebCore::GraphicsContext::restorePlatformState):
+ (WebCore::GraphicsContext::drawRect):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ (WebCore::GraphicsContext::clearPlatformShadow):
+
+2010-07-28 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Implement IDBKeyPath parser.
+ https://bugs.webkit.org/show_bug.cgi?id=42976
+
+ IDBKeyPath is an internal class, exposed only for unit tests for now.
+ It'll allow indexed database implementation to traverse a given key path and obtain the corresponding properties
+ from a SerializedScriptValue.
+
+ * WebCore.gypi:
+ * storage/IDBKeyPath.cpp: Added.
+ (WebCore::IDBKeyPath::create):
+ (WebCore::IDBKeyPath::IDBKeyPath):
+ (WebCore::IDBKeyPath::~IDBKeyPath):
+ (WebCore::IDBKeyPath::hasNext):
+ (WebCore::IDBKeyPath::next):
+ (WebCore::IDBKeyPath::identifier):
+ (WebCore::IDBKeyPath::hasIndex):
+ (WebCore::IDBKeyPath::indexValue):
+ (WebCore::IDBKeyPath::parserError):
+ (WebCore::IDBKeyPath::parse):
+ (WebCore::IDBKeyPath::Lexer::lex):
+ (WebCore::isSafeIdentifierStartCharacter):
+ (WebCore::isSafeIdentifierCharacter):
+ (WebCore::IDBKeyPath::Lexer::lexIdentifier):
+ (WebCore::IDBKeyPath::Lexer::lexNumber):
+ * storage/IDBKeyPath.h: Added.
+ (WebCore::IDBKeyPath::Token::Token):
+ (WebCore::IDBKeyPath::):
+ (WebCore::IDBKeyPath::Lexer::Lexer):
+ (WebCore::IDBKeyPath::Lexer::next):
+ (WebCore::IDBKeyPath::Lexer::currentToken):
+
+2010-08-13 Steve Block <steveblock@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Geolocation requests in progress when the frame is disconnected should invoke the error callback
+ https://bugs.webkit.org/show_bug.cgi?id=43974
+
+ If requests are ongoing when the Frame is disconnected, we abort them with a fatal error.
+ To do this, when Geolocation::disconnectFrame() is called we call cancelAllRequests() to
+ set a fatal error on all ongoing requests. Once the requests have made their error
+ callbacks, they are deleted. Note that we check at callback time that the script
+ execution context for the callback is still valid, so it's safe to attempt these
+ callbacks even after the Geolocation object's Frame has gone.
+
+ This requires a change to allow multiple calls to GeoNotifier::setFatalError().
+ For repeated calls, we do not replace the existing error. This ensures that when
+ permission has been denied and the frame is then disconnected, the error callback
+ reports the permission error, as required by the spec.
+
+ Tests: fast/dom/Geolocation/disconnected-frame.html
+ fast/dom/Geolocation/disconnected-frame-permission-denied.html
+
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::GeoNotifier::setFatalError):
+ (WebCore::Geolocation::disconnectFrame):
+ (WebCore::Geolocation::startRequest):
+ (WebCore::Geolocation::cancelAllRequests):
+ * page/Geolocation.h:
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: upstream frontend-side WebSocket transport.
+ https://bugs.webkit.org/show_bug.cgi?id=43970
+
+ Chromium already has an alternate WebSocket-based communication channel with
+ the backend. Upstreaming it in this change. We will agree on the URI
+ of the remote service as the protocol matures.
+
+ * inspector/front-end/inspector.js:
+ (.WebInspector.socket.onmessage):
+ (.WebInspector.socket.onerror):
+ (.WebInspector.socket.onopen):
+ (WebInspector.loaded):
+ (WebInspector.doLoadedDone):
+ (WebInspector_syncDispatch):
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Make InjectedScript proto-based.
+ https://bugs.webkit.org/show_bug.cgi?id=44028
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+ * inspector/front-end/inspector.js:
+ (WebInspector.loaded):
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: [REGRESSION] console's clear command does not work.
+ https://bugs.webkit.org/show_bug.cgi?id=44027
+
+ Test: inspector/console-command-clear.html
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorBackend.cpp:
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::clearConsoleMessages):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.requestClearMessages):
+ * inspector/front-end/inspector.js:
+ (WebInspector.consoleMessagesCleared):
+
+2010-08-16 Jeremy Orlow <jorlow@chromium.org>
+
+ Ugh, the #if ENABLE() was supposed to be added to Settings not GroupSettings.
+
+ * page/GroupSettings.cpp:
+ (WebCore::GroupSettings::GroupSettings):
+ (WebCore::GroupSettings::setLocalStorageQuotaBytes):
+ * page/GroupSettings.h:
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+
+2010-08-16 Jeremy Orlow <jorlow@chromium.org>
+
+ Last build fix?
+
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::PageGroup):
+
+2010-08-16 Jeremy Orlow <jorlow@chromium.org>
+
+ Ugh...another build fix.
+
+ * page/GroupSettings.cpp:
+ (WebCore::GroupSettings::GroupSettings):
+ * page/GroupSettings.h:
+
+2010-08-16 Jeremy Orlow <jorlow@chromium.org>
+
+ Build fix.
+
+ * GNUmakefile.am:
+
+2010-08-16 Jeremy Orlow <jorlow@chromium.org>
+
+ Build fix.
+
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::localStorage):
+
+2010-08-13 Jeremy Orlow <jorlow@chromium.org>
+
+ Some settings are linked to the PageGroup not the Page. Create a new class for those.
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ Since persistient storage is shared between pages, there's no way to modify
+ some settings related to it on a per page basis. As such, it's not technically
+ correct for these settings to be on the Page's settings. Create a new class
+ called GroupSettings, move group-wide local storage setting there (the other we
+ can't), and add a new setting for IndexedDB's path (which is prompting this change).
+
+ No behavior has changed, so no tests.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/GroupSettings.cpp: Added.
+ (WebCore::GroupSettings::GroupSettings):
+ (WebCore::GroupSettings::setLocalStorageQuotaBytes):
+ (WebCore::GroupSettings::setLocalStorageDatabasePath):
+ (WebCore::GroupSettings::setIndexedDBDatabasePath):
+ * page/GroupSettings.h: Added.
+ (WebCore::GroupSettings::create):
+ (WebCore::GroupSettings::localStorageQuotaBytes):
+ (WebCore::GroupSettings::localStorageDatabasePath):
+ (WebCore::GroupSettings::indexedDBDatabasePath):
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::PageGroup):
+ (WebCore::PageGroup::localStorage):
+ * page/PageGroup.h:
+ (WebCore::PageGroup::groupSettings):
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setSessionStorageQuota):
+ * page/Settings.h:
+
+2010-08-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ HTML5 fragment parsing doesn't load iframes
+ https://bugs.webkit.org/show_bug.cgi?id=44038
+
+ Previously, this code assumed that every source iframe was actually
+ attached to a render tree. It tried to "keep the iframe alive" as it
+ moved documents. However, if the iframe wasn't attached to begin with,
+ it was never "alive," so trying to keep a dead iframe alive lead to a
+ ... zombie iframe.
+
+ Test: fast/frames/adopt-from-created-document.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::adoptNode):
+
+2010-08-13 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43778
+ Dropping should fire textInput event
+
+ This change:
+ - added TextEvent::m_isDrop to distinguish drop-initiated events.
+ - added to dispatch TextEvent from DragController before making a side effect
+ and cancel the side effect if the event prevents default
+
+ Tests: editing/pasteboard/drop-text-events-sideeffect.html
+ editing/pasteboard/drop-text-events.html
+
+ * dom/TextEvent.cpp:
+ (WebCore::TextEvent::createForDrop): Added.
+ (WebCore::TextEvent::TextEvent):
+ * dom/TextEvent.h:
+ (WebCore::TextEvent::isDrop): Added.
+ * editing/Editor.cpp:
+ (WebCore::Editor::handleTextEvent):
+ (WebCore::Editor::findEventTargetFrom): Extracted from findEventTargetFromSelection().
+ (WebCore::Editor::findEventTargetFromSelection):
+ * editing/Editor.h:
+ * page/DragController.cpp:
+ (WebCore::DragController::dispatchTextInputEventFor): Added.
+ (WebCore::DragController::concludeEditDrag): Added an event dispatch path.
+ * page/DragController.h:
+
+2010-08-15 Ariya Hidayat <ariya@sencha.com>
+
+ Unreviewed, rolling out r65393.
+ http://trac.webkit.org/changeset/65393
+ https://bugs.webkit.org/show_bug.cgi?id=44031
+
+ Breaks some canvas tests.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::):
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow):
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::savePlatformState):
+ (WebCore::GraphicsContext::restorePlatformState):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ (WebCore::GraphicsContext::clearPlatformShadow):
+
+2010-08-15 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Save and restore shadow state in GraphicsContextQt
+ https://bugs.webkit.org/show_bug.cgi?id=44031
+
+ This is needed after r65362.
+ Use a new class ContextShadowParameter to track and keep the shadow
+ state. We use this rather than using GraphicsContextState to allow
+ possible optimizations (right now only to determine the shadow type,
+ but in future it might cover things like cached scratch image,
+ persistent shader, etc).
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::ContextShadowParameter::):
+ (WebCore::ContextShadowParameter::ContextShadowParameter):
+ (WebCore::ContextShadowParameter::clear):
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow):
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::savePlatformState):
+ (WebCore::GraphicsContext::restorePlatformState):
+ (WebCore::GraphicsContext::drawRect):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ (WebCore::GraphicsContext::clearPlatformShadow):
+
+2010-08-15 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Border should not cast shadows
+ https://bugs.webkit.org/show_bug.cgi?id=44015
+
+ Shadows should be not casted except for brush fill (which is not what
+ drawLine and drawRect are supposed to do).
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawRect): Remove shadow painting,
+ (WebCore::GraphicsContext::drawLine): ditto.
+
+2010-08-15 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Build error on r65378
+ https://bugs.webkit.org/show_bug.cgi?id=44019
+
+ Change build script for HTMLEntityNames.json instead of HTMLEntityNames.gperf
+
+ * CMakeLists.txt:
+
+2010-08-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add missing header.
+
+ * platform/graphics/WOFFFileFormat.cpp:
+
+2010-08-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, don't build PluginDataNone.cpp even on GTK as PluginDataWx.cpp compiles.
+
+ * wscript:
+
+2010-08-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ document.write() doesn't flush plain text
+ https://bugs.webkit.org/show_bug.cgi?id=8961
+
+ Originally I thought we should buffer the character tokens until we've
+ reached the end of the input stream, but that's not how the spec
+ handles things (it emits the character tokens one-by-one).
+
+ Tests: fast/tokenizer/flush-characters-in-document-write-evil.html
+ fast/tokenizer/flush-characters-in-document-write.html
+
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::emitEndOfFile):
+ (WebCore::HTMLTokenizer::nextToken):
+ (WebCore::HTMLTokenizer::haveBufferedCharacterToken):
+ - Renamed this function now that it's simplier.
+ * html/HTMLTokenizer.h:
+
+2010-08-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't try to replace a non-existent document after executing JavaScript URLs
+ https://bugs.webkit.org/show_bug.cgi?id=44024
+
+ Synchronous JavaScript execution is evil. Previously, the frame was
+ deleted after executing the JavaScript URL, so we'd get confused when
+ we tried to replace its document.
+
+ Test: fast/frames/javascript-url-for-deleted-frame.html
+
+ * bindings/ScriptControllerBase.cpp:
+ (WebCore::ScriptController::executeIfJavaScriptURL):
+
+2010-08-14 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65374.
+ http://trac.webkit.org/changeset/65374
+ https://bugs.webkit.org/show_bug.cgi?id=44018
+
+ broke a myriad of svg tests (Requested by kling on #webkit).
+
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::strokeBoundingRect):
+
+2010-08-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ XSLTProcessor.transformToFragment should not pass contextElement to html/xml document parsers
+ https://bugs.webkit.org/show_bug.cgi?id=44017
+
+ This fixes two tests which otherwise would fail when the
+ HTML5 TreeBuilder is enabled for fragment parsing.
+
+ This revealed a bug in HTMLTreeBuilder() which I fixed as well.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ * xml/XSLTProcessor.cpp:
+ (WebCore::createFragmentFromSource):
+
+2010-08-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Path: Fast approximation of stroke bounding rects
+ https://bugs.webkit.org/show_bug.cgi?id=44014
+
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::strokeBoundingRect): Use QPainterPath::controlPointRect()
+ to calculate a slightly larger bounding rect in a fraction of the time.
+
+2010-08-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move innerHTML off of Range::createContextualFragment
+ https://bugs.webkit.org/show_bug.cgi?id=44011
+
+ This makes all the editing tests stop failing under the
+ HTML5 TreeBuilder.
+
+ In a previous patch Adam disabled some of the (wrong) code
+ in createContextualFragment when in html5 treebuilder mode.
+ The problem is that the editing code depends on
+ createContextualFragment (as well as the Range DOM API),
+ so we have to leave this code in until we can figure
+ out if it's right or wrong behavior for the Range API.
+
+ This patch moves innerHTML/outerHTML off of using
+ createContextualFragment and instead calls
+ DocumentFragment::parseHTML directly (which is much simpler).
+
+ I expect Adam and I will end up turning on the HTML5 TreeBuilder
+ in the next couple days, and most of the if branches I added
+ here will go away for good.
+
+ I renamed Element::createContextualFragment to
+ deprecatedCreateContextualFragment, to indicate that it's a
+ dead API. The editing code should move off of it and consider
+ using DocumentFragment::parseHTML instead.
+
+ * dom/Element.cpp:
+ (WebCore::Element::deprecatedCreateContextualFragment):
+ * dom/Element.h:
+ * dom/Range.cpp:
+ (WebCore::Range::createContextualFragment):
+ * editing/markup.cpp:
+ (WebCore::createFragmentFromMarkup):
+ * html/HTMLElement.cpp:
+ (WebCore::useLegacyTreeBuilder):
+ (WebCore::HTMLElement::deprecatedCreateContextualFragment):
+ (WebCore::HTMLElement::setInnerHTML):
+ (WebCore::HTMLElement::setOuterHTML):
+ * html/HTMLElement.h:
+
+2010-08-14 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Antonio Gomes.
+
+ [Qt] Fix compilation with QT_NO_LINEEDIT
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+ (JSC::Bindings::convertQVariantToValue):
+
+2010-08-14 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Dirk Schulze.
+
+ IE SVG empty path test fails
+ https://bugs.webkit.org/show_bug.cgi?id=44008
+
+ Change createLine to allow creating zero-length lines. This makes it possible
+ to have markers and line-caps applied to zero-length lines.
+
+ Test: svg/custom/marker-empty-path.svg
+
+ * platform/graphics/Path.cpp:
+ (WebCore::Path::createLine):
+
+2010-08-14 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [CMake] Move SQL files into a IF (ENABLE_DATABASE) section
+ https://bugs.webkit.org/show_bug.cgi?id=43979
+
+ * CMakeLists.txt:
+
+2010-08-14 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Canvas is not reset when setting canvas.width
+ https://bugs.webkit.org/show_bug.cgi?id=43341
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::reset): Moved the call to
+ hasCreatedImageBuffer up *before* the call to setSurface since setSurface
+ sets hasCreatedImageBuffer to false every time.
+
+2010-08-14 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [CMake] Set target properties only if available
+ https://bugs.webkit.org/show_bug.cgi?id=43978
+
+ * CMakeLists.txt:
+
+2010-08-14 Dirk Schulze <krit@webkit.org>
+
+ Unreviewed sort of Xcode project file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-08-14 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Simon Hausmann and Kenneth Rohde Christiansen.
+
+ [Qt] Refactor shadow state handling in GraphicsContextQt
+ https://bugs.webkit.org/show_bug.cgi?id=44006
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::): Added shadow states as
+ member variables.
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow): Convenient
+ function to check whether there is shadow or not.
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::drawRect): Use shadow states instead of
+ calling getShadow.
+ (WebCore::GraphicsContext::drawLine): ditto.
+ (WebCore::GraphicsContext::strokeArc): ditto.
+ (WebCore::GraphicsContext::drawConvexPolygon): ditto.
+ (WebCore::GraphicsContext::fillPath): ditto.
+ (WebCore::GraphicsContext::strokePath): ditto.
+ (WebCore::GraphicsContext::fillRect): Removes the use of helper function
+ drawBorderlessRectShadow as the code already becomes a lot simpler.
+ (WebCore::GraphicsContext::fillRoundedRect): Removes the use of helper
+ function drawFilledShadowPath as the code already becomes a lot simpler.
+ (WebCore::GraphicsContext::setPlatformShadow): Store shadow states
+ and find out the shadow type (complexity) for future use.
+ (WebCore::GraphicsContext::clearPlatformShadow): Reset shadow states.
+
+2010-08-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename some concepts in HTML entity search to be more self-documenting
+ https://bugs.webkit.org/show_bug.cgi?id=44004
+
+ Start and end are now first and last, which lets us use some better
+ names for the statics in HTMLEntityTable.
+
+ * html/HTMLEntityParser.cpp:
+ (WebCore::consumeHTMLEntity):
+ * html/HTMLEntitySearch.cpp:
+ (WebCore::HTMLEntitySearch::HTMLEntitySearch):
+ (WebCore::HTMLEntitySearch::findFirst):
+ (WebCore::HTMLEntitySearch::findLast):
+ (WebCore::HTMLEntitySearch::advance):
+ * html/HTMLEntitySearch.h:
+ (WebCore::HTMLEntitySearch::isEntityPrefix):
+ (WebCore::HTMLEntitySearch::mostRecentMatch):
+ (WebCore::HTMLEntitySearch::fail):
+ * html/HTMLEntityTable.h:
+
+2010-08-13 Adam Barth <abarth@webkit.org>
+
+ Fix ASSERT in XML entity parsing. You can't advance the entity search
+ if you've already discovered that your string is not an entity.
+
+ * html/HTMLEntityParser.cpp:
+ (WebCore::decodeNamedEntity):
+
+2010-08-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Attempt at fixing Chromium build.
+
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
+
+ * WebCore.gyp/WebCore.gyp:
+ - I have no clue if this is right or not.
+
+2010-08-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Attempted build fix for Windows.
+
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
+
+ * DerivedSources.cpp:
+ - Add HTMLEntityTable.cpp
+
+2010-08-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
+
+ Implementing the HTML5 entity parsing algorithm require refactoring how
+ we search for entity names. Instead of using a perfect hash, we now
+ use a sorted list. As we advance through the input, we walk down a
+ binary search of the table looking for an entity.
+
+ Using this data structure lets us keep track of whether the current
+ string is a prefix of an existing entity, which we need for the
+ algorithm. In a future patch, I plan to add some indices to the
+ table, which should let us narrow down the range of interesting entries
+ more quickly.
+
+ The one nasty piece of the algorithm is if we walk too far down the
+ input and we need to back up to a previous match. In this patch, we
+ accomplish this by rewinding the input and consuming a known number of
+ characters to resync the source.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTMLEntityParser.cpp:
+ (WebCore::consumeHTMLEntity):
+ * html/HTMLEntitySearch.cpp: Added.
+ (WebCore::):
+ (WebCore::HTMLEntitySearch::HTMLEntitySearch):
+ (WebCore::HTMLEntitySearch::compare):
+ (WebCore::HTMLEntitySearch::findStart):
+ (WebCore::HTMLEntitySearch::findEnd):
+ (WebCore::HTMLEntitySearch::advance):
+ * html/HTMLEntitySearch.h: Added.
+ (WebCore::HTMLEntitySearch::isEntityPrefix):
+ (WebCore::HTMLEntitySearch::currentValue):
+ (WebCore::HTMLEntitySearch::lastMatch):
+ (WebCore::HTMLEntitySearch::):
+ (WebCore::HTMLEntitySearch::fail):
+ * html/HTMLEntityTable.h: Added.
+ (WebCore::HTMLEntityTableEntry::lastCharacter):
+
+2010-08-13 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Refactor HTMLScriptRunner to allow deferred scripts to share code
+ https://bugs.webkit.org/show_bug.cgi?id=43736
+
+ No new tests because no functional change
+
+ * html/HTMLScriptRunner.cpp:
+ (WebCore::HTMLScriptRunner::sourceFromPendingScript): Make const to enforce the idea that it doesn't change m_parsingBlockingScript.
+ (WebCore::HTMLScriptRunner::executeParsingBlockingScript): Rename to make it clear this deals with the parsing blocking script and refactor to use executePendingScriptAndDispatchEvent.
+ (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Factored out of executePendingScript, this can be used for executing any external script.
+ (WebCore::HTMLScriptRunner::executeScript): This can be used for executing any inline or external script. ASSERTs moved to the two calling points.
+ (WebCore::HTMLScriptRunner::executeParsingBlockingScripts): Moved method.
+ (WebCore::HTMLScriptRunner::requestParsingBlockingScript): Factored out requestPendingScript.
+ (WebCore::HTMLScriptRunner::requestPendingScript): Factored out from reqeustParsingBlockingScript.
+ (WebCore::HTMLScriptRunner::runScript):
+ * html/HTMLScriptRunner.h:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/win/SharedBufferWin.cpp:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+ Switch String::/UString::ascii() to return a CString.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/c/c_class.cpp:
+ (JSC::Bindings::CClass::methodsNamed):
+ (JSC::Bindings::CClass::fieldNamed):
+ * bridge/jni/jsc/JNIBridgeJSC.cpp:
+ (JavaField::valueFromInstance):
+ (JavaField::setValueToInstance):
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ (JavaInstance::invokeMethod):
+ * bridge/objc/objc_class.mm:
+ (JSC::Bindings::ObjcClass::methodsNamed):
+ (JSC::Bindings::ObjcClass::fieldNamed):
+ * bridge/objc/objc_instance.mm:
+ (ObjcInstance::setValueOfUndefinedField):
+ (ObjcInstance::getValueOfUndefinedField):
+ * loader/icon/IconRecord.cpp:
+ * platform/sql/SQLiteDatabase.cpp:
+ * platform/sql/SQLiteStatement.cpp:
+ * storage/SQLStatement.cpp:
+
+2010-08-13 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Session history should skip over JS redirects
+ https://bugs.webkit.org/show_bug.cgi?id=42861
+
+ Lock the back/forward list for location changes and form submits that
+ happen before the onload event fires that are not the result of user
+ gestures.
+
+ Made form submission (at the ScheduledFormSubmission level) more similar
+ to ScheduledURLNavigation by having it call clientRedirected too, fixing
+ a long-standing FIXME.
+
+ Test: fast/history/gesture-before-onload-location-href.html,
+ fast/history/gesture-before-onload-form-submit.html and updated
+ expectations for http/tests/history tests that used to fail.
+
+ * loader/FormSubmission.cpp:
+ (WebCore::FormSubmission::requestURL):
+ (WebCore::FormSubmission::populateFrameLoadRequest):
+ * loader/FormSubmission.h:
+ * loader/RedirectScheduler.cpp:
+ (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
+ (WebCore::ScheduledFormSubmission::fire):
+ (WebCore::ScheduledFormSubmission::didStartTimer):
+ (WebCore::ScheduledFormSubmission::didStopTimer):
+ (WebCore::RedirectScheduler::scheduleRedirect):
+ (WebCore::RedirectScheduler::mustLockBackForwardList):
+ (WebCore::RedirectScheduler::scheduleLocationChange):
+ (WebCore::RedirectScheduler::scheduleFormSubmission):
+ * loader/RedirectScheduler.h:
+
+2010-08-13 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Unreviewed build fix.
+ These changes were supposed to be landed on r65319, but due to some
+ svn-apply/commit-queue bug it wasn't fully applied. A bug was filed
+ by Patrick Gansterer (author of the changes in this commit):
+ https://bugs.webkit.org/show_bug.cgi?id=43981
+
+ * CMakeLists.txt: Update calls to GENERATE_GPERF and
+ GENERATE_GRAMMAR macros.
+
+2010-08-13 Chris Fleizach <cfleizach@apple.com>
+
+ AX: isNativeCheckbox does not work as advertised
+ https://bugs.webkit.org/show_bug.cgi?id=43872
+
+ Re-adding this patch after it was erroneously rolled out.
+
+ Test: platform/mac/accessibility/native-vs-nonnative-checkboxes.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isInputImage):
+ (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
+ * dom/InputElement.h:
+ * html/HTMLInputElement.h:
+ (WebCore::HTMLInputElement::isCheckbox):
+
+2010-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65331.
+ http://trac.webkit.org/changeset/65331
+ https://bugs.webkit.org/show_bug.cgi?id=43980
+
+ This patch breaks some shadow tests on Qt Linux release
+ (Requested by ariya on #webkit).
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::drawRect):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::drawFilledShadowPath):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::drawBorderlessRectShadow):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ (WebCore::GraphicsContext::clearPlatformShadow):
+
+2010-08-13 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ Update run-bindings-tests expectations
+ https://bugs.webkit.org/show_bug.cgi?id=43944
+
+ The results have become out of sync after changeset 64552 and 65269.
+
+ Test: WebKitTools/Scripts/run-bindings-tests
+
+ * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
+ (webkit_dom_test_callback_callback_with_class1param):
+ (webkit_dom_test_callback_callback_with_class2param):
+ (webkit_dom_test_callback_callback_with_non_bool_return_type):
+ * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_void_method_with_args):
+ (webkit_dom_test_obj_int_method_with_args):
+ (webkit_dom_test_obj_obj_method):
+ (webkit_dom_test_obj_obj_method_with_args):
+ (webkit_dom_test_obj_method_that_requires_all_args):
+ (webkit_dom_test_obj_method_that_requires_all_args_and_throws):
+ (webkit_dom_test_obj_serialized_value):
+ (webkit_dom_test_obj_idb_key):
+ (webkit_dom_test_obj_with_dynamic_frame_and_user_gesture):
+ (webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad):
+ (webkit_dom_test_obj_with_script_state_obj):
+ (webkit_dom_test_obj_with_script_state_obj_exception):
+ (webkit_dom_test_obj_get_read_only_string_attr):
+ (webkit_dom_test_obj_get_read_only_test_obj_attr):
+ (webkit_dom_test_obj_get_string_attr):
+ (webkit_dom_test_obj_set_string_attr):
+ (webkit_dom_test_obj_get_test_obj_attr):
+ (webkit_dom_test_obj_set_test_obj_attr):
+ (webkit_dom_test_obj_get_xml_obj_attr):
+ (webkit_dom_test_obj_set_xml_obj_attr):
+ (webkit_dom_test_obj_get_reflected_string_attr):
+ (webkit_dom_test_obj_set_reflected_string_attr):
+ (webkit_dom_test_obj_get_reflected_url_attr):
+ (webkit_dom_test_obj_set_reflected_url_attr):
+ (webkit_dom_test_obj_get_reflected_non_empty_url_attr):
+ (webkit_dom_test_obj_set_reflected_non_empty_url_attr):
+ (webkit_dom_test_obj_get_reflected_custom_url_attr):
+ (webkit_dom_test_obj_set_reflected_custom_url_attr):
+ (webkit_dom_test_obj_get_reflected_custom_non_empty_url_attr):
+ (webkit_dom_test_obj_set_reflected_custom_non_empty_url_attr):
+ (webkit_dom_test_obj_get_string_attr_with_getter_exception):
+ (webkit_dom_test_obj_set_string_attr_with_getter_exception):
+ (webkit_dom_test_obj_get_string_attr_with_setter_exception):
+ (webkit_dom_test_obj_set_string_attr_with_setter_exception):
+ (webkit_dom_test_obj_get_script_string_attr):
+ (webkit_dom_test_obj_get_hash):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
+
+2010-08-13 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Canvas and CSS: blur option in shadow not working
+ https://bugs.webkit.org/show_bug.cgi?id=34479
+
+ Patch 1: Refactor shadow states handling.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContextPlatformPrivate::): Added shadow states as
+ member variables.
+ (WebCore::GraphicsContextPlatformPrivate::hasShadow): Convenient
+ function to check whether there is shadow or not.
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+ (WebCore::GraphicsContext::drawRect): Use shadow states instead of
+ calling getShadow.
+ (WebCore::GraphicsContext::drawLine): ditto.
+ (WebCore::GraphicsContext::strokeArc): ditto.
+ (WebCore::GraphicsContext::drawConvexPolygon): ditto.
+ (WebCore::GraphicsContext::fillPath): ditto.
+ (WebCore::GraphicsContext::strokePath): ditto.
+ (WebCore::GraphicsContext::fillRect): Removes the use of helper function
+ drawBorderlessRectShadow as the code already becomes a lot simpler.
+ (WebCore::GraphicsContext::fillRoundedRect): Removes the use of helper
+ function drawFilledShadowPath as the code already becomes a lot simpler.
+ (WebCore::GraphicsContext::setPlatformShadow): Store shadow states
+ and find out the shadow type (complexity) for future use.
+ (WebCore::GraphicsContext::clearPlatformShadow): Reset shadow states.
+
+2010-08-11 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Regression in linking of programs
+ https://bugs.webkit.org/show_bug.cgi?id=43820
+
+ Shaders and programs shouldn't be deleted until their attachments are removed, therefore, we need to track the attach/detach/useProgram.
+
+ * html/canvas/WebGLObject.cpp: Track the object attachment count and whether it should really be deleted.
+ (WebCore::WebGLObject::WebGLObject):
+ (WebCore::WebGLObject::setObject):
+ (WebCore::WebGLObject::deleteObject):
+ * html/canvas/WebGLObject.h: Track the object attachment count and whether it should really be deleted.
+ (WebCore::WebGLObject::onAttached):
+ (WebCore::WebGLObject::onDetached):
+ (WebCore::WebGLObject::getAttachmentCount):
+ * html/canvas/WebGLProgram.cpp: Track the attached shaders.
+ (WebCore::WebGLProgram::WebGLProgram):
+ (WebCore::WebGLProgram::deleteObjectImpl):
+ (WebCore::WebGLProgram::getAttachedShader):
+ (WebCore::WebGLProgram::attachShader):
+ (WebCore::WebGLProgram::detachShader):
+ * html/canvas/WebGLProgram.h: Track the attached shaders.
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::attachShader): Track the attachment of a shader to a program.
+ (WebCore::WebGLRenderingContext::deleteProgram): Detach shaders.
+ (WebCore::WebGLRenderingContext::detachShader): Track the attachment of a shader to a program.
+ (WebCore::WebGLRenderingContext::validateWebGLObject): Also check if object == 0.
+ (WebCore::WebGLRenderingContext::linkProgram): Using the cached attached shaders instead of query from driver.
+ (WebCore::WebGLRenderingContext::useProgram): Track the attachment of a program to the current rendering pipeline.
+
+2010-08-13 Steve Block <steveblock@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Geolocation activity started after frame has been disconnected can cause crash
+ https://bugs.webkit.org/show_bug.cgi?id=39879
+
+ New requests started after the Frame has been disconnected are ignored. We do
+ not invoke the error callback as this would allow buggy or malicious pages to
+ hose the CPU. Such a page could hold a reference to a Geolocation object from
+ a since closed Page and register new requests from the error callback to
+ create an infinite loop.
+
+ Tests: fast/dom/Geolocation/disconnected-frame-already.html
+
+ * page/Geolocation.cpp:
+
+2010-08-13 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Support for multiple speech enabled elements in same page.
+ https://bugs.webkit.org/show_bug.cgi?id=43922
+
+ * page/SpeechInput.cpp: Generates request ids as necessary when each speech enabled input element gets
+ created/destroyed and multiplexes the listener callbacks to the appropriate input element based on the request id.
+ (WebCore::SpeechInput::SpeechInput):
+ (WebCore::SpeechInput::~SpeechInput):
+ (WebCore::SpeechInput::registerListener):
+ (WebCore::SpeechInput::unregisterListener):
+ (WebCore::SpeechInput::didCompleteRecording):
+ (WebCore::SpeechInput::didCompleteRecognition):
+ (WebCore::SpeechInput::setRecognitionResult):
+ (WebCore::SpeechInput::startRecognition):
+ (WebCore::SpeechInput::stopRecording):
+ (WebCore::SpeechInput::cancelRecognition):
+ * page/SpeechInput.h:
+ * page/SpeechInputClient.h: Now requires a one time set for the WebCore::SpeechInputListener and
+ takes in a 'requestId' for all calls.
+ * page/SpeechInputListener.h: Now returns the above mentioned requestId in all the listener callbacks for
+ identifying which input element the event goes to.
+ * platform/mock/SpeechInputClientMock.cpp:
+ (WebCore::SpeechInputClientMock::SpeechInputClientMock):
+ (WebCore::SpeechInputClientMock::setListener):
+ (WebCore::SpeechInputClientMock::startRecognition):
+ (WebCore::SpeechInputClientMock::stopRecording):
+ (WebCore::SpeechInputClientMock::cancelRecognition):
+ (WebCore::SpeechInputClientMock::timerFired):
+ * platform/mock/SpeechInputClientMock.h:
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
+ (WebCore::InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::speechInput):
+ (WebCore::InputFieldSpeechButtonElement::didCompleteRecording):
+ (WebCore::InputFieldSpeechButtonElement::didCompleteRecognition):
+ (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
+ * rendering/TextControlInnerElements.h:
+
+2010-08-13 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by David Kilzer.
+
+ HTMLMediaElement::prepareForLoad should cancel current plug-in proxy media player
+ https://bugs.webkit.org/show_bug.cgi?id=43923
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::prepareForLoad): Tell mediaPlayer to cancel the current load
+ if it already exists.
+
+2010-08-12 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ [CHROMIUM] Use the BGRA format for canvas 2D accel upload and readbacks.
+ https://bugs.webkit.org/show_bug.cgi?id=43804
+
+ Use the BGRA format from GraphicsContext3D, if supported. Also keep a
+ texture around for uploads, rather than re-creating it each time.
+
+ Covered by many layout tests (once we're running them).
+
+ * platform/graphics/chromium/GLES2Texture.cpp:
+ (WebCore::convertFormat):
+ Move convertFormat() ahead of texture creation, so we can check for
+ BGRA support.
+ (WebCore::GLES2Texture::create):
+ Use convertFormat() to determine the correct format and types to use;
+ use the returned format also for internalFormat, since GLES2 insists
+ they match.
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PlatformContextSkia::setGraphicsContext3D):
+ Clear the upload texture when a new context is set.
+ (WebCore::PlatformContextSkia::uploadSoftwareToHardware):
+ Use m_uploadTexture instead of creating a new one each time.
+ (WebCore::PlatformContextSkia::readbackHardwareToSoftware):
+ When the context supports it, use the BGRA format for readbacks
+ instead of swizzling.
+ * platform/graphics/skia/PlatformContextSkia.h:
+ Add m_uploadTexture for consecutive uploads.
+
+2010-08-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Clean up mobile feature useage
+ https://bugs.webkit.org/show_bug.cgi?id=43968
+
+ * WebCore.pro: Replaced use of Nokia specific platform scopes with concrete
+ feature names.
+
+2010-08-13 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: rename InspectorValue::push and set to
+ push{Value|Object|Array} and set{...}.
+ https://bugs.webkit.org/show_bug.cgi?id=43966
+
+ * bindings/js/ScriptProfile.cpp:
+ (WebCore::buildInspectorObjectFor):
+ * bindings/js/ScriptValue.cpp:
+ (WebCore::jsToInspectorValue):
+ * bindings/v8/ScriptCallStack.cpp:
+ (WebCore::ScriptCallStack::stackTrace):
+ * bindings/v8/ScriptProfile.cpp:
+ (WebCore::buildInspectorObjectFor):
+ * bindings/v8/ScriptValue.cpp:
+ (WebCore::v8ToInspectorValue):
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/ConsoleMessage.cpp:
+ (WebCore::ConsoleMessage::addToFrontend):
+ * inspector/Inspector.idl:
+ * inspector/InspectorApplicationCacheAgent.cpp:
+ (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
+ (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::buildArrayForCookies):
+ (WebCore::InspectorController::getDOMStorageEntries):
+ (WebCore::InspectorController::getProfileHeaders):
+ (WebCore::InspectorController::getProfile):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::getEventListenersForNode):
+ (WebCore::InspectorDOMAgent::buildObjectForNode):
+ (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
+ (WebCore::InspectorDOMAgent::getStyles):
+ (WebCore::InspectorDOMAgent::getAllStyles):
+ (WebCore::InspectorDOMAgent::getRuleRanges):
+ (WebCore::InspectorDOMAgent::buildObjectForAttributeStyles):
+ (WebCore::InspectorDOMAgent::buildArrayForCSSRules):
+ (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
+ (WebCore::InspectorDOMAgent::buildObjectForStyle):
+ (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties):
+ (WebCore::InspectorDOMAgent::buildArrayForDisabledStyleProperties):
+ (WebCore::InspectorDOMAgent::buildObjectForStyleSheet):
+ (WebCore::InspectorDOMAgent::buildObjectForRule):
+ * inspector/InspectorDebuggerAgent.cpp:
+ (WebCore::InspectorDebuggerAgent::saveBreakpoints):
+ * inspector/InspectorResource.cpp:
+ (WebCore::InspectorResource::updateScriptObject):
+ * inspector/InspectorStorageAgent.cpp:
+ (WebCore::):
+ (WebCore::InspectorStorageAgent::executeSQL):
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::pushGCEventRecords):
+ (WebCore::InspectorTimelineAgent::didInstallTimer):
+ (WebCore::InspectorTimelineAgent::didRemoveTimer):
+ (WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
+ (WebCore::InspectorTimelineAgent::willSendResourceRequest):
+ (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
+ (WebCore::InspectorTimelineAgent::didMarkTimeline):
+ (WebCore::InspectorTimelineAgent::addRecordToTimeline):
+ (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
+ * inspector/InspectorValues.cpp:
+ (WebCore::):
+ (WebCore::InspectorValue::asValue):
+ (WebCore::InspectorValue::asObject):
+ (WebCore::InspectorValue::asArray):
+ (WebCore::InspectorObject::asObject):
+ (WebCore::InspectorArray::asArray):
+ * inspector/InspectorValues.h:
+ (WebCore::InspectorObject::setBool):
+ (WebCore::InspectorObject::setNumber):
+ (WebCore::InspectorObject::setString):
+ (WebCore::InspectorObject::setValue):
+ (WebCore::InspectorObject::setObject):
+ (WebCore::InspectorObject::setArray):
+ (WebCore::InspectorArray::pushValue):
+ (WebCore::InspectorArray::pushObject):
+ (WebCore::InspectorArray::pushArray):
+ * inspector/ScriptBreakpoint.cpp:
+ (WebCore::ScriptBreakpoint::inspectorObjectFromSourceBreakpoints):
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createGenericRecord):
+
+2010-08-13 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65204.
+ http://trac.webkit.org/changeset/65204
+ https://bugs.webkit.org/show_bug.cgi?id=43965
+
+ Caused a lot of test crashes in Chromium (Requested by yutak
+ on #webkit).
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isInputImage):
+ (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
+ * dom/InputElement.h:
+ * html/HTMLInputElement.h:
+
+2010-08-13 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ Reapplying http://trac.webkit.org/changeset/65284 after fixed include.
+
+ [v8] Create callbacks for named access of elements from document object on fly.
+ https://bugs.webkit.org/show_bug.cgi?id=43725
+
+ That should speed up access to methods on document as there is no need to
+ consult with interceptor before invoking the method.
+
+ This reapplies http://trac.webkit.org/changeset/60670 reverted with
+ http://trac.webkit.org/changeset/63845. The main difference is in treatment
+ of removed named elements: we don't remove an accessor any more, but leave it.
+ Therefore any accessor should be able to treat the case when there is no
+ expando property.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::namedItemAdded):
+ (WebCore::ScriptController::namedItemRemoved):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::checkDocumentWrapper):
+ (WebCore::V8DOMWindowShell::updateDocumentWrapperCache):
+ (WebCore::getter):
+ (WebCore::V8DOMWindowShell::namedItemAdded):
+ (WebCore::V8DOMWindowShell::namedItemRemoved):
+ * bindings/v8/V8DOMWindowShell.h:
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::WrapInShadowObject):
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ (WebCore::V8HTMLDocument::allAccessorSetter):
+ (WebCore::toV8):
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::removeItemFromMap):
+
+2010-08-13 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: remove openInInspectorWindow and evaluateAndStringify from InjectedScript.
+ https://bugs.webkit.org/show_bug.cgi?id=43854
+
+ * inspector/Inspector.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::openInInspectedWindow):
+ * inspector/InspectorController.h:
+ * inspector/front-end/ExtensionServer.js:
+ (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage.callback):
+ (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ * inspector/front-end/InjectedScriptAccess.js:
+ * inspector/front-end/InspectorBackendStub.js:
+ (WebInspector.InspectorBackendStub):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourceSidebarTreeElement.prototype.ondblclick):
+
+2010-08-13 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ flaky websocket/tests/frame-length-overflow.html
+ https://bugs.webkit.org/show_bug.cgi?id=43902
+
+ Add m_shouldDiscardReceivedData flag to indicate it will no longer
+ receive data from network.
+
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ (WebCore::WebSocketChannel::didReceiveData):
+ (WebCore::WebSocketChannel::didFail):
+ (WebCore::WebSocketChannel::processBuffer):
+ - when frame length overflows, we couldn't process data any more.
+ clear buffer and mark m_shouldDiscardReceivedData true to make sure
+ it doesn't process the same buffer again.
+ * websockets/WebSocketChannel.h:
+
+2010-08-13 Dirk Schulze <krit@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Use SVGPathByteStream to animate SVGPath
+ https://bugs.webkit.org/show_bug.cgi?id=43929
+
+ Use SVGPathByteStream to perform animations of Paths. SVGPathBlender blends
+ the starting point to the end point according to the current progress value.
+ Cleanup SVGPathSegList, by removing the unnecessary legacy blending code.
+
+ No new tests because no functional changes.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * svg/SVGAllInOne.cpp:
+ * svg/SVGAnimateElement.cpp:
+ (WebCore::SVGAnimateElement::SVGAnimateElement):
+ (WebCore::SVGAnimateElement::calculateAnimatedValue):
+ (WebCore::SVGAnimateElement::calculateFromAndToValues):
+ (WebCore::SVGAnimateElement::resetToBaseValue):
+ (WebCore::SVGAnimateElement::applyResultsToTarget):
+ * svg/SVGAnimateElement.h:
+ * svg/SVGPathBlender.cpp: Added.
+ (WebCore::SVGPathBlender::SVGPathBlender):
+ (WebCore::SVGPathBlender::~SVGPathBlender):
+ (WebCore::SVGPathBlender::blendAnimatedFloat):
+ (WebCore::SVGPathBlender::blendAnimatedFloatPoint):
+ (WebCore::SVGPathBlender::blendMoveToSegment):
+ (WebCore::SVGPathBlender::blendLineToSegment):
+ (WebCore::SVGPathBlender::blendLineToHorizontalSegment):
+ (WebCore::SVGPathBlender::blendLineToVerticalSegment):
+ (WebCore::SVGPathBlender::blendCurveToCubicSegment):
+ (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment):
+ (WebCore::SVGPathBlender::blendCurveToQuadraticSegment):
+ (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment):
+ (WebCore::SVGPathBlender::blendArcToSegment):
+ (WebCore::SVGPathBlender::blendAnimatedPath):
+ (WebCore::SVGPathBlender::cleanup):
+ * svg/SVGPathBlender.h: Added.
+ * svg/SVGPathParserFactory.cpp:
+ (WebCore::globalSVGPathBlender):
+ (WebCore::SVGPathParserFactory::buildAnimatedSVGPathByteStream):
+ * svg/SVGPathParserFactory.h:
+ * svg/SVGPathSegList.cpp:
+ (WebCore::SVGPathSegList::getPathSegAtLength):
+ * svg/SVGPathSegList.h:
+ (WebCore::SVGPathSegList::create):
+ * svg/SVGPointList.cpp:
+ (WebCore::adjustAnimatedValue):
+
+2010-08-12 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Window size changes + resources on absolute sized content leads to pixelation
+ https://bugs.webkit.org/show_bug.cgi?id=43921
+
+ Avoid pixelation when using resources on absolute sized objects. Be sure to invalidate the used resources if window size changes.
+ Otherwhise masks etc. will be scaled up and pixelate. As nice side-effect, this fixes run-webkit-tests --singly svg/W3C-SVG-1.1, which
+ used to produce wrong results for the gradient tests, as the window size change from 800x600 for 480x360 (svg/W3C-SVG-1.1 specific DRT quirk)
+ didn't invalidate the resources.
+
+ Renamed invalidateClient -> removeClientFromCache and invalidateClients -> removeAllClientsFromCache.
+ Add a boolean "markForInvalidation" parameter, that controls wheter the clients should be marked for repaint/boundaries invalidation/layout
+ or wheter we only want to notify the parents that the resource changed, to avoid doing unncessary work in SVGRenderSupport::layoutChildren.
+
+ Test: svg/custom/absolute-sized-content-with-resources.xhtml
+
+ * rendering/RenderSVGGradientStop.cpp:
+ (WebCore::RenderSVGGradientStop::styleDidChange): Don't do anything for StyleDifferenceEqual.
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::imageChanged):
+ * rendering/RenderSVGResource.cpp:
+ (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
+ * rendering/RenderSVGResource.h:
+ * rendering/RenderSVGResourceClipper.cpp:
+ (WebCore::RenderSVGResourceClipper::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourceClipper::removeClientFromCache):
+ * rendering/RenderSVGResourceClipper.h:
+ * rendering/RenderSVGResourceContainer.cpp:
+ (WebCore::RenderSVGResourceContainer::layout):
+ (WebCore::RenderSVGResourceContainer::idChanged):
+ (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
+ (WebCore::RenderSVGResourceContainer::markClientForInvalidation):
+ * rendering/RenderSVGResourceContainer.h:
+ (WebCore::RenderSVGResourceContainer::):
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourceFilter::removeClientFromCache):
+ (WebCore::RenderSVGResourceFilter::postApplyResource):
+ * rendering/RenderSVGResourceFilter.h:
+ * rendering/RenderSVGResourceGradient.cpp:
+ (WebCore::RenderSVGResourceGradient::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourceGradient::removeClientFromCache):
+ (WebCore::RenderSVGResourceGradient::applyResource):
+ * rendering/RenderSVGResourceGradient.h:
+ * rendering/RenderSVGResourceMarker.cpp:
+ (WebCore::RenderSVGResourceMarker::layout):
+ (WebCore::RenderSVGResourceMarker::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourceMarker::removeClientFromCache):
+ * rendering/RenderSVGResourceMarker.h:
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourceMasker::removeClientFromCache):
+ * rendering/RenderSVGResourceMasker.h:
+ * rendering/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourcePattern::removeClientFromCache):
+ (WebCore::RenderSVGResourcePattern::applyResource):
+ * rendering/RenderSVGResourcePattern.h:
+ * rendering/RenderSVGResourceSolidColor.h:
+ (WebCore::RenderSVGResourceSolidColor::removeAllClientsFromCache):
+ (WebCore::RenderSVGResourceSolidColor::removeClientFromCache):
+ * rendering/SVGRenderSupport.cpp:
+ (WebCore::invalidateResourcesOfChildren): Add new helper funtion recursively invalidating resources of a sub render tree.
+ (WebCore::SVGRenderSupport::layoutChildren): Keep track of all objects that didn't need layout, as we still have to invalidate their resources, if window size changes.
+ * rendering/SVGResources.cpp:
+ (WebCore::SVGResources::removeClientFromCache):
+ (WebCore::SVGResources::resourceDestroyed):
+ * rendering/SVGResources.h:
+ * rendering/SVGResourcesCache.cpp:
+ (WebCore::SVGResourcesCache::clientLayoutChanged):
+
+2010-08-13 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium DevTools: [CRASH] Autocomplete on arrays causes crashes.
+ https://bugs.webkit.org/show_bug.cgi?id=43955
+
+ * bindings/v8/ScriptValue.cpp:
+ (WebCore::v8ToInspectorValue):
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
+ * bridge/NP_jsobject.cpp:
+ (_NPN_Enumerate):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertValueToNPVariant):
+ * bridge/jni/JNIBridge.cpp:
+ (JavaParameter::JavaParameter):
+ (JavaMethod::JavaMethod):
+ (JavaMethod::signature):
+ (JavaMethod::methodID):
+ * bridge/jni/JNIBridge.h:
+ (JSC::Bindings::JavaString::utf8):
+ (JSC::Bindings::JavaParameter::type):
+ (JSC::Bindings::JavaMethod::returnType):
+ * bridge/jni/jni_jsobject.mm:
+ (JavaJSObject::call):
+ (JavaJSObject::eval):
+ (JavaJSObject::getMember):
+ (JavaJSObject::setMember):
+ (JavaJSObject::removeMember):
+ (JavaJSObject::convertJObjectToValue):
+ * bridge/jni/jsc/JNIBridgeJSC.cpp:
+ (JavaField::JavaField):
+ (JavaField::valueFromInstance):
+ (JavaField::setValueToInstance):
+ * bridge/jni/jsc/JNIBridgeJSC.h:
+ (JSC::Bindings::JavaField::type):
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ (JavaInstance::invokeMethod):
+ * bridge/jni/jsc/JavaStringJSC.h:
+ (JSC::Bindings::JavaStringImpl::utf8):
+ * bridge/runtime_array.cpp:
+ (JSC::RuntimeArray::getOwnPropertySlot):
+ (JSC::RuntimeArray::getOwnPropertyDescriptor):
+ (JSC::RuntimeArray::put):
+
+2010-08-12 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: allow interrupting long running JS to execute inspector command
+ https://bugs.webkit.org/show_bug.cgi?id=43900
+
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::):
+ (WebCore::ScriptDebugServer::pause):
+ (WebCore::ScriptDebugServer::interruptAndRun):
+ (WebCore::ScriptDebugServer::runPendingTasks):
+ (WebCore::ScriptDebugServer::handleV8DebugEvent):
+ * bindings/v8/ScriptDebugServer.h:
+ (WebCore::ScriptDebugServer::Task::~Task):
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65295.
+ http://trac.webkit.org/changeset/65295
+ https://bugs.webkit.org/show_bug.cgi?id=43950
+
+ It broke 4 sputnik tests (Requested by Ossy on #webkit).
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
+ * bridge/NP_jsobject.cpp:
+ (_NPN_Enumerate):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertValueToNPVariant):
+ * bridge/jni/JNIBridge.cpp:
+ (JavaParameter::JavaParameter):
+ (JavaMethod::JavaMethod):
+ (JavaMethod::signature):
+ (JavaMethod::methodID):
+ * bridge/jni/JNIBridge.h:
+ (JSC::Bindings::JavaString::UTF8String):
+ (JSC::Bindings::JavaParameter::type):
+ (JSC::Bindings::JavaMethod::returnType):
+ * bridge/jni/jni_jsobject.mm:
+ (JavaJSObject::call):
+ (JavaJSObject::eval):
+ (JavaJSObject::getMember):
+ (JavaJSObject::setMember):
+ (JavaJSObject::removeMember):
+ (JavaJSObject::convertJObjectToValue):
+ * bridge/jni/jsc/JNIBridgeJSC.cpp:
+ (JavaField::JavaField):
+ (JavaField::valueFromInstance):
+ (JavaField::setValueToInstance):
+ * bridge/jni/jsc/JNIBridgeJSC.h:
+ (JSC::Bindings::JavaField::type):
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ (JavaInstance::invokeMethod):
+ * bridge/jni/jsc/JavaStringJSC.h:
+ (JSC::Bindings::JavaStringImpl::UTF8String):
+ * bridge/runtime_array.cpp:
+ (JSC::RuntimeArray::getOwnPropertySlot):
+ (JSC::RuntimeArray::getOwnPropertyDescriptor):
+ (JSC::RuntimeArray::put):
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Fixed typo in inspector js.
+ Follow up to r65300.
+
+ * inspector/front-end/inspector.js:
+ (WebInspector.log.isLogAvailable):
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Make getPrototypes return objects, not names.
+ https://bugs.webkit.org/show_bug.cgi?id=43934
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+ * inspector/front-end/PropertiesSidebarPane.js:
+ (WebInspector.PropertiesSidebarPane.prototype.update.callback):
+ * inspector/front-end/inspector.js:
+ (WebInspector.log):
+
+2010-08-12 James Robinson <jamesr@chromium.org>
+
+ Unreviewed, rolling out r65284 and r65288. Broke chromium compile.
+ https://bugs.webkit.org/show_bug.cgi?id=43725
+ http://trac.webkit.org/changeset/65284
+ http://trac.webkit.org/changeset/65288
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::namedItemAdded):
+ (WebCore::ScriptController::namedItemRemoved):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::updateDocumentWrapperCache):
+ * bindings/v8/V8DOMWindowShell.h:
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::namedPropertyDeleter):
+ (WebCore::V8HTMLDocument::namedPropertyGetter):
+ (WebCore::V8HTMLDocument::indexedPropertyGetter):
+ (WebCore::V8HTMLDocument::allAccessorSetter):
+ (WebCore::toV8):
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::removeItemFromMap):
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
+ * bridge/NP_jsobject.cpp:
+ (_NPN_Enumerate):
+ * bridge/c/c_utility.cpp:
+ (JSC::Bindings::convertValueToNPVariant):
+ * bridge/jni/JNIBridge.cpp:
+ (JavaParameter::JavaParameter):
+ (JavaMethod::JavaMethod):
+ (JavaMethod::signature):
+ (JavaMethod::methodID):
+ * bridge/jni/JNIBridge.h:
+ (JSC::Bindings::JavaString::utf8):
+ (JSC::Bindings::JavaParameter::type):
+ (JSC::Bindings::JavaMethod::returnType):
+ * bridge/jni/jni_jsobject.mm:
+ (JavaJSObject::call):
+ (JavaJSObject::eval):
+ (JavaJSObject::getMember):
+ (JavaJSObject::setMember):
+ (JavaJSObject::removeMember):
+ (JavaJSObject::convertJObjectToValue):
+ * bridge/jni/jsc/JNIBridgeJSC.cpp:
+ (JavaField::JavaField):
+ (JavaField::valueFromInstance):
+ (JavaField::setValueToInstance):
+ * bridge/jni/jsc/JNIBridgeJSC.h:
+ (JSC::Bindings::JavaField::type):
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ (JavaInstance::invokeMethod):
+ * bridge/jni/jsc/JavaStringJSC.h:
+ (JSC::Bindings::JavaStringImpl::utf8):
+ * bridge/runtime_array.cpp:
+ (JSC::RuntimeArray::getOwnPropertySlot):
+ (JSC::RuntimeArray::getOwnPropertyDescriptor):
+ (JSC::RuntimeArray::put):
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Speculative build fix for chromium bindings (someone added the old include style!).
+
+ * bindings/v8/V8DOMWindowShell.h:
+
+2010-08-12 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Tony Chang.
+
+ [Refactoring] TextEvent class has to many flags
+ https://bugs.webkit.org/show_bug.cgi?id=43893
+
+ Turned TextEvent::m_isLineBreak, TextEvent::m_isBacktab, TextEvent::m_isPaste
+ into single TextEvent::m_inputType enumeration.
+
+ No functional change. No new tests.
+
+ * dom/TextEvent.cpp:
+ (WebCore::TextEvent::selectInputType):
+ (WebCore::TextEvent::create):
+ (WebCore::TextEvent::createForPlainTextPaste):
+ (WebCore::TextEvent::createForFragmentPaste):
+ (WebCore::TextEvent::TextEvent):
+ * dom/TextEvent.h:
+ (WebCore::TextEvent::):
+ (WebCore::TextEvent::isLineBreak):
+ (WebCore::TextEvent::isBackTab):
+ (WebCore::TextEvent::isPaste):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleTextInputEvent):
+
+2010-08-12 Kenneth Russell <kbr@google.com>
+
+ Reviewed by David Levin.
+
+ Delete obsolete CanvasNumberArray
+ https://bugs.webkit.org/show_bug.cgi?id=38619
+
+ Deleted unreferenced code. Built WebKit and Chromium to test.
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * Android.jscbindings.mk:
+ * Android.mk:
+ * bindings/js/JSCanvasNumberArrayCustom.cpp: Removed.
+ * html/canvas/CanvasNumberArray.cpp: Removed.
+ * html/canvas/CanvasNumberArray.h: Removed.
+ * html/canvas/CanvasNumberArray.idl: Removed.
+
+2010-08-12 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ [v8] Create callbacks for named access of elements from document object on fly.
+ https://bugs.webkit.org/show_bug.cgi?id=43725
+
+ That should speed up access to methods on document as there is no need to
+ consult with interceptor before invoking the method.
+
+ This reapplies http://trac.webkit.org/changeset/60670 reverted with
+ http://trac.webkit.org/changeset/63845. The main difference is in treatment
+ of removed named elements: we don't remove an accessor any more, but leave it.
+ Therefore any accessor should be able to treat the case when there is no
+ expando property.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::namedItemAdded):
+ (WebCore::ScriptController::namedItemRemoved):
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::checkDocumentWrapper):
+ (WebCore::V8DOMWindowShell::updateDocumentWrapperCache):
+ (WebCore::getter):
+ (WebCore::V8DOMWindowShell::namedItemAdded):
+ (WebCore::V8DOMWindowShell::namedItemRemoved):
+ * bindings/v8/V8DOMWindowShell.h:
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::WrapInShadowObject):
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ (WebCore::V8HTMLDocument::allAccessorSetter):
+ (WebCore::toV8):
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::removeItemFromMap):
+
+2010-08-12 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Ensure that parser doesn't attach children that have been removed by JavaScript event handlers.
+ https://bugs.webkit.org/show_bug.cgi?id=43813
+
+ This patch re-fixes bug 40742 in a way that keeps allowing HTMLLinkElement
+ to lazy-attach.
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::attach): Added parent check.
+ * html/HTMLLinkElement.cpp: Basically undoes changes introduced by r61424.
+ * html/HTMLLinkElement.h: Ditto.
+
+2010-08-12 Justin Schuh <jschuh@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Clear PluginData's page pointer on page refresh
+ https://bugs.webkit.org/show_bug.cgi?id=43888
+
+ Test: plugins/access-after-page-destroyed.html
+
+ * page/Page.cpp:
+ (WebCore::Page::refreshPlugins):
+
+2010-08-12 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ getParameter(STENCIL_VALUE_MASK) (and others) returns the wrong value
+ https://bugs.webkit.org/show_bug.cgi?id=31842
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getUnsignedLongParameter): Casting from int to unsigned long correctly.
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: mimic FireBug's array detection.
+ https://bugs.webkit.org/show_bug.cgi?id=30974
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-08-12 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ regression in generateMipmap
+ https://bugs.webkit.org/show_bug.cgi?id=43873
+
+ * html/canvas/WebGLTexture.cpp:
+ (WebCore::WebGLTexture::generateMipmapLevelInfo): should set m_needToUseBlackTexture to false if generateMipmapLevelInfo runs through successfully.
+
+2010-08-12 Ariya Hidayat <ariya@sencha.com>
+
+ Reviewed by David Hyatt.
+
+ [Qt] Split TransparencyLayer into its own header file.
+ https://bugs.webkit.org/show_bug.cgi?id=43935
+
+ * WebCore.pro: Include TransparencyLayer.h.
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ * platform/graphics/qt/TransparencyLayer.h: Added.
+ (WebCore::TransparencyLayer::TransparencyLayer):
+ (WebCore::TransparencyLayer::operator=):
+
+2010-08-12 François Sausset <sausset@gmail.com>
+
+ Reviewed by Beth Dakin.
+
+ Horizontal padding should be 0 on mrow elements.
+ https://bugs.webkit.org/show_bug.cgi?id=43908
+
+ Updated tests in /mathml
+
+ * css/mathml.css:
+ (mrow, mfenced):
+ (mfenced):
+
+2010-08-12 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Make the cascade level of "user" styles configurable
+ https://bugs.webkit.org/show_bug.cgi?id=43457
+
+ * WebCore.exp.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::CSSStyleSelector):
+ * dom/Document.cpp:
+ (WebCore::Document::pageGroupUserSheets):
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::addUserStyleSheetToWorld):
+ * page/PageGroup.h:
+ * page/UserStyleSheet.h:
+ (WebCore::UserStyleSheet::):
+ (WebCore::UserStyleSheet::UserStyleSheet):
+ (WebCore::UserStyleSheet::level):
+
+2010-08-12 Jian Li <jianli@chromium.org>
+
+ Fix qt build break.
+
+ * html/ThreadableBlobRegistry.cpp:
+ (WebCore::postTaskToMainThread):
+
+2010-08-12 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add ThreadableBlobRegistry to support calling BlobRegistry methods in
+ main thread.
+ https://bugs.webkit.org/show_bug.cgi?id=43874
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+ (WebCore::ScriptExecutionContext::addBlob):
+ (WebCore::ScriptExecutionContext::removeBlob):
+ (WebCore::ScriptExecutionContext::createPublicBlobURL):
+ (WebCore::ScriptExecutionContext::revokePublicBlobURL):
+ * dom/ScriptExecutionContext.h:
+ * html/Blob.cpp:
+ (WebCore::Blob::Blob):
+ (WebCore::Blob::~Blob):
+ (WebCore::Blob::contextDestroyed):
+ * html/Blob.h:
+ * html/BlobRegistryImpl.cpp:
+ (WebCore::BlobRegistryImpl::registerBlobURL):
+ (WebCore::BlobRegistryImpl::unregisterBlobURL):
+ (WebCore::BlobRegistryImpl::getBlobDataFromURL):
+ * html/ThreadableBlobRegistry.cpp: Added.
+ * html/ThreadableBlobRegistry.h: Added.
+
+2010-08-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ generate-bindings.pl should generate warning free code
+ https://bugs.webkit.org/show_bug.cgi?id=43353
+
+ * bindings/scripts/CodeGeneratorJS.pm: Suggested parentheses added around && within ||
+
+2010-08-11 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Kent Tamura.
+
+ merge MarkupAccumulator and MarkupAccumulatorWrapper
+ https://bugs.webkit.org/show_bug.cgi?id=43834
+
+ Removed MarkupAccumulator and added serializeNodesWithNamespaces to use MarkupAccumulatorWrapper
+ in both versions of createMarkup. Accumulation of nodes done manually in serializeNodes is
+ now done by MarkupAccumulatorWrapper as done in the original MarkupAccumulator.
+
+ No new tests added since this is a cleanup.
+
+ * editing/markup.cpp:
+ (WebCore::MarkupAccumulatorWrapper::MarkupAccumulatorWrapper): Takes vector of nodes and set it to m_nodes.
+ (WebCore::MarkupAccumulatorWrapper::insertOpenTag): Adds node to m_nodes.
+ (WebCore::MarkupAccumulatorWrapper::wrapWithNode): Adds node to m_nodes.
+ (WebCore::serializeNodes): Adding node to nodes is moved into MarkupAccumulatorWrapper.
+ (WebCore::createMarkup): Instantiates MarkupAccumulatorWrapper.
+ (WebCore::serializeNodesWithNamespaces): Renamed from MarkupAccumulator::appendMarkup.
+
+2010-08-12 Dirk Schulze <krit@webkit.org>
+
+ Unreviewed sort of Xcode project file.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-08-12 Ben Murdoch <benm@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ InspectorController.h missing InspectorObject forward declaration
+ https://bugs.webkit.org/show_bug.cgi?id=43913
+
+ Build fix so no new tests.
+
+ * inspector/InspectorController.h: Adds the necessary forward declaration.
+
+2010-08-12 Hui Huang <hui.2.huang@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ m_windowRect is not updated because parent of PluginView is not
+ set when updatePluginWidget is called. plugin gets wrong window
+ size on setwindow.
+ https://bugs.webkit.org/show_bug.cgi?id=43635
+
+ * plugins/symbian/PluginViewSymbian.cpp:
+ (WebCore::PluginView::setParent):
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed, re-apply r65241 and 65243.
+
+ Web Inspector: brush up object proxies, introduce remote object model.
+ https://bugs.webkit.org/show_bug.cgi?id=43847
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+ (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.doEvalInWindow):
+ (WebInspector.ConsoleView.prototype._enterKeyPressed.printResult):
+ (WebInspector.ConsoleView.prototype._enterKeyPressed):
+ (WebInspector.ConsoleView.prototype._format):
+ (WebInspector.ConsoleView.prototype._formatarray):
+ (WebInspector.ConsoleView.prototype._formatAsArrayEntry):
+ (WebInspector.ConsoleMessage.prototype._format):
+ (WebInspector.ConsoleCommandResult):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMNode):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.performSearch):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._createTooltipForNode):
+ * inspector/front-end/EventListenersSidebarPane.js:
+ ():
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertiesSection.prototype.update):
+ (WebInspector.ObjectPropertiesSection.prototype.updateProperties):
+ (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate):
+ (WebInspector.ObjectPropertyTreeElement.prototype.update):
+ (WebInspector.ObjectPropertyTreeElement.prototype.applyExpression):
+ * inspector/front-end/ObjectProxy.js: Removed.
+ * inspector/front-end/PropertiesSidebarPane.js:
+ (WebInspector.PropertiesSidebarPane.prototype.update.callback):
+ * inspector/front-end/RemoteObject.js: Added.
+ (WebInspector.RemoteObjectId):
+ (WebInspector.RemoteObject):
+ (WebInspector.RemoteObject.fromPrimitiveValue):
+ (WebInspector.RemoteObject.fromNode):
+ (WebInspector.RemoteObject.fromPayload):
+ (WebInspector.RemoteObject.type):
+ (WebInspector.RemoteObject.prototype.get objectId):
+ (WebInspector.RemoteObject.prototype.get type):
+ (WebInspector.RemoteObject.prototype.get description):
+ (WebInspector.RemoteObject.prototype.get hasChildren):
+ (WebInspector.RemoteObject.prototype.isError):
+ (WebInspector.RemoteObject.prototype.getPropertyValueDescriptions):
+ (WebInspector.RemoteObject.prototype.getOwnProperties):
+ (WebInspector.RemoteObject.prototype.getProperties.remoteObjectBinder):
+ (WebInspector.RemoteObjectProperty):
+ * inspector/front-end/ScopeChainSidebarPane.js:
+ (WebInspector.ScopeChainSidebarPane.prototype.update):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame.updatingCallbackWrapper):
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
+ (WebInspector.ScriptsPanel.prototype.doEvalInCallFrame):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._showPopup.evaluateCallback):
+ (WebInspector.SourceFrame.prototype._showPopup):
+ (WebInspector.SourceFrame.prototype._evalSelectionInCallFrame):
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSection.prototype.update):
+ (WebInspector.WatchExpressionTreeElement.prototype.update):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector.log.logMessage):
+ (WebInspector.log):
+ * inspector/front-end/utilities.js:
+ ():
+
+2010-08-11 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add support for BGRA pixel format to GraphicsContext3D.
+ https://bugs.webkit.org/show_bug.cgi?id=43858
+
+ Although this has been standard in desktop GL since 1.2, it's an
+ extension in GL ES 2.0, so a query function is provided to check
+ for support. Since they differ on semantics (GL ES 2.0 requires
+ TexImage2D()'s format and internalFormat to match, while desktop GL
+ will not accept BGRA as an internalFormat), the stub implementation
+ returns false until these quirks have been implemented and tested on
+ each port.
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::supportsBGRA):
+ Add implementation for non-chromium platforms which returns false.
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::):
+ Add query function (supportsBGRA()) and the BGRA_EXT token.
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Rolling out r65241 and 65243 for breaking inspector tests.
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Adding the file missing in r65241.
+
+ * inspector/front-end/RemoteObject.js: Added.
+ (WebInspector.RemoteObjectId):
+ (WebInspector.RemoteObject):
+ (WebInspector.RemoteObject.fromPrimitiveValue):
+ (WebInspector.RemoteObject.fromNode):
+ (WebInspector.RemoteObject.fromPayload):
+ (WebInspector.RemoteObject.type):
+ (WebInspector.RemoteObject.prototype.get objectId):
+ (WebInspector.RemoteObject.prototype.get type):
+ (WebInspector.RemoteObject.prototype.get description):
+ (WebInspector.RemoteObject.prototype.get hasChildren):
+ (WebInspector.RemoteObject.prototype.isError):
+ (WebInspector.RemoteObject.prototype.getPropertyValueDescriptions):
+ (WebInspector.RemoteObject.prototype.getOwnProperties):
+ (WebInspector.RemoteObject.prototype.getProperties.remoteObjectBinder):
+ (WebInspector.RemoteObjectProperty):
+
+2010-08-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: brush up object proxies, introduce remote object model.
+ https://bugs.webkit.org/show_bug.cgi?id=43847
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+ (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.doEvalInWindow):
+ (WebInspector.ConsoleView.prototype._enterKeyPressed.printResult):
+ (WebInspector.ConsoleView.prototype._enterKeyPressed):
+ (WebInspector.ConsoleView.prototype._format):
+ (WebInspector.ConsoleView.prototype._formatnode):
+ (WebInspector.ConsoleView.prototype._formatarray):
+ (WebInspector.ConsoleView.prototype._formatAsArrayEntry):
+ (WebInspector.ConsoleMessage.prototype._format):
+ (WebInspector.ConsoleCommandResult):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMNode):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._createTooltipForNode):
+ * inspector/front-end/EventListenersSidebarPane.js:
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertiesSection.prototype.update):
+ (WebInspector.ObjectPropertiesSection.prototype.updateProperties):
+ (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate):
+ (WebInspector.ObjectPropertyTreeElement.prototype.update):
+ (WebInspector.ObjectPropertyTreeElement.prototype.applyExpression):
+ * inspector/front-end/ObjectProxy.js: Removed.
+ * inspector/front-end/PropertiesSidebarPane.js:
+ (WebInspector.PropertiesSidebarPane.prototype.update.callback):
+ * inspector/front-end/RemoteObject.js: Added.
+ (WebInspector.RemoteObjectId):
+ (WebInspector.RemoteObject):
+ (WebInspector.RemoteObject.fromPrimitiveValue):
+ (WebInspector.RemoteObject.fromErrorMessage):
+ (WebInspector.RemoteObject.fromNode):
+ (WebInspector.RemoteObject.fromPayload):
+ (WebInspector.RemoteObject.type):
+ (WebInspector.RemoteObject.prototype.get objectId):
+ (WebInspector.RemoteObject.prototype.get type):
+ (WebInspector.RemoteObject.prototype.get description):
+ (WebInspector.RemoteObject.prototype.get hasChildren):
+ (WebInspector.RemoteObject.prototype.isError):
+ (WebInspector.RemoteObject.prototype.getPropertyValueDescriptions):
+ (WebInspector.RemoteObject.prototype.getOwnProperties):
+ (WebInspector.RemoteObject.prototype.getProperties.remoteObjectBinder):
+ (WebInspector.RemoteObjectProperty):
+ * inspector/front-end/ScopeChainSidebarPane.js:
+ (WebInspector.ScopeChainSidebarPane.prototype.update):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame.updatingCallbackWrapper):
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
+ (WebInspector.ScriptsPanel.prototype.doEvalInCallFrame):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._showPopup.evaluateCallback):
+ (WebInspector.SourceFrame.prototype._showPopup):
+ (WebInspector.SourceFrame.prototype._evalSelectionInCallFrame):
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSection.prototype.update):
+ (WebInspector.WatchExpressionTreeElement.prototype.update):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector.log.logMessage):
+ (WebInspector.log):
+ * inspector/front-end/utilities.js:
+
+2010-08-12 Ben Murdoch <benm@google.com>
+
+ Reviewed by Steve Block.
+
+ V8 code generator does not add V8BindingMacros.h include in all places it is needed
+ https://bugs.webkit.org/show_bug.cgi?id=43907
+
+ Adds the V8BindingMacros.h header before using the STRING_TO_V8PARAMETER_EXCEPTION_BLOCK
+ macro.
+
+ Build fix so no new tests.
+
+ * bindings/scripts/CodeGeneratorV8.pm: include the header at the right time.
+
+2010-08-12 Jeremy Orlow <jorlow@chromium.org>
+
+ Revert for now
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.exp.in:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/GroupSettings.cpp: Removed.
+ * page/GroupSettings.h: Removed.
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::PageGroup):
+ (WebCore::PageGroup::localStorage):
+ * page/PageGroup.h:
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setLocalStorageQuota):
+ (WebCore::Settings::setLocalStorageDatabasePath):
+ * page/Settings.h:
+ (WebCore::Settings::localStorageQuota):
+ (WebCore::Settings::localStorageDatabasePath):
+
+2010-08-12 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Not reviewed. Follow up to Jeremys fix, just remove the context parameter, it's not needed anymore.
+
+ * rendering/RenderSVGResourceGradient.cpp:
+ (WebCore::createMaskAndSwapContextForTextGradient):
+ * rendering/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::applyResource):
+ * rendering/SVGImageBufferTools.cpp:
+ (WebCore::SVGImageBufferTools::createImageBuffer):
+ * rendering/SVGImageBufferTools.h:
+
+2010-08-12 Jeremy Orlow <jorlow@chromium.org>
+
+ Build fix.
+
+ * rendering/SVGImageBufferTools.cpp:
+ (WebCore::SVGImageBufferTools::createImageBuffer):
+
+2010-08-12 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ SVG masking performance very slow
+ https://bugs.webkit.org/show_bug.cgi?id=43622
+
+ Create ImageBuffers only as large as the final rendered size on screen. Only gradient on text on CG handled this correctly so far.
+ Refactored the code into a new SVGImageBufferTools class, and use the code from RenderSVGResourceMasker -> makes the IE9 demo SVG dice usable.
+ Clippers, Patterns and Filters remain to be converted.
+
+ Test: svg/zoom/page/zoom-mask-with-percentages.svg
+
+ * Android.mk: Add SVGImageBufferTools.* to build.
+ * CMakeLists.txt: Ditto.
+ * GNUmakefile.am: Ditto.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * rendering/RenderSVGAllInOne.cpp: Ditto.
+ * rendering/RenderSVGResourceGradient.cpp: Refactored CG gradient specific "create image buffer in absolute coordinates" code into SVGImageBufferTools class.
+ (WebCore::createMaskAndSwapContextForTextGradient):
+ (WebCore::clipToTextMask):
+ (WebCore::RenderSVGResourceGradient::applyResource):
+ * rendering/RenderSVGResourceMasker.cpp: Use new SVGImageBufferTools class, to avoid pixelation when zooming and to create image buffers as big as the final rendered size on screen, not more.
+ (WebCore::RenderSVGResourceMasker::invalidateClients):
+ (WebCore::RenderSVGResourceMasker::applyResource):
+ (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+ (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
+ (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
+ * rendering/RenderSVGResourceMasker.h:
+ * rendering/SVGImageBufferTools.cpp: Added.
+ (WebCore::SVGImageBufferTools::absoluteTransformFromContext):
+ (WebCore::SVGImageBufferTools::createImageBuffer):
+ (WebCore::SVGImageBufferTools::clipToImageBuffer):
+ * rendering/SVGImageBufferTools.h: Added.
+ (WebCore::SVGImageBufferTools::SVGImageBufferTools):
+ (WebCore::SVGImageBufferTools::~SVGImageBufferTools):
+
+2010-08-10 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Some settings are linked to the PageGroup not the Page. Create a new class for those.
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ Since persistient storage is shared between pages, there's no way to modify
+ some settings related to it on a per page basis. As such, it's not technically
+ correct for these settings to be on the Page's settings. Create a new class
+ called GroupSettings, move the 2 group-wide local storage settings there, and
+ add a new setting for IndexedDB's path (which is prompting this change).
+
+ No behavior has changed, so no tests.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.exp.in:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::PageGroup):
+ (WebCore::PageGroup::localStorage):
+ * page/PageGroup.h:
+ (WebCore::PageGroup::groupSettings):
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ (WebCore::Settings::setSessionStorageQuota):
+ * page/Settings.h:
+
+2010-08-12 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Decode images directly to QPixmap
+ https://bugs.webkit.org/show_bug.cgi?id=40797
+
+ Use the new API of Qt 4.7 to decode data from the image
+ reader directly to QPixmap.
+
+ This allow us to use JDCT_IFAST when decoding jpeg images
+ to pixmap, and to decode animated GIF images, while still
+ using in-place conversion of color space.
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::setData):
+ (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+
+2010-07-14 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by darin@apple.com.
+
+ Removes DontCheckEnums from some IDLs and fixes the corresponding enums.
+ https://bugs.webkit.org/show_bug.cgi?id=42278
+
+ This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=42250: it fixes some IDL/.h and enables generating compile-time checks for enums.
+
+ Tests: idls should generate valid code.
+
+ * dom/Node.h:
+ (WebCore::Node::):
+ * dom/Node.idl:
+ * dom/OverflowEvent.h:
+ (WebCore::OverflowEvent::):
+ * dom/OverflowEvent.idl:
+ * html/FileReader.cpp:
+ (WebCore::FileReader::readyState):
+ * html/FileReader.h:
+ (WebCore::FileReader::):
+ * html/FileReader.idl:
+
+2010-08-12 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by David Levin.
+
+ The #if clause enabling a feature should avoid the all includes of
+ the feature
+ https://bugs.webkit.org/show_bug.cgi?id=43866
+
+ Modified the position of the guard to avoid including all the
+ headers if the feature controlling the guard is not enabled.
+
+ * dom/make_names.pl:
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65221.
+ http://trac.webkit.org/changeset/65221
+ https://bugs.webkit.org/show_bug.cgi?id=43896
+
+ Broke snow leopard build. (Requested by dave_levin on
+ #webkit).
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::):
+
+2010-08-11 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add support for BGRA pixel format to GraphicsContext3D.
+ https://bugs.webkit.org/show_bug.cgi?id=43858
+
+ Although this has been standard in desktop GL since 1.2, it's an
+ extension in GL ES 2.0, so a query function is provided to check
+ for support. Since they differ on semantics (GL ES 2.0 requires
+ TexImage2D()'s format and internalFormat to match, while desktop GL
+ will not accept BGRA as an internalFormat), the stub implementation
+ returns false until these quirks have been implemented and tested on
+ each port.
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::supportsBGRA):
+ Add implementation for non-chromium platforms which returns false.
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::):
+ Add query function (supportsBGRA()) and the BGRA_EXT token.
+
+2010-08-11 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Handle clicks and recognition events for the speech input button
+ https://bugs.webkit.org/show_bug.cgi?id=43857
+
+ * rendering/RenderInputSpeech.cpp:
+ (WebCore::RenderInputSpeech::paintInputFieldSpeechButton): Selects the image based on current state.
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ (WebCore::InputFieldSpeechButtonElement::set_state): Switch to a new state and update the UI.
+ (WebCore::InputFieldSpeechButtonElement::didCompleteRecording):
+ (WebCore::InputFieldSpeechButtonElement::didCompleteRecognition):
+ * rendering/TextControlInnerElements.h:
+ (WebCore::InputFieldSpeechButtonElement::):
+ (WebCore::InputFieldSpeechButtonElement::state):
+
+2010-08-11 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ REGRESSION(65135): format specifier warnings
+ https://bugs.webkit.org/show_bug.cgi?id=43876
+
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::appendToBuffer): cast size_t to unsigned long for %lu.
+ (WebCore::WebSocketChannel::processBuffer): cast size_t to unsigned long for %lu.
+
+2010-08-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, don't generate WebDOMEventTarget.h/.cpp as we use the ones in bindings/cpp.
+
+ * DerivedSources.make:
+
+2010-08-11 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Make PendingScript copyable so that it can be stored in containers
+ https://bugs.webkit.org/show_bug.cgi?id=43875
+
+ This will be useful for storing PendingScripts in a Vector or Deque for
+ async and defer scripts.
+
+ No new tests because no functional changes.
+
+ * dom/PendingScript.h:
+ (WebCore::PendingScript::PendingScript):
+ (WebCore::PendingScript::operator=):
+
+2010-08-11 Victoria Kirst <vrk@google.com>
+
+ Reviewed by David Levin.
+
+ Fixing a regression in the UI for Mac default audio/video controls.
+ https://bugs.webkit.org/show_bug.cgi?id=43750
+
+ * rendering/RenderThemeChromiumMac.h:
+ * rendering/RenderThemeChromiumMac.mm:
+ (WebCore::RenderThemeChromiumMac::paintMediaVolumeSliderContainer):
+ (WebCore::RenderThemeChromiumMac::paintMediaSliderThumb):
+ (WebCore::RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton):
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTML TreeBuilder hits ASSERT in fragment case with insertAdjacentHTML and colgroup
+ https://bugs.webkit.org/show_bug.cgi?id=43758
+
+ This patch conditionalizes some LegacyHTMLTreeBuilder-specific code in
+ HTMLElement::createContextualFragment that interferes with the new
+ HTMLTreeBuilder. Doing that exposes the above ASSERT, which I've fixed
+ in this patch too. Fixing that ASSERT involved a small refactoring in
+ ExternalCharacterTokenBuffer.
+
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::createContextualFragment):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipLeadingWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeadingWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeadingNonWhitespace):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipLeading):
+ (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeLeading):
+ (WebCore::HTMLTreeBuilder::processCharacterBuffer):
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Conditionalize wrong fragment parsing code to pass more HTML5lib tests
+ https://bugs.webkit.org/show_bug.cgi?id=43877
+
+ This code exists to support the LegacyHTMLTreeBuilder. Unfortunately,
+ it causes problems for the new HTMLTreeBuilder (which is more
+ self-contained).
+
+ * dom/Element.cpp:
+ (WebCore::Element::createContextualFragment):
+
+2010-08-11 Ryosuke Niwa <rniwa@webkit.org>
+
+ Reviewed by Tony Chang.
+
+ Can't unbold text in div in font-weight span
+ https://bugs.webkit.org/show_bug.cgi?id=26871
+
+ The bug was caused by removeInlineStyle not being able to include styled inline nodes around the start.
+ Solved this problem by pushing down all inline styles instead of just text-decorations.
+ This approach allows removeInlineStyle to remove styled ancestors properly and generates compact markups.
+
+ Test: editing/style/push-down-inline-styles.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::removeCSSStyle): No longer removes attributes or node when mode == RemoveNone.
+ (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle): Calls shouldRemoveInlineStyleFromElement
+ to determine the highest ancestor whose style needs to be pushed down.
+ (WebCore::ApplyStyleCommand::extractInlineStyleToPushDown): Renamed from extractTextDecorationStyle.
+ Extracts all inline CSS properties specified instead of just text decorations.
+ (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): Renamed from applyTextDecorationStyle.
+ Applies inline styles using addInlineStyleIfNeeded or adds inline CSS values.
+ (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Renamed from pushDownTextDecorationStyleAroundNode.
+ (WebCore::ApplyStyleCommand::removeInlineStyle): Calls pushDownTextDecorationStyleAroundNode.
+ * editing/ApplyStyleCommand.h:
+ * editing/DeleteSelectionCommand.cpp:
+ (WebCore::DeleteSelectionCommand::mergeParagraphs): Prevents moveParagraph from preserving
+ the style of an empty paragraph when merged with the previous paragraph because we don't use that style anyways.
+
+2010-08-11 Julien Chaffraix <jchaffraix@codeaurora.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Remove dead code in CSSStyleSelector.
+ https://bugs.webkit.org/show_bug.cgi?id=43805
+
+ * css/CSSStyleSelector.cpp: Remove some debugging code that
+ was compiled out.
+
+2010-08-11 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: isNativeCheckbox does not work as advertised
+ https://bugs.webkit.org/show_bug.cgi?id=43872
+
+ Test: platform/mac/accessibility/native-vs-nonnative-checkboxes.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isInputImage):
+ Only say it's an input image if its role has not been overriden
+ (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
+ * dom/InputElement.h:
+ Add methods to query if it's a checkbox or radio button type element.
+ * html/HTMLInputElement.h:
+ (WebCore::HTMLInputElement::isCheckbox):
+
+2010-08-11 Kenneth Russell <kbr@google.com>
+
+ Reviewed by David Levin.
+
+ Remove obsolete WebGLArray type names
+ https://bugs.webkit.org/show_bug.cgi?id=43885
+
+ Deleted aliases to obsolete WebGLArray type names. Updated
+ affected layout tests, synchronizing them with the versions in the
+ Khronos repository where appropriate. Ran all layout tests.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ * page/DOMWindow.idl:
+
+2010-08-11 Steve Block <steveblock@google.com>
+
+ Reviewed by David Levin.
+
+ [chromium] Geolocation breaks the compile if ENABLE_GEOLOCATION is set to 0
+ https://bugs.webkit.org/show_bug.cgi?id=43753
+
+ This change guards the entire contents of the V8 custom bindings files
+ with ENABLE(GEOLOCATION) to match JSC.
+
+ No new tests, build fix only.
+
+ * bindings/v8/custom/V8CustomPositionCallback.cpp:
+ * bindings/v8/custom/V8CustomPositionErrorCallback.cpp:
+ * bindings/v8/custom/V8GeolocationCustom.cpp:
+
+2010-08-11 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by David Levin.
+
+ Include <wtf/UnusedParam.h> in GraphicsContextSkia.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=43843
+
+ wtf/UnusedParam.h must be included because UNUSED_PARAM macro is used.
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+
+2010-08-11 Nico Weber <thakis@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium/mac]: Fix colors in compositing mode
+ https://bugs.webkit.org/show_bug.cgi?id=43823
+
+ The textures are drawn by opengl, which doesn't do any color space
+ correction -- it assumes everything is in the device color space
+ already. Hence, when drawing into the memory that will be uploaded
+ as opengl texture, use the device color space.
+
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ (WebCore::ImageLayerChromium::updateTextureContents):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::updateTextureContents):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::setRootLayerCanvasSize):
+
+2010-08-11 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Remove obsolete texImage2D and texSubImage2D entry points
+ https://bugs.webkit.org/show_bug.cgi?id=40320
+
+ No new tests; covered by existing WebGL tests.
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ * html/canvas/WebGLRenderingContext.h:
+ * html/canvas/WebGLRenderingContext.idl:
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * platform/win/BString.cpp:
+ (WebCore::BString::BString):
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Qt build fix II.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Qt build fix.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2010-08-11 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Need EmptyDeviceOrientationClient and EmptyDeviceMotionClient for use with SVGImage
+ https://bugs.webkit.org/show_bug.cgi?id=43848
+
+ Tested by existing DeviceOrientation tests.
+
+ * loader/EmptyClients.h:
+ (WebCore::EmptyDeviceMotionClient::setController):
+ (WebCore::EmptyDeviceMotionClient::startUpdating):
+ (WebCore::EmptyDeviceMotionClient::stopUpdating):
+ (WebCore::EmptyDeviceMotionClient::currentDeviceMotion):
+ (WebCore::EmptyDeviceOrientationClient::setController):
+ (WebCore::EmptyDeviceOrientationClient::startUpdating):
+ (WebCore::EmptyDeviceOrientationClient::stopUpdating):
+ (WebCore::EmptyDeviceOrientationClient::lastOrientation):
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::dataChanged):
+
+2010-08-11 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42042
+ An empty value for xml:lang isn't considered
+
+ Revert last line change of my patch ; it happens to
+ behave correctly and same as before, but makes the
+ use case of empty values unneededly slower.
+
+ No new tests. (No change in behavior)
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+
+2010-08-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx, WebDOM] Build fix. Fix callback params and WebCore::String -> WTF::String fixes.
+
+ * bindings/cpp/WebDOMCustomVoidCallback.cpp: Added.
+ (WebDOMCustomVoidCallback::WebDOMCustomVoidCallback):
+ (WebDOMCustomVoidCallback::~WebDOMCustomVoidCallback):
+ (WebDOMCustomVoidCallback::handleEvent):
+ (toWebCore):
+ * bindings/cpp/WebDOMCustomVoidCallback.h: Added.
+ (WebDOMCustomVoidCallback::create):
+ * bindings/cpp/WebDOMHTMLDocumentCustom.cpp:
+ (documentWrite):
+ * bindings/cpp/WebDOMString.cpp:
+ (WebDOMString::equals):
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
+ (WebDOMTestCallback::callbackWithClass1Param):
+ (WebDOMTestCallback::callbackWithClass2Param):
+ (WebDOMTestCallback::callbackWithNonBoolReturnType):
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ * bindings/scripts/test/V8/V8TestInterface.h:
+ * bindings/scripts/test/V8/V8TestObj.h:
+ * wscript:
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamps by Darin Adler & Sam Weinig.
+
+ Bug 43867 - Some UString cleanup
+
+ Change JSC::UString data(), size(), and from(), to characters(), length(), and number() to match WTF::String.
+ Move string concatenation methods to a new header to simplify down UString.h. Remove is8Bit().
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::hasCSSPropertyNamePrefix):
+ (WebCore::cssPropertyName):
+ * bindings/js/JSLocationCustom.cpp:
+ (WebCore::JSLocation::setPort):
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::dispatchDidParseSource):
+ * bindings/js/ScriptString.h:
+ (WebCore::ScriptString::size):
+ * bindings/js/ScriptValue.cpp:
+ (WebCore::jsToInspectorValue):
+ * bindings/objc/WebScriptObject.mm:
+ (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
+ * bridge/jni/jni_jsobject.mm:
+ (JavaJSObject::convertValueToJObject):
+ * bridge/jni/jsc/JNIUtilityPrivate.cpp:
+ (JSC::Bindings::convertArrayInstanceToJavaArray):
+ (JSC::Bindings::convertValueToJValue):
+ * bridge/objc/objc_runtime.mm:
+ (JSC::Bindings::callObjCFallbackObject):
+
+2010-08-10 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43806, add ability to paginate screen content.
+
+ Add a new boolean to Document to indicate that content should be paginated. This is checked when doing page breaks
+ and in a couple of other cases.
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ * dom/Document.h:
+ (WebCore::Document::paginatedForScreen):
+ (WebCore::Document::setPaginatedForScreen):
+ (WebCore::Document::paginated):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintChildren):
+ (WebCore::RenderBlock::calcColumnWidth):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calcHeight):
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::paint):
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Windows build fix. Turns out we need to unconditionally include
+ HTMLEntityNames.cpp now that LegacyHTMLDocumentParser doesn't exist.
+
+ * html/HTMLEntityParser.cpp:
+
+2010-08-11 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Inserting a <source> element should immediately set networkState to NETWORK_NO_SOURCE.
+ https://bugs.webkit.org/show_bug.cgi?id=42897
+
+ A <source> element inserted as a child of a media element with a networkState of NETWORK_EMPTY
+ should cause the networkState to immediately change to NETWORK_NO_SOURCE.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement): Remove unused variable m_processingLoad.
+ (WebCore::HTMLMediaElement::prepareForLoad): Set m_networkState to NETWORK_NO_SOURCE.
+ (WebCore::HTMLMediaElement::loadInternal): Remove unused variable m_processingLoad.
+ (WebCore::HTMLMediaElement::selectMediaResource): No need to change m_networkState, it was done in prepareForLoad.
+ * html/HTMLMediaElement.h:
+
+ * html/HTMLSourceElement.cpp:
+ (WebCore::HTMLSourceElement::insertedIntoTree): Renamed from insertedIntoDocument because we want
+ to do this setup whether or not the parent media element is in the document.
+ * html/HTMLSourceElement.h:
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Delete LegacyHTMLDocumentParser and LegacyPreloadScanner
+ https://bugs.webkit.org/show_bug.cgi?id=43836
+
+ These classes are bit-rotting disturbingly quickly. We removed the
+ last dependencies on these classes and so we can remove them.
+
+ We might need to preserve some of their particular quirks to handle
+ some legacy applications, but our current thinking is to do that with
+ individual settings that affect the new parser.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ * dom/DocumentFragment.cpp:
+ (WebCore::DocumentFragment::parseHTML):
+ * dom/DocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ * dom/XMLDocumentParserQt.cpp:
+ * html/HTMLConstructionSite.cpp:
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::createParser):
+ * html/HTMLEntityParser.cpp:
+ (WebCore::decodeNamedEntity):
+ * html/HTMLEntityParser.h:
+ * html/HTMLFormControlElement.cpp:
+ * html/HTMLTreeBuilder.cpp:
+ * html/HTMLViewSourceDocument.cpp:
+ (WebCore::HTMLViewSourceDocument::createParser):
+ * html/LegacyHTMLDocumentParser.cpp: Removed.
+ * html/LegacyHTMLDocumentParser.h: Removed.
+ * html/LegacyHTMLTreeBuilder.cpp:
+ * html/LegacyPreloadScanner.cpp: Removed.
+ * html/LegacyPreloadScanner.h: Removed.
+ * loader/FTPDirectoryDocument.cpp:
+ (WebCore::FTPDirectoryDocumentParser::FTPDirectoryDocumentParser):
+ (WebCore::FTPDirectoryDocumentParser::appendEntry):
+ (WebCore::FTPDirectoryDocumentParser::createTDForFilename):
+ (WebCore::processFilesizeString):
+ (WebCore::wasLastDayOfMonth):
+ (WebCore::processFileDateString):
+ (WebCore::FTPDirectoryDocumentParser::parseAndAppendOneLine):
+ (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
+ (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
+ (WebCore::FTPDirectoryDocumentParser::append):
+ (WebCore::FTPDirectoryDocumentParser::finish):
+ * page/XSSAuditor.cpp:
+ (WebCore::XSSAuditor::decodeHTMLEntities):
+ * page/XSSAuditor.h:
+ * platform/text/SegmentedString.cpp:
+ (WebCore::SegmentedString::prepend):
+
+2010-08-11 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Refactored FrameLoader::createWindow() out of the FrameLoader class
+ since FrameLoader should not be responsible for creating windows.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39156
+
+ No new functionality, so no new tests.
+
+ * bindings/generic/BindingDOMWindow.h:
+ (WebCore::::createWindow):
+ - Updated the call to FrameLoader's createWindow().
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::createWindow):
+ - Updated the call to FrameLoader's createWindow().
+ * loader/FrameLoader.cpp:
+ (WebCore::createWindowFromFrameLoader):
+ - Made FrameLoader::createWindow() non-member, non-friend and changed it
+ to accept Frame* parameters instead of FrameLoader*.
+ * loader/FrameLoader.h:
+ - Updated the header file to reflect the above change to FrameLoader.cpp.
+
+2010-08-11 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ WebInspector: small refactoring for CodeGeneratorInspector.
+ all "notify" methods are generating in InspectorFrontend
+ the other methods are generating in InspectorBackend.
+ https://bugs.webkit.org/show_bug.cgi?id=43849
+
+ * inspector/CodeGeneratorInspector.pm:
+
+2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Misc improvements to the scrolling code
+ https://bugs.webkit.org/show_bug.cgi?id=41926
+
+ Refactor code that uses deprecated ways of dealing with the
+ adjustments to use the GtkVersioning infrastructure.
+
+ * GNUmakefile.am:
+ * platform/gtk/GtkVersioning.cpp: Added.
+ * platform/gtk/GtkVersioning.h:
+ * platform/gtk/ScrollViewGtk.cpp:
+ * platform/gtk/ScrollbarGtk.cpp:
+ (ScrollbarGtk::detachAdjustment):
+ (ScrollbarGtk::updateThumbPosition):
+ (ScrollbarGtk::updateThumbProportion):
+
+2010-08-11 Nate Chapin <japhet@chromium.org>
+
+ Chromium mac build fix (variables weren't being initialized).
+
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::apply): Initalize dxLeft, dxRight, dyLeft, dyRight.
+
+2010-08-11 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: apply correct fix to storage panel status bar buttons.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43846
+
+ * inspector/front-end/DatabaseTableView.js:
+ (WebInspector.DatabaseTableView.prototype.get statusBarItems):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype._genericViewSetup):
+
+2010-08-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Adam Barth.
+
+ Override operator= for C++ DOM binding classes with private structs
+ and update C++ DOM bindings test results.
+ https://bugs.webkit.org/show_bug.cgi?id=43735
+
+ * bindings/cpp/WebDOMEventTarget.cpp:
+ (WebDOMEventTarget::operator=):
+ * bindings/cpp/WebDOMEventTarget.h:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
+ (WebDOMTestCallback::operator=):
+ * bindings/scripts/test/CPP/WebDOMTestCallback.h:
+ * bindings/scripts/test/CPP/WebDOMTestInterface.cpp:
+ (WebDOMTestInterface::operator=):
+ * bindings/scripts/test/CPP/WebDOMTestInterface.h:
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ (WebDOMTestObj::operator=):
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+
+2010-08-11 Julie Parent <jparent@chromium.org>
+
+ Reviewed by Justin Garcia.
+
+ Crash in replaceSelectionCommand with RTL text.
+ https://bugs.webkit.org/show_bug.cgi?id=41485
+
+ For text with mixed directionality, sort the text boxes before
+ computing gaps, since that code assumes the boxes are in order.
+
+ Test: editing/execCommand/insert-image-on-top-of-directional-text.html
+
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::deleteInsignificantText): Sort boxes
+ like we do in TextIterator before computing gaps.
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::handleTextNode): Use new compareByStart
+ rather than compareBoxStart. No functional change.
+ * rendering/InlineTextBox.h:
+ (WebCore::InlineTextBox::compareByStart): Moved compareBoxStart
+ from TextIterator here so it can be used in multiple places.
+
+2010-08-11 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed build fix of Leopard Intel Debug (Build)
+
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::processBuffer): use %lu, instead of %ul
+
+2010-08-11 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Dirk Schulze.
+
+ Fixes to the gaussian blur algorithm
+ https://bugs.webkit.org/show_bug.cgi?id=41605
+
+ Added the recomendations of SVG regarding the kernel size
+ calculation for the approximation of the gaussian
+ blur. http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement.
+ Modified also some variable names to clarify algorithm, reviewed
+ the situation where both standard deviations are 0.
+
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::FEGaussianBlur):
+ (WebCore::FEGaussianBlur::stdDeviationX):
+ (WebCore::FEGaussianBlur::setStdDeviationX):
+ (WebCore::FEGaussianBlur::stdDeviationY):
+ (WebCore::FEGaussianBlur::setStdDeviationY):
+ (WebCore::boxBlur):
+ (WebCore::FEGaussianBlur::kernelPosition): Added the SVG kernel
+ position recomendation.
+ (WebCore::FEGaussianBlur::apply):
+ (WebCore::FEGaussianBlur::externalRepresentation):
+ * platform/graphics/filters/FEGaussianBlur.h:
+
+2010-08-11 Kristian Monsen <kristianm@google.com>
+
+ Reviewed by Steve Block.
+
+ Compile fix for Android, added include for <wtf/text/Cstring.h, this
+ did not get included in Android.
+ https://bugs.webkit.org/show_bug.cgi?id=41517
+
+ Build fix only, no new tests.
+
+ * page/PrintContext.cpp:
+
+2010-08-11 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix length calculation to be more robust.
+ https://bugs.webkit.org/show_bug.cgi?id=43777
+
+ Test: websocket/tests/frame-length-overflow.html
+
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::appendToBuffer): len is size_t.
+ - add sanity check for integer wraps.
+ (WebCore::WebSocketChannel::skipBuffer): len is size_t.
+ (WebCore::WebSocketChannel::processBuffer): length is size_t.
+ - add sanity check for integer wraps.
+ * websockets/WebSocketChannel.h: change m_bufferSize and len to size_t.
+
+2010-08-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fix three ASSERTs hit with the HTML5 TreeBuilder in fragment mode
+ https://bugs.webkit.org/show_bug.cgi?id=43762
+
+ In fixing the insertAdjacentHTML I had to make small changes to
+ the error logic, which ended up bringing us closer to HTML5.
+
+ Test: fast/dom/HTMLElement/insertAdjacentHTML-errors.html
+
+ * html/HTMLConstructionSite.cpp:
+ (WebCore::HTMLConstructionSite::attach):
+ - This ASSERT was just wrong, the child should not be attached
+ in the case the parent is not attached.
+ * html/HTMLElement.cpp:
+ (WebCore::contextElementForInsertion):
+ - This is part of HTML5, needed to know what to call the
+ HTML or XML parsers with. The previous code always passed
+ "this" which is wrong in the case of beforeBegin or afterEnd insertion.
+ (WebCore::HTMLElement::insertAdjacentHTML):
+ - Use the right contextElement now that we know how to compute it.
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processEndTagForInCell):
+ - This ASSERT is direct from the spec, but it's wrong, so I've filed a spec bug.
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Attempt to fix Windows build.
+
+ * platform/win/COMPtr.h:
+ (WTF::):
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Port view-source to new parser
+ https://bugs.webkit.org/show_bug.cgi?id=43746
+
+ This patch switches the view-source mode for frames over to using the
+ new HTML parsing infrastructure. This patch is an architectural change
+ to how we parser view source documents.
+
+ Previously, the LegacyHTMLDocumentParser would output a "guide string"
+ that consided of the inter-attribute whitespace and various "control"
+ characters. The HTMLViewSourceDocument would then interpret this guide
+ string to approximately reconstruct the source of the original document
+ and colorize various syntatic constructs.
+
+ Unfortunately, that approach is inherently low-fidelity. It's not
+ really feasible to reconstruct the input document from the token
+ stream. The old view source mode also had a number of hacks in the old
+ parser (e.g., to turn of decoding of HTML entities).
+
+ Instead of trying to reconstruct the original document from the token
+ stream, we use the segmentation information given by the tokens to
+ colorize the input document itself. Each token now caries information
+ about where in the input stream it came from and where various
+ subcomponents (e.g., attribute names and values) are located. This
+ approach is higher fidelity because we use this segmentation
+ information to colorize the original input instead of attempting to
+ reconstruct the original input.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTMLDocumentParser.cpp:
+ * html/HTMLToken.h:
+ (WebCore::HTMLToken::clear):
+ (WebCore::HTMLToken::startIndex):
+ (WebCore::HTMLToken::length):
+ (WebCore::HTMLToken::end):
+ * html/HTMLViewSourceDocument.cpp:
+ (WebCore::HTMLViewSourceDocument::createParser):
+ (WebCore::HTMLViewSourceDocument::addSource):
+ (WebCore::HTMLViewSourceDocument::processDoctypeToken):
+ (WebCore::HTMLViewSourceDocument::processTagToken):
+ (WebCore::HTMLViewSourceDocument::processCommentToken):
+ (WebCore::HTMLViewSourceDocument::processCharacterToken):
+ (WebCore::HTMLViewSourceDocument::addRange):
+ * html/HTMLViewSourceDocument.h:
+ * html/HTMLViewSourceParser.cpp: Added.
+ (WebCore::HTMLViewSourceParser::~HTMLViewSourceParser):
+ (WebCore::HTMLViewSourceParser::insert):
+ (WebCore::HTMLViewSourceParser::pumpTokenizer):
+ (WebCore::HTMLViewSourceParser::append):
+ (WebCore::HTMLViewSourceParser::sourceForToken):
+ (WebCore::HTMLViewSourceParser::updateTokenizerState):
+ (WebCore::HTMLViewSourceParser::finish):
+ (WebCore::HTMLViewSourceParser::finishWasCalled):
+ * html/HTMLViewSourceParser.h: Added.
+ (WebCore::HTMLViewSourceParser::HTMLViewSourceParser):
+ (WebCore::HTMLViewSourceParser::document):
+ * html/LegacyHTMLDocumentParser.cpp:
+ (WebCore::LegacyHTMLDocumentParser::processToken):
+ (WebCore::LegacyHTMLDocumentParser::processDoctypeToken):
+
+2010-08-11 Yoshiki Hayashi <yhayashi@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Make form controls, textarea, legend and datagrid treat width:
+ auto as specified in stretching vertical flexbox. Otherwise it's
+ treated as intrinsic as before.
+ https://bugs.webkit.org/show_bug.cgi?id=17918
+
+ Test: fast/flexbox/vertical-box-form-controls.html
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::adjustRenderStyle):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::sizesToIntrinsicWidth):
+
+2010-08-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add leakRef and clear to all RefPtr variants
+ https://bugs.webkit.org/show_bug.cgi?id=42389
+
+ * platform/win/COMPtr.h: Changed all uses of "template <...>" to instead do
+ "template<...>". Defined many of the inlined functions outside the class
+ definition, to avoid style checker warnings about multiple statements on
+ a single line and for slightly better clarity of the class definition itself.
+ Renamed releaseRef to leakRef. Added a releaseRef that calls leakRef so we
+ don't have to rename all callers at once. Added a clear function. Changed
+ the hash table code so it doesn't need to call releaseRef, and so it uses
+ the hash table deleted value hooks already present within the class.
+
+2010-08-10 Ariya Hidayat <ariya@sencha.com>
+
+ [Qt] Fix build warning: remove reference to html/BlobRegistryImp.h
+
+ * WebCore.pro:
+
+2010-08-10 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43803
+ <rdar://problem/6988023> Only the last Korean character can be shown if font style is enabled while typing (43803)
+
+ Test: platform/mac/editing/input/bold-node.html
+
+ * editing/Editor.cpp: (WebCore::Editor::setComposition): It is not clear to me what the
+ "baseNode == extentNode" check is about in this function , but let's try to make it more
+ likely that it passes.
+
+2010-08-10 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Make CSSSelector::specificity() non-recursive.
+ https://bugs.webkit.org/show_bug.cgi?id=43784
+
+ This change is one of the required changes to fix the following master bug:
+ https://bugs.webkit.org/show_bug.cgi?id=42806
+
+ No functional change, thus no tests.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::specificity):
+ (WebCore::CSSSelector::specificityForOneSelector):
+ (WebCore::CSSSelector::specificityForPage):
+ * css/CSSSelector.h:
+
+2010-08-10 Matthew Delaney <mdelaney@apple.com>
+
+ Reviewed by Darin Adler.
+
+ 2d.path.clip.empty.html test is failing
+ https://bugs.webkit.org/show_bug.cgi?id=43161
+
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::clip):
+ Catching the empty path case from being sent directly to
+ CGContextClip - which would ignore it. Instead, using
+ CGContextClip with a CGRectZero to achieve the desired
+ behavior of reducing the clipping region to nothing.
+
+2010-08-10 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Add video files to enable video in WebKit EFL
+ https://bugs.webkit.org/show_bug.cgi?id=43790
+
+ Add files regarding html5 video to CMakeList.txt for WebKit Efl.
+ But, this patch is not run html5 video on WebKit EFL yet.
+
+ * CMakeLists.txt: Add files related to html5video.
+ * platform/efl/LocalizedStringsEfl.cpp: Add functions for html5 video.
+ (WebCore::localizedMediaControlElementString):
+ (WebCore::localizedMediaControlElementHelpText):
+ (WebCore::localizedMediaTimeDescription):
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::installedMediaEngines): Disable MediaPlayerPrivate::r
+ egisterMediaEngine for WebKit EFL.
+
+2010-08-10 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Add a toRenderSVGImage function
+ https://bugs.webkit.org/show_bug.cgi?id=43789
+
+ Add a function for casting to RenderSVGImage and use it.
+
+ * rendering/RenderSVGImage.h:
+ (WebCore::toRenderSVGImage):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::write):
+ * rendering/SVGRenderTreeAsText.cpp:
+ (WebCore::writeSVGImage):
+ * rendering/SVGRenderTreeAsText.h:
+ * svg/SVGImageElement.cpp:
+ (WebCore::SVGImageElement::attach):
+
+2010-08-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Clients of HTMLTokenizer should be able to see where characters went in the token
+ https://bugs.webkit.org/show_bug.cgi?id=43766
+
+ When viewing the source of a document, we want to colorize different
+ parts of the input depending on how they were tokenized. In this
+ patch, we expose the internal segmentation of a token by recording the
+ start and end offsets for each attribute name and each attribute value.
+
+ * html/HTMLToken.h:
+ (WebCore::HTMLToken::addNewAttribute):
+ (WebCore::HTMLToken::beginAttributeName):
+ (WebCore::HTMLToken::endAttributeName):
+ (WebCore::HTMLToken::beginAttributeValue):
+ (WebCore::HTMLToken::endAttributeValue):
+ (WebCore::HTMLToken::appendToAttributeName):
+ (WebCore::HTMLToken::appendToAttributeValue):
+ (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::nextToken):
+
+2010-08-10 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by David Levin.
+
+ Do not post a sync task to the DB thread if it's terminating.
+ https://bugs.webkit.org/show_bug.cgi?id=43676
+
+ * bindings/generic/ActiveDOMCallback.cpp: The context can
+ sometimes be NULL. Check if it's NULL instead of asserting that
+ it's not.
+ (WebCore::ActiveDOMCallback::ActiveDOMCallback):
+ * dom/ActiveDOMObject.cpp:
+ (WebCore::ActiveDOMObject::ActiveDOMObject):
+
+ * storage/Database.cpp: Do not post a sync task to the DB thread
+ if the DB thread is terminating. Also, when a task is destroyed,
+ ASSERT that it was completed, or that it had no synchronizer.
+ (WebCore::Database::openAndVerifyVersion):
+ (WebCore::Database::markAsDeletedAndClose):
+ (WebCore::Database::tableNames):
+ * storage/DatabaseTask.cpp:
+ (WebCore::DatabaseTaskSynchronizer::DatabaseTaskSynchronizer):
+ (WebCore::DatabaseTask::~DatabaseTask):
+ (WebCore::DatabaseTask::performTask):
+ * storage/DatabaseTask.h:
+ (WebCore::DatabaseTaskSynchronizer::hasCheckedForTermination):
+ (WebCore::DatabaseTaskSynchronizer::setHasCheckedForTermination):
+ (WebCore::DatabaseTask::hasSynchronizer):
+ (WebCore::DatabaseTask::hasCheckedForTermination):
+ * storage/DatabaseThread.cpp:
+ (WebCore::DatabaseThread::terminationRequested):
+ (WebCore::DatabaseThread::scheduleTask):
+ (WebCore::DatabaseThread::scheduleImmediateTask):
+ * storage/DatabaseThread.h:
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Qt build fix.
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ Fix more build break.
+
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::ZigZag::Reader::readBlob):
+ (WebCore::ZigZag::Reader::readFile):
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+ (WebCore::ScriptExecutionContext::revokeBlobURL):
+ * dom/ScriptExecutionContext.h:
+ * html/Blob.cpp:
+ (WebCore::Blob::slice):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig
+
+ Bug 43817 - Remove UString::Rep
+ UString::Rep has for a long time been replaced by UStringImpl (Rep
+ remaining as a typedef). UStringImpl has since been removed too
+ (unified with StringImpl). Remove Rep, rename rep() to impl() and
+ m_rep to m_impl. Also add impl() method to Identifier, and rename
+ its UString member from _ustring to m_string.
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::findAtomicString):
+ * bindings/js/JSDOMBinding.h:
+ (WebCore::ustringToString):
+ (WebCore::identifierToString):
+ (WebCore::ustringToAtomicString):
+ (WebCore::identifierToAtomicString):
+ * bindings/js/SerializedScriptValue.h:
+ (WebCore::SerializedScriptValueData::SerializedScriptValueData):
+ * bridge/IdentifierRep.cpp:
+ (WebCore::IdentifierRep::get):
+ * bridge/c/c_class.cpp:
+ (JSC::Bindings::CClass::methodsNamed):
+ (JSC::Bindings::CClass::fieldNamed):
+ * bridge/jni/jsc/JavaClassJSC.cpp:
+ (JavaClass::JavaClass):
+ (JavaClass::methodsNamed):
+ (JavaClass::fieldNamed):
+ * bridge/jni/jsc/JavaStringJSC.h:
+ (JSC::Bindings::JavaStringImpl::~JavaStringImpl):
+ (JSC::Bindings::JavaStringImpl::init):
+ (JSC::Bindings::JavaStringImpl::UTF8String):
+ (JSC::Bindings::JavaStringImpl::uchars):
+ (JSC::Bindings::JavaStringImpl::length):
+ (JSC::Bindings::JavaStringImpl::uString):
+ * bridge/jsc/BridgeJSC.h:
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ Fix qt build break.
+
+ * html/BlobRegistryImpl.cpp:
+ * html/BlobRegistryImpl.h:
+ * html/BlobURL.cpp:
+ * html/BlobURL.h:
+ * platform/BlobRegistry.h:
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add the support to register the blob data.
+ https://bugs.webkit.org/show_bug.cgi?id=43600
+
+ This is the first step towards adding Blob URL support. The blob has
+ an internal URL (used by FileReader) and public URLs (used by Blob.url).
+ The URL and its associated data are managed by BlobRegistry interface.
+
+ This patch does not remove the usage of BlobItem. It will be removed
+ when all the blob data support is hooked up and the new tests will be
+ added then.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::SerializedBlob::create):
+ (WebCore::SerializedBlob::url):
+ (WebCore::SerializedBlob::type):
+ (WebCore::SerializedBlob::size):
+ (WebCore::SerializedBlob::SerializedBlob):
+ (WebCore::SerializedFile::create):
+ (WebCore::SerializedFile::path):
+ (WebCore::SerializedFile::url):
+ (WebCore::SerializedFile::type):
+ (WebCore::SerializedFile::SerializedFile):
+ (WebCore::SerializedFileList::item):
+ (WebCore::SerializedFileList::SerializedFileList):
+ (WebCore::SerializedScriptValueData::SerializedScriptValueData):
+ (WebCore::SharedSerializedData::asBlob):
+ (WebCore::SharedSerializedData::asFile):
+ (WebCore::SerializingTreeWalker::convertIfTerminal):
+ (WebCore::DeserializingTreeWalker::convertIfTerminal):
+ (WebCore::TeardownTreeWalker::convertIfTerminal):
+ * bindings/js/SerializedScriptValue.h:
+ (WebCore::SerializedScriptValueData::):
+ (WebCore::SerializedScriptValueData::asString):
+ (WebCore::SerializedScriptValueData::asBlob):
+ (WebCore::SerializedScriptValueData::asFile):
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::ZigZag::Writer::writeBlob):
+ (WebCore::ZigZag::Writer::writeFile):
+ (WebCore::ZigZag::Writer::writeFileList):
+ (WebCore::ZigZag::Writer::doWriteUintHelper):
+ (WebCore::ZigZag::Writer::doWriteUint32):
+ (WebCore::ZigZag::Writer::doWriteUint64):
+ (WebCore::ZigZag::Serializer::writeBlob):
+ (WebCore::ZigZag::Serializer::writeFile):
+ (WebCore::ZigZag::Reader::readBlob):
+ (WebCore::ZigZag::Reader::readFile):
+ (WebCore::ZigZag::Reader::readFileList):
+ (WebCore::ZigZag::Reader::doReadUintHelper):
+ (WebCore::ZigZag::Reader::doReadUint32):
+ (WebCore::ZigZag::Reader::doReadUint64):
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+ (WebCore::ScriptExecutionContext::trackBlobURL):
+ (WebCore::ScriptExecutionContext::revokeBlobURL):
+ * dom/ScriptExecutionContext.h:
+ * html/Blob.cpp:
+ (WebCore::Blob::Blob):
+ (WebCore::Blob::~Blob):
+ (WebCore::Blob::createPublicURL):
+ * html/Blob.h:
+ (WebCore::Blob::create):
+ (WebCore::Blob::url):
+ * html/BlobRegistryImpl.cpp: Added.
+ * html/BlobRegistryImpl.h: Added.
+ * html/BlobStorageData.h: Added.
+ * html/BlobURL.cpp: Added.
+ * html/BlobURL.h: Added.
+ * html/File.cpp:
+ (WebCore::File::File):
+ * html/File.h:
+ (WebCore::File::create):
+ * platform/BlobData.cpp: Added.
+ * platform/BlobData.h: Added.
+ * platform/BlobRegistry.h: Added.
+
+2010-08-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ SegmentedString should keep track of how many characters it consumes
+ https://bugs.webkit.org/show_bug.cgi?id=43765
+
+ The easiest way to keep track of how many characters we've consumed
+ would be to increment a counter every time we advance, but that's too
+ slow. Instead, we keep track lazily and update our summary durning the
+ slow case of advance (which is sufficiently rare).
+
+ There's some subtly to how this works w.r.t. "unconsuming" characters
+ by pushing them back on the front of the segmented string. This isn't
+ really a "right answer" here because the notion of unconsuming input
+ isn't present in the API. This patch makes some assumptions about how
+ clients of this class use its API. In a future patch, we might want to
+ rename some of the method names to make this more explicit.
+
+ * platform/text/SegmentedString.cpp:
+ (WebCore::SegmentedString::operator=):
+ (WebCore::SegmentedString::append):
+ (WebCore::SegmentedString::prepend):
+ (WebCore::SegmentedString::advanceSubstring):
+ * platform/text/SegmentedString.h:
+ (WebCore::SegmentedSubstring::numberOfCharactersConsumed):
+ (WebCore::SegmentedString::SegmentedString):
+ (WebCore::SegmentedString::numberOfCharactersConsumed):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Bug 43816 - Remove UStringImpl
+ The class was actually removed a long time ago, replaced by StringImpl.
+ UStringImpl is just a typedef onto StringImpl. Remove this.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::findAtomicString):
+
+2010-08-09 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Prefer the medium-quality (bilinear) image resampling for 2D canvas on
+ Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=43646
+
+ This is what the accelerated path is going to do,
+ so do it in the software path as well.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::createImageBuffer):
+ * platform/graphics/GraphicsContext.h:
+
+2010-08-10 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Removing an element from an anonymous block causes crash
+ https://bugs.webkit.org/show_bug.cgi?id=42309
+
+ There was a case where a continuation was added as a child, but if you asked
+ that child who is your parent, it would return the wrong answer.
+
+ The specific scenario was when a sibling of an element who was the start of a
+ continuation was present. Retrieving the parent object had then follow the sibling
+ chain and then follow the originating continuation chain.
+
+ Test: accessibility/removed-anonymous-block-child-causes-crash.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::nextSibling):
+ Fix erroneous comment
+ (WebCore::nextContinuation):
+ (WebCore::AccessibilityRenderObject::renderParentObject):
+ Handle unhandled continuation case.
+ (WebCore::AccessibilityRenderObject::addChildren):
+ ASSERT that the parentObject() is the same when adding a new child.
+
+2010-08-10 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Take checks for ruby base existence out of the ASSERTs.
+ https://bugs.webkit.org/show_bug.cgi?id=43795
+
+ Test: fast/ruby/ruby-remove-no-base.html
+
+ * rendering/RenderRubyRun.cpp:
+ (WebCore::RenderRubyRun::addChild):
+ (WebCore::RenderRubyRun::removeChild):
+
+2010-08-06 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ texture functions should gen INVALID_OPERATION if no texture is bound
+ https://bugs.webkit.org/show_bug.cgi?id=42907
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::copyTexImage2D): Check if a texture is bound to target.
+ (WebCore::WebGLRenderingContext::copyTexSubImage2D): Ditto.
+ (WebCore::WebGLRenderingContext::generateMipmap): Ditto.
+ (WebCore::WebGLRenderingContext::getTexParameter): Ditto.
+ (WebCore::WebGLRenderingContext::texImage2DBase): Ditto.
+ (WebCore::WebGLRenderingContext::texParameter): Ditto.
+ (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
+ (WebCore::WebGLRenderingContext::validateTextureBinding): Check if target is valid and if a texture is bound to it.
+ * html/canvas/WebGLRenderingContext.h: Declare validateTextureBinding().
+
+2010-08-10 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Sam Weinig.
+
+ [WINCE] Implement Path::currentPoint()
+ https://bugs.webkit.org/show_bug.cgi?id=42927
+
+ * platform/graphics/wince/PathWince.cpp:
+ (WebCore::Path::currentPoint):
+
+2010-08-10 Ariya Hidayat <ariya@sencha.com>
+
+ [Qt] Warning fix, remove reference to platform/text/StringImpl.h
+
+ * WebCore.pro:
+
+2010-08-10 Alice Liu <alice.liu@apple.com>
+
+ Chromium build fix attempt. not reviewed
+
+ * platform/text/TextBoundaries.cpp: use correct stringimplh include
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ Chromium build fix.
+
+ * platform/graphics/chromium/FontPlatformDataChromiumWin.h:
+ * platform/graphics/chromium/FontPlatformDataLinux.cpp:
+
+2010-08-10 Johnny Ding <jnd@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Change the ScriptController::processingUserGesture to static method
+ and use dynamic(JSC binding)/entered(V8 binding) frame to check the user gesture.
+ https://bugs.webkit.org/show_bug.cgi?id=42827.
+
+ Test: fast/events/popup-blocked-from-iframe-script.html
+
+ * WebCore.order:
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::processingUserGesture):
+ * bindings/js/JSDOMBinding.h:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::setLocation):
+ (WebCore::createWindow):
+ (WebCore::domWindowAllowPopUp):
+ (WebCore::JSDOMWindow::open):
+ (WebCore::JSDOMWindow::showModalDialog):
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::setLocation):
+ * bindings/js/JSLocationCustom.cpp:
+ (WebCore::navigateIfAllowed):
+ (WebCore::JSLocation::reload):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::processingUserGesture):
+ * bindings/js/ScriptController.h:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture):
+ (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD):
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::processingUserGesture):
+ (WebCore::ScriptController::anyPageIsProcessingUserGesture):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/specialization/V8BindingState.cpp:
+ (WebCore::::processingUserGesture):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::isProcessingUserGesture):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Chromium build fix
+
+ * platform/graphics/chromium/FontPlatformDataLinux.h:
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Bug 43786 - Move AtomicStringHash from WebCore to WTF
+ Also remove deprecated string headers from WebCore/platform/text.
+
+ * ForwardingHeaders/wtf/text/AtomicStringHash.h: Added.
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ * bindings/cpp/WebDOMHTMLCollectionCustom.cpp:
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ * bindings/js/JSClipboardCustom.cpp:
+ * bindings/js/JSDOMApplicationCacheCustom.cpp:
+ * bindings/js/JSDOMMimeTypeArrayCustom.cpp:
+ * bindings/js/JSDOMPluginArrayCustom.cpp:
+ * bindings/js/JSDOMPluginCustom.cpp:
+ * bindings/js/JSDOMStringMapCustom.cpp:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ * bindings/js/JSDataGridColumnListCustom.cpp:
+ * bindings/js/JSHTMLAllCollectionCustom.cpp:
+ * bindings/js/JSHTMLCollectionCustom.cpp:
+ * bindings/js/JSMessagePortCustom.cpp:
+ * bindings/js/JSNodeListCustom.cpp:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ * bindings/scripts/test/V8/V8TestInterface.h:
+ * bindings/scripts/test/V8/V8TestObj.h:
+ * bindings/v8/ScriptDebugServer.h:
+ * bindings/v8/V8Binding.cpp:
+ * bindings/v8/V8Binding.h:
+ * bridge/jni/v8/JavaClassV8.h:
+ * css/CSSFontFaceSource.h:
+ * css/CSSFontSelector.cpp:
+ * css/CSSFontSelector.h:
+ * css/CSSNamespace.h:
+ * css/CSSParser.cpp:
+ * css/CSSParser.h:
+ * css/CSSParserValues.h:
+ * css/CSSStyleSelector.h:
+ * css/CSSVariablesDeclaration.h:
+ * css/MediaFeatureNames.h:
+ * css/MediaQueryExp.h:
+ * css/WebKitCSSKeyframesRule.h:
+ * dom/CustomEvent.h:
+ * dom/Document.cpp:
+ * dom/Event.cpp:
+ * dom/Event.h:
+ * dom/EventNames.h:
+ * dom/EventTarget.h:
+ * dom/InputElement.h:
+ * dom/MessagePort.cpp:
+ * dom/MessagePort.h:
+ * dom/NameNodeList.h:
+ * dom/NodeRareData.h:
+ * dom/QualifiedName.h:
+ * dom/ScriptElement.cpp:
+ * dom/SpaceSplitString.h:
+ * dom/TagNodeList.h:
+ * dom/XMLDocumentParser.h:
+ * editing/EditorCommand.cpp:
+ * history/mac/HistoryItemMac.mm:
+ * html/BlobBuilder.cpp:
+ * html/DataGridColumn.h:
+ * html/DataGridColumnList.cpp:
+ * html/HTMLDocument.h:
+ * html/HTMLInputElement.cpp:
+ * html/HTMLTokenizer.cpp:
+ * html/HTMLTokenizer.h:
+ * html/LegacyPreloadScanner.cpp:
+ * html/LegacyPreloadScanner.h:
+ * inspector/InspectorCSSStore.h:
+ * inspector/InspectorController.h:
+ * inspector/InspectorDOMAgent.cpp:
+ * inspector/InspectorDOMAgent.h:
+ * inspector/InspectorDebuggerAgent.h:
+ * inspector/InspectorValues.h:
+ * loader/Cache.h:
+ * loader/CrossOriginAccessControl.cpp:
+ * loader/CrossOriginPreflightResultCache.h:
+ * loader/DocLoader.h:
+ * loader/ImageLoader.h:
+ * loader/appcache/ApplicationCache.h:
+ * loader/appcache/ApplicationCacheStorage.h:
+ * loader/appcache/DOMApplicationCache.h:
+ * loader/icon/IconDatabase.h:
+ * loader/icon/IconRecord.h:
+ * loader/loader.h:
+ * notifications/Notification.h:
+ * page/FrameTree.h:
+ * page/Page.cpp:
+ * page/PageGroup.h:
+ * page/SecurityOrigin.h:
+ * page/Settings.h:
+ * page/WindowFeatures.cpp:
+ * page/animation/AnimationBase.h:
+ * page/animation/AnimationControllerPrivate.h:
+ * page/animation/CompositeAnimation.h:
+ * platform/Cookie.h:
+ * platform/KURL.cpp:
+ * platform/KURLGoogle.cpp:
+ * platform/KURLHash.h:
+ * platform/Length.cpp:
+ * platform/LinkHash.cpp:
+ * platform/LinkHash.h:
+ * platform/MIMETypeRegistry.cpp:
+ * platform/MIMETypeRegistry.h:
+ * platform/SchemeRegistry.h:
+ * platform/ThreadGlobalData.cpp:
+ * platform/ThreadGlobalData.h:
+ * platform/cf/BinaryPropertyList.cpp:
+ * platform/chromium/SearchPopupMenuChromium.cpp:
+ * platform/efl/ClipboardEfl.cpp:
+ * platform/efl/CookieJarEfl.cpp:
+ * platform/efl/PlatformKeyboardEventEfl.cpp:
+ * platform/graphics/FontCache.cpp:
+ * platform/graphics/FontFamily.h:
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/cg/ImageSourceCGWin.cpp:
+ * platform/graphics/chromium/FontCacheChromiumWin.cpp:
+ * platform/graphics/chromium/FontCacheLinux.cpp:
+ * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
+ * platform/graphics/chromium/LayerChromium.h:
+ * platform/graphics/filters/Filter.h:
+ * platform/graphics/mac/FontPlatformData.h:
+ * platform/graphics/mac/GraphicsLayerCA.h:
+ * platform/graphics/qt/FontCacheQt.cpp:
+ * platform/graphics/win/FontCacheWin.cpp:
+ * platform/graphics/win/FontPlatformDataCGWin.cpp:
+ * platform/graphics/win/FontPlatformDataCairoWin.cpp:
+ * platform/graphics/win/FontPlatformDataWin.cpp:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
+ * platform/graphics/win/WKCACFLayer.h:
+ * platform/graphics/wince/FontPlatformData.cpp:
+ * platform/graphics/wx/FontPlatformData.h:
+ * platform/gtk/ClipboardGtk.cpp:
+ * platform/gtk/DataObjectGtk.h:
+ * platform/haiku/ClipboardHaiku.cpp:
+ * platform/haiku/CookieJarHaiku.cpp:
+ * platform/haiku/SearchPopupMenuHaiku.cpp:
+ * platform/mac/SearchPopupMenuMac.mm:
+ * platform/mac/ThreadCheck.mm:
+ * platform/network/CredentialStorage.cpp:
+ * platform/network/HTTPHeaderMap.h:
+ * platform/network/cf/DNSCFNet.cpp:
+ * platform/network/curl/CookieJarCurl.cpp:
+ * platform/qt/ClipboardQt.cpp:
+ * platform/text/AtomicString.h: Removed.
+ * platform/text/AtomicStringHash.h: Removed.
+ * platform/text/AtomicStringImpl.h: Removed.
+ * platform/text/AtomicStringKeyedMRUCache.h:
+ * platform/text/StringBuilder.cpp:
+ * platform/text/StringHash.h: Removed.
+ * platform/text/StringImpl.h: Removed.
+ * platform/text/TextCodecLatin1.cpp:
+ * platform/text/TextCodecUTF16.cpp:
+ * platform/text/TextCodecUserDefined.cpp:
+ * platform/text/cf/HyphenationCF.cpp:
+ * platform/text/cf/StringImplCF.cpp:
+ * platform/text/mac/HyphenationMac.mm:
+ * platform/text/mac/StringImplMac.mm:
+ * platform/text/transcoder/FontTranscoder.h:
+ * platform/text/wince/TextCodecWinCE.cpp:
+ * platform/win/BString.cpp:
+ * platform/win/ClipboardWin.cpp:
+ * platform/win/SearchPopupMenuWin.cpp:
+ * platform/wince/SearchPopupMenuWince.cpp:
+ * platform/wx/ClipboardWx.cpp:
+ * plugins/DOMMimeTypeArray.cpp:
+ * plugins/DOMPlugin.cpp:
+ * plugins/DOMPluginArray.cpp:
+ * plugins/PluginDatabase.h:
+ * plugins/PluginPackage.h:
+ * plugins/PluginStream.h:
+ * rendering/RenderApplet.h:
+ * rendering/RenderText.cpp:
+ * rendering/style/BindingURI.h:
+ * rendering/style/ContentData.cpp:
+ * rendering/style/CounterContent.h:
+ * rendering/style/CounterDirectives.h:
+ * rendering/style/KeyframeList.h:
+ * rendering/style/StyleRareInheritedData.h:
+ * storage/AbstractDatabase.cpp:
+ * storage/DatabaseAuthorizer.h:
+ * storage/DatabaseTracker.h:
+ * storage/IDBDatabaseBackendImpl.h:
+ * storage/IDBFactoryBackendImpl.h:
+ * storage/IDBObjectStoreBackendImpl.h:
+ * storage/OriginQuotaManager.h:
+ * storage/OriginUsageRecord.h:
+ * storage/SQLTransactionCoordinator.h:
+ * storage/StorageAreaSync.h:
+ * storage/StorageMap.h:
+ * storage/StorageNamespaceImpl.cpp:
+ * storage/chromium/QuotaTracker.h:
+ * svg/SVGAltGlyphElement.h:
+ * svg/SVGDocumentExtensions.cpp:
+ * svg/SVGDocumentExtensions.h:
+ * svg/SVGFitToViewBox.cpp:
+ * svg/SVGLangSpace.h:
+ * svg/animation/SMILTimeContainer.h:
+ * svg/graphics/filters/SVGFilterBuilder.h:
+ * websockets/WebSocket.h:
+ * websockets/WebSocketChannel.cpp:
+ * websockets/WebSocketHandshake.cpp:
+ * websockets/WebSocketHandshakeResponse.cpp:
+ * wml/WMLPageState.h:
+ * workers/AbstractWorker.h:
+ * workers/DefaultSharedWorkerRepository.h:
+ * workers/Worker.h:
+ * workers/WorkerContext.h:
+ * xml/XMLHttpRequest.h:
+ * xml/XMLHttpRequestUpload.cpp:
+ * xml/XMLHttpRequestUpload.h:
+ * xml/XPathExpressionNode.h:
+ * xml/XPathNamespace.h:
+ * xml/XPathParser.cpp:
+ * xml/XSLTProcessor.h:
+
+2010-08-10 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Adding changes that escaped from r65072.
+
+ Web Inspector: move database processing to native layer.
+ https://bugs.webkit.org/show_bug.cgi?id=43788
+
+ * inspector/front-end/InspectorBackendStub.js:
+ (WebInspector.InspectorBackendStub):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype._genericViewSetup):
+
+2010-08-10 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Inputs of type 'search' have weird looking checkboxes instead of search/clear icons
+ https://bugs.webkit.org/show_bug.cgi?id=43760
+
+ Draw appropriate GTK+ stock images for search/clear icons in search entries.
+
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
+ (WebCore::RenderThemeGtk::paintSearchFieldResultsDecoration):
+ (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
+
+2010-08-10 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed. Qt build fix, follow up for r65072.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+
2010-08-10 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/Configurations/WebCore.xcconfig b/WebCore/Configurations/WebCore.xcconfig
index 73e3519..83e535c 100644
--- a/WebCore/Configurations/WebCore.xcconfig
+++ b/WebCore/Configurations/WebCore.xcconfig
@@ -43,14 +43,14 @@ FRAMEWORK_SEARCH_PATHS_iphoneos_Production = $(PRODUCTION_FRAMEWORKS_DIR);
FRAMEWORK_SEARCH_PATHS_iphonesimulator = $(FRAMEWORK_SEARCH_PATHS_iphoneos_$(CONFIGURATION));
FRAMEWORK_SEARCH_PATHS_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(FRAMEWORK_SEARCH_PATHS);
-HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 $(SQLITE3_HEADER_SEARCH_PATHS) "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore" $(HEADER_SEARCH_PATHS);
+HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 $(SQLITE3_HEADER_SEARCH_PATHS) "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore" "${BUILT_PRODUCTS_DIR}/usr/local/include" $(HEADER_SEARCH_PATHS);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = $(INSTALL_PATH_$(REAL_PLATFORM_NAME));
INSTALL_PATH_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
INSTALLHDRS_COPY_PHASE = YES;
INSTALLHDRS_SCRIPT_PHASE = YES;
PRODUCT_NAME = WebCore;
-OTHER_LDFLAGS_BASE = -l$(SQLITE3_LIBRARY) -lobjc;
+OTHER_LDFLAGS_BASE = -l$(SQLITE3_LIBRARY) -lobjc -lANGLE;
OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(REAL_PLATFORM_NAME));
OTHER_LDFLAGS_iphoneos = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework QuartzCore;
OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_iphoneos);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index fd7fcf8..351db54 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -26,6 +26,7 @@
// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
#include "HTMLElementFactory.cpp"
+#include "HTMLEntityTable.cpp"
#include "JSAbstractWorker.cpp"
#include "JSAttr.cpp"
#include "JSBarInfo.cpp"
@@ -72,11 +73,14 @@
#include "JSDataGridColumnList.cpp"
#include "JSDedicatedWorkerContext.cpp"
#include "JSDeviceOrientationEvent.cpp"
+#include "JSDirectoryEntry.cpp"
+#include "JSDirectoryReader.cpp"
#include "JSDocument.cpp"
#include "JSDocumentFragment.cpp"
#include "JSDocumentType.cpp"
#include "JSDOMApplicationCache.cpp"
#include "JSDOMCoreException.cpp"
+#include "JSDOMFileSystem.cpp"
#include "JSDOMFormData.cpp"
#include "JSDOMImplementation.cpp"
#include "JSDOMMimeType.cpp"
@@ -91,14 +95,22 @@
#include "JSElement.cpp"
#include "JSEntity.cpp"
#include "JSEntityReference.cpp"
+#include "JSEntriesCallback.cpp"
+#include "JSEntry.cpp"
+#include "JSEntryArray.cpp"
+#include "JSEntryCallback.cpp"
+#include "JSErrorCallback.cpp"
#include "JSErrorEvent.cpp"
#include "JSEvent.cpp"
#include "JSEventException.cpp"
#include "JSEventSource.cpp"
#include "JSFile.cpp"
+#include "JSFileEntry.cpp"
#include "JSFileError.cpp"
#include "JSFileList.cpp"
#include "JSFileReader.cpp"
+#include "JSFileSystemCallback.cpp"
+#include "JSFlags.cpp"
#include "JSGeolocation.cpp"
#include "JSGeoposition.cpp"
#include "JSHistory.cpp"
@@ -202,6 +214,8 @@
#include "JSMessageChannel.cpp"
#include "JSMessageEvent.cpp"
#include "JSMessagePort.cpp"
+#include "JSMetadata.cpp"
+#include "JSMetadataCallback.cpp"
#include "JSMouseEvent.cpp"
#include "JSMutationEvent.cpp"
#include "JSNamedNodeMap.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index f25e91e..886c1f3 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -129,6 +129,8 @@ DOM_CLASSES = \
DatabaseSync \
DeviceMotionEvent \
DeviceOrientationEvent \
+ DirectoryEntry \
+ DirectoryReader \
Document \
DocumentFragment \
DocumentType \
@@ -136,7 +138,9 @@ DOM_CLASSES = \
ElementTimeControl \
Entity \
EntityReference \
+ EntriesCallback \
Entry \
+ EntryArray \
EntryCallback \
ErrorCallback \
ErrorEvent \
@@ -146,6 +150,7 @@ DOM_CLASSES = \
EventSource \
EventTarget \
File \
+ FileEntry \
FileError \
FileList \
FileReader \
@@ -490,7 +495,7 @@ JS_DOM_HEADERS=$(filter-out JSEventListener.h JSEventTarget.h,$(DOM_CLASSES:%=JS
WEB_DOM_HEADERS :=
ifeq ($(findstring BUILDING_WX,$(FEATURE_DEFINES)), BUILDING_WX)
-WEB_DOM_HEADERS := $(filter-out WebDOMXSLTProcessor.h,$(DOM_CLASSES:%=WebDOM%.h))
+WEB_DOM_HEADERS := $(filter-out WebDOMXSLTProcessor.h WebDOMEventTarget.h,$(DOM_CLASSES:%=WebDOM%.h))
endif # BUILDING_WX
all : \
@@ -505,7 +510,7 @@ all : \
ColorData.cpp \
DocTypeStrings.cpp \
HTMLElementFactory.cpp \
- HTMLEntityNames.cpp \
+ HTMLEntityTable.cpp \
HTMLNames.cpp \
WMLElementFactory.cpp \
WMLNames.cpp \
@@ -600,8 +605,8 @@ DocTypeStrings.cpp : html/DocTypeStrings.gperf $(WebCore)/make-hash-tools.pl
# HTML entity names
-HTMLEntityNames.cpp : html/HTMLEntityNames.gperf $(WebCore)/make-hash-tools.pl
- perl $(WebCore)/make-hash-tools.pl . $(WebCore)/html/HTMLEntityNames.gperf
+HTMLEntityTable.cpp : html/HTMLEntityNames.json $(WebCore)/../WebKitTools/Scripts/create-html-entity-table
+ python $(WebCore)/../WebKitTools/Scripts/create-html-entity-table -o HTMLEntityTable.cpp $(WebCore)/html/HTMLEntityNames.json
# --------
diff --git a/WebCore/ForwardingHeaders/wtf/text/AtomicStringHash.h b/WebCore/ForwardingHeaders/wtf/text/AtomicStringHash.h
new file mode 100644
index 0000000..3ca1b77
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/text/AtomicStringHash.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_AtomicStringHash_h
+#define WebCore_FWD_AtomicStringHash_h
+#include <JavaScriptCore/AtomicStringHash.h>
+#endif
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 388b687..c191573 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -69,6 +69,7 @@ webcore_cppflags += \
-DDATA_DIR=\"${datadir}\"
webcoregtk_cppflags += \
+ -DWEBKITGTK_API_VERSION_STRING=\"@WEBKITGTK_API_VERSION@\" \
-DWTF_USE_SOUP=1 \
-DWTF_USE_GSTREAMER=1 \
-I$(srcdir)/WebCore/accessibility/gtk \
@@ -92,7 +93,7 @@ webcore_built_sources += \
DerivedSources/WebCore/CSSValueKeywords.h \
DerivedSources/WebCore/HTMLElementFactory.cpp \
DerivedSources/WebCore/HTMLElementFactory.h \
- DerivedSources/WebCore/HTMLEntityNames.cpp \
+ DerivedSources/WebCore/HTMLEntityTable.cpp \
DerivedSources/WebCore/HTMLNames.cpp \
DerivedSources/WebCore/HTMLNames.h \
DerivedSources/WebCore/InspectorBackendDispatcher.cpp \
@@ -1314,6 +1315,8 @@ webcore_sources += \
WebCore/html/Blob.h \
WebCore/html/BlobBuilder.cpp \
WebCore/html/BlobBuilder.h \
+ WebCore/html/BlobURL.cpp \
+ WebCore/html/BlobURL.h \
WebCore/html/canvas/CanvasContextAttributes.h \
WebCore/html/canvas/CanvasGradient.cpp \
WebCore/html/canvas/CanvasGradient.h \
@@ -1422,6 +1425,8 @@ webcore_sources += \
WebCore/html/HTMLElement.h \
WebCore/html/HTMLElementStack.cpp \
WebCore/html/HTMLElementStack.h \
+ WebCore/html/HTMLEntitySearch.cpp \
+ WebCore/html/HTMLEntitySearch.h \
WebCore/html/HTMLEmbedElement.cpp \
WebCore/html/HTMLEmbedElement.h \
WebCore/html/HTMLFieldSetElement.cpp \
@@ -1544,12 +1549,12 @@ webcore_sources += \
WebCore/html/HTMLTextAreaElement.h \
WebCore/html/HTMLTitleElement.cpp \
WebCore/html/HTMLTitleElement.h \
- WebCore/html/LegacyHTMLDocumentParser.cpp \
- WebCore/html/LegacyHTMLDocumentParser.h \
WebCore/html/HTMLUListElement.cpp \
WebCore/html/HTMLUListElement.h \
WebCore/html/HTMLViewSourceDocument.cpp \
WebCore/html/HTMLViewSourceDocument.h \
+ WebCore/html/HTMLViewSourceParser.cpp \
+ WebCore/html/HTMLViewSourceParser.h \
WebCore/html/ImageData.cpp \
WebCore/html/ImageData.h \
WebCore/html/ImageResizerThread.cpp \
@@ -1557,11 +1562,11 @@ webcore_sources += \
WebCore/html/LabelsNodeList.cpp \
WebCore/html/LabelsNodeList.h \
WebCore/html/MediaError.h \
- WebCore/html/LegacyPreloadScanner.cpp \
- WebCore/html/LegacyPreloadScanner.h \
WebCore/html/StepRange.cpp \
WebCore/html/StepRange.h \
WebCore/html/TextMetrics.h \
+ WebCore/html/ThreadableBlobRegistry.cpp \
+ WebCore/html/ThreadableBlobRegistry.h \
WebCore/html/ValidityState.cpp \
WebCore/html/ValidityState.h \
WebCore/html/VoidCallback.h \
@@ -1685,6 +1690,7 @@ webcore_sources += \
WebCore/loader/FrameLoaderStateMachine.cpp \
WebCore/loader/FrameLoaderStateMachine.h \
WebCore/loader/FrameLoaderTypes.h \
+ WebCore/loader/FrameNetworkingContext.h \
WebCore/loader/HistoryController.cpp \
WebCore/loader/HistoryController.h \
WebCore/loader/ImageDocument.cpp \
@@ -1795,6 +1801,8 @@ webcore_sources += \
WebCore/page/GeolocationPositionCache.cpp \
WebCore/page/GeolocationPositionCache.h \
WebCore/page/Geoposition.h \
+ WebCore/page/GroupSettings.cpp \
+ WebCore/page/GroupSettings.h \
WebCore/page/HaltablePlugin.h \
WebCore/page/History.cpp \
WebCore/page/History.h \
@@ -1893,6 +1901,7 @@ webcore_sources += \
WebCore/platform/EventLoop.h \
WebCore/platform/FileChooser.cpp \
WebCore/platform/FileChooser.h \
+ WebCore/platform/FileSystem.cpp \
WebCore/platform/FileSystem.h \
WebCore/platform/FloatConversion.h \
WebCore/platform/GeolocationService.cpp \
@@ -2080,6 +2089,12 @@ webcore_sources += \
WebCore/platform/network/AuthenticationChallengeBase.cpp \
WebCore/platform/network/AuthenticationChallengeBase.h \
WebCore/platform/network/AuthenticationClient.h \
+ WebCore/platform/network/BlobData.cpp \
+ WebCore/platform/network/BlobData.h \
+ WebCore/platform/network/BlobRegistry.h \
+ WebCore/platform/network/BlobRegistryImpl.cpp \
+ WebCore/platform/network/BlobRegistryImpl.h \
+ WebCore/platform/network/BlobStorageData.h \
WebCore/platform/network/Credential.cpp \
WebCore/platform/network/Credential.h \
WebCore/platform/network/DNS.h \
@@ -2093,6 +2108,7 @@ webcore_sources += \
WebCore/platform/network/HTTPParsers.h \
WebCore/platform/network/NetworkStateNotifier.cpp \
WebCore/platform/network/NetworkStateNotifier.h \
+ WebCore/platform/network/NetworkingContext.h \
WebCore/platform/network/ProtectionSpace.cpp \
WebCore/platform/network/ProtectionSpace.h \
WebCore/platform/network/ResourceErrorBase.cpp \
@@ -2106,8 +2122,6 @@ webcore_sources += \
WebCore/platform/network/ResourceRequestBase.h \
WebCore/platform/network/ResourceResponseBase.cpp \
WebCore/platform/network/ResourceResponseBase.h \
- WebCore/platform/text/AtomicString.h \
- WebCore/platform/text/AtomicStringHash.h \
WebCore/platform/text/AtomicStringImpl.h \
WebCore/platform/text/Base64.cpp \
WebCore/platform/text/Base64.h \
@@ -2432,6 +2446,8 @@ webcoregtk_sources += \
WebCore/platform/graphics/cairo/FontPlatformData.h \
WebCore/platform/graphics/cairo/GOwnPtrCairo.cpp \
WebCore/platform/graphics/cairo/GOwnPtrCairo.h \
+ WebCore/platform/graphics/cairo/GRefPtrCairo.cpp \
+ WebCore/platform/graphics/cairo/GRefPtrCairo.h \
WebCore/platform/graphics/cairo/GradientCairo.cpp \
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \
WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h \
@@ -2473,6 +2489,7 @@ webcoregtk_sources += \
WebCore/platform/gtk/gtkdrawing.h \
WebCore/platform/gtk/GtkPluginWidget.cpp \
WebCore/platform/gtk/GtkPluginWidget.h \
+ WebCore/platform/gtk/GtkVersioning.cpp \
WebCore/platform/gtk/GtkVersioning.h \
WebCore/platform/gtk/KeyEventGtk.cpp \
WebCore/platform/gtk/KURLGtk.cpp \
@@ -2982,6 +2999,55 @@ FEATURE_DEFINES += ENABLE_FILE_SYSTEM=1
webcore_cppflags += -DENABLE_FILE_SYSTEM=1
endif # END ENABLE_FILE_SYSTEM
+webcore_built_sources += \
+ DerivedSources/WebCore/JSDirectoryEntry.cpp \
+ DerivedSources/WebCore/JSDirectoryEntry.h \
+ DerivedSources/WebCore/JSDirectoryReader.cpp \
+ DerivedSources/WebCore/JSDirectoryReader.h \
+ DerivedSources/WebCore/JSDOMFileSystem.cpp \
+ DerivedSources/WebCore/JSDOMFileSystem.h \
+ DerivedSources/WebCore/JSEntriesCallback.cpp \
+ DerivedSources/WebCore/JSEntriesCallback.h \
+ DerivedSources/WebCore/JSEntry.cpp \
+ DerivedSources/WebCore/JSEntry.h \
+ DerivedSources/WebCore/JSEntryArray.cpp \
+ DerivedSources/WebCore/JSEntryArray.h \
+ DerivedSources/WebCore/JSEntryCallback.cpp \
+ DerivedSources/WebCore/JSEntryCallback.h \
+ DerivedSources/WebCore/JSErrorCallback.cpp \
+ DerivedSources/WebCore/JSErrorCallback.h \
+ DerivedSources/WebCore/JSFileEntry.cpp \
+ DerivedSources/WebCore/JSFileEntry.h \
+ DerivedSources/WebCore/JSFileSystemCallback.cpp \
+ DerivedSources/WebCore/JSFileSystemCallback.h \
+ DerivedSources/WebCore/JSFlags.cpp \
+ DerivedSources/WebCore/JSFlags.h \
+ DerivedSources/WebCore/JSMetadata.cpp \
+ DerivedSources/WebCore/JSMetadata.h \
+ DerivedSources/WebCore/JSMetadataCallback.cpp \
+ DerivedSources/WebCore/JSMetadataCallback.h
+
+webcore_sources += \
+ WebCore/storage/DirectoryEntry.cpp \
+ WebCore/storage/DirectoryEntry.h \
+ WebCore/storage/DirectoryReader.cpp \
+ WebCore/storage/DirectoryReader.h \
+ WebCore/storage/DOMFileSystem.cpp \
+ WebCore/storage/DOMFileSystem.h \
+ WebCore/storage/EntriesCallback.h \
+ WebCore/storage/Entry.cpp \
+ WebCore/storage/Entry.h \
+ WebCore/storage/EntryArray.cpp \
+ WebCore/storage/EntryArray.h \
+ WebCore/storage/EntryCallback.h \
+ WebCore/storage/ErrorCallback.h \
+ WebCore/storage/FileEntry.cpp \
+ WebCore/storage/FileEntry.h \
+ WebCore/storage/FileSystemCallback.h \
+ WebCore/storage/Flags.h \
+ WebCore/storage/Metadata.h \
+ WebCore/storage/MetadataCallback.h
+
# ----
# Speech Input API support
# ----
@@ -3472,7 +3538,6 @@ DerivedSources/WebCore/MathMLNames.h: DerivedSources/WebCore/MathMLNames.cpp
DerivedSources/WebCore/MathMLElementFactory.cpp DerivedSources/WebCore/MathMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/mathml/mathtags.in $(WebCore)/mathml/mathattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
-
# ----
# Notifications support
# ----
@@ -3866,6 +3931,8 @@ webcore_sources += \
WebCore/rendering/SVGCharacterLayoutInfo.h \
WebCore/rendering/SVGInlineFlowBox.cpp \
WebCore/rendering/SVGInlineFlowBox.h \
+ WebCore/rendering/SVGImageBufferTools.cpp \
+ WebCore/rendering/SVGImageBufferTools.h \
WebCore/rendering/SVGInlineTextBox.cpp \
WebCore/rendering/SVGInlineTextBox.h \
WebCore/rendering/SVGMarkerData.h \
@@ -4072,6 +4139,8 @@ webcore_sources += \
WebCore/svg/SVGPaint.h \
WebCore/svg/SVGParserUtilities.cpp \
WebCore/svg/SVGParserUtilities.h \
+ WebCore/svg/SVGPathBlender.cpp \
+ WebCore/svg/SVGPathBlender.h \
WebCore/svg/SVGPathBuilder.cpp \
WebCore/svg/SVGPathBuilder.h \
WebCore/svg/SVGPathByteStream.h \
@@ -4119,6 +4188,8 @@ webcore_sources += \
WebCore/svg/SVGPathStringBuilder.h \
WebCore/svg/SVGPathStringSource.cpp \
WebCore/svg/SVGPathStringSource.h \
+ WebCore/svg/SVGPathTraversalStateBuilder.cpp \
+ WebCore/svg/SVGPathTraversalStateBuilder.h \
WebCore/svg/SVGPatternElement.cpp \
WebCore/svg/SVGPatternElement.h \
WebCore/svg/SVGPointList.cpp \
@@ -4384,8 +4455,8 @@ DerivedSources/WebCore/DocTypeStrings.cpp : $(WebCore)/html/DocTypeStrings.gperf
$(PERL) $(WebCore)/make-hash-tools.pl $(GENSOURCES_WEBCORE) $(WebCore)/html/DocTypeStrings.gperf
# HTML entity names
-DerivedSources/WebCore/HTMLEntityNames.cpp : $(WebCore)/html/HTMLEntityNames.gperf $(WebCore)/make-hash-tools.pl
- $(PERL) $(WebCore)/make-hash-tools.pl $(GENSOURCES_WEBCORE) $(WebCore)/html/HTMLEntityNames.gperf
+DerivedSources/WebCore/HTMLEntityTable.cpp : $(WebCore)/html/HTMLEntityNames.json $(WebCore)/../WebKitTools/Scripts/create-html-entity-table
+ $(PYTHON) $(WebCore)/../WebKitTools/Scripts/create-html-entity-table -o $(GENSOURCES_WEBCORE)/HTMLEntityTable.cpp $(WebCore)/html/HTMLEntityNames.json
# color names
DerivedSources/WebCore/ColorData.cpp: $(WebCore)/platform/ColorData.gperf $(WebCore)/make-hash-tools.pl
@@ -4549,6 +4620,7 @@ EXTRA_DIST += \
webinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
dist_webinspector_DATA = \
$(WebCore)/English.lproj/localizedStrings.js \
+ DerivedSources/WebCore/InspectorBackendStub.js \
$(shell ls $(WebCore)/inspector/front-end/*.js) \
$(shell ls $(WebCore)/inspector/front-end/*.html) \
$(shell ls $(WebCore)/inspector/front-end/*.css)
@@ -4558,7 +4630,14 @@ dist_webinspectorimages_DATA = \
$(shell ls $(WebCore)/inspector/front-end/Images/*.gif) \
$(shell ls $(WebCore)/inspector/front-end/Images/*.png)
-webresourcesdir = ${datadir}/webkit-@WEBKITGTK_API_VERSION@/images
+noinst_webinspectordir = ${GENSOURCES_INSPECTOR}
+noinst_webinspector_SCRIPTS = ${GENSOURCES_INSPECTOR}/inspector.html
+${GENSOURCES_INSPECTOR}/inspector.html :
+ mkdir -p ${GENSOURCES_INSPECTOR}/images
+ cp ${dist_webinspector_DATA} ${GENSOURCES_INSPECTOR}
+ cp ${dist_webinspectorimages_DATA} ${GENSOURCES_INSPECTOR}/images
+
+webresourcesdir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/images
dist_webresources_DATA = \
$(WebCore)/Resources/textAreaResizeCorner.png \
$(WebCore)/Resources/nullPlugin.png \
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 2da4dee..1369296 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -820,7 +820,7 @@ __ZN7WebCore9PageGroup18addVisitedLinkHashEy
__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
__ZN7WebCore9PageGroup20removeAllUserContentEv
__ZN7WebCore9PageGroup21removeAllVisitedLinksEv
-__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesE
+__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_4KURLENS3_10PassOwnPtrINS3_6VectorIS4_Lm0EEEEESD_NS_25UserContentInjectedFramesENS_14UserStyleSheet5LevelE
__ZN7WebCore9PageGroup25removeUserScriptFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
__ZN7WebCore9PageGroup26removeUserScriptsFromWorldEPNS_15DOMWrapperWorldE
__ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index a28ee5d..fed9c0d 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -127,6 +127,7 @@
'../loader/appcache',
'../loader/archive',
'../loader/icon',
+ '../mathml',
'../notifications',
'../page',
'../page/animation',
@@ -266,6 +267,51 @@
},
'targets': [
{
+ 'target_name': 'inspector_protocol_sources',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'generateInspectorProtocolSources',
+ # The second input item will be used as item name in vcproj.
+ # It is not possible to put Inspector.idl there because
+ # all idl files are marking as excluded by gyp generator.
+ 'inputs': [
+ '../bindings/scripts/generate-bindings.pl',
+ '../inspector/CodeGeneratorInspector.pm',
+ '../bindings/scripts/CodeGenerator.pm',
+ '../bindings/scripts/IDLParser.pm',
+ '../bindings/scripts/IDLStructure.pm',
+ '../inspector/Inspector.idl',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorBackendDispatcher.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/RemoteInspectorFrontend.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/RemoteInspectorFrontend.h',
+ ],
+ 'variables': {
+ 'generator_include_dirs': [
+ ],
+ },
+ 'action': [
+ 'python',
+ 'scripts/rule_binding.py',
+ '../inspector/Inspector.idl',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT',
+ '--generator', 'Inspector',
+ '<@(generator_include_dirs)'
+ ],
+ 'message': 'Generating Inspector protocol sources from Inspector.idl',
+ },
+ ]
+ },
+ {
'target_name': 'webcore_bindings_sources',
'type': 'none',
'hard_dependency': 1,
@@ -276,9 +322,11 @@
# gperf rule
'../html/DocTypeStrings.gperf',
- '../html/HTMLEntityNames.gperf',
'../platform/ColorData.gperf',
+ # json rule
+ '../html/HTMLEntityNames.json',
+
# idl rules
'<@(bindings_idl_files)',
],
@@ -397,6 +445,8 @@
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.h',
],
'action': [
'python',
@@ -405,6 +455,7 @@
'--',
'<@(_inputs)',
'--',
+ '--factory',
'--extraDefines', '<(feature_defines)'
],
},
@@ -419,6 +470,7 @@
'../css/themeWin.css',
'../css/themeWinQuirks.css',
'../css/svg.css',
+ '../css/mathml.css',
'../css/mediaControls.css',
'../css/mediaControlsChromium.css',
],
@@ -475,44 +527,6 @@
],
},
{
- 'action_name': 'RemoteInspectorFrontend',
- # The second input item will be used as item name in vcproj.
- # It is not possible to put Inspector.idl there because
- # all idl files are marking as excluded by gyp generator.
- 'inputs': [
- '../bindings/scripts/generate-bindings.pl',
- '../inspector/CodeGeneratorInspector.pm',
- '../bindings/scripts/CodeGenerator.pm',
- '../bindings/scripts/IDLParser.pm',
- '../bindings/scripts/IDLStructure.pm',
- '../inspector/Inspector.idl',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/InspectorBackendDispatcher.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/InspectorBackendDispatcher.h',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/RemoteInspectorFrontend.h',
- ],
- 'variables': {
- 'generator_include_dirs': [
- ],
- },
- 'action': [
- 'python',
- 'scripts/rule_binding.py',
- '../inspector/Inspector.idl',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings',
- '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
- '--',
- '<@(_inputs)',
- '--',
- '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT',
- '--generator', 'Inspector',
- '<@(generator_include_dirs)'
- ],
- 'message': 'Generating Inspector interface classes from Inspector.idl',
- },
- {
'action_name': 'XMLNames',
'inputs': [
'../dom/make_names.pl',
@@ -598,7 +612,7 @@
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
],
- 'dependencies': [
+ 'inputs': [
'../make-hash-tools.pl',
],
'action': [
@@ -609,6 +623,26 @@
],
'process_outputs_as_sources': 0,
},
+ {
+ 'rule_name': 'json',
+ 'extension': 'json',
+ #
+ # json outputs are generated by WebKitTools/Scripts/create-html-entity-table
+ #
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp',
+ ],
+ 'inputs': [
+ '../../WebKitTools/Scripts/create-html-entity-table',
+ ],
+ 'action': [
+ 'python',
+ '../../WebKitTools/Scripts/create-html-entity-table',
+ '-o',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp',
+ '<(RULE_INPUT_PATH)',
+ ],
+ },
# Rule to build generated JavaScript (V8) bindings from .idl source.
{
'rule_name': 'binding',
@@ -670,6 +704,7 @@
'hard_dependency': 1,
'dependencies': [
'webcore_bindings_sources',
+ 'inspector_protocol_sources',
'../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
'../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
'<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
@@ -711,15 +746,19 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
+ # Generated from HTMLEntityNames.json
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp',
+
# Additional .cpp files from the webcore_bindings_sources rules.
'<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
# Additional .cpp files from the webcore_inspector_sources list.
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/RemoteInspectorFrontend.cpp',
- '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/InspectorBackendDispatcher.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/RemoteInspectorFrontend.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
],
'conditions': [
['javascript_engine=="v8"', {
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 33645b5..d906385 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -231,10 +231,15 @@
'storage/Database.idl',
'storage/DatabaseCallback.idl',
'storage/DatabaseSync.idl',
+ 'storage/DirectoryEntry.idl',
+ 'storage/DirectoryReader.idl',
'storage/DOMFileSystem.idl',
+ 'storage/EntriesCallback.idl',
'storage/Entry.idl',
+ 'storage/EntryArray.idl',
'storage/EntryCallback.idl',
'storage/ErrorCallback.idl',
+ 'storage/FileEntry.idl',
'storage/FileSystemCallback.idl',
'storage/Flags.idl',
'storage/IDBAny.idl',
@@ -1432,6 +1437,8 @@
'html/Blob.h',
'html/BlobBuilder.cpp',
'html/BlobBuilder.h',
+ 'html/BlobURL.cpp',
+ 'html/BlobURL.h',
'html/canvas/ArrayBufferView.cpp',
'html/canvas/ArrayBufferView.h',
'html/canvas/ArrayBuffer.cpp',
@@ -1583,6 +1590,8 @@
'html/HTMLElement.h',
'html/HTMLElementStack.cpp',
'html/HTMLElementStack.h',
+ 'html/HTMLEntitySearch.cpp',
+ 'html/HTMLEntitySearch.h',
'html/HTMLEmbedElement.cpp',
'html/HTMLEmbedElement.h',
'html/HTMLFieldSetElement.cpp',
@@ -1708,14 +1717,14 @@
'html/HTMLTextAreaElement.h',
'html/HTMLTitleElement.cpp',
'html/HTMLTitleElement.h',
- 'html/LegacyHTMLDocumentParser.cpp',
- 'html/LegacyHTMLDocumentParser.h',
'html/HTMLUListElement.cpp',
'html/HTMLUListElement.h',
'html/HTMLVideoElement.cpp',
'html/HTMLVideoElement.h',
'html/HTMLViewSourceDocument.cpp',
'html/HTMLViewSourceDocument.h',
+ 'html/HTMLViewSourceParser.cpp',
+ 'html/HTMLViewSourceParser.h',
'html/ImageData.cpp',
'html/ImageData.h',
'html/ImageResizerThread.cpp',
@@ -1723,11 +1732,11 @@
'html/LabelsNodeList.cpp',
'html/LabelsNodeList.h',
'html/MediaError.h',
- 'html/LegacyPreloadScanner.cpp',
- 'html/LegacyPreloadScanner.h',
'html/StepRange.cpp',
'html/StepRange.h',
'html/TextMetrics.h',
+ 'html/ThreadableBlobRegistry.cpp',
+ 'html/ThreadableBlobRegistry.h',
'html/TimeRanges.cpp',
'html/TimeRanges.h',
'html/ValidityState.cpp',
@@ -1867,6 +1876,7 @@
'loader/FrameLoaderStateMachine.cpp',
'loader/FrameLoaderStateMachine.h',
'loader/FrameLoaderTypes.h',
+ 'loader/FrameNetworkingContext.h',
'loader/HistoryController.cpp',
'loader/HistoryController.h',
'loader/ImageDocument.cpp',
@@ -1920,6 +1930,34 @@
'loader/WorkerThreadableLoader.h',
'loader/loader.cpp',
'loader/loader.h',
+ 'mathml/MathMLElement.cpp',
+ 'mathml/MathMLElement.h',
+ 'mathml/MathMLInlineContainerElement.cpp',
+ 'mathml/MathMLInlineContainerElement.h',
+ 'mathml/MathMLMathElement.cpp',
+ 'mathml/MathMLMathElement.h',
+ 'mathml/MathMLTextElement.cpp',
+ 'mathml/MathMLTextElement.h',
+ 'mathml/RenderMathMLBlock.cpp',
+ 'mathml/RenderMathMLBlock.h',
+ 'mathml/RenderMathMLFenced.cpp',
+ 'mathml/RenderMathMLFenced.h',
+ 'mathml/RenderMathMLFraction.cpp',
+ 'mathml/RenderMathMLFraction.h',
+ 'mathml/RenderMathMLMath.cpp',
+ 'mathml/RenderMathMLMath.h',
+ 'mathml/RenderMathMLOperator.cpp',
+ 'mathml/RenderMathMLOperator.h',
+ 'mathml/RenderMathMLRoot.cpp',
+ 'mathml/RenderMathMLRoot.h',
+ 'mathml/RenderMathMLRow.cpp',
+ 'mathml/RenderMathMLRow.h',
+ 'mathml/RenderMathMLSquareRoot.cpp',
+ 'mathml/RenderMathMLSquareRoot.h',
+ 'mathml/RenderMathMLSubSup.cpp',
+ 'mathml/RenderMathMLSubSup.h',
+ 'mathml/RenderMathMLUnderOver.cpp',
+ 'mathml/RenderMathMLUnderOver.h',
'notifications/Notification.cpp',
'notifications/Notification.h',
'notifications/NotificationCenter.cpp',
@@ -2013,6 +2051,8 @@
'page/GeolocationPositionCache.cpp',
'page/GeolocationPositionCache.h',
'page/Geoposition.h',
+ 'page/GroupSettings.cpp',
+ 'page/GroupSettings.h',
'page/HaltablePlugin.h',
'page/History.cpp',
'page/History.h',
@@ -2227,6 +2267,8 @@
'platform/graphics/chromium/PlatformIcon.h',
'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp',
'platform/graphics/chromium/SimpleFontDataLinux.cpp',
+ 'platform/graphics/chromium/TilingData.h',
+ 'platform/graphics/chromium/TilingData.cpp',
'platform/graphics/chromium/TransformLayerChromium.cpp',
'platform/graphics/chromium/TransformLayerChromium.h',
'platform/graphics/chromium/TransparencyWin.cpp',
@@ -2743,6 +2785,12 @@
'platform/network/AuthenticationChallengeBase.cpp',
'platform/network/AuthenticationChallengeBase.h',
'platform/network/AuthenticationClient.h',
+ 'platform/network/BlobData.cpp',
+ 'platform/network/BlobData.h',
+ 'platform/network/BlobRegistry.h',
+ 'platform/network/BlobRegistryImpl.cpp',
+ 'platform/network/BlobRegistryImpl.h',
+ 'platform/network/BlobStorageData.h',
'platform/network/Credential.cpp',
'platform/network/Credential.h',
'platform/network/DNS.h',
@@ -2754,6 +2802,7 @@
'platform/network/HTTPHeaderMap.h',
'platform/network/HTTPParsers.cpp',
'platform/network/HTTPParsers.h',
+ 'platform/network/NetworkingContext.h',
'platform/network/NetworkStateNotifier.cpp',
'platform/network/NetworkStateNotifier.h',
'platform/network/ProtectionSpace.cpp',
@@ -2854,8 +2903,6 @@
'platform/text/transcoder/FontTranscoder.h',
'platform/text/win/TextBreakIteratorInternalICUWin.cpp',
'platform/text/wx/StringWx.cpp',
- 'platform/text/AtomicString.h',
- 'platform/text/AtomicStringHash.h',
'platform/text/AtomicStringImpl.h',
'platform/text/Base64.cpp',
'platform/text/Base64.h',
@@ -3013,6 +3060,7 @@
'platform/EventLoop.h',
'platform/FileChooser.cpp',
'platform/FileChooser.h',
+ 'platform/FileSystem.cpp',
'platform/FileSystem.h',
'platform/FloatConversion.h',
'platform/GeolocationService.cpp',
@@ -3440,6 +3488,8 @@
'rendering/SVGCharacterLayoutInfo.h',
'rendering/SVGInlineFlowBox.cpp',
'rendering/SVGInlineFlowBox.h',
+ 'rendering/SVGImageBufferTools.cpp',
+ 'rendering/SVGImageBufferTools.h',
'rendering/SVGInlineTextBox.cpp',
'rendering/SVGInlineTextBox.h',
'rendering/SVGMarkerData.h',
@@ -3497,11 +3547,21 @@
'storage/DatabaseTracker.cpp',
'storage/DatabaseTracker.h',
'storage/DatabaseTrackerClient.h',
+ 'storage/DirectoryEntry.cpp',
+ 'storage/DirectoryEntry.h',
+ 'storage/DirectoryReader.cpp',
+ 'storage/DirectoryReader.h',
'storage/DOMFileSystem.cpp',
'storage/DOMFileSystem.h',
+ 'storage/EntriesCallback.h',
'storage/Entry.cpp',
'storage/Entry.h',
+ 'storage/EntryArray.cpp',
+ 'storage/EntryArray.h',
'storage/EntryCallback.h',
+ 'storage/ErrorCallback.h',
+ 'storage/FileEntry.cpp',
+ 'storage/FileEntry.h',
'storage/FileSystemCallback.h',
'storage/Flags.h',
'storage/IDBAny.cpp',
@@ -3536,6 +3596,8 @@
'storage/IDBIndexBackendImpl.h',
'storage/IDBKey.cpp',
'storage/IDBKey.h',
+ 'storage/IDBKeyPath.cpp',
+ 'storage/IDBKeyPath.h',
'storage/IDBKeyRange.cpp',
'storage/IDBKeyRange.h',
'storage/IDBKeyTree.h',
@@ -3822,6 +3884,8 @@
'svg/SVGPaint.h',
'svg/SVGParserUtilities.cpp',
'svg/SVGParserUtilities.h',
+ 'svg/SVGPathBlender.cpp',
+ 'svg/SVGPathBlender.h',
'svg/SVGPathBuilder.cpp',
'svg/SVGPathBuilder.h',
'svg/SVGPathByteStream.h',
@@ -3869,6 +3933,8 @@
'svg/SVGPathStringBuilder.h',
'svg/SVGPathStringSource.cpp',
'svg/SVGPathStringSource.h',
+ 'svg/SVGPathTraversalStateBuilder.cpp',
+ 'svg/SVGPathTraversalStateBuilder.h',
'svg/SVGPatternElement.cpp',
'svg/SVGPatternElement.h',
'svg/SVGPointList.cpp',
@@ -4098,7 +4164,6 @@
'inspector/front-end/HAREntry.js',
'inspector/front-end/HelpScreen.js',
'inspector/front-end/ImageView.js',
- 'inspector/front-end/InspectorBackendStub.js',
'inspector/front-end/InspectorFrontendHostStub.js',
'inspector/front-end/InjectedFakeWorker.js',
'inspector/front-end/InjectedScript.js',
@@ -4107,7 +4172,6 @@
'inspector/front-end/KeyboardShortcut.js',
'inspector/front-end/MetricsSidebarPane.js',
'inspector/front-end/Object.js',
- 'inspector/front-end/ObjectProxy.js',
'inspector/front-end/ObjectPropertiesSection.js',
'inspector/front-end/Panel.js',
'inspector/front-end/PanelEnablerView.js',
@@ -4118,6 +4182,7 @@
'inspector/front-end/ProfileView.js',
'inspector/front-end/PropertiesSection.js',
'inspector/front-end/PropertiesSidebarPane.js',
+ 'inspector/front-end/RemoteObject.js',
'inspector/front-end/Resource.js',
'inspector/front-end/ResourceCategory.js',
'inspector/front-end/ResourcesPanel.js',
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index c815bbe..4124777 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -7340,8 +7340,8 @@ __ZN7WebCore27JSHTMLMediaElementPrototype18getOwnPropertySlotEPN3JSC9ExecStateER
__ZNK7WebCore18JSHTMLAudioElement9classInfoEv
__ZN7WebCore21jsHTMLMediaElementSrcEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
__ZN7WebCore39jsHTMLMediaElementPrototypeFunctionLoadEPN3JSC9ExecStateEPNS0_8JSObjectENS0_7JSValueERKNS0_7ArgListE
-__ZN7WebCore21processingUserGestureEPN3JSC9ExecStateE
-__ZNK7WebCore16ScriptController21processingUserGestureEPNS_15DOMWrapperWorldE
+__ZN7WebCore21processingUserGestureEv
+__ZN7WebCore16ScriptController21processingUserGestureEv
__ZN7WebCore16HTMLMediaElement4loadEbRi
__ZN7WebCore11MediaPlayerD0Ev
__ZN7WebCore18MediaPlayerPrivateD0Ev
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index b0effee..de9638f 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -29,7 +29,7 @@ XML_NAMES = $$PWD/xml/xmlattrs.in
XMLNS_NAMES = $$PWD/xml/xmlnsattrs.in
-ENTITIES_GPERF = $$PWD/html/HTMLEntityNames.gperf
+HTML_ENTITIES = $$PWD/html/HTMLEntityNames.json
COLORDATA_GPERF = $$PWD/platform/ColorData.gperf
@@ -291,6 +291,17 @@ IDL_BINDINGS += \
storage/Database.idl \
storage/DatabaseCallback.idl \
storage/DatabaseSync.idl \
+ storage/DirectoryEntry.idl \
+ storage/DirectoryReader.idl \
+ storage/DOMFileSystem.idl \
+ storage/EntriesCallback.idl \
+ storage/Entry.idl \
+ storage/EntryArray.idl \
+ storage/EntryCallback.idl \
+ storage/ErrorCallback.idl \
+ storage/FileEntry.idl \
+ storage/FileSystemCallback.idl \
+ storage/Flags.idl \
storage/IDBAny.idl \
storage/IDBCursor.idl \
storage/IDBDatabaseError.idl \
@@ -306,6 +317,8 @@ IDL_BINDINGS += \
storage/IDBRequest.idl \
storage/IDBSuccessEvent.idl \
storage/IDBTransaction.idl \
+ storage/Metadata.idl \
+ storage/MetadataCallback.idl \
storage/Storage.idl \
storage/StorageEvent.idl \
storage/SQLError.idl \
@@ -477,6 +490,7 @@ IDL_BINDINGS += \
INSPECTOR_INTERFACES = inspector/Inspector.idl
+INSPECTOR_BACKEND_STUB_QRC = inspector/front-end/InspectorBackendStub.qrc
mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
mathmlnames.input = MATHML_NAMES
@@ -551,6 +565,13 @@ inspectorIDL.depends = $$PWD/bindings/scripts/CodeGenerator.pm \
$$PWD/bindings/scripts/InFilesParser.pm
addExtraCompiler(inspectorIDL)
+inspectorBackendStub.wkAddOutputToSources = false
+inspectorBackendStub.output = generated/InspectorBackendStub.qrc
+inspectorBackendStub.input = INSPECTOR_BACKEND_STUB_QRC
+inspectorBackendStub.tempNames = $$PWD/$$INSPECTOR_BACKEND_STUB_QRC $${WC_GENERATED_SOURCES_DIR}/InspectorBackendStub.qrc
+inspectorBackendStub.commands = $$QMAKE_COPY $$replace(inspectorBackendStub.tempNames, "/", $$QMAKE_DIR_SEP)
+addExtraCompiler(inspectorBackendStub)
+
# GENERATOR 3: tokenizer (flex)
tokenizer.output = $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.cpp
tokenizer.input = TOKENIZER
@@ -590,12 +611,12 @@ xmlnames.commands = perl -I$$PWD/bindings/scripts $$xmlnames.wkScript --attrs $$
addExtraCompiler(xmlnames)
# GENERATOR 8-A:
-entities.output = $${WC_GENERATED_SOURCES_DIR}/HTMLEntityNames.cpp
-entities.input = ENTITIES_GPERF
-entities.wkScript = $$PWD/make-hash-tools.pl
-entities.commands = perl $$entities.wkScript $${WC_GENERATED_SOURCES_DIR} $$ENTITIES_GPERF
+entities.output = $${WC_GENERATED_SOURCES_DIR}/HTMLEntityTable.cpp
+entities.input = HTML_ENTITIES
+entities.wkScript = $$PWD/../WebKitTools/Scripts/create-html-entity-table
+entities.commands = python $$entities.wkScript -o $${WC_GENERATED_SOURCES_DIR}/HTMLEntityTable.cpp $$HTML_ENTITIES
entities.clean = ${QMAKE_FILE_OUT}
-entities.depends = $$PWD/make-hash-tools.pl
+entities.depends = $$PWD/../WebKitTools/Scripts/create-html-entity-table
addExtraCompiler(entities)
# GENERATOR 8-B:
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 652d443..2f5769c 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -136,17 +136,11 @@ symbian {
RESOURCES += \
$$PWD/../WebCore/WebCore.qrc
-!symbian:!maemo5 {
- RESOURCES += $$PWD/../WebCore/inspector/front-end/WebKit.qrc
-}
+include_webinspector: RESOURCES += $$PWD/../WebCore/inspector/front-end/WebKit.qrc $$WC_GENERATED_SOURCES_DIR/InspectorBackendStub.qrc
-maemo5|symbian|embedded {
- DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
-}
+enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
-maemo5|symbian {
- DEFINES += WTF_USE_QT_MOBILE_THEME=1
-}
+use_qt_mobile_theme: DEFINES += WTF_USE_QT_MOBILE_THEME=1
contains(DEFINES, WTF_USE_QT_MOBILE_THEME=1) {
DEFINES += ENABLE_NO_LISTBOX_RENDERING=1
@@ -625,6 +619,7 @@ SOURCES += \
html/AsyncImageResizer.cpp \
html/Blob.cpp \
html/BlobBuilder.cpp \
+ html/BlobURL.cpp \
html/canvas/CanvasGradient.cpp \
html/canvas/CanvasPattern.cpp \
html/canvas/CanvasPixelArray.cpp \
@@ -675,6 +670,7 @@ SOURCES += \
html/HTMLDocument.cpp \
html/HTMLElement.cpp \
html/HTMLElementStack.cpp \
+ html/HTMLEntitySearch.cpp \
html/HTMLEmbedElement.cpp \
html/HTMLFieldSetElement.cpp \
html/HTMLFontElement.cpp \
@@ -735,13 +731,13 @@ SOURCES += \
html/HTMLTableSectionElement.cpp \
html/HTMLTextAreaElement.cpp \
html/HTMLTitleElement.cpp \
- html/LegacyHTMLDocumentParser.cpp \
html/HTMLUListElement.cpp \
html/HTMLViewSourceDocument.cpp \
+ html/HTMLViewSourceParser.cpp \
html/ImageData.cpp \
html/ImageResizerThread.cpp \
html/LabelsNodeList.cpp \
- html/LegacyPreloadScanner.cpp \
+ html/ThreadableBlobRegistry.cpp \
html/StepRange.cpp \
html/ValidityState.cpp \
inspector/ConsoleMessage.cpp \
@@ -838,6 +834,7 @@ SOURCES += \
page/Geolocation.cpp \
page/GeolocationController.cpp \
page/GeolocationPositionCache.cpp \
+ page/GroupSettings.cpp \
page/History.cpp \
page/Location.cpp \
page/MemoryInfo.cpp \
@@ -878,6 +875,7 @@ SOURCES += \
platform/DragData.cpp \
platform/DragImage.cpp \
platform/FileChooser.cpp \
+ platform/FileSystem.cpp \
platform/GeolocationService.cpp \
platform/image-decoders/qt/RGBA32BufferQt.cpp \
platform/graphics/FontDescription.cpp \
@@ -896,6 +894,7 @@ SOURCES += \
platform/graphics/GeneratedImage.cpp \
platform/graphics/Gradient.cpp \
platform/graphics/GraphicsContext.cpp \
+ platform/graphics/GraphicsLayer.cpp \
platform/graphics/GraphicsTypes.cpp \
platform/graphics/Image.cpp \
platform/graphics/ImageBuffer.cpp \
@@ -929,6 +928,8 @@ SOURCES += \
platform/mock/GeolocationServiceMock.cpp \
platform/mock/SpeechInputClientMock.cpp \
platform/network/AuthenticationChallengeBase.cpp \
+ platform/network/BlobData.cpp \
+ platform/network/BlobRegistryImpl.cpp \
platform/network/Credential.cpp \
platform/network/FormData.cpp \
platform/network/FormDataBuilder.cpp \
@@ -1004,6 +1005,8 @@ SOURCES += \
rendering/RenderIndicator.cpp \
rendering/RenderInline.cpp \
rendering/RenderLayer.cpp \
+ rendering/RenderLayerBacking.cpp \
+ rendering/RenderLayerCompositor.cpp \
rendering/RenderLineBoxList.cpp \
rendering/RenderListBox.cpp \
rendering/RenderListItem.cpp \
@@ -1390,6 +1393,7 @@ HEADERS += \
html/AsyncImageResizer.h \
html/Blob.h \
html/BlobBuilder.h \
+ html/BlobURL.h \
html/canvas/CanvasGradient.h \
html/canvas/CanvasPattern.h \
html/canvas/CanvasPixelArray.h \
@@ -1495,14 +1499,13 @@ HEADERS += \
html/HTMLTableSectionElement.h \
html/HTMLTextAreaElement.h \
html/HTMLTitleElement.h \
- html/LegacyHTMLDocumentParser.h \
html/HTMLUListElement.h \
html/HTMLVideoElement.h \
html/HTMLViewSourceDocument.h \
+ html/HTMLViewSourceParser.h \
html/ImageData.h \
html/ImageResizerThread.h \
html/LabelsNodeList.h \
- html/LegacyPreloadScanner.h \
html/StepRange.h \
html/TimeRanges.h \
html/ValidityState.h \
@@ -1615,6 +1618,7 @@ HEADERS += \
page/Geolocation.h \
page/GeolocationPositionCache.h \
page/Geoposition.h \
+ page/GroupSettings.h \
page/HaltablePlugin.h \
page/History.h \
page/Location.h \
@@ -1649,6 +1653,7 @@ HEADERS += \
platform/DragData.h \
platform/DragImage.h \
platform/FileChooser.h \
+ platform/FileSystem.h \
platform/GeolocationService.h \
platform/image-decoders/ImageDecoder.h \
platform/mock/DeviceOrientationClientMock.h \
@@ -1676,6 +1681,8 @@ HEADERS += \
platform/graphics/GeneratedImage.h \
platform/graphics/Gradient.h \
platform/graphics/GraphicsContext.h \
+ platform/graphics/GraphicsLayer.h \
+ platform/graphics/GraphicsLayerClient.h \
platform/graphics/GraphicsTypes.h \
platform/graphics/Image.h \
platform/graphics/ImageSource.h \
@@ -1687,9 +1694,12 @@ HEADERS += \
platform/graphics/PathTraversalState.h \
platform/graphics/Pattern.h \
platform/graphics/Pen.h \
+ platform/graphics/qt/ContextShadow.h \
platform/graphics/qt/FontCustomPlatformData.h \
+ platform/graphics/qt/GraphicsLayerQt.h \
platform/graphics/qt/ImageDecoderQt.h \
platform/graphics/qt/StillImageQt.h \
+ platform/graphics/qt/TransparencyLayer.h \
platform/graphics/SegmentedFontData.h \
platform/graphics/SimpleFontData.h \
platform/graphics/Tile.h \
@@ -1713,11 +1723,16 @@ HEADERS += \
platform/MIMETypeRegistry.h \
platform/network/AuthenticationChallengeBase.h \
platform/network/AuthenticationClient.h \
+ platform/network/BlobData.h \
+ platform/network/BlobRegistry.h \
+ platform/network/BlobRegistryImpl.h \
+ platform/network/BlobStorageData.h \
platform/network/Credential.h \
platform/network/FormDataBuilder.h \
platform/network/FormData.h \
platform/network/HTTPHeaderMap.h \
platform/network/HTTPParsers.h \
+ platform/network/NetworkingContext.h \
platform/network/NetworkStateNotifier.h \
platform/network/ProtectionSpace.h \
platform/network/qt/QNetworkReplyHandler.h \
@@ -1744,7 +1759,6 @@ HEADERS += \
platform/sql/SQLiteStatement.h \
platform/sql/SQLiteTransaction.h \
platform/sql/SQLValue.h \
- platform/text/AtomicString.h \
platform/text/Base64.h \
platform/text/BidiContext.h \
platform/text/Hyphenation.h \
@@ -1752,7 +1766,6 @@ HEADERS += \
platform/text/RegularExpression.h \
platform/text/SegmentedString.h \
platform/text/StringBuilder.h \
- platform/text/StringImpl.h \
platform/text/TextCodec.h \
platform/text/TextCodecLatin1.h \
platform/text/TextCodecUserDefined.h \
@@ -1817,6 +1830,8 @@ HEADERS += \
rendering/RenderInline.h \
rendering/RenderInputSpeech.h \
rendering/RenderLayer.h \
+ rendering/RenderLayerBacking.h \
+ rendering/RenderLayerCompositor.h \
rendering/RenderLineBoxList.h \
rendering/RenderListBox.h \
rendering/RenderListItem.h \
@@ -1913,6 +1928,7 @@ HEADERS += \
rendering/style/SVGRenderStyle.h \
rendering/SVGCharacterData.h \
rendering/SVGCharacterLayoutInfo.h \
+ rendering/SVGImageBufferTools.h \
rendering/SVGInlineFlowBox.h \
rendering/SVGInlineTextBox.h \
rendering/SVGMarkerData.h \
@@ -2164,6 +2180,7 @@ HEADERS += \
$$PWD/../WebKit/qt/Api/qwebplugindatabase_p.h \
$$PWD/../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
$$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
+ $$PWD/../WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
$$PWD/../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
$$PWD/../WebKit/qt/WebCoreSupport/PageClientQt.h \
$$PWD/../WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
@@ -2183,12 +2200,14 @@ SOURCES += \
page/qt/FrameQt.cpp \
platform/graphics/qt/TransformationMatrixQt.cpp \
platform/graphics/qt/ColorQt.cpp \
+ platform/graphics/qt/ContextShadow.cpp \
platform/graphics/qt/FontQt.cpp \
platform/graphics/qt/FontPlatformDataQt.cpp \
platform/graphics/qt/FloatPointQt.cpp \
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 \
@@ -2253,6 +2272,7 @@ SOURCES += \
../WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
../WebKit/qt/WebCoreSupport/EditCommandQt.cpp \
../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
+ ../WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
../WebKit/qt/WebCoreSupport/PageClientQt.cpp \
@@ -2342,6 +2362,9 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
CONFIG += x11
LIBS += -lXrender
}
+ maemo5 {
+ DEFINES += MOZ_PLATFORM_MAEMO=5
+ }
SOURCES += \
plugins/qt/PluginContainerQt.cpp \
plugins/qt/PluginPackageQt.cpp \
@@ -2541,6 +2564,31 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) {
storage/StorageSyncManager.cpp
}
+contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
+ HEADERS += \
+ storage/DirectoryEntry.h \
+ storage/DirectoryReader.h \
+ storage/DOMFileSystem.h \
+ storage/EntriesCallback.h \
+ storage/Entry.h \
+ storage/EntryArray.h \
+ storage/EntryCallback.h \
+ storage/ErrorCallback.h \
+ storage/FileEntry.h \
+ storage/FileSystemCallback.h \
+ storage/Flags.h \
+ storage/Metadata.h \
+ storage/MetadataCallback.h
+
+ SOURCES += \
+ storage/DirectoryEntry.cpp \
+ storage/DirectoryReader.cpp \
+ storage/DOMFileSystem.cpp \
+ storage/Entry.cpp \
+ storage/EntryArray.cpp \
+ storage/FileEntry.cpp
+}
+
contains(DEFINES, ENABLE_ICONDATABASE=1) {
SOURCES += \
loader/icon/IconDatabase.cpp \
@@ -2857,6 +2905,7 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/SVGNumberList.cpp \
svg/SVGPaint.cpp \
svg/SVGParserUtilities.cpp \
+ svg/SVGPathBlender.cpp \
svg/SVGPathBuilder.cpp \
svg/SVGPathByteStreamBuilder.cpp \
svg/SVGPathByteStreamSource.cpp \
@@ -2879,6 +2928,7 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/SVGPathSegMoveto.cpp \
svg/SVGPathStringBuilder.cpp \
svg/SVGPathStringSource.cpp \
+ svg/SVGPathTraversalStateBuilder.cpp \
svg/SVGPatternElement.cpp \
svg/SVGPointList.cpp \
svg/SVGPolyElement.cpp \
@@ -2966,6 +3016,7 @@ contains(DEFINES, ENABLE_SVG=1) {
rendering/RenderSVGViewportContainer.cpp \
rendering/SVGCharacterData.cpp \
rendering/SVGCharacterLayoutInfo.cpp \
+ rendering/SVGImageBufferTools.cpp \
rendering/SVGInlineFlowBox.cpp \
rendering/SVGInlineTextBox.cpp \
rendering/SVGMarkerLayoutInfo.cpp \
@@ -3213,19 +3264,6 @@ win32:!win32-g++*:contains(QMAKE_HOST.arch, x86_64):{
plugins/win/PaintHooks.asm
}
}
-contains(DEFINES, WTF_USE_ACCELERATED_COMPOSITING) {
-HEADERS += \
- rendering/RenderLayerBacking.h \
- rendering/RenderLayerCompositor.h \
- platform/graphics/GraphicsLayer.h \
- platform/graphics/GraphicsLayerClient.h \
- platform/graphics/qt/GraphicsLayerQt.h
-SOURCES += \
- platform/graphics/GraphicsLayer.cpp \
- platform/graphics/qt/GraphicsLayerQt.cpp \
- rendering/RenderLayerBacking.cpp \
- rendering/RenderLayerCompositor.cpp
-}
symbian {
shared {
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index cee21ac..d2f6d3d 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -67,7 +67,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\transcoder\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CommandLine="cmd /C copyForwardingHeaders.cmd cg cf&#x0D;&#x0A;cmd /C copyInspectorFiles.cmd&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -123,7 +123,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\transcoder\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CommandLine="cmd /C copyForwardingHeaders.cmd cg cf&#x0D;&#x0A;cmd /C copyInspectorFiles.cmd&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -178,7 +178,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\transcoder\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CommandLine="cmd /C copyForwardingHeaders.cmd cg cf&#x0D;&#x0A;cmd /C copyInspectorFiles.cmd&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -233,7 +233,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cairo\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\transcoder\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\curl\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CommandLine="cmd /C copyForwardingHeaders.cmd cairo curl&#x0D;&#x0A;cmd /C copyInspectorFiles.cmd&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -289,7 +289,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cairo\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\transcoder\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\curl\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CommandLine="cmd /C copyForwardingHeaders.cmd cairo curl&#x0D;&#x0A;cmd /C copyInspectorFiles.cmd&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
@@ -344,7 +344,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\config.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\obj\WebCore\DerivedSources\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\accessibility\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\inspector\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\appcache\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\archive\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\loader\icon\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\history\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\html\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\notifications\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\css\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\cg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\transforms\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\graphics\opentype\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\text\transcoder\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\cf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\network\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\sql\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\platform\cairo\cairo\src\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bindings\js\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\page\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\bridge\jsc\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\plugins\win\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\rendering\style\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\editing\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\dom\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\xml\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\animation\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\svg\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\storage\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\websockets\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\workers\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\bindings\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\bindings&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\parser\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\parser&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\runtime\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\runtime&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\masm\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\masm&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\pcre\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\pcre&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\profiler\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\profiler&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wrec\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wrec&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\text\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\text&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\unicode\icu\*.h&quot; &quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders\wtf\unicode\icu&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\inspector\front-end\*&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\inspector&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d /s /exclude:xcopy.excludes &quot;$(ProjectDir)\..\English.lproj\localizedStrings.js&quot; &quot;$(WebKitOutputDir)\bin\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CommandLine="cmd /C copyForwardingHeaders.cmd cg cf&#x0D;&#x0A;cmd /C copyInspectorFiles.cmd&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
@@ -3017,6 +3017,118 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDirectoryEntry.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\JSDirectoryEntry.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDirectoryReader.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\JSDirectoryReader.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDocument.cpp"
>
<FileConfiguration
@@ -3297,6 +3409,62 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMFileSystem.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\JSDOMFileSystem.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSDOMFormData.cpp"
>
<FileConfiguration
@@ -4085,6 +4253,286 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSEntriesCallback.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\JSEntriesCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSEntry.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\JSEntry.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSEntryArray.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\JSEntryArray.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSEntryCallback.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\JSEntryCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSErrorCallback.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\JSErrorCallback.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSErrorEvent.cpp"
>
<FileConfiguration
@@ -4533,6 +4981,118 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileSystemCallback.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\JSFileSystemCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFlags.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\JSFlags.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGeolocation.cpp"
>
<FileConfiguration
@@ -9405,6 +9965,118 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMetadata.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\JSMetadata.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMetadataCallback.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\JSMetadataCallback.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMouseEvent.cpp"
>
<FileConfiguration
@@ -22337,6 +23009,14 @@
>
</File>
<File
+ RelativePath="..\page\GroupSettings.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\page\GroupSettings.h"
+ >
+ </File>
+ <File
RelativePath="..\page\HaltablePlugin.h"
>
</File>
@@ -22853,6 +23533,10 @@
>
</File>
<File
+ RelativePath="..\loader\FrameNetworkingContext.h"
+ >
+ </File>
+ <File
RelativePath="..\loader\FTPDirectoryDocument.cpp"
>
</File>
@@ -23349,6 +24033,10 @@
>
</File>
<File
+ RelativePath="..\platform\FileSystem.cpp"
+ >
+ </File>
+ <File
RelativePath="..\platform\FileSystem.h"
>
</File>
@@ -26112,6 +26800,30 @@
>
</File>
<File
+ RelativePath="..\platform\network\BlobData.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\BlobData.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\BlobRegistry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\BlobRegistryImpl.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\BlobRegistryImpl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\network\BlobStorageData.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\network\Credential.cpp"
>
</File>
@@ -26168,6 +26880,10 @@
>
</File>
<File
+ RelativePath="..\platform\network\NetworkingContext.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\network\ProtectionSpace.cpp"
>
</File>
@@ -27172,14 +27888,6 @@
Name="text"
>
<File
- RelativePath="..\platform\text\AtomicString.h"
- >
- </File>
- <File
- RelativePath="..\platform\text\AtomicStringHash.h"
- >
- </File>
- <File
RelativePath="..\platform\text\AtomicStringImpl.h"
>
</File>
@@ -36273,6 +36981,14 @@
>
</File>
<File
+ RelativePath="..\html\BlobURL.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BlobURL.h"
+ >
+ </File>
+ <File
RelativePath="..\html\canvas\CanvasGradient.cpp"
>
</File>
@@ -37633,6 +38349,14 @@
>
</File>
<File
+ RelativePath="..\html\HTMLEntitySearch.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\HTMLEntitySearch.h"
+ >
+ </File>
+ <File
RelativePath="..\html\HTMLEmbedElement.cpp"
>
<FileConfiguration
@@ -40893,35 +41617,35 @@
>
</File>
<File
- RelativePath="..\html\ImageData.cpp"
+ RelativePath="..\html\HTMLViewSourceParser.cpp"
>
</File>
<File
- RelativePath="..\html\ImageData.h"
+ RelativePath="..\html\HTMLViewSourceParser.h"
>
</File>
<File
- RelativePath="..\html\ImageResizerThread.cpp"
+ RelativePath="..\html\ImageData.cpp"
>
</File>
<File
- RelativePath="..\html\ImageResizerThread.h"
+ RelativePath="..\html\ImageData.h"
>
</File>
<File
- RelativePath="..\html\LabelsNodeList.cpp"
+ RelativePath="..\html\ImageResizerThread.cpp"
>
</File>
<File
- RelativePath="..\html\LabelsNodeList.h"
+ RelativePath="..\html\ImageResizerThread.h"
>
</File>
<File
- RelativePath="..\html\LegacyHTMLDocumentParser.cpp"
+ RelativePath="..\html\LabelsNodeList.cpp"
>
</File>
<File
- RelativePath="..\html\LegacyHTMLDocumentParser.h"
+ RelativePath="..\html\LabelsNodeList.h"
>
</File>
<File
@@ -40933,23 +41657,23 @@
>
</File>
<File
- RelativePath="..\html\LegacyPreloadScanner.cpp"
+ RelativePath="..\html\MediaError.h"
>
</File>
<File
- RelativePath="..\html\LegacyPreloadScanner.h"
+ RelativePath="..\html\StepRange.cpp"
>
</File>
<File
- RelativePath="..\html\MediaError.h"
+ RelativePath="..\html\StepRange.h"
>
</File>
<File
- RelativePath="..\html\StepRange.cpp"
+ RelativePath="..\html\ThreadableBlobRegistry.cpp"
>
</File>
<File
- RelativePath="..\html\StepRange.h"
+ RelativePath="..\html\ThreadableBlobRegistry.h"
>
</File>
<File
@@ -49353,6 +50077,10 @@
>
</File>
<File
+ RelativePath="..\svg\SVGPathBlender.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGPathBuilder.h"
>
</File>
@@ -49453,6 +50181,10 @@
>
</File>
<File
+ RelativePath="..\svg\SVGPathTraversalStateBuilder.h"
+ >
+ </File>
+ <File
RelativePath="..\svg\SVGPatternElement.h"
>
</File>
@@ -50353,6 +51085,74 @@
>
</File>
<File
+ RelativePath="..\storage\DirectoryEntry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\DirectoryEntry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\DirectoryReader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\DirectoryReader.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\DOMFileSystem.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\DOMFileSystem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\EntriesCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\Entry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\Entry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\EntryArray.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\EntryArray.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\EntryCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\ErrorCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\FileEntry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\FileEntry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\FileSystemCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\Flags.h"
+ >
+ </File>
+ <File
RelativePath="..\storage\IDBAny.cpp"
>
</File>
@@ -50541,6 +51341,14 @@
>
</File>
<File
+ RelativePath="..\storage\Metadata.h"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\MetadataCallback.h"
+ >
+ </File>
+ <File
RelativePath="..\storage\LocalStorageThread.cpp"
>
</File>
@@ -51264,10 +52072,6 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\ObjectProxy.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\Panel.js"
>
</File>
@@ -51308,6 +52112,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\RemoteObject.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\Resource.js"
>
</File>
diff --git a/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
new file mode 100755
index 0000000..7ad3217
--- /dev/null
+++ b/WebCore/WebCore.vcproj/copyForwardingHeaders.cmd
@@ -0,0 +1,80 @@
+rem %1 argument is used for graphics. It can be cg or cairo
+rem %2 argument is used for network. It can be cf or curl
+
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\bindings"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\parser"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\runtime"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\masm"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\pcre"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\profiler"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wrec"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf\text"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf\unicode"
+mkdir 2>NUL "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf\unicode\icu"
+
+xcopy /y /d "%ProjectDir%..\config.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%WebKitOutputDir%\obj\WebCore\DerivedSources\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\accessibility\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\accessibility\win\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\inspector\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\loader\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\loader\appcache\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\loader\archive\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\loader\archive\cf\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\loader\icon\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\history\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\history\cf\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\html\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\notifications\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\css\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\animation\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\cf\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\graphics\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\graphics\%1\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\graphics\transforms\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\graphics\win\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\graphics\opentype\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\text\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\text\transcoder\*.h" "%WebKitOutputDir%\include\WebCore"
+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"
+xcopy /y /d "%ProjectDir%..\bindings\js\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\page\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\page\animation\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\page\win\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\bridge\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\bridge\jsc\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\plugins\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\plugins\win\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\rendering\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\rendering\style\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\editing\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\dom\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\xml\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\svg\animation\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\svg\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\storage\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\websockets\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\workers\*.h" "%WebKitOutputDir%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\bindings\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\bindings"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\parser\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\parser"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\runtime\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\runtime"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\masm\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\masm"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\pcre\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\pcre"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\profiler\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\profiler"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\wrec\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wrec"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\wtf\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\wtf\text\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf\text"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\wtf\unicode\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf\unicode"
+xcopy /y /d "%ProjectDir%..\ForwardingHeaders\wtf\unicode\icu\*.h" "%WebKitOutputDir%\include\WebCore\ForwardingHeaders\wtf\unicode\icu"
+
+if exist "%WebKitOutputDir%\buildfailed" del "%WebKitOutputDir%\buildfailed"
diff --git a/WebCore/WebCore.vcproj/copyInspectorFiles.cmd b/WebCore/WebCore.vcproj/copyInspectorFiles.cmd
new file mode 100755
index 0000000..316fddc
--- /dev/null
+++ b/WebCore/WebCore.vcproj/copyInspectorFiles.cmd
@@ -0,0 +1,5 @@
+mkdir 2>NUL "%WebKitOutputDir%\bin\WebKit.resources\inspector"
+xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\inspector\front-end\*" "%WebKitOutputDir%\bin\WebKit.resources\inspector"
+xcopy /y /d /s /exclude:xcopy.excludes "%WebKitOutputDir%\obj\WebCore\DerivedSources\InspectorBackendStub.js" "%WebKitOutputDir%\bin\WebKit.resources\inspector"
+mkdir 2>NUL "%WebKitOutputDir%\bin\WebKit.resources\en.lproj"
+xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\English.lproj\localizedStrings.js" "%WebKitOutputDir%\bin\WebKit.resources\en.lproj"
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 9e54ab5..2953b96 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -179,6 +179,8 @@
08C34AF81179C057002D7456 /* RenderSVGResourceLinearGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C34AF41179C057002D7456 /* RenderSVGResourceLinearGradient.h */; };
08C34AFD1179C072002D7456 /* RenderSVGResourceRadialGradient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C34AFB1179C072002D7456 /* RenderSVGResourceRadialGradient.cpp */; };
08C34AFE1179C072002D7456 /* RenderSVGResourceRadialGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C34AFC1179C072002D7456 /* RenderSVGResourceRadialGradient.h */; };
+ 08C46B691212F15E0011AF40 /* SVGImageBufferTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C46B671212F15D0011AF40 /* SVGImageBufferTools.cpp */; };
+ 08C46B6A1212F15E0011AF40 /* SVGImageBufferTools.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C46B681212F15D0011AF40 /* SVGImageBufferTools.h */; };
08C4C5180EF19A4000E4840F /* WMLImageElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C4C5140EF19A4000E4840F /* WMLImageElement.cpp */; };
08C4C5190EF19A4000E4840F /* WMLImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C4C5150EF19A4000E4840F /* WMLImageElement.h */; };
08C4C51A0EF19A4000E4840F /* WMLImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C4C5160EF19A4000E4840F /* WMLImageLoader.cpp */; };
@@ -237,7 +239,6 @@
0F69B9CA120FE1D6000E1FC7 /* RenderMathMLFenced.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F69B9C8120FE1D6000E1FC7 /* RenderMathMLFenced.h */; };
0F6ECD450F252F3700BDE271 /* CSSPropertyLonghand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6ECD430F252F3700BDE271 /* CSSPropertyLonghand.h */; };
0F6ECD460F252F3700BDE271 /* CSSPropertyLonghand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6ECD440F252F3700BDE271 /* CSSPropertyLonghand.cpp */; };
- 0FC705210EB1815600B90AD8 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC705200EB1815600B90AD8 /* AtomicStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF33230F2B9715004B6795 /* ColorCG.cpp */; };
0FCF332C0F2B9A25004B6795 /* WebTiledLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF33280F2B9A25004B6795 /* WebTiledLayer.mm */; };
0FCF332D0F2B9A25004B6795 /* WebTiledLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCF33290F2B9A25004B6795 /* WebTiledLayer.h */; };
@@ -709,6 +710,16 @@
2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ECF7ADF10162B5800427DE7 /* ErrorEvent.h */; };
2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ED609BA1145B07100C8684E /* DOMFormData.cpp */; };
2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED609BB1145B07100C8684E /* DOMFormData.h */; };
+ 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDEF1ED121B0EFC00726DB2 /* BlobData.cpp */; };
+ 2EDEF1F4121B0EFC00726DB2 /* BlobData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1EE121B0EFC00726DB2 /* BlobData.h */; };
+ 2EDEF1F5121B0EFC00726DB2 /* BlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1EF121B0EFC00726DB2 /* BlobRegistry.h */; };
+ 2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */; };
+ 2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */; };
+ 2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */; };
+ 2EED575512109ED0007656BB /* BlobURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EED575012109ED0007656BB /* BlobURL.cpp */; };
+ 2EED575612109ED0007656BB /* BlobURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EED575112109ED0007656BB /* BlobURL.h */; };
+ 2EED57FD1214A9C2007656BB /* ThreadableBlobRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EED57FB1214A9C2007656BB /* ThreadableBlobRegistry.cpp */; };
+ 2EED57FE1214A9C2007656BB /* ThreadableBlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EED57FC1214A9C2007656BB /* ThreadableBlobRegistry.h */; };
31288E720E3005D6003619AE /* WebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */; };
31288E730E3005D6003619AE /* WebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */; };
31288E740E3005D6003619AE /* WebKitCSSKeyframesRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */; };
@@ -890,6 +901,8 @@
46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DA0B0D60170028EE36 /* aliasCursor.png */; };
46F9D5DE0B0D60170028EE36 /* noDropCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DB0B0D60170028EE36 /* noDropCursor.png */; };
46F9D5DF0B0D60170028EE36 /* progressCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DC0B0D60170028EE36 /* progressCursor.png */; };
+ 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */; };
+ 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */; };
492273A31083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 492273A21083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp */; };
49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49484FB3102CF23C00187DD3 /* CanvasGradient.cpp */; };
49484FC2102CF23C00187DD3 /* CanvasGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 49484FB4102CF23C00187DD3 /* CanvasGradient.h */; };
@@ -1256,6 +1269,8 @@
5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; };
626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; };
626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 626CDE0D1140424C001E5A68 /* SpatialNavigation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 628D214B12131ED10055DCFC /* NetworkingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 628D214E12131EF40055DCFC /* FrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 628D214D12131EF40055DCFC /* FrameNetworkingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
62C1217C11AB9E77003C462C /* SuspendableTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */; };
62C1217D11AB9E77003C462C /* SuspendableTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 62C1217B11AB9E77003C462C /* SuspendableTimer.h */; };
62CD32591157E57C0063B0A7 /* CustomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62CD32561157E57C0063B0A7 /* CustomEvent.cpp */; };
@@ -1488,6 +1503,10 @@
84B6B978120F13E500B8EFAF /* SVGPathSegListSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */; };
84BDA16B11358D2A00DBF64C /* RenderSVGResourceClipper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */; };
84BDA16C11358D2A00DBF64C /* RenderSVGResourceClipper.h in Headers */ = {isa = PBXBuildFile; fileRef = 84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */; };
+ 84C5B2FA1216DC810088B53A /* SVGPathTraversalStateBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C5B2F81216DC810088B53A /* SVGPathTraversalStateBuilder.cpp */; };
+ 84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C5B2F91216DC810088B53A /* SVGPathTraversalStateBuilder.h */; };
+ 84C6784C1214814700A92902 /* SVGPathBlender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84C6784A1214814700A92902 /* SVGPathBlender.cpp */; };
+ 84C6784D1214814700A92902 /* SVGPathBlender.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C6784B1214814700A92902 /* SVGPathBlender.h */; };
84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D0C4031115F1D40018AA34 /* AffineTransform.cpp */; };
84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D0C4051115F1EA0018AA34 /* AffineTransform.h */; settings = {ATTRIBUTES = (Private, ); }; };
85004D940ACEEAEF00C438F6 /* DOMSVGDefsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */; };
@@ -2365,6 +2384,45 @@
895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DE116C4F0600CABF00 /* FileThreadTask.h */; };
8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8988E10C11A3508B00DB732E /* BlobItem.cpp */; };
8988E10F11A3508B00DB732E /* BlobItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8988E10D11A3508B00DB732E /* BlobItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 899ABC261215E4A300F9F219 /* DirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */; };
+ 899ABC271215E4A300F9F219 /* DirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC211215E4A300F9F219 /* DirectoryEntry.h */; };
+ 899ABC291215E4A300F9F219 /* DirectoryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC231215E4A300F9F219 /* DirectoryReader.cpp */; };
+ 899ABC2A1215E4A300F9F219 /* DirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC241215E4A300F9F219 /* DirectoryReader.h */; };
+ 899ABC341215E4BE00F9F219 /* EntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC2C1215E4BE00F9F219 /* EntriesCallback.h */; };
+ 899ABC361215E4BE00F9F219 /* EntryArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC2E1215E4BE00F9F219 /* EntryArray.cpp */; };
+ 899ABC371215E4BE00F9F219 /* EntryArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC2F1215E4BE00F9F219 /* EntryArray.h */; };
+ 899ABC391215E4BE00F9F219 /* FileEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC311215E4BE00F9F219 /* FileEntry.cpp */; };
+ 899ABC3A1215E4BE00F9F219 /* FileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC321215E4BE00F9F219 /* FileEntry.h */; };
+ 899ABC5D1215EB2A00F9F219 /* JSDirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC551215EB2A00F9F219 /* JSDirectoryEntry.cpp */; };
+ 899ABC5E1215EB2A00F9F219 /* JSDirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC561215EB2A00F9F219 /* JSDirectoryEntry.h */; };
+ 899ABC5F1215EB2A00F9F219 /* JSEntriesCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC571215EB2A00F9F219 /* JSEntriesCallback.cpp */; };
+ 899ABC601215EB2A00F9F219 /* JSEntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC581215EB2A00F9F219 /* JSEntriesCallback.h */; };
+ 899ABC611215EB2A00F9F219 /* JSEntryArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC591215EB2A00F9F219 /* JSEntryArray.cpp */; };
+ 899ABC621215EB2A00F9F219 /* JSEntryArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC5A1215EB2A00F9F219 /* JSEntryArray.h */; };
+ 899ABC631215EB2A00F9F219 /* JSFileEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC5B1215EB2A00F9F219 /* JSFileEntry.cpp */; };
+ 899ABC641215EB2A00F9F219 /* JSFileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC5C1215EB2A00F9F219 /* JSFileEntry.h */; };
+ 899ABC6D1215ECEF00F9F219 /* JSDirectoryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC6B1215ECEF00F9F219 /* JSDirectoryReader.cpp */; };
+ 899ABC6E1215ECEF00F9F219 /* JSDirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC6C1215ECEF00F9F219 /* JSDirectoryReader.h */; };
+ 899ABC791215F03100F9F219 /* JSDOMFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D8D1200035F0082740C /* JSDOMFileSystem.cpp */; };
+ 899ABC7A1215F03100F9F219 /* JSDOMFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D8E1200035F0082740C /* JSDOMFileSystem.h */; };
+ 899ABC7B1215F03300F9F219 /* JSEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D4911FF6C900082740C /* JSEntry.cpp */; };
+ 899ABC7C1215F03300F9F219 /* JSEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D4A11FF6C900082740C /* JSEntry.h */; };
+ 899ABC7D1215F03600F9F219 /* JSEntryCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D4B11FF6C900082740C /* JSEntryCallback.cpp */; };
+ 899ABC7E1215F03700F9F219 /* JSEntryCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D4C11FF6C900082740C /* JSEntryCallback.h */; };
+ 899ABC7F1215F03800F9F219 /* JSErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D4D11FF6C900082740C /* JSErrorCallback.cpp */; };
+ 899ABC801215F03800F9F219 /* JSErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D4E11FF6C900082740C /* JSErrorCallback.h */; };
+ 899ABC811215F03B00F9F219 /* JSFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D92120003760082740C /* JSFlags.h */; };
+ 899ABC821215F03B00F9F219 /* JSFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D91120003760082740C /* JSFlags.cpp */; };
+ 899ABC831215F03C00F9F219 /* JSFileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D5611FF6CA40082740C /* JSFileSystemCallback.h */; };
+ 899ABC841215F03D00F9F219 /* JSFileSystemCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D5511FF6CA40082740C /* JSFileSystemCallback.cpp */; };
+ 899ABC861215F0D800F9F219 /* DOMFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D1911FF58A50082740C /* DOMFileSystem.cpp */; };
+ 899ABC871215F0DF00F9F219 /* DOMFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D1A11FF58A50082740C /* DOMFileSystem.h */; };
+ 899ABC961215F9DA00F9F219 /* ErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D2011FF58A50082740C /* ErrorCallback.h */; };
+ 899ABC971215F9DF00F9F219 /* EntryCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D1E11FF58A50082740C /* EntryCallback.h */; };
+ 899ABCAA1215FA5500F9F219 /* FileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D2111FF58A50082740C /* FileSystemCallback.h */; };
+ 899ABCAB1215FA5A00F9F219 /* Flags.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D60120001220082740C /* Flags.h */; };
+ 899ABCB91215FAB500F9F219 /* Entry.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D1D11FF58A50082740C /* Entry.h */; };
+ 899ABCBA1215FAB800F9F219 /* Entry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D1C11FF58A50082740C /* Entry.cpp */; };
89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */; };
89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */ = {isa = PBXBuildFile; fileRef = 89B5EAA011E8003D00F2367E /* LineEnding.h */; settings = {ATTRIBUTES = (Private, ); }; };
89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */; };
@@ -2592,7 +2650,6 @@
93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23C02DE4396018635CA /* HTMLDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F198E608245E59001E9ABC /* HTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23F02DE4396018635CA /* HTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F198EF08245E59001E9ABC /* LegacyHTMLTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* LegacyHTMLTreeBuilder.h */; };
- 93F198F008245E59001E9ABC /* LegacyHTMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* LegacyHTMLDocumentParser.h */; };
93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* TextResourceDecoder.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1992108245E59001E9ABC /* XMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* XMLDocumentParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2622,7 +2679,6 @@
93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23B02DE4396018635CA /* HTMLDocument.cpp */; };
93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23E02DE4396018635CA /* HTMLElement.cpp */; };
93F19A9B08245E59001E9ABC /* LegacyHTMLTreeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25002DE4396018635CA /* LegacyHTMLTreeBuilder.cpp */; };
- 93F19A9C08245E59001E9ABC /* LegacyHTMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25202DE4396018635CA /* LegacyHTMLDocumentParser.cpp */; };
93F19A9D08245E59001E9ABC /* TextResourceDecoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */; };
93F19AB908245E59001E9ABC /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30302DE4476018635CA /* Range.cpp */; };
93F19ABC08245E59001E9ABC /* XMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* XMLDocumentParser.cpp */; };
@@ -2667,6 +2723,8 @@
976E2BA811CAE4DE006C56A0 /* CSSPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */; };
976E896011C0CA3A00EA9CA9 /* HTMLEntityParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */; };
976E896111C0CA3A00EA9CA9 /* HTMLEntityParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */; };
+ 978B6FC912128821001595EF /* HTMLViewSourceParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978B6FC712128821001595EF /* HTMLViewSourceParser.cpp */; };
+ 978B6FCA12128821001595EF /* HTMLViewSourceParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 978B6FC812128821001595EF /* HTMLViewSourceParser.h */; };
979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 979F43D11075E44A0000F83B /* RedirectScheduler.cpp */; };
979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44A0000F83B /* RedirectScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; };
@@ -3170,6 +3228,9 @@
A8A564A611DC0E59003AC2F0 /* HTMLFormattingElementList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A564A411DC0E59003AC2F0 /* HTMLFormattingElementList.cpp */; };
A8A909AC0CBCD6B50029B807 /* RenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A909AA0CBCD6B50029B807 /* RenderSVGTransformableContainer.h */; };
A8A909AD0CBCD6B50029B807 /* RenderSVGTransformableContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A909AB0CBCD6B50029B807 /* RenderSVGTransformableContainer.cpp */; };
+ A8BC044E1214EB2A00B5F122 /* HTMLEntitySearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 970C4FDF1211266200C3D393 /* HTMLEntitySearch.cpp */; };
+ A8BC044F1214EB2B00B5F122 /* HTMLEntitySearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 970C4FE01211266200C3D393 /* HTMLEntitySearch.h */; };
+ A8BC04921214F69600B5F122 /* HTMLEntityTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */; };
A8BCFD05120A046100B5F122 /* SVGPathSeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8BCFD04120A046100B5F122 /* SVGPathSeg.cpp */; };
A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C2280D11D4A59700D5A7D3 /* DocumentParser.cpp */; };
A8C228A111D5722E00D5A7D3 /* DecodedDataDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A8C2289F11D5722E00D5A7D3 /* DecodedDataDocumentParser.h */; };
@@ -4022,7 +4083,7 @@
B2A015A90AF6CD53006BCE0E /* GraphicsContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015930AF6CD53006BCE0E /* GraphicsContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2A015AA0AF6CD53006BCE0E /* GraphicsTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A015940AF6CD53006BCE0E /* GraphicsTypes.cpp */; };
B2A015AB0AF6CD53006BCE0E /* GraphicsTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A015950AF6CD53006BCE0E /* GraphicsTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
- B2A10B920B3818BD00099AA4 /* ImageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A10B910B3818BD00099AA4 /* ImageBuffer.h */; };
+ B2A10B920B3818BD00099AA4 /* ImageBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A10B910B3818BD00099AA4 /* ImageBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A10B930B3818D700099AA4 /* ImageBufferCG.cpp */; };
B2A1F2AA0CEF0ABF00442F6A /* SVGFontElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A1F2A10CEF0ABF00442F6A /* SVGFontElement.cpp */; };
B2A1F2AB0CEF0ABF00442F6A /* SVGFontElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A1F2A20CEF0ABF00442F6A /* SVGFontElement.h */; };
@@ -4053,8 +4114,6 @@
B2B2645D0D00A77E000ACC1D /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B2645B0D00A77E000ACC1D /* StringImplCF.cpp */; };
B2B33A5F0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B33A5D0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp */; };
B2B33A600B887CEF00C15984 /* SVGCharacterLayoutInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2B33A5E0B887CEF00C15984 /* SVGCharacterLayoutInfo.h */; };
- B2C3DA1F0D006C1D00EF6F26 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9EE0D006C1D00EF6F26 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
- B2C3DA200D006C1D00EF6F26 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9EF0D006C1D00EF6F26 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2C3DA210D006C1D00EF6F26 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9F00D006C1D00EF6F26 /* Base64.cpp */; };
B2C3DA220D006C1D00EF6F26 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9F10D006C1D00EF6F26 /* Base64.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2C3DA230D006C1D00EF6F26 /* BidiContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */; };
@@ -4068,8 +4127,6 @@
B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */; };
B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA000D006C1D00EF6F26 /* String.cpp */; };
- B2C3DA310D006C1D00EF6F26 /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA010D006C1D00EF6F26 /* StringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
- B2C3DA330D006C1D00EF6F26 /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA030D006C1D00EF6F26 /* StringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
B2C3DA370D006C1D00EF6F26 /* TextBreakIteratorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA070D006C1D00EF6F26 /* TextBreakIteratorICU.cpp */; };
@@ -4758,6 +4815,7 @@
BCA8C83111E3D53200812FB7 /* BackForwardControllerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8C83011E3D53200812FB7 /* BackForwardControllerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCA8CA5F11E4E6D100812FB7 /* BackForwardListImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */; };
BCA8CA6011E4E6D100812FB7 /* BackForwardListImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BCA979171215D055005C485C /* ImageBufferData.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA979161215D055005C485C /* ImageBufferData.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; };
BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4951,6 +5009,8 @@
C0DFC8700DB6841A003EAE7C /* JSConsoleCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */; };
C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
+ C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50B561412119D23008B46E0 /* GroupSettings.cpp */; };
+ C50B561712119D23008B46E0 /* GroupSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = C50B561512119D23008B46E0 /* GroupSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */; };
C50D0E830FF4272900AC2644 /* StorageNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = C50D0E810FF4272900AC2644 /* StorageNamespace.h */; };
C5102D940FD9AA2D00FAFF04 /* StorageSyncManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C5102D920FD9AA2D00FAFF04 /* StorageSyncManager.h */; };
@@ -4972,6 +5032,7 @@
C572EE0F1201C736007D8F82 /* IDBIndexBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = C572EE091201C736007D8F82 /* IDBIndexBackendInterface.h */; };
C572EE1E1201C9BC007D8F82 /* JSIDBIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C572EE1C1201C9BC007D8F82 /* JSIDBIndex.cpp */; };
C572EE1F1201C9BC007D8F82 /* JSIDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */; };
+ C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */; };
C585A65E11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C585A65C11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp */; };
C585A65F11D4FAB2004C3E4B /* JSIDBKeyCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C585A65D11D4FAB2004C3E4B /* JSIDBKeyCustom.cpp */; };
C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */; };
@@ -5204,8 +5265,6 @@
E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E4778B7E115A581A00B5D372 /* JSCustomEvent.h */; };
E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = E47B4BE60E71241600038854 /* CachedResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */; };
- E49626C20D80D94800E3405C /* LegacyPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D4ABE00D7542F000F96869 /* LegacyPreloadScanner.cpp */; };
- E49626C30D80D94900E3405C /* LegacyPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D4ABE10D7542F100F96869 /* LegacyPreloadScanner.h */; };
E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */; };
E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0050DAF335400F5F55C /* SMILTime.cpp */; };
E4AFD00C0DAF335400F5F55C /* SMILTime.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD0060DAF335400F5F55C /* SMILTime.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5883,6 +5942,8 @@
08C34AF41179C057002D7456 /* RenderSVGResourceLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceLinearGradient.h; sourceTree = "<group>"; };
08C34AFB1179C072002D7456 /* RenderSVGResourceRadialGradient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceRadialGradient.cpp; sourceTree = "<group>"; };
08C34AFC1179C072002D7456 /* RenderSVGResourceRadialGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceRadialGradient.h; sourceTree = "<group>"; };
+ 08C46B671212F15D0011AF40 /* SVGImageBufferTools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImageBufferTools.cpp; sourceTree = "<group>"; };
+ 08C46B681212F15D0011AF40 /* SVGImageBufferTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageBufferTools.h; sourceTree = "<group>"; };
08C4C5140EF19A4000E4840F /* WMLImageElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLImageElement.cpp; sourceTree = "<group>"; };
08C4C5150EF19A4000E4840F /* WMLImageElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLImageElement.h; sourceTree = "<group>"; };
08C4C5160EF19A4000E4840F /* WMLImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLImageLoader.cpp; sourceTree = "<group>"; };
@@ -5943,7 +6004,6 @@
0F69B9C8120FE1D6000E1FC7 /* RenderMathMLFenced.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLFenced.h; sourceTree = "<group>"; };
0F6ECD430F252F3700BDE271 /* CSSPropertyLonghand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertyLonghand.h; sourceTree = "<group>"; };
0F6ECD440F252F3700BDE271 /* CSSPropertyLonghand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyLonghand.cpp; sourceTree = "<group>"; };
- 0FC705200EB1815600B90AD8 /* AtomicStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringHash.h; sourceTree = "<group>"; };
0FCF33230F2B9715004B6795 /* ColorCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorCG.cpp; sourceTree = "<group>"; };
0FCF33280F2B9A25004B6795 /* WebTiledLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTiledLayer.mm; sourceTree = "<group>"; };
0FCF33290F2B9A25004B6795 /* WebTiledLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTiledLayer.h; sourceTree = "<group>"; };
@@ -6463,6 +6523,16 @@
2ECF7AE010162B5800427DE7 /* ErrorEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ErrorEvent.idl; sourceTree = "<group>"; };
2ED609BA1145B07100C8684E /* DOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMFormData.cpp; sourceTree = "<group>"; };
2ED609BB1145B07100C8684E /* DOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFormData.h; sourceTree = "<group>"; };
+ 2EDEF1ED121B0EFC00726DB2 /* BlobData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobData.cpp; sourceTree = "<group>"; };
+ 2EDEF1EE121B0EFC00726DB2 /* BlobData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobData.h; sourceTree = "<group>"; };
+ 2EDEF1EF121B0EFC00726DB2 /* BlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobRegistry.h; sourceTree = "<group>"; };
+ 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobRegistryImpl.cpp; sourceTree = "<group>"; };
+ 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobRegistryImpl.h; sourceTree = "<group>"; };
+ 2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobStorageData.h; sourceTree = "<group>"; };
+ 2EED575012109ED0007656BB /* BlobURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobURL.cpp; sourceTree = "<group>"; };
+ 2EED575112109ED0007656BB /* BlobURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobURL.h; sourceTree = "<group>"; };
+ 2EED57FB1214A9C2007656BB /* ThreadableBlobRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableBlobRegistry.cpp; sourceTree = "<group>"; };
+ 2EED57FC1214A9C2007656BB /* ThreadableBlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableBlobRegistry.h; sourceTree = "<group>"; };
31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSKeyframeRule.cpp; sourceTree = "<group>"; };
31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSKeyframeRule.h; sourceTree = "<group>"; };
31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSKeyframesRule.cpp; sourceTree = "<group>"; };
@@ -6660,6 +6730,8 @@
46F9D5DA0B0D60170028EE36 /* aliasCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = aliasCursor.png; sourceTree = "<group>"; };
46F9D5DB0B0D60170028EE36 /* noDropCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noDropCursor.png; sourceTree = "<group>"; };
46F9D5DC0B0D60170028EE36 /* progressCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progressCursor.png; sourceTree = "<group>"; };
+ 490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ANGLEWebKitBridge.cpp; sourceTree = "<group>"; };
+ 490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANGLEWebKitBridge.h; sourceTree = "<group>"; };
492273A21083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSArrayBufferViewCustom.cpp; sourceTree = "<group>"; };
49484FB3102CF23C00187DD3 /* CanvasGradient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CanvasGradient.cpp; path = canvas/CanvasGradient.cpp; sourceTree = "<group>"; };
49484FB4102CF23C00187DD3 /* CanvasGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanvasGradient.h; path = canvas/CanvasGradient.h; sourceTree = "<group>"; };
@@ -7077,6 +7149,8 @@
5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; };
626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpatialNavigation.cpp; sourceTree = "<group>"; };
626CDE0D1140424C001E5A68 /* SpatialNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpatialNavigation.h; sourceTree = "<group>"; };
+ 628D214B12131ED10055DCFC /* NetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkingContext.h; sourceTree = "<group>"; };
+ 628D214D12131EF40055DCFC /* FrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameNetworkingContext.h; sourceTree = "<group>"; };
62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SuspendableTimer.cpp; sourceTree = "<group>"; };
62C1217B11AB9E77003C462C /* SuspendableTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuspendableTimer.h; sourceTree = "<group>"; };
62CD32561157E57C0063B0A7 /* CustomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomEvent.cpp; sourceTree = "<group>"; };
@@ -7332,6 +7406,10 @@
84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListSource.h; sourceTree = "<group>"; };
84BDA16911358D2A00DBF64C /* RenderSVGResourceClipper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceClipper.cpp; sourceTree = "<group>"; };
84BDA16A11358D2A00DBF64C /* RenderSVGResourceClipper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceClipper.h; sourceTree = "<group>"; };
+ 84C5B2F81216DC810088B53A /* SVGPathTraversalStateBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathTraversalStateBuilder.cpp; sourceTree = "<group>"; };
+ 84C5B2F91216DC810088B53A /* SVGPathTraversalStateBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathTraversalStateBuilder.h; sourceTree = "<group>"; };
+ 84C6784A1214814700A92902 /* SVGPathBlender.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathBlender.cpp; sourceTree = "<group>"; };
+ 84C6784B1214814700A92902 /* SVGPathBlender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathBlender.h; sourceTree = "<group>"; };
84D0C4031115F1D40018AA34 /* AffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AffineTransform.cpp; path = transforms/AffineTransform.cpp; sourceTree = "<group>"; };
84D0C4051115F1EA0018AA34 /* AffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AffineTransform.h; path = transforms/AffineTransform.h; sourceTree = "<group>"; };
85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGDefsElement.h; sourceTree = "<group>"; };
@@ -8184,6 +8262,30 @@
897A2D92120003760082740C /* JSFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFlags.h; sourceTree = "<group>"; };
8988E10C11A3508B00DB732E /* BlobItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobItem.cpp; sourceTree = "<group>"; };
8988E10D11A3508B00DB732E /* BlobItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobItem.h; sourceTree = "<group>"; };
+ 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryEntry.cpp; sourceTree = "<group>"; };
+ 899ABC211215E4A300F9F219 /* DirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryEntry.h; sourceTree = "<group>"; };
+ 899ABC221215E4A300F9F219 /* DirectoryEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DirectoryEntry.idl; sourceTree = "<group>"; };
+ 899ABC231215E4A300F9F219 /* DirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryReader.cpp; sourceTree = "<group>"; };
+ 899ABC241215E4A300F9F219 /* DirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryReader.h; sourceTree = "<group>"; };
+ 899ABC251215E4A300F9F219 /* DirectoryReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DirectoryReader.idl; sourceTree = "<group>"; };
+ 899ABC2C1215E4BE00F9F219 /* EntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntriesCallback.h; sourceTree = "<group>"; };
+ 899ABC2D1215E4BE00F9F219 /* EntriesCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EntriesCallback.idl; sourceTree = "<group>"; };
+ 899ABC2E1215E4BE00F9F219 /* EntryArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EntryArray.cpp; sourceTree = "<group>"; };
+ 899ABC2F1215E4BE00F9F219 /* EntryArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntryArray.h; sourceTree = "<group>"; };
+ 899ABC301215E4BE00F9F219 /* EntryArray.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EntryArray.idl; sourceTree = "<group>"; };
+ 899ABC311215E4BE00F9F219 /* FileEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileEntry.cpp; sourceTree = "<group>"; };
+ 899ABC321215E4BE00F9F219 /* FileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileEntry.h; sourceTree = "<group>"; };
+ 899ABC331215E4BE00F9F219 /* FileEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileEntry.idl; sourceTree = "<group>"; };
+ 899ABC551215EB2A00F9F219 /* JSDirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntry.cpp; sourceTree = "<group>"; };
+ 899ABC561215EB2A00F9F219 /* JSDirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryEntry.h; sourceTree = "<group>"; };
+ 899ABC571215EB2A00F9F219 /* JSEntriesCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntriesCallback.cpp; sourceTree = "<group>"; };
+ 899ABC581215EB2A00F9F219 /* JSEntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntriesCallback.h; sourceTree = "<group>"; };
+ 899ABC591215EB2A00F9F219 /* JSEntryArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryArray.cpp; sourceTree = "<group>"; };
+ 899ABC5A1215EB2A00F9F219 /* JSEntryArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntryArray.h; sourceTree = "<group>"; };
+ 899ABC5B1215EB2A00F9F219 /* JSFileEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileEntry.cpp; sourceTree = "<group>"; };
+ 899ABC5C1215EB2A00F9F219 /* JSFileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileEntry.h; sourceTree = "<group>"; };
+ 899ABC6B1215ECEF00F9F219 /* JSDirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryReader.cpp; sourceTree = "<group>"; };
+ 899ABC6C1215ECEF00F9F219 /* JSDirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryReader.h; sourceTree = "<group>"; };
89B5EA9F11E8003D00F2367E /* LineEnding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineEnding.cpp; sourceTree = "<group>"; };
89B5EAA011E8003D00F2367E /* LineEnding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineEnding.h; sourceTree = "<group>"; };
89BED5E911BE11CE00448492 /* BlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobBuilder.cpp; sourceTree = "<group>"; };
@@ -8460,6 +8562,10 @@
97059974107D975200A50A7C /* PolicyCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyCallback.h; sourceTree = "<group>"; };
97059975107D975200A50A7C /* PolicyChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolicyChecker.cpp; sourceTree = "<group>"; };
97059976107D975200A50A7C /* PolicyChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyChecker.h; sourceTree = "<group>"; };
+ 970C4FDF1211266200C3D393 /* HTMLEntitySearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntitySearch.cpp; sourceTree = "<group>"; };
+ 970C4FE01211266200C3D393 /* HTMLEntitySearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntitySearch.h; sourceTree = "<group>"; };
+ 970C4FE11211266200C3D393 /* HTMLEntityTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityTable.cpp; sourceTree = "<group>"; };
+ 970C4FE21211266200C3D393 /* HTMLEntityTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntityTable.h; sourceTree = "<group>"; };
9719AEFF11D09F2C00D45831 /* HTMLInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLInputStream.h; sourceTree = "<group>"; };
9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentWriter.cpp; sourceTree = "<group>"; };
9738899F116EA9DC00ADF313 /* DocumentWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentWriter.h; sourceTree = "<group>"; };
@@ -8469,6 +8575,8 @@
976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPreloadScanner.h; sourceTree = "<group>"; };
976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityParser.cpp; sourceTree = "<group>"; };
976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntityParser.h; sourceTree = "<group>"; };
+ 978B6FC712128821001595EF /* HTMLViewSourceParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLViewSourceParser.cpp; sourceTree = "<group>"; };
+ 978B6FC812128821001595EF /* HTMLViewSourceParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLViewSourceParser.h; sourceTree = "<group>"; };
979F43D11075E44A0000F83B /* RedirectScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RedirectScheduler.cpp; sourceTree = "<group>"; };
979F43D21075E44A0000F83B /* RedirectScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedirectScheduler.h; sourceTree = "<group>"; };
97C0784F1165D5BE003A32EF /* SuffixTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuffixTree.h; sourceTree = "<group>"; };
@@ -8843,6 +8951,7 @@
A8A564A411DC0E59003AC2F0 /* HTMLFormattingElementList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFormattingElementList.cpp; sourceTree = "<group>"; };
A8A909AA0CBCD6B50029B807 /* RenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTransformableContainer.h; sourceTree = "<group>"; };
A8A909AB0CBCD6B50029B807 /* RenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTransformableContainer.cpp; sourceTree = "<group>"; };
+ A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityTable.cpp; sourceTree = "<group>"; };
A8BCFD04120A046100B5F122 /* SVGPathSeg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSeg.cpp; sourceTree = "<group>"; };
A8C2280D11D4A59700D5A7D3 /* DocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentParser.cpp; sourceTree = "<group>"; };
A8C2289F11D5722E00D5A7D3 /* DecodedDataDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecodedDataDocumentParser.h; sourceTree = "<group>"; };
@@ -9753,8 +9862,6 @@
B2B2645B0D00A77E000ACC1D /* StringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StringImplCF.cpp; sourceTree = "<group>"; };
B2B33A5D0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGCharacterLayoutInfo.cpp; sourceTree = "<group>"; };
B2B33A5E0B887CEF00C15984 /* SVGCharacterLayoutInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGCharacterLayoutInfo.h; sourceTree = "<group>"; };
- B2C3D9EE0D006C1D00EF6F26 /* AtomicString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AtomicString.h; sourceTree = "<group>"; };
- B2C3D9EF0D006C1D00EF6F26 /* AtomicStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AtomicStringImpl.h; sourceTree = "<group>"; };
B2C3D9F00D006C1D00EF6F26 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; };
B2C3D9F10D006C1D00EF6F26 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BidiContext.cpp; sourceTree = "<group>"; };
@@ -9768,8 +9875,6 @@
B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SegmentedString.cpp; sourceTree = "<group>"; };
B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SegmentedString.h; sourceTree = "<group>"; };
B2C3DA000D006C1D00EF6F26 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; };
- B2C3DA010D006C1D00EF6F26 /* StringHash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringHash.h; sourceTree = "<group>"; };
- B2C3DA030D006C1D00EF6F26 /* StringImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StringImpl.h; sourceTree = "<group>"; };
B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBoundaries.h; sourceTree = "<group>"; };
B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBreakIterator.h; sourceTree = "<group>"; };
B2C3DA070D006C1D00EF6F26 /* TextBreakIteratorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIteratorICU.cpp; sourceTree = "<group>"; };
@@ -10494,6 +10599,7 @@
BCA8C83011E3D53200812FB7 /* BackForwardControllerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardControllerClient.h; sourceTree = "<group>"; };
BCA8CA5D11E4E6D100812FB7 /* BackForwardListImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardListImpl.cpp; sourceTree = "<group>"; };
BCA8CA5E11E4E6D100812FB7 /* BackForwardListImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardListImpl.h; sourceTree = "<group>"; };
+ BCA979161215D055005C485C /* ImageBufferData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBufferData.h; sourceTree = "<group>"; };
BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Scrollbar.cpp; path = platform/Scrollbar.cpp; sourceTree = SOURCE_ROOT; };
BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentURLPattern.cpp; sourceTree = "<group>"; };
BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentURLPattern.h; sourceTree = "<group>"; };
@@ -10698,6 +10804,8 @@
C0DFC86F0DB6841A003EAE7C /* JSConsoleCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSConsoleCustom.cpp; sourceTree = "<group>"; };
C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingDetectorICU.cpp; sourceTree = "<group>"; };
C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
+ C50B561412119D23008B46E0 /* GroupSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GroupSettings.cpp; sourceTree = "<group>"; };
+ C50B561512119D23008B46E0 /* GroupSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupSettings.h; sourceTree = "<group>"; };
C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespace.cpp; sourceTree = "<group>"; };
C50D0E810FF4272900AC2644 /* StorageNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespace.h; sourceTree = "<group>"; };
C5102D920FD9AA2D00FAFF04 /* StorageSyncManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageSyncManager.h; sourceTree = "<group>"; };
@@ -10721,6 +10829,7 @@
C572EE091201C736007D8F82 /* IDBIndexBackendInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBIndexBackendInterface.h; sourceTree = "<group>"; };
C572EE1C1201C9BC007D8F82 /* JSIDBIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBIndex.cpp; sourceTree = "<group>"; };
C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBIndex.h; sourceTree = "<group>"; };
+ C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = "<group>"; };
C585A65C11D4FAB2004C3E4B /* JSIDBAnyCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBAnyCustom.cpp; sourceTree = "<group>"; };
C585A65D11D4FAB2004C3E4B /* JSIDBKeyCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBKeyCustom.cpp; sourceTree = "<group>"; };
C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBBindingUtilities.cpp; sourceTree = "<group>"; };
@@ -10927,7 +11036,6 @@
E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = "<group>"; };
E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocTypeStrings.cpp; sourceTree = "<group>"; };
E406F3FB1198307D009D59D6 /* ColorData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorData.cpp; sourceTree = "<group>"; };
- E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityNames.cpp; sourceTree = "<group>"; };
E415F10C0D9A05870033CE97 /* ElementTimeControl.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ElementTimeControl.idl; sourceTree = "<group>"; };
E415F1680D9A165D0033CE97 /* DOMElementTimeControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMElementTimeControl.h; sourceTree = "<group>"; };
E415F1830D9A1A830033CE97 /* ElementTimeControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementTimeControl.h; sourceTree = "<group>"; };
@@ -10994,8 +11102,6 @@
E4C178960EE6903800824D69 /* CSSSelectorList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorList.h; sourceTree = "<group>"; };
E4C279560CF9741900E97B98 /* RenderMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMedia.cpp; sourceTree = "<group>"; };
E4C279570CF9741900E97B98 /* RenderMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMedia.h; sourceTree = "<group>"; };
- E4D4ABE00D7542F000F96869 /* LegacyPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyPreloadScanner.cpp; sourceTree = "<group>"; };
- E4D4ABE10D7542F100F96869 /* LegacyPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyPreloadScanner.h; sourceTree = "<group>"; };
E4D687760ED7AE3D006EA978 /* PurgeableBufferMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PurgeableBufferMac.cpp; sourceTree = "<group>"; };
E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgeableBuffer.h; sourceTree = "<group>"; };
E4EEFFC60D34550C00469A58 /* JSAudioConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioConstructor.cpp; sourceTree = "<group>"; };
@@ -11024,8 +11130,6 @@
F523D23F02DE4396018635CA /* HTMLElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D25002DE4396018635CA /* LegacyHTMLTreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyHTMLTreeBuilder.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D25102DE4396018635CA /* LegacyHTMLTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = LegacyHTMLTreeBuilder.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D25202DE4396018635CA /* LegacyHTMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyHTMLDocumentParser.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D25302DE4396018635CA /* LegacyHTMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = LegacyHTMLDocumentParser.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextResourceDecoder.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D27902DE43D7018635CA /* TextResourceDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TextResourceDecoder.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30302DE4476018635CA /* Range.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Range.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -11459,16 +11563,30 @@
1AD51A130CB59CD300953D11 /* DatabaseTracker.cpp */,
1AD51A120CB59CD300953D11 /* DatabaseTracker.h */,
51FAFE330CECBF2D00BB3F24 /* DatabaseTrackerClient.h */,
+ 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */,
+ 899ABC211215E4A300F9F219 /* DirectoryEntry.h */,
+ 899ABC221215E4A300F9F219 /* DirectoryEntry.idl */,
+ 899ABC231215E4A300F9F219 /* DirectoryReader.cpp */,
+ 899ABC241215E4A300F9F219 /* DirectoryReader.h */,
+ 899ABC251215E4A300F9F219 /* DirectoryReader.idl */,
897A2D1911FF58A50082740C /* DOMFileSystem.cpp */,
897A2D1A11FF58A50082740C /* DOMFileSystem.h */,
897A2D1B11FF58A50082740C /* DOMFileSystem.idl */,
+ 899ABC2C1215E4BE00F9F219 /* EntriesCallback.h */,
+ 899ABC2D1215E4BE00F9F219 /* EntriesCallback.idl */,
897A2D1C11FF58A50082740C /* Entry.cpp */,
897A2D1D11FF58A50082740C /* Entry.h */,
897A2D3B11FF63860082740C /* Entry.idl */,
+ 899ABC2E1215E4BE00F9F219 /* EntryArray.cpp */,
+ 899ABC2F1215E4BE00F9F219 /* EntryArray.h */,
+ 899ABC301215E4BE00F9F219 /* EntryArray.idl */,
897A2D1E11FF58A50082740C /* EntryCallback.h */,
897A2D1F11FF58A50082740C /* EntryCallback.idl */,
897A2D2011FF58A50082740C /* ErrorCallback.h */,
897A2D5D120000FF0082740C /* ErrorCallback.idl */,
+ 899ABC311215E4BE00F9F219 /* FileEntry.cpp */,
+ 899ABC321215E4BE00F9F219 /* FileEntry.h */,
+ 899ABC331215E4BE00F9F219 /* FileEntry.idl */,
897A2D2111FF58A50082740C /* FileSystemCallback.h */,
897A2D5F120001220082740C /* FileSystemCallback.idl */,
897A2D60120001220082740C /* Flags.h */,
@@ -12278,7 +12396,7 @@
E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */,
A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */,
A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */,
- E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */,
+ A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */,
A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
A8D06B370A265DCD005E7203 /* HTMLNames.h */,
938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
@@ -12316,11 +12434,18 @@
656B84D70AEA1CE900A095B4 /* network */ = {
isa = PBXGroup;
children = (
+ 628D214B12131ED10055DCFC /* NetworkingContext.h */,
B2F34FE70E82F81700F627CD /* cf */,
656B84E70AEA1DAE00A095B4 /* mac */,
934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */,
934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */,
E124748310AA161D00B79493 /* AuthenticationClient.h */,
+ 2EDEF1ED121B0EFC00726DB2 /* BlobData.cpp */,
+ 2EDEF1EE121B0EFC00726DB2 /* BlobData.h */,
+ 2EDEF1EF121B0EFC00726DB2 /* BlobRegistry.h */,
+ 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */,
+ 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */,
+ 2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */,
514C76580CE923A1007EF3CD /* Credential.cpp */,
514C76590CE923A1007EF3CD /* Credential.h */,
51A052321058774F00CC9E95 /* CredentialStorage.cpp */,
@@ -12514,6 +12639,8 @@
596229791133EFE200DC4CBB /* GeolocationPositionCache.h */,
FE80D7BB0E9C1F25000D6F75 /* Geoposition.h */,
FE80D7BC0E9C1F25000D6F75 /* Geoposition.idl */,
+ C50B561412119D23008B46E0 /* GroupSettings.cpp */,
+ C50B561512119D23008B46E0 /* GroupSettings.h */,
7693BACE106C2DCA007B0823 /* HaltablePlugin.h */,
BC94D1500C275C8B006BC617 /* History.cpp */,
BC94D1510C275C8B006BC617 /* History.h */,
@@ -13850,6 +13977,8 @@
89BED5E911BE11CE00448492 /* BlobBuilder.cpp */,
89BED5EA11BE11CE00448492 /* BlobBuilder.h */,
89CD027911C859A80070B791 /* BlobBuilder.idl */,
+ 2EED575012109ED0007656BB /* BlobURL.cpp */,
+ 2EED575112109ED0007656BB /* BlobURL.h */,
93C441ED0F813A1A00C1A634 /* CollectionCache.cpp */,
93C441EE0F813A1A00C1A634 /* CollectionCache.h */,
93C441FF0F813AE100C1A634 /* CollectionType.h */,
@@ -13971,6 +14100,10 @@
859128790AB222EC00202265 /* HTMLEmbedElement.idl */,
976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */,
976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */,
+ 970C4FDF1211266200C3D393 /* HTMLEntitySearch.cpp */,
+ 970C4FE01211266200C3D393 /* HTMLEntitySearch.h */,
+ 970C4FE11211266200C3D393 /* HTMLEntityTable.cpp */,
+ 970C4FE21211266200C3D393 /* HTMLEntityTable.h */,
A81369B9097374F500D74463 /* HTMLFieldSetElement.cpp */,
A81369B8097374F500D74463 /* HTMLFieldSetElement.h */,
1AE2A9F40A1CDA5700B42B25 /* HTMLFieldSetElement.idl */,
@@ -14160,6 +14293,8 @@
E446139A0CD6331000FADA75 /* HTMLVideoElement.idl */,
BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */,
BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */,
+ 978B6FC712128821001595EF /* HTMLViewSourceParser.cpp */,
+ 978B6FC812128821001595EF /* HTMLViewSourceParser.h */,
A77979130D6B9D0C003851B9 /* ImageData.cpp */,
A77979140D6B9D0C003851B9 /* ImageData.h */,
A77979150D6B9D0C003851B9 /* ImageData.idl */,
@@ -14167,18 +14302,16 @@
B0149E7C11A4B21500196A7B /* ImageResizerThread.h */,
A456FA2411AD4A830020B420 /* LabelsNodeList.cpp */,
A456FA2511AD4A830020B420 /* LabelsNodeList.h */,
- F523D25202DE4396018635CA /* LegacyHTMLDocumentParser.cpp */,
- F523D25302DE4396018635CA /* LegacyHTMLDocumentParser.h */,
F523D25002DE4396018635CA /* LegacyHTMLTreeBuilder.cpp */,
F523D25102DE4396018635CA /* LegacyHTMLTreeBuilder.h */,
- E4D4ABE00D7542F000F96869 /* LegacyPreloadScanner.cpp */,
- E4D4ABE10D7542F100F96869 /* LegacyPreloadScanner.h */,
E446139B0CD6331000FADA75 /* MediaError.h */,
E446139C0CD6331000FADA75 /* MediaError.idl */,
A5AFB34D115151A700B045CB /* StepRange.cpp */,
A5AFB34E115151A700B045CB /* StepRange.h */,
BCEF45E80E687767001C1287 /* TextMetrics.h */,
BCEF453F0E676AC1001C1287 /* TextMetrics.idl */,
+ 2EED57FB1214A9C2007656BB /* ThreadableBlobRegistry.cpp */,
+ 2EED57FC1214A9C2007656BB /* ThreadableBlobRegistry.h */,
E446139D0CD6331000FADA75 /* TimeRanges.cpp */,
E446139E0CD6331000FADA75 /* TimeRanges.h */,
E446139F0CD6331000FADA75 /* TimeRanges.idl */,
@@ -14938,14 +15071,24 @@
B59DD697119029E5007E9684 /* JSDatabaseCallback.h */,
B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */,
B58CEB6711913607002A6790 /* JSDatabaseSync.h */,
+ 899ABC551215EB2A00F9F219 /* JSDirectoryEntry.cpp */,
+ 899ABC561215EB2A00F9F219 /* JSDirectoryEntry.h */,
+ 899ABC6B1215ECEF00F9F219 /* JSDirectoryReader.cpp */,
+ 899ABC6C1215ECEF00F9F219 /* JSDirectoryReader.h */,
897A2D8D1200035F0082740C /* JSDOMFileSystem.cpp */,
897A2D8E1200035F0082740C /* JSDOMFileSystem.h */,
+ 899ABC571215EB2A00F9F219 /* JSEntriesCallback.cpp */,
+ 899ABC581215EB2A00F9F219 /* JSEntriesCallback.h */,
897A2D4911FF6C900082740C /* JSEntry.cpp */,
897A2D4A11FF6C900082740C /* JSEntry.h */,
+ 899ABC591215EB2A00F9F219 /* JSEntryArray.cpp */,
+ 899ABC5A1215EB2A00F9F219 /* JSEntryArray.h */,
897A2D4B11FF6C900082740C /* JSEntryCallback.cpp */,
897A2D4C11FF6C900082740C /* JSEntryCallback.h */,
897A2D4D11FF6C900082740C /* JSErrorCallback.cpp */,
897A2D4E11FF6C900082740C /* JSErrorCallback.h */,
+ 899ABC5B1215EB2A00F9F219 /* JSFileEntry.cpp */,
+ 899ABC5C1215EB2A00F9F219 /* JSFileEntry.h */,
897A2D5511FF6CA40082740C /* JSFileSystemCallback.cpp */,
897A2D5611FF6CA40082740C /* JSFileSystemCallback.h */,
897A2D91120003760082740C /* JSFlags.cpp */,
@@ -15318,6 +15461,8 @@
B22278BF0D00BF200071B782 /* SVGPaint.idl */,
B22278C00D00BF200071B782 /* SVGParserUtilities.cpp */,
B22278C10D00BF200071B782 /* SVGParserUtilities.h */,
+ 84C6784A1214814700A92902 /* SVGPathBlender.cpp */,
+ 84C6784B1214814700A92902 /* SVGPathBlender.h */,
8476C9E711DF6A2900555B02 /* SVGPathBuilder.cpp */,
8476C9E811DF6A2900555B02 /* SVGPathBuilder.h */,
8419D2A4120D92D000141F8F /* SVGPathByteStream.h */,
@@ -15387,6 +15532,8 @@
8419D2B8120E0C7600141F8F /* SVGPathStringBuilder.h */,
84300BD9120C9AED0021954A /* SVGPathStringSource.cpp */,
84300BD5120C9AAC0021954A /* SVGPathStringSource.h */,
+ 84C5B2F81216DC810088B53A /* SVGPathTraversalStateBuilder.cpp */,
+ 84C5B2F91216DC810088B53A /* SVGPathTraversalStateBuilder.h */,
B22278F10D00BF210071B782 /* SVGPatternElement.cpp */,
B22278F20D00BF210071B782 /* SVGPatternElement.h */,
B22278F30D00BF210071B782 /* SVGPatternElement.idl */,
@@ -15573,6 +15720,7 @@
B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */,
A80D67070E9E9DEB00E420F0 /* GraphicsContextPlatformPrivateCG.h */,
B2A10B930B3818D700099AA4 /* ImageBufferCG.cpp */,
+ BCA979161215D055005C485C /* ImageBufferData.h */,
B27535300B053814002CE64F /* ImageCG.cpp */,
B27535310B053814002CE64F /* ImageSourceCG.cpp */,
4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */,
@@ -15642,6 +15790,8 @@
B27535490B053814002CE64F /* mac */,
F4EAF4AB10C74268009100D3 /* opentype */,
49E911B20EF86D27009D0CAF /* transforms */,
+ 490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */,
+ 490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */,
A89943270B42338700D7C802 /* BitmapImage.cpp */,
A89943260B42338700D7C802 /* BitmapImage.h */,
B27535380B053814002CE64F /* Color.cpp */,
@@ -15751,9 +15901,6 @@
B2B264590D00A77E000ACC1D /* cf */,
B2C3D9F90D006C1D00EF6F26 /* mac */,
B734B17F119B98DB006587BD /* transcoder */,
- B2C3D9EE0D006C1D00EF6F26 /* AtomicString.h */,
- 0FC705200EB1815600B90AD8 /* AtomicStringHash.h */,
- B2C3D9EF0D006C1D00EF6F26 /* AtomicStringImpl.h */,
37C61F0012095C87007A3C67 /* AtomicStringKeyedMRUCache.h */,
B2C3D9F00D006C1D00EF6F26 /* Base64.cpp */,
B2C3D9F10D006C1D00EF6F26 /* Base64.h */,
@@ -15774,8 +15921,6 @@
939B3E4D0D3C1E8400B4A92B /* StringBuffer.h */,
E1A302C00DE8376900C52F2C /* StringBuilder.cpp */,
E1A302BB0DE8370300C52F2C /* StringBuilder.h */,
- B2C3DA010D006C1D00EF6F26 /* StringHash.h */,
- B2C3DA030D006C1D00EF6F26 /* StringImpl.h */,
97C0784F1165D5BE003A32EF /* SuffixTree.h */,
B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */,
B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */,
@@ -16246,6 +16391,7 @@
BCB16BFB0979C38700467741 /* loader */ = {
isa = PBXGroup;
children = (
+ 628D214D12131EF40055DCFC /* FrameNetworkingContext.h */,
1A8F6BB00DB55CDC001DB794 /* appcache */,
512DD8E80D91E691000F89EE /* archive */,
5126E6B60A2E3AEF005C29FA /* icon */,
@@ -16448,6 +16594,7 @@
1CA19E150DC255CA0065A994 /* EventLoop.h */,
934FE9E40B5CA539003E4A73 /* FileChooser.cpp */,
066C772A0AB603B700238CC4 /* FileChooser.h */,
+ C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */,
514B3F720C722047000530DF /* FileSystem.h */,
BC073BA90C399B1F000F5979 /* FloatConversion.h */,
BC3BC29B0E91AB0F00835588 /* HostWindow.h */,
@@ -17081,6 +17228,8 @@
0842BC711190144000C7D08F /* SVGCharacterData.h */,
B2B33A5D0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp */,
B2B33A5E0B887CEF00C15984 /* SVGCharacterLayoutInfo.h */,
+ 08C46B671212F15D0011AF40 /* SVGImageBufferTools.cpp */,
+ 08C46B681212F15D0011AF40 /* SVGImageBufferTools.h */,
853CA9E20AEEC608002372DC /* SVGInlineFlowBox.cpp */,
853CA9E30AEEC608002372DC /* SVGInlineFlowBox.h */,
AA0972CA0B6947A800A705E9 /* SVGInlineTextBox.cpp */,
@@ -17502,9 +17651,6 @@
49EECDE010503C2400099FAB /* ArrayBufferView.h in Headers */,
B0149E7E11A4B21500196A7B /* AsyncImageResizer.h in Headers */,
8A413AE01207BBA50082016E /* AsyncScriptRunner.h in Headers */,
- B2C3DA1F0D006C1D00EF6F26 /* AtomicString.h in Headers */,
- 0FC705210EB1815600B90AD8 /* AtomicStringHash.h in Headers */,
- B2C3DA200D006C1D00EF6F26 /* AtomicStringImpl.h in Headers */,
37C61F0112095C87007A3C67 /* AtomicStringKeyedMRUCache.h in Headers */,
A8C4A80D09D563270003AC8D /* Attr.h in Headers */,
A8C4A80B09D563270003AC8D /* Attribute.h in Headers */,
@@ -17534,6 +17680,7 @@
2EAFAF0F10E2AF2D007ED3D6 /* Blob.h in Headers */,
89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */,
8988E10F11A3508B00DB732E /* BlobItem.h in Headers */,
+ 2EED575612109ED0007656BB /* BlobURL.h in Headers */,
93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */,
BC5EB5E10E81BE8700B25965 /* BorderData.h in Headers */,
BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */,
@@ -18575,6 +18722,7 @@
D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */,
93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */,
658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */,
+ 628D214E12131EF40055DCFC /* FrameNetworkingContext.h in Headers */,
65A21485097A3F5300B9050A /* FrameTree.h in Headers */,
65CBFEFA0974F607001DAC25 /* FrameView.h in Headers */,
51E4ADB70C42B4CF0042BC55 /* FTPDirectoryDocument.h in Headers */,
@@ -18642,6 +18790,7 @@
A8A563B411DB3D10003AC2F0 /* HTMLElementStack.h in Headers */,
A871D45C0A127CBC00B12A68 /* HTMLEmbedElement.h in Headers */,
976E896111C0CA3A00EA9CA9 /* HTMLEntityParser.h in Headers */,
+ A8BC044F1214EB2B00B5F122 /* HTMLEntitySearch.h in Headers */,
A81369D4097374F600D74463 /* HTMLFieldSetElement.h in Headers */,
A8CFF7A60A156978000A4234 /* HTMLFontElement.h in Headers */,
A8A564A511DC0E59003AC2F0 /* HTMLFormattingElementList.h in Headers */,
@@ -18715,6 +18864,7 @@
A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */,
E44613AB0CD6331000FADA75 /* HTMLVideoElement.h in Headers */,
BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */,
+ 978B6FCA12128821001595EF /* HTMLViewSourceParser.h in Headers */,
514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
375CD232119D43C800A2A859 /* Hyphenation.h in Headers */,
@@ -18794,6 +18944,7 @@
F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
41F062010F5F0B6600A07EAC /* InspectorResource.h in Headers */,
+ 7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
4F3289B611A42AAB005ABE7E /* InspectorValues.h in Headers */,
F375CC071150D300008DDB81 /* InspectorWorkerResource.h in Headers */,
@@ -19262,9 +19413,7 @@
A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
85EC9AFB0A71A2C600EEEAED /* Language.h in Headers */,
2D9066070BE141D400956998 /* LayoutState.h in Headers */,
- 93F198F008245E59001E9ABC /* LegacyHTMLDocumentParser.h in Headers */,
93F198EF08245E59001E9ABC /* LegacyHTMLTreeBuilder.h in Headers */,
- E49626C30D80D94900E3405C /* LegacyPreloadScanner.h in Headers */,
512DD8F50D91E6AF000F89EE /* LegacyWebArchive.h in Headers */,
BCE65BEB0EACDF16007E4533 /* Length.h in Headers */,
BCFF64910EAD15C200C1D6F7 /* LengthBox.h in Headers */,
@@ -19325,6 +19474,7 @@
A9C6E5A60D746458006442E9 /* Navigator.h in Headers */,
E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */,
656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */,
+ 628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */,
1A7FA6190DDA3B3A0028F8A5 /* NetworkStateNotifier.h in Headers */,
BCEF43DD0E674012001C1287 /* NinePieceImage.h in Headers */,
14115B5209F84B7100CA4FC1 /* Node.h in Headers */,
@@ -19688,8 +19838,6 @@
C5102D940FD9AA2D00FAFF04 /* StorageSyncManager.h in Headers */,
939B3E4E0D3C1E8400B4A92B /* StringBuffer.h in Headers */,
E1A302BC0DE8370300C52F2C /* StringBuilder.h in Headers */,
- B2C3DA310D006C1D00EF6F26 /* StringHash.h in Headers */,
- B2C3DA330D006C1D00EF6F26 /* StringImpl.h in Headers */,
65488D6B0DD5A83D009D83B2 /* StringSourceProvider.h in Headers */,
B23540F30D00782E002382FA /* StringTruncator.h in Headers */,
849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */,
@@ -19814,6 +19962,7 @@
B2227A2A0D00BF220071B782 /* SVGGradientElement.h in Headers */,
650FBF2B0D9AF047008FC292 /* SVGHKernElement.h in Headers */,
B25599A40D00D8BA00BB825C /* SVGImage.h in Headers */,
+ 08C46B6A1212F15E0011AF40 /* SVGImageBufferTools.h in Headers */,
B2227A2D0D00BF220071B782 /* SVGImageElement.h in Headers */,
B28C6A2A0D00C44800334AA4 /* SVGImageLoader.h in Headers */,
853CA9E70AEEC608002372DC /* SVGInlineFlowBox.h in Headers */,
@@ -19837,6 +19986,7 @@
B2227A510D00BF220071B782 /* SVGNumberList.h in Headers */,
B2227A540D00BF220071B782 /* SVGPaint.h in Headers */,
B2227A570D00BF220071B782 /* SVGParserUtilities.h in Headers */,
+ 84C6784D1214814700A92902 /* SVGPathBlender.h in Headers */,
8476C9EB11DF6A2900555B02 /* SVGPathBuilder.h in Headers */,
8419D2A7120D92D000141F8F /* SVGPathByteStream.h in Headers */,
8419D2A9120D92D000141F8F /* SVGPathByteStreamBuilder.h in Headers */,
@@ -19862,6 +20012,7 @@
84300BD8120C9AD40021954A /* SVGPathSource.h in Headers */,
8419D2BA120E0C7600141F8F /* SVGPathStringBuilder.h in Headers */,
84300BD6120C9AAC0021954A /* SVGPathStringSource.h in Headers */,
+ 84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */,
B2227A880D00BF220071B782 /* SVGPatternElement.h in Headers */,
B25599950D00D8BA00BB825C /* SVGPointLightSource.h in Headers */,
B2227A8C0D00BF220071B782 /* SVGPointList.h in Headers */,
@@ -19949,6 +20100,7 @@
BCE658FF0EA9248A007E4533 /* Theme.h in Headers */,
BCE659E60EA92FB2007E4533 /* ThemeMac.h in Headers */,
BCE659A90EA927B9007E4533 /* ThemeTypes.h in Headers */,
+ 2EED57FE1214A9C2007656BB /* ThreadableBlobRegistry.h in Headers */,
0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */,
0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */,
5112247410CFB8D8008099D7 /* ThreadableWebSocketChannel.h in Headers */,
@@ -20139,7 +20291,35 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
- 7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
+ C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
+ BCA979171215D055005C485C /* ImageBufferData.h in Headers */,
+ 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
+ 899ABC271215E4A300F9F219 /* DirectoryEntry.h in Headers */,
+ 899ABC2A1215E4A300F9F219 /* DirectoryReader.h in Headers */,
+ 899ABC341215E4BE00F9F219 /* EntriesCallback.h in Headers */,
+ 899ABC371215E4BE00F9F219 /* EntryArray.h in Headers */,
+ 899ABC3A1215E4BE00F9F219 /* FileEntry.h in Headers */,
+ 899ABC5E1215EB2A00F9F219 /* JSDirectoryEntry.h in Headers */,
+ 899ABC601215EB2A00F9F219 /* JSEntriesCallback.h in Headers */,
+ 899ABC621215EB2A00F9F219 /* JSEntryArray.h in Headers */,
+ 899ABC641215EB2A00F9F219 /* JSFileEntry.h in Headers */,
+ 899ABC6E1215ECEF00F9F219 /* JSDirectoryReader.h in Headers */,
+ 899ABC7A1215F03100F9F219 /* JSDOMFileSystem.h in Headers */,
+ 899ABC7C1215F03300F9F219 /* JSEntry.h in Headers */,
+ 899ABC7E1215F03700F9F219 /* JSEntryCallback.h in Headers */,
+ 899ABC801215F03800F9F219 /* JSErrorCallback.h in Headers */,
+ 899ABC811215F03B00F9F219 /* JSFlags.h in Headers */,
+ 899ABC831215F03C00F9F219 /* JSFileSystemCallback.h in Headers */,
+ 899ABC871215F0DF00F9F219 /* DOMFileSystem.h in Headers */,
+ 899ABC961215F9DA00F9F219 /* ErrorCallback.h in Headers */,
+ 899ABC971215F9DF00F9F219 /* EntryCallback.h in Headers */,
+ 899ABCAA1215FA5500F9F219 /* FileSystemCallback.h in Headers */,
+ 899ABCAB1215FA5A00F9F219 /* Flags.h in Headers */,
+ 899ABCB91215FAB500F9F219 /* Entry.h in Headers */,
+ 2EDEF1F4121B0EFC00726DB2 /* BlobData.h in Headers */,
+ 2EDEF1F5121B0EFC00726DB2 /* BlobRegistry.h in Headers */,
+ 2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */,
+ 2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -20284,7 +20464,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/combine-javascript-resources\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined script.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\nfi\n";
+ shellScript = "# Don't do anything for Debug builds, so the Inspector is easier to debug.\nif [[ ${CONFIGURATION:=Debug} == \"Debug\" ]]; then\n exit\nfi\n\n# Combine all script resources in the inspector.html file.\n\"$SRCROOT/combine-javascript-resources\" --input-html \"${SRCROOT}/inspector/front-end/inspector.html\" --generated-scripts-dir ${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore --output-dir \"${DERIVED_FILE_DIR}/WebCore\" --output-script-name inspector.js\n\nif [ -d \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\" ]; then\n # Remove any JavaScript files, since they will be replaced with the combined file.\n cd \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n rm *.js\n\n # Copy the modified HTML file and the combined script.\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.html\" inspector.html\n cp \"${DERIVED_FILE_DIR}/WebCore/inspector.js\" inspector.js\nfi\n";
};
1C81BA330E97357C00266E07 /* Copy Inspector Resources */ = {
isa = PBXShellScriptBuildPhase;
@@ -20300,7 +20480,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "# Copy all the Inspector front-end resources.\nditto \"${SRCROOT}/inspector/front-end\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n# Remove the WebKit.qrc file since it is not used on the Mac (this file is for Qt)\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/WebKit.qrc\"\n\n# Remove *.re2js files, they are only used to generate some .js files.\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.re2js\n";
+ shellScript = "# Copy all the Inspector front-end resources.\nditto \"${SRCROOT}/inspector/front-end\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\nditto \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/InspectorBackendStub.js\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector\"\n\n# Remove the WebKit.qrc file since it is not used on the Mac (this file is for Qt)\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/WebKit.qrc\"\n\n# Remove *.re2js files, they are only used to generate some .js files.\nrm -f \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector/\"*.re2js\n";
};
5D0D540D0E9862F60029E223 /* Check For Weak VTables and Externals */ = {
isa = PBXShellScriptBuildPhase;
@@ -20507,6 +20687,7 @@
2EAFAF0E10E2AF2D007ED3D6 /* Blob.cpp in Sources */,
89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */,
8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */,
+ 2EED575512109ED0007656BB /* BlobURL.cpp in Sources */,
93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */,
BCEA4854097D93020094C9E4 /* break_lines.cpp in Sources */,
93309DDA099E64920056E581 /* BreakBlockquoteCommand.cpp in Sources */,
@@ -21100,6 +21281,8 @@
A8A563B511DB3D10003AC2F0 /* HTMLElementStack.cpp in Sources */,
A871D45F0A127CBC00B12A68 /* HTMLEmbedElement.cpp in Sources */,
976E896011C0CA3A00EA9CA9 /* HTMLEntityParser.cpp in Sources */,
+ A8BC044E1214EB2A00B5F122 /* HTMLEntitySearch.cpp in Sources */,
+ A8BC04921214F69600B5F122 /* HTMLEntityTable.cpp in Sources */,
A81369D5097374F600D74463 /* HTMLFieldSetElement.cpp in Sources */,
A8CFF7A20A156978000A4234 /* HTMLFontElement.cpp in Sources */,
A8A564A611DC0E59003AC2F0 /* HTMLFormattingElementList.cpp in Sources */,
@@ -21170,6 +21353,7 @@
A8EA79F30A1916DF00A8EF5F /* HTMLUListElement.cpp in Sources */,
E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */,
BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */,
+ 978B6FC912128821001595EF /* HTMLViewSourceParser.cpp in Sources */,
0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */,
@@ -21237,6 +21421,7 @@
F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
41F062020F5F0B6600A07EAC /* InspectorResource.cpp in Sources */,
+ 7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
4F3289B511A42AAB005ABE7E /* InspectorValues.cpp in Sources */,
49EECDEB10503C2400099FAB /* Int16Array.cpp in Sources */,
@@ -21798,9 +21983,7 @@
A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
9352084509BD43B900F2038D /* Language.mm in Sources */,
2D9066060BE141D400956998 /* LayoutState.cpp in Sources */,
- 93F19A9C08245E59001E9ABC /* LegacyHTMLDocumentParser.cpp in Sources */,
93F19A9B08245E59001E9ABC /* LegacyHTMLTreeBuilder.cpp in Sources */,
- E49626C20D80D94800E3405C /* LegacyPreloadScanner.cpp in Sources */,
512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */,
BCE65BEA0EACDF16007E4533 /* Length.cpp in Sources */,
@@ -22284,6 +22467,7 @@
B2227A290D00BF220071B782 /* SVGGradientElement.cpp in Sources */,
650FBF2A0D9AF047008FC292 /* SVGHKernElement.cpp in Sources */,
B25599A30D00D8BA00BB825C /* SVGImage.cpp in Sources */,
+ 08C46B691212F15E0011AF40 /* SVGImageBufferTools.cpp in Sources */,
B2227A2C0D00BF220071B782 /* SVGImageElement.cpp in Sources */,
B28C6A290D00C44800334AA4 /* SVGImageLoader.cpp in Sources */,
853CA9E60AEEC608002372DC /* SVGInlineFlowBox.cpp in Sources */,
@@ -22305,6 +22489,7 @@
B2227A500D00BF220071B782 /* SVGNumberList.cpp in Sources */,
B2227A530D00BF220071B782 /* SVGPaint.cpp in Sources */,
B2227A560D00BF220071B782 /* SVGParserUtilities.cpp in Sources */,
+ 84C6784C1214814700A92902 /* SVGPathBlender.cpp in Sources */,
8476C9EA11DF6A2900555B02 /* SVGPathBuilder.cpp in Sources */,
8419D2A8120D92D000141F8F /* SVGPathByteStreamBuilder.cpp in Sources */,
8419D2AC120D92FC00141F8F /* SVGPathByteStreamSource.cpp in Sources */,
@@ -22327,6 +22512,7 @@
B2227A830D00BF220071B782 /* SVGPathSegMoveto.cpp in Sources */,
8419D2B9120E0C7600141F8F /* SVGPathStringBuilder.cpp in Sources */,
84300BDA120C9AED0021954A /* SVGPathStringSource.cpp in Sources */,
+ 84C5B2FA1216DC810088B53A /* SVGPathTraversalStateBuilder.cpp in Sources */,
B2227A870D00BF220071B782 /* SVGPatternElement.cpp in Sources */,
B2227A8B0D00BF220071B782 /* SVGPointList.cpp in Sources */,
B2227A8E0D00BF220071B782 /* SVGPolyElement.cpp in Sources */,
@@ -22402,6 +22588,7 @@
B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
BCE65D320EAD1211007E4533 /* Theme.cpp in Sources */,
BCE659E90EA92FFA007E4533 /* ThemeMac.mm in Sources */,
+ 2EED57FD1214A9C2007656BB /* ThreadableBlobRegistry.cpp in Sources */,
0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */,
5112247210CFB8C6008099D7 /* ThreadableWebSocketChannel.cpp in Sources */,
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */,
@@ -22562,7 +22749,28 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- 7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
+ C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */,
+ 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */,
+ 899ABC261215E4A300F9F219 /* DirectoryEntry.cpp in Sources */,
+ 899ABC291215E4A300F9F219 /* DirectoryReader.cpp in Sources */,
+ 899ABC361215E4BE00F9F219 /* EntryArray.cpp in Sources */,
+ 899ABC391215E4BE00F9F219 /* FileEntry.cpp in Sources */,
+ 899ABC5D1215EB2A00F9F219 /* JSDirectoryEntry.cpp in Sources */,
+ 899ABC5F1215EB2A00F9F219 /* JSEntriesCallback.cpp in Sources */,
+ 899ABC611215EB2A00F9F219 /* JSEntryArray.cpp in Sources */,
+ 899ABC631215EB2A00F9F219 /* JSFileEntry.cpp in Sources */,
+ 899ABC6D1215ECEF00F9F219 /* JSDirectoryReader.cpp in Sources */,
+ 899ABC791215F03100F9F219 /* JSDOMFileSystem.cpp in Sources */,
+ 899ABC7B1215F03300F9F219 /* JSEntry.cpp in Sources */,
+ 899ABC7D1215F03600F9F219 /* JSEntryCallback.cpp in Sources */,
+ 899ABC7F1215F03800F9F219 /* JSErrorCallback.cpp in Sources */,
+ 899ABC821215F03B00F9F219 /* JSFlags.cpp in Sources */,
+ 899ABC841215F03D00F9F219 /* JSFileSystemCallback.cpp in Sources */,
+ 899ABC861215F0D800F9F219 /* DOMFileSystem.cpp in Sources */,
+ 899ABCBA1215FAB800F9F219 /* Entry.cpp in Sources */,
+ C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
+ 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
+ 2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 24c29d4..6b90b63 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -354,10 +354,10 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const
else if (isInlineWithContinuation(m_renderer->parent())) {
RenderObject* continuation = toRenderInline(m_renderer->parent())->continuation();
- // Case 4a: continuation is a block - in this case the block itself is the next sibling.
+ // Case 5a: continuation is a block - in this case the block itself is the next sibling.
if (continuation->isRenderBlock())
nextSibling = continuation;
- // Case 4b: continuation is an inline - in this case the inline's first child is the next sibling
+ // Case 5b: continuation is an inline - in this case the inline's first child is the next sibling
else
nextSibling = firstChildConsideringContinuation(continuation);
}
@@ -368,6 +368,13 @@ AccessibilityObject* AccessibilityRenderObject::nextSibling() const
return axObjectCache()->getOrCreate(nextSibling);
}
+static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
+{
+ if (renderer->isInline() && !renderer->isReplaced())
+ return toRenderInline(renderer)->continuation();
+ return toRenderBlock(renderer)->inlineElementContinuation();
+}
+
RenderObject* AccessibilityRenderObject::renderParentObject() const
{
if (!m_renderer)
@@ -377,7 +384,8 @@ RenderObject* AccessibilityRenderObject::renderParentObject() const
// Case 1: node is a block and is an inline's continuation. Parent
// is the start of the continuation chain.
- RenderInline* startOfConts = 0;
+ RenderObject* startOfConts = 0;
+ RenderObject* firstChild = 0;
if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer)))
parent = startOfConts;
@@ -386,6 +394,20 @@ RenderObject* AccessibilityRenderObject::renderParentObject() const
else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent)))
parent = startOfConts;
+ // Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation.
+ else if (parent && (firstChild = parent->firstChild()) && firstChild->node()) {
+ // Get the node's renderer and follow that continuation chain until the first child is found
+ RenderObject* nodeRenderFirstChild = firstChild->node()->renderer();
+ if (nodeRenderFirstChild != firstChild) {
+ for (RenderObject* contsTest = nodeRenderFirstChild; contsTest; contsTest = nextContinuation(contsTest)) {
+ if (contsTest == firstChild) {
+ parent = nodeRenderFirstChild->parent();
+ break;
+ }
+ }
+ }
+ }
+
return parent;
}
@@ -486,8 +508,9 @@ bool AccessibilityRenderObject::isFileUploadButton() const
bool AccessibilityRenderObject::isInputImage() const
{
- if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->node());
+ Node* elementNode = node();
+ if (roleValue() == ButtonRole && elementNode && elementNode->hasTagName(inputTag)) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(elementNode);
return input->inputType() == HTMLInputElement::IMAGE;
}
@@ -569,8 +592,11 @@ bool AccessibilityRenderObject::isIndeterminate() const
bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const
{
Node* elementNode = node();
- if (elementNode && elementNode->isElementNode())
- return toInputElement(static_cast<Element*>(elementNode));
+ if (elementNode && elementNode->isElementNode()) {
+ InputElement* input = toInputElement(static_cast<Element*>(elementNode));
+ if (input)
+ return input->isCheckbox() || input->isRadioButton();
+ }
return false;
}
@@ -3299,8 +3325,10 @@ void AccessibilityRenderObject::addChildren()
unsigned length = children.size();
for (unsigned i = 0; i < length; ++i)
m_children.append(children[i]);
- } else
+ } else {
+ ASSERT(obj->parentObject() == this);
m_children.append(obj);
+ }
}
// for a RenderImage, add the <area> elements as individual accessibility objects
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index fd5d6bb..b162346 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -41,7 +41,6 @@
#include "AccessibilityTableCell.h"
#include "AccessibilityTableColumn.h"
#include "AccessibilityTableRow.h"
-#include "AtomicString.h"
#include "Document.h"
#include "DocumentType.h"
#include "Editor.h"
@@ -58,6 +57,7 @@
#include "RenderText.h"
#include "TextEncoding.h"
#include <wtf/text/CString.h>
+#include <wtf/text/AtomicString.h>
#include <atk/atk.h>
#include <glib.h>
diff --git a/WebCore/bindings/ScriptControllerBase.cpp b/WebCore/bindings/ScriptControllerBase.cpp
index 9bea8ae..01911d8 100644
--- a/WebCore/bindings/ScriptControllerBase.cpp
+++ b/WebCore/bindings/ScriptControllerBase.cpp
@@ -72,12 +72,19 @@ bool ScriptController::executeIfJavaScriptURL(const KURL& url, bool userGesture,
if (!protocolIsJavaScript(url))
return false;
- if (m_frame->page() && !m_frame->page()->javaScriptURLsAreAllowed())
+ if (!m_frame->page())
+ return true;
+
+ if (!m_frame->page()->javaScriptURLsAreAllowed())
return true;
if (m_frame->inViewSourceMode())
return true;
+ // We need to hold onto the Frame here because executing script can
+ // destroy the frame.
+ RefPtr<Frame> protector(m_frame);
+
const int javascriptSchemeLength = sizeof("javascript:") - 1;
String decodedURL = decodeURLEscapeSequences(url.string());
@@ -85,6 +92,11 @@ bool ScriptController::executeIfJavaScriptURL(const KURL& url, bool userGesture,
if (xssAuditor()->canEvaluateJavaScriptURL(decodedURL))
result = executeScript(decodedURL.substring(javascriptSchemeLength), userGesture, AllowXSS);
+ // If executing script caused this frame to be removed from the page, we
+ // don't want to try to replace its document!
+ if (!m_frame->page())
+ return true;
+
String scriptResult;
#if USE(JSC)
JSDOMWindowShell* shell = windowShell(mainThreadNormalWorld());
diff --git a/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp b/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp
new file mode 100644
index 0000000..d79eaae
--- /dev/null
+++ b/WebCore/bindings/cpp/WebDOMCustomVoidCallback.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Kevin Ollivier <kevino@theolliviers.com>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebDOMCustomVoidCallback.h"
+
+WebDOMCustomVoidCallback::WebDOMCustomVoidCallback()
+{
+}
+
+WebDOMCustomVoidCallback::~WebDOMCustomVoidCallback()
+{
+}
+
+void WebDOMCustomVoidCallback::handleEvent()
+{
+
+}
+
+WebCore::VoidCallback* toWebCore(const WebDOMCustomVoidCallback& callback)
+{
+ return const_cast<WebCore::VoidCallback*>((WebCore::VoidCallback*)&callback);
+} \ No newline at end of file
diff --git a/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h b/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h
new file mode 100644
index 0000000..0fd8f96
--- /dev/null
+++ b/WebCore/bindings/cpp/WebDOMCustomVoidCallback.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) Kevin Ollivier <kevino@theolliviers.com>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDOMCustomVoidCallback_h
+#define WebDOMCustomVoidCallback_h
+
+#include "VoidCallback.h"
+#include <wtf/PassRefPtr.h>
+
+// FIXME: This is just a stub to keep compilation working. We need to revisit
+// this when we add support for these callbacks to the WebDOM bindings.
+
+class WebDOMCustomVoidCallback : public WebCore::VoidCallback {
+public:
+ static PassRefPtr<WebDOMCustomVoidCallback> create()
+ {
+ return adoptRef(new WebDOMCustomVoidCallback());
+ }
+
+ virtual ~WebDOMCustomVoidCallback();
+
+ virtual void handleEvent();
+
+private:
+ WebDOMCustomVoidCallback();
+};
+
+WebCore::VoidCallback* toWebCore(const WebDOMCustomVoidCallback&);
+
+#endif // WebDOMCustomVoidCallback_h
diff --git a/WebCore/bindings/cpp/WebDOMEventTarget.cpp b/WebCore/bindings/cpp/WebDOMEventTarget.cpp
index b24bc84..7dee138 100644
--- a/WebCore/bindings/cpp/WebDOMEventTarget.cpp
+++ b/WebCore/bindings/cpp/WebDOMEventTarget.cpp
@@ -197,3 +197,10 @@ WebDOMEventTarget toWebKit(WebCore::EventTarget* value)
ASSERT_NOT_REACHED();
return WebDOMEventTarget();
}
+
+WebDOMEventTarget& WebDOMEventTarget::operator=(const WebDOMEventTarget& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMEventTargetPrivate(copy.impl()) : 0;
+ return *this;
+}
diff --git a/WebCore/bindings/cpp/WebDOMEventTarget.h b/WebCore/bindings/cpp/WebDOMEventTarget.h
index d514372..4548a8b 100644
--- a/WebCore/bindings/cpp/WebDOMEventTarget.h
+++ b/WebCore/bindings/cpp/WebDOMEventTarget.h
@@ -64,6 +64,7 @@ public:
WebDOMNotification toNotification();
WebDOMWebSocket toWebSocket();
+ WebDOMEventTarget& operator=(const WebDOMEventTarget&);
protected:
struct WebDOMEventTargetPrivate;
WebDOMEventTargetPrivate* m_impl;
diff --git a/WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp b/WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp
index 3f3378c..a16a329 100644
--- a/WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp
+++ b/WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp
@@ -20,10 +20,10 @@
#include "config.h"
#include "WebDOMHTMLCollection.h"
-#include "AtomicString.h"
#include "HTMLCollection.h"
#include "WebDOMNode.h"
#include <wtf/GetPtr.h>
+#include <wtf/text/AtomicString.h>
WebDOMNode WebDOMHTMLCollection::item(unsigned index)
{
diff --git a/WebCore/bindings/cpp/WebDOMHTMLDocumentCustom.cpp b/WebCore/bindings/cpp/WebDOMHTMLDocumentCustom.cpp
index 3bab0c1..d608b0f 100644
--- a/WebCore/bindings/cpp/WebDOMHTMLDocumentCustom.cpp
+++ b/WebCore/bindings/cpp/WebDOMHTMLDocumentCustom.cpp
@@ -25,11 +25,13 @@
#include "SegmentedString.h"
#include "WebExceptionHandler.h"
+#include <wtf/Forward.h>
+
static inline void documentWrite(const WebDOMString& text, WebCore::HTMLDocument* document, bool addNewline)
{
WebCore::SegmentedString segmentedString = WTF::String(text);
if (addNewline)
- segmentedString.append(WebCore::SegmentedString(&WebCore::newlineCharacter, 1));
+ segmentedString.append(WebCore::SegmentedString(WTF::String(&WebCore::newlineCharacter)));
document->write(segmentedString);
}
diff --git a/WebCore/bindings/cpp/WebDOMString.cpp b/WebCore/bindings/cpp/WebDOMString.cpp
index 59d98f7..debd4f4 100644
--- a/WebCore/bindings/cpp/WebDOMString.cpp
+++ b/WebCore/bindings/cpp/WebDOMString.cpp
@@ -110,7 +110,7 @@ WebDOMString::operator WTF::AtomicString() const
bool WebDOMString::equals(const char* string) const
{
- return WebCore::equal(m_private, string);
+ return WTF::equal(m_private, string);
}
void WebDOMString::assign(WebDOMStringPrivate* p)
diff --git a/WebCore/bindings/generic/ActiveDOMCallback.cpp b/WebCore/bindings/generic/ActiveDOMCallback.cpp
index 2e69d10..c42c93a 100644
--- a/WebCore/bindings/generic/ActiveDOMCallback.cpp
+++ b/WebCore/bindings/generic/ActiveDOMCallback.cpp
@@ -123,7 +123,6 @@ static void destroyOnContextThread(PassOwnPtr<ActiveDOMObjectCallbackImpl> impl)
ActiveDOMCallback::ActiveDOMCallback(ScriptExecutionContext* context)
: m_impl(new ActiveDOMObjectCallbackImpl(context))
{
- ASSERT(context->isContextThread());
}
ActiveDOMCallback::~ActiveDOMCallback()
diff --git a/WebCore/bindings/generic/BindingDOMWindow.h b/WebCore/bindings/generic/BindingDOMWindow.h
index dda5644..0c450a5 100644
--- a/WebCore/bindings/generic/BindingDOMWindow.h
+++ b/WebCore/bindings/generic/BindingDOMWindow.h
@@ -108,11 +108,9 @@ Frame* BindingDOMWindow<Binding>::createWindow(State<Binding>* state,
// issues to pass the URL instead of "".
bool created;
- // We pass in the opener frame here so it can be used for looking up the
- // frame name, in case the active frame is different from the opener frame,
- // and the name references a frame relative to the opener frame, for example
- // "_self" or "_parent".
- Frame* newFrame = callingFrame->loader()->createWindow(openerFrame->loader(), frameRequest, windowFeatures, created);
+ // We pass the opener frame for the lookupFrame in case the active frame is different from
+ // the opener frame, and the name references a frame relative to the opener frame.
+ Frame* newFrame = WebCore::createWindow(callingFrame, openerFrame, frameRequest, windowFeatures, created);
if (!newFrame)
return 0;
diff --git a/WebCore/bindings/gobject/GObjectEventListener.cpp b/WebCore/bindings/gobject/GObjectEventListener.cpp
index 1a4f680..3ce8461 100644
--- a/WebCore/bindings/gobject/GObjectEventListener.cpp
+++ b/WebCore/bindings/gobject/GObjectEventListener.cpp
@@ -21,6 +21,7 @@
#include "Event.h"
#include "EventListener.h"
+#include "webkit/WebKitDOMEvent.h"
#include "webkit/WebKitDOMEventPrivate.h"
#include <wtf/HashMap.h>
#include <wtf/text/CString.h>
@@ -30,7 +31,7 @@ namespace WebCore {
void GObjectEventListener::handleEvent(ScriptExecutionContext*, Event* event)
{
gboolean handled = FALSE;
- WebKitDOMEvent* gobjectEvent = WebKit::wrapEvent(event);
+ WebKitDOMEvent* gobjectEvent = WEBKIT_DOM_EVENT(WebKit::kit(event));
g_signal_emit_by_name(m_object, m_signalName.utf8().data(), gobjectEvent, &handled);
}
diff --git a/WebCore/bindings/gobject/WebKitDOMBinding.cpp b/WebCore/bindings/gobject/WebKitDOMBinding.cpp
index 1154d6c..3c066e3 100644
--- a/WebCore/bindings/gobject/WebKitDOMBinding.cpp
+++ b/WebCore/bindings/gobject/WebKitDOMBinding.cpp
@@ -32,6 +32,7 @@
#include "UIEvent.h"
#include "WebKitDOMDOMWindowPrivate.h"
#include "WebKitDOMElementPrivate.h"
+#include "WebKitDOMEventPrivate.h"
#include "WebKitDOMNode.h"
#include "WebKitDOMNodePrivate.h"
#include "WebKitHTMLElementWrapperFactory.h"
@@ -140,7 +141,7 @@ gpointer kit(Event* event)
else if (event->isUIEvent())
wrappedEvent = wrapUIEvent(static_cast<UIEvent*>(event));
else
- wrappedEvent = 0;
+ wrappedEvent = wrapEvent(event);
return DOMObjectCache::put(event, wrappedEvent);
}
diff --git a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
index 22bfee4..3b3465e 100644
--- a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
+++ b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "JSCSSStyleDeclarationCustom.h"
-#include "AtomicString.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSPrimitiveValue.h"
#include "CSSValue.h"
@@ -34,6 +33,7 @@
#include <runtime/StringObjectThatMasqueradesAsUndefined.h>
#include <runtime/StringPrototype.h>
#include <wtf/ASCIICType.h>
+#include <wtf/text/AtomicString.h>
using namespace JSC;
using namespace WTF;
@@ -66,17 +66,17 @@ static bool hasCSSPropertyNamePrefix(const Identifier& propertyName, const char*
ASSERT(*prefix);
for (const char* p = prefix; *p; ++p)
ASSERT(isASCIILower(*p));
- ASSERT(propertyName.size());
+ ASSERT(propertyName.length());
#endif
- if (toASCIILower(propertyName.data()[0]) != prefix[0])
+ if (toASCIILower(propertyName.characters()[0]) != prefix[0])
return false;
- unsigned length = propertyName.size();
+ unsigned length = propertyName.length();
for (unsigned i = 1; i < length; ++i) {
if (!prefix[i])
- return isASCIIUpper(propertyName.data()[i]);
- if (propertyName.data()[i] != prefix[i])
+ return isASCIIUpper(propertyName.characters()[i]);
+ if (propertyName.characters()[i] != prefix[i])
return false;
}
return false;
@@ -87,7 +87,7 @@ static String cssPropertyName(const Identifier& propertyName, bool* hadPixelOrPo
if (hadPixelOrPosPrefix)
*hadPixelOrPosPrefix = false;
- unsigned length = propertyName.size();
+ unsigned length = propertyName.length();
if (!length)
return String();
@@ -111,14 +111,14 @@ static String cssPropertyName(const Identifier& propertyName, bool* hadPixelOrPo
|| hasCSSPropertyNamePrefix(propertyName, "apple"))
name.append('-');
else {
- if (isASCIIUpper(propertyName.data()[0]))
+ if (isASCIIUpper(propertyName.characters()[0]))
return String();
}
- name.append(toASCIILower(propertyName.data()[i++]));
+ name.append(toASCIILower(propertyName.characters()[i++]));
for (; i < length; ++i) {
- UChar c = propertyName.data()[i];
+ UChar c = propertyName.characters()[i];
if (!isASCIIUpper(c))
name.append(c);
else {
diff --git a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
index 8221fed..532b38b 100644
--- a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
@@ -57,9 +57,9 @@ static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState*, JSValue value)
return 0;
JSObject* object = asObject(value);
if (object->inherits(&JSCanvasGradient::s_info))
- return CanvasStyle::create(static_cast<JSCanvasGradient*>(object)->impl());
+ return CanvasStyle::createFromGradient(static_cast<JSCanvasGradient*>(object)->impl());
if (object->inherits(&JSCanvasPattern::s_info))
- return CanvasStyle::create(static_cast<JSCanvasPattern*>(object)->impl());
+ return CanvasStyle::createFromPattern(static_cast<JSCanvasPattern*>(object)->impl());
return 0;
}
diff --git a/WebCore/bindings/js/JSClipboardCustom.cpp b/WebCore/bindings/js/JSClipboardCustom.cpp
index 9bdffdb..2a8d309 100644
--- a/WebCore/bindings/js/JSClipboardCustom.cpp
+++ b/WebCore/bindings/js/JSClipboardCustom.cpp
@@ -37,10 +37,10 @@
#include "JSNode.h"
#include "Node.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <runtime/ArrayPrototype.h>
#include <runtime/Error.h>
#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
using namespace JSC;
diff --git a/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp b/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
index 4d7b6e1..263f2f9 100644
--- a/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
+++ b/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
@@ -28,7 +28,6 @@
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-#include "AtomicString.h"
#include "DOMApplicationCache.h"
#include "DOMWindow.h"
#include "Event.h"
@@ -37,6 +36,7 @@
#include "JSDOMWindowCustom.h"
#include "JSEvent.h"
#include "JSEventListener.h"
+#include <wtf/text/AtomicString.h>
using namespace JSC;
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 8220f51..96394eb 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -501,7 +501,7 @@ AtomicStringImpl* findAtomicString(const Identifier& identifier)
{
if (identifier.isNull())
return 0;
- UStringImpl* impl = identifier.ustring().rep();
+ StringImpl* impl = identifier.impl();
ASSERT(impl->existingHash());
return AtomicString::find(impl->characters(), impl->length(), impl->existingHash());
}
@@ -679,10 +679,9 @@ Frame* toDynamicFrame(ExecState* exec)
return asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
}
-bool processingUserGesture(ExecState* exec)
+bool processingUserGesture()
{
- Frame* frame = toDynamicFrame(exec);
- return frame && frame->script()->processingUserGesture(currentWorld(exec));
+ return ScriptController::processingUserGesture();
}
KURL completeURL(ExecState* exec, const String& relativeURL)
diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h
index 7086a89..749b0d7 100644
--- a/WebCore/bindings/js/JSDOMBinding.h
+++ b/WebCore/bindings/js/JSDOMBinding.h
@@ -313,7 +313,7 @@ namespace WebCore {
Frame* toLexicalFrame(JSC::ExecState*);
Frame* toDynamicFrame(JSC::ExecState*);
- bool processingUserGesture(JSC::ExecState*);
+ bool processingUserGesture();
KURL completeURL(JSC::ExecState*, const String& relativeURL);
inline JSC::JSValue jsString(JSC::ExecState* exec, const String& s)
@@ -339,7 +339,7 @@ namespace WebCore {
inline String ustringToString(const JSC::UString& u)
{
- return u.rep();
+ return u.impl();
}
inline JSC::UString stringToUString(const String& s)
@@ -349,17 +349,17 @@ namespace WebCore {
inline String identifierToString(const JSC::Identifier& i)
{
- return i.ustring().rep();
+ return i.impl();
}
inline AtomicString ustringToAtomicString(const JSC::UString& u)
{
- return AtomicString(u.rep());
+ return AtomicString(u.impl());
}
inline AtomicString identifierToAtomicString(const JSC::Identifier& identifier)
{
- return AtomicString(identifier.ustring().rep());
+ return AtomicString(identifier.impl());
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp b/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
index 2d41843..0194962 100644
--- a/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
+++ b/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
@@ -20,9 +20,9 @@
#include "config.h"
#include "JSDOMMimeTypeArray.h"
-#include "AtomicString.h"
#include "DOMMimeTypeArray.h"
#include "JSDOMMimeType.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp b/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
index abf3148..20ce5e5 100644
--- a/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
+++ b/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
@@ -20,9 +20,9 @@
#include "config.h"
#include "JSDOMPluginArray.h"
-#include "AtomicString.h"
#include "DOMPluginArray.h"
#include "JSDOMPlugin.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/bindings/js/JSDOMPluginCustom.cpp b/WebCore/bindings/js/JSDOMPluginCustom.cpp
index c8d187e..319cb3c 100644
--- a/WebCore/bindings/js/JSDOMPluginCustom.cpp
+++ b/WebCore/bindings/js/JSDOMPluginCustom.cpp
@@ -19,9 +19,9 @@
#include "config.h"
#include "JSDOMPlugin.h"
-#include "AtomicString.h"
#include "DOMPlugin.h"
#include "JSDOMMimeType.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/bindings/js/JSDOMStringMapCustom.cpp b/WebCore/bindings/js/JSDOMStringMapCustom.cpp
index 455c7b1..d1c1d69 100644
--- a/WebCore/bindings/js/JSDOMStringMapCustom.cpp
+++ b/WebCore/bindings/js/JSDOMStringMapCustom.cpp
@@ -26,8 +26,8 @@
#include "config.h"
#include "JSDOMStringMap.h"
-#include "AtomicString.h"
#include "DOMStringMap.h"
+#include <wtf/text/AtomicString.h>
using namespace JSC;
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 252ea93..2ad71f0 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -20,7 +20,6 @@
#include "config.h"
#include "JSDOMWindowCustom.h"
-#include "AtomicString.h"
#include "Chrome.h"
#include "DOMWindow.h"
#include "Document.h"
@@ -87,6 +86,7 @@
#include <runtime/JSFunction.h>
#include <runtime/JSObject.h>
#include <runtime/PrototypeFunction.h>
+#include <wtf/text/AtomicString.h>
using namespace JSC;
@@ -271,7 +271,7 @@ bool JSDOMWindow::getOwnPropertySlot(ExecState* exec, const Identifier& property
// allow window[1] or parent[1] etc. (#56983)
bool ok;
- unsigned i = propertyName.toArrayIndex(&ok);
+ unsigned i = propertyName.toArrayIndex(ok);
if (ok && i < impl()->frame()->tree()->childCount()) {
slot.setCustomIndex(this, i, indexGetter);
return true;
@@ -345,7 +345,7 @@ bool JSDOMWindow::getOwnPropertyDescriptor(ExecState* exec, const Identifier& pr
}
bool ok;
- unsigned i = propertyName.toArrayIndex(&ok);
+ unsigned i = propertyName.toArrayIndex(ok);
if (ok && i < impl()->frame()->tree()->childCount()) {
PropertySlot slot;
slot.setCustomIndex(this, i, indexGetter);
@@ -512,7 +512,7 @@ void JSDOMWindow::setLocation(ExecState* exec, JSValue value)
if (!protocolIsJavaScript(url) || allowsAccessFrom(exec)) {
// We want a new history item if this JS was called via a user gesture
- frame->redirectScheduler()->scheduleLocationChange(url, lexicalFrame->loader()->outgoingReferrer(), !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, processingUserGesture(exec));
+ frame->redirectScheduler()->scheduleLocationChange(url, lexicalFrame->loader()->outgoingReferrer(), !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, processingUserGesture());
}
}
@@ -606,47 +606,6 @@ JSValue JSDOMWindow::float32Array(ExecState* exec) const
return getDOMConstructor<JSFloat32ArrayConstructor>(exec, this);
}
-// Temporary aliases to keep current WebGL content working during transition period to TypedArray spec.
-// To be removed before WebGL spec is finalized. (FIXME)
-JSValue JSDOMWindow::webGLArrayBuffer(ExecState* exec) const
-{
- return getDOMConstructor<JSArrayBufferConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLByteArray(ExecState* exec) const
-{
- return getDOMConstructor<JSInt8ArrayConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLUnsignedByteArray(ExecState* exec) const
-{
- return getDOMConstructor<JSUint8ArrayConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLIntArray(ExecState* exec) const
-{
- return getDOMConstructor<JSInt32ArrayConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLUnsignedIntArray(ExecState* exec) const
-{
- return getDOMConstructor<JSUint32ArrayConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLShortArray(ExecState* exec) const
-{
- return getDOMConstructor<JSInt16ArrayConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLUnsignedShortArray(ExecState* exec) const
-{
- return getDOMConstructor<JSUint16ArrayConstructor>(exec, this);
-}
-
-JSValue JSDOMWindow::webGLFloatArray(ExecState* exec) const
-{
- return getDOMConstructor<JSFloat32ArrayConstructor>(exec, this);
-}
#endif
JSValue JSDOMWindow::xmlHttpRequest(ExecState* exec) const
@@ -724,10 +683,9 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF
// We'd have to resolve all those issues to pass the URL instead of "".
bool created;
- // We pass in the opener frame here so it can be used for looking up the frame name, in case the active frame
- // is different from the opener frame, and the name references a frame relative to the opener frame, for example
- // "_self" or "_parent".
- Frame* newFrame = lexicalFrame->loader()->createWindow(openerFrame->loader(), frameRequest, windowFeatures, created);
+ // We pass the opener frame for the lookupFrame in case the active frame is different from
+ // the opener frame, and the name references a frame relative to the opener frame.
+ Frame* newFrame = createWindow(lexicalFrame, openerFrame, frameRequest, windowFeatures, created);
if (!newFrame)
return 0;
@@ -742,7 +700,7 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF
if (!protocolIsJavaScript(url) || newWindow->allowsAccessFrom(exec)) {
KURL completedURL = url.isEmpty() ? KURL(ParsedURLString, "") : completeURL(exec, url);
- bool userGesture = processingUserGesture(exec);
+ bool userGesture = processingUserGesture();
if (created)
newFrame->loader()->changeLocation(completedURL, referrer, false, false, userGesture);
@@ -753,10 +711,10 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF
return newFrame;
}
-static bool domWindowAllowPopUp(Frame* activeFrame, ExecState* exec)
+static bool domWindowAllowPopUp(Frame* activeFrame)
{
ASSERT(activeFrame);
- if (activeFrame->script()->processingUserGesture(currentWorld(exec)))
+ if (ScriptController::processingUserGesture())
return true;
return DOMWindow::allowPopUp(activeFrame);
}
@@ -781,7 +739,7 @@ JSValue JSDOMWindow::open(ExecState* exec)
// Because FrameTree::find() returns true for empty strings, we must check for empty framenames.
// Otherwise, illegitimate window.open() calls with no name will pass right through the popup blocker.
- if (!domWindowAllowPopUp(dynamicFrame, exec) && (frameName.isEmpty() || !frame->tree()->find(frameName)))
+ if (!domWindowAllowPopUp(dynamicFrame) && (frameName.isEmpty() || !frame->tree()->find(frameName)))
return jsUndefined();
// Get the target frame for the special cases of _top and _parent. In those
@@ -805,7 +763,7 @@ JSValue JSDOMWindow::open(ExecState* exec)
const JSDOMWindow* targetedWindow = toJSDOMWindow(frame, currentWorld(exec));
if (!completedURL.isEmpty() && (!protocolIsJavaScript(completedURL) || (targetedWindow && targetedWindow->allowsAccessFrom(exec)))) {
- bool userGesture = processingUserGesture(exec);
+ bool userGesture = processingUserGesture();
// For whatever reason, Firefox uses the dynamicGlobalObject to
// determine the outgoingReferrer. We replicate that behavior
@@ -851,7 +809,7 @@ JSValue JSDOMWindow::showModalDialog(ExecState* exec)
if (!dynamicFrame)
return jsUndefined();
- if (!DOMWindow::canShowModalDialogNow(frame) || !domWindowAllowPopUp(dynamicFrame, exec))
+ if (!DOMWindow::canShowModalDialogNow(frame) || !domWindowAllowPopUp(dynamicFrame))
return jsUndefined();
HashMap<String, String> features;
diff --git a/WebCore/bindings/js/JSDataGridColumnListCustom.cpp b/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
index 5ee790c..cc41093 100644
--- a/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
+++ b/WebCore/bindings/js/JSDataGridColumnListCustom.cpp
@@ -29,10 +29,10 @@
#include "JSDataGridColumnList.h"
-#include "AtomicString.h"
#include "DataGridColumn.h"
#include "DataGridColumnList.h"
#include "JSDataGridColumn.h"
+#include <wtf/text/AtomicString.h>
using namespace JSC;
diff --git a/WebCore/bindings/js/JSDocumentCustom.cpp b/WebCore/bindings/js/JSDocumentCustom.cpp
index 7407e86..ec66cbd 100644
--- a/WebCore/bindings/js/JSDocumentCustom.cpp
+++ b/WebCore/bindings/js/JSDocumentCustom.cpp
@@ -88,7 +88,7 @@ void JSDocument::setLocation(ExecState* exec, JSValue value)
if (activeFrame)
str = activeFrame->document()->completeURL(str).string();
- bool userGesture = activeFrame->script()->processingUserGesture(currentWorld(exec));
+ bool userGesture = ScriptController::processingUserGesture();
frame->redirectScheduler()->scheduleLocationChange(str, activeFrame->loader()->outgoingReferrer(), !activeFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
}
diff --git a/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
index a504f25..64615b9 100644
--- a/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "JSHTMLAllCollection.h"
-#include "AtomicString.h"
#include "HTMLAllCollection.h"
#include "JSDOMBinding.h"
#include "JSHTMLAllCollection.h"
@@ -36,6 +35,7 @@
#include "StaticNodeList.h"
#include <runtime/JSValue.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
using namespace JSC;
@@ -74,7 +74,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
// Support for document.all(<index>) etc.
bool ok;
UString string = exec->argument(0).toString(exec);
- unsigned index = string.toUInt32(&ok, false);
+ unsigned index = Identifier::toUInt32(string, ok);
if (ok)
return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection->item(index)));
@@ -85,7 +85,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
// The second arg, if set, is the index of the item we want
bool ok;
UString string = exec->argument(0).toString(exec);
- unsigned index = exec->argument(1).toString(exec).toUInt32(&ok, false);
+ unsigned index = Identifier::toUInt32(exec->argument(1).toString(exec), ok);
if (ok) {
String pstr = ustringToString(string);
Node* node = collection->namedItem(pstr);
@@ -122,7 +122,7 @@ JSValue JSHTMLAllCollection::nameGetter(ExecState* exec, JSValue slotBase, const
JSValue JSHTMLAllCollection::item(ExecState* exec)
{
bool ok;
- uint32_t index = exec->argument(0).toString(exec).toUInt32(&ok, false);
+ uint32_t index = Identifier::toUInt32(exec->argument(0).toString(exec), ok);
if (ok)
return toJS(exec, globalObject(), impl()->item(index));
return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec)));
diff --git a/WebCore/bindings/js/JSHTMLCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
index b0cfd99..6b2f350 100644
--- a/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
@@ -20,7 +20,6 @@
#include "config.h"
#include "JSHTMLCollection.h"
-#include "AtomicString.h"
#include "HTMLCollection.h"
#include "HTMLOptionsCollection.h"
#include "HTMLAllCollection.h"
@@ -32,6 +31,7 @@
#include "Node.h"
#include "StaticNodeList.h"
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
using namespace JSC;
@@ -70,7 +70,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec)
// Support for document.all(<index>) etc.
bool ok;
UString string = exec->argument(0).toString(exec);
- unsigned index = string.toUInt32(&ok, false);
+ unsigned index = Identifier::toUInt32(string, ok);
if (ok)
return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection->item(index)));
@@ -81,7 +81,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec)
// The second arg, if set, is the index of the item we want
bool ok;
UString string = exec->argument(0).toString(exec);
- unsigned index = exec->argument(1).toString(exec).toUInt32(&ok, false);
+ unsigned index = Identifier::toUInt32(exec->argument(1).toString(exec), ok);
if (ok) {
String pstr = ustringToString(string);
Node* node = collection->namedItem(pstr);
@@ -118,7 +118,7 @@ JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, const Id
JSValue JSHTMLCollection::item(ExecState* exec)
{
bool ok;
- uint32_t index = exec->argument(0).toString(exec).toUInt32(&ok, false);
+ uint32_t index = Identifier::toUInt32(exec->argument(0).toString(exec), ok);
if (ok)
return toJS(exec, globalObject(), impl()->item(index));
return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec)));
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 0c891a3..06360fb 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -183,6 +183,9 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
if (injectedScript)
return InjectedScript(ScriptObject(scriptState, injectedScript));
+ if (!canAccessInspectedWindow(scriptState))
+ return InjectedScript();
+
ASSERT(!m_injectedScriptSource.isEmpty());
pair<long, ScriptObject> injectedScriptObject = injectScript(m_injectedScriptSource, scriptState);
globalObject->setInjectedScript(injectedScriptObject.second.jsObject());
diff --git a/WebCore/bindings/js/JSLocationCustom.cpp b/WebCore/bindings/js/JSLocationCustom.cpp
index 76005fa..99166cd 100644
--- a/WebCore/bindings/js/JSLocationCustom.cpp
+++ b/WebCore/bindings/js/JSLocationCustom.cpp
@@ -191,7 +191,7 @@ static void navigateIfAllowed(ExecState* exec, Frame* frame, const KURL& url, bo
return;
if (!protocolIsJavaScript(url) || allowsAccessFromFrame(exec, frame))
- frame->redirectScheduler()->scheduleLocationChange(url.string(), lexicalFrame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGesture(exec));
+ frame->redirectScheduler()->scheduleLocationChange(url.string(), lexicalFrame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGesture());
}
void JSLocation::setHref(ExecState* exec, JSValue value)
@@ -253,7 +253,7 @@ void JSLocation::setPort(ExecState* exec, JSValue value)
KURL url = frame->loader()->url();
// FIXME: Could make this a little less ugly if String provided a toUnsignedShort function.
const UString& portString = value.toString(exec);
- int port = charactersToInt(portString.data(), portString.size());
+ int port = charactersToInt(portString.characters(), portString.length());
if (port < 0 || port > 0xFFFF)
url.removePort();
else
@@ -325,7 +325,7 @@ JSValue JSLocation::reload(ExecState* exec)
return jsUndefined();
if (!protocolIsJavaScript(frame->loader()->url()))
- frame->redirectScheduler()->scheduleRefresh(processingUserGesture(exec));
+ frame->redirectScheduler()->scheduleRefresh(processingUserGesture());
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSMessagePortCustom.cpp b/WebCore/bindings/js/JSMessagePortCustom.cpp
index 227d6ed..06b4178 100644
--- a/WebCore/bindings/js/JSMessagePortCustom.cpp
+++ b/WebCore/bindings/js/JSMessagePortCustom.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "JSMessagePort.h"
-#include "AtomicString.h"
#include "Event.h"
#include "ExceptionCode.h"
#include "Frame.h"
@@ -36,6 +35,7 @@
#include "JSMessagePortCustom.h"
#include "MessagePort.h"
#include <runtime/Error.h>
+#include <wtf/text/AtomicString.h>
using namespace JSC;
diff --git a/WebCore/bindings/js/JSNodeListCustom.cpp b/WebCore/bindings/js/JSNodeListCustom.cpp
index dd59c15..c81914c 100644
--- a/WebCore/bindings/js/JSNodeListCustom.cpp
+++ b/WebCore/bindings/js/JSNodeListCustom.cpp
@@ -26,10 +26,10 @@
#include "config.h"
#include "JSNodeList.h"
-#include "AtomicString.h"
#include "JSNode.h"
#include "Node.h"
#include "NodeList.h"
+#include <wtf/text/AtomicString.h>
using namespace JSC;
@@ -39,7 +39,7 @@ namespace WebCore {
static EncodedJSValue JSC_HOST_CALL callNodeList(ExecState* exec)
{
bool ok;
- unsigned index = exec->argument(0).toString(exec).toUInt32(&ok);
+ unsigned index = Identifier::toUInt32(exec->argument(0).toString(exec), ok);
if (!ok)
return JSValue::encode(jsUndefined());
return JSValue::encode(toJS(exec, static_cast<JSNodeList*>(exec->callee())->impl()->item(index)));
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 98022d9..d318cbb 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -244,14 +244,26 @@ int ScriptController::eventHandlerLineNumber() const
return 0;
}
-bool ScriptController::processingUserGesture(DOMWrapperWorld* world) const
+bool ScriptController::processingUserGesture()
{
- if (m_allowPopupsFromPlugin || isJavaScriptAnchorNavigation())
+ ExecState* exec = JSMainThreadExecState::currentState();
+ Frame* frame = exec ? toDynamicFrame(exec) : 0;
+ // No script is running, so it is user-initiated unless the gesture stack
+ // explicitly says it is not.
+ if (!frame)
+ return UserGestureIndicator::getUserGestureState() != DefinitelyNotProcessingUserGesture;
+
+ // FIXME: We check the plugin popup flag and javascript anchor navigation
+ // from the dynamic frame becuase they should only be initiated on the
+ // dynamic frame in which execution began if they do happen.
+ ScriptController* scriptController = frame->script();
+ ASSERT(scriptController);
+ if (scriptController->allowPopupsFromPlugin() || scriptController->isJavaScriptAnchorNavigation())
return true;
// If a DOM event is being processed, check that it was initiated by the user
// and that it is in the whitelist of event types allowed to generate pop-ups.
- if (JSDOMWindowShell* shell = existingWindowShell(world))
+ if (JSDOMWindowShell* shell = scriptController->existingWindowShell(currentWorld(exec)))
if (Event* event = shell->window()->currentEvent())
return event->fromUserGesture();
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index 8dae637..2ec71b9 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -110,7 +110,7 @@ public:
int eventHandlerLineNumber() const;
void setProcessingTimerCallback(bool b) { m_processingTimerCallback = b; }
- bool processingUserGesture(DOMWrapperWorld*) const;
+ static bool processingUserGesture();
bool anyPageIsProcessingUserGesture() const;
static bool canAccessFromCurrentOrigin(Frame*);
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index d71034b..cd80de4 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -268,7 +268,7 @@ void ScriptDebugServer::dispatchDidContinue(ScriptDebugListener* listener)
void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source, ScriptWorldType worldType)
{
- String sourceID = ustringToString(JSC::UString::from(source.provider()->asID()));
+ String sourceID = ustringToString(JSC::UString::number(source.provider()->asID()));
String url = ustringToString(source.provider()->url());
String data = ustringToString(JSC::UString(source.data(), source.length()));
int firstLine = source.firstLine();
@@ -497,6 +497,10 @@ void ScriptDebugServer::returnEvent(const DebuggerCallFrame& debuggerCallFrame,
m_currentCallFrame->update(debuggerCallFrame, sourceID, lineNumber);
pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject()));
+ // detach may have been called during pauseIfNeeded
+ if (!m_currentCallFrame)
+ return;
+
// Treat stepping over a return statement like stepping out.
if (m_currentCallFrame == m_pauseOnCallFrame)
m_pauseOnCallFrame = m_currentCallFrame->caller();
diff --git a/WebCore/bindings/js/ScriptProfile.cpp b/WebCore/bindings/js/ScriptProfile.cpp
index 1fbd040..0eb2814 100644
--- a/WebCore/bindings/js/ScriptProfile.cpp
+++ b/WebCore/bindings/js/ScriptProfile.cpp
@@ -84,8 +84,8 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const JSC::ProfileNod
const ProfileNodesList& children = node->children();
ProfileNodesList::const_iterator end = children.end();
for (ProfileNodesList::const_iterator iter = children.begin(); iter != end; ++iter)
- childrenArray->push(buildInspectorObjectFor(iter->get()));
- result->set("children", childrenArray);
+ childrenArray->pushObject(buildInspectorObjectFor(iter->get()));
+ result->setArray("children", childrenArray);
return result;
}
diff --git a/WebCore/bindings/js/ScriptString.h b/WebCore/bindings/js/ScriptString.h
index 558ad33..7401818 100644
--- a/WebCore/bindings/js/ScriptString.h
+++ b/WebCore/bindings/js/ScriptString.h
@@ -51,7 +51,7 @@ public:
const JSC::UString& ustring() const { return m_str; }
bool isNull() const { return m_str.isNull(); }
- size_t size() const { return m_str.size(); }
+ size_t size() const { return m_str.length(); }
ScriptString& operator=(const char* s)
{
diff --git a/WebCore/bindings/js/ScriptValue.cpp b/WebCore/bindings/js/ScriptValue.cpp
index 23934cd..a58e0c7 100644
--- a/WebCore/bindings/js/ScriptValue.cpp
+++ b/WebCore/bindings/js/ScriptValue.cpp
@@ -109,7 +109,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, J
return InspectorBasicValue::create(value.uncheckedGetNumber());
if (value.isString()) {
UString s = value.getString(scriptState);
- return InspectorString::create(String(s.data(), s.size()));
+ return InspectorString::create(String(s.characters(), s.length()));
}
if (value.isObject()) {
if (isJSArray(&scriptState->globalData(), value)) {
@@ -123,7 +123,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, J
ASSERT_NOT_REACHED();
elementValue = InspectorValue::null();
}
- inspectorArray->push(elementValue);
+ inspectorArray->pushValue(elementValue);
}
return inspectorArray;
}
@@ -139,7 +139,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ScriptState* scriptState, J
ASSERT_NOT_REACHED();
inspectorValue = InspectorValue::null();
}
- inspectorObject->set(String(name.data(), name.size()), inspectorValue);
+ inspectorObject->setValue(String(name.characters(), name.length()), inspectorValue);
}
return inspectorObject;
}
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index 6d6fa21..00ec25f 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -27,9 +27,11 @@
#include "config.h"
#include "SerializedScriptValue.h"
+#include "Blob.h"
#include "File.h"
#include "FileList.h"
#include "ImageData.h"
+#include "JSBlob.h"
#include "JSDOMGlobalObject.h"
#include "JSFile.h"
#include "JSFileList.h"
@@ -147,26 +149,86 @@ private:
unsigned m_length;
};
+class SerializedBlob : public SharedSerializedData {
+public:
+ static PassRefPtr<SerializedBlob> create(const Blob* blob)
+ {
+ return adoptRef(new SerializedBlob(blob));
+ }
+
+ const KURL& url() const { return m_url; }
+ const String& type() const { return m_type; }
+ unsigned long long size() const { return m_size; }
+
+private:
+ SerializedBlob(const Blob* blob)
+ : m_url(blob->url().copy())
+ , m_type(blob->type().crossThreadString())
+ , m_size(blob->size())
+ {
+ }
+
+ KURL m_url;
+ String m_type;
+ unsigned long long m_size;
+};
+
+class SerializedFile : public SharedSerializedData {
+public:
+ static PassRefPtr<SerializedFile> create(const File* file)
+ {
+ return adoptRef(new SerializedFile(file));
+ }
+
+ const String& path() const { return m_path; }
+ const KURL& url() const { return m_url; }
+ const String& type() const { return m_type; }
+
+private:
+ SerializedFile(const File* file)
+ : m_path(file->path().crossThreadString())
+ , m_url(file->url().copy())
+ , m_type(file->type().crossThreadString())
+ {
+ }
+
+ String m_path;
+ KURL m_url;
+ String m_type;
+};
+
class SerializedFileList : public SharedSerializedData {
public:
+ struct FileData {
+ String path;
+ KURL url;
+ String type;
+ };
+
static PassRefPtr<SerializedFileList> create(const FileList* list)
{
return adoptRef(new SerializedFileList(list));
}
unsigned length() const { return m_files.size(); }
- const String& item(unsigned idx) { return m_files[idx]; }
+ const FileData& item(unsigned idx) { return m_files[idx]; }
private:
SerializedFileList(const FileList* list)
{
unsigned length = list->length();
m_files.reserveCapacity(length);
- for (unsigned i = 0; i < length; i++)
- m_files.append(list->item(i)->path().crossThreadString());
+ for (unsigned i = 0; i < length; i++) {
+ File* file = list->item(i);
+ FileData fileData;
+ fileData.path = file->path().crossThreadString();
+ fileData.url = file->url().copy();
+ fileData.type = file->type().crossThreadString();
+ m_files.append(fileData);
+ }
}
- Vector<String> m_files;
+ Vector<FileData> m_files;
};
class SerializedImageData : public SharedSerializedData {
@@ -217,9 +279,15 @@ SerializedScriptValueData::SerializedScriptValueData(const ImageData* imageData)
{
}
+SerializedScriptValueData::SerializedScriptValueData(const Blob* blob)
+ : m_type(BlobType)
+ , m_sharedData(SerializedBlob::create(blob))
+{
+}
+
SerializedScriptValueData::SerializedScriptValueData(const File* file)
: m_type(FileType)
- , m_string(file->path().crossThreadString())
+ , m_sharedData(SerializedFile::create(file))
{
}
@@ -233,6 +301,16 @@ SerializedObject* SharedSerializedData::asObject()
return static_cast<SerializedObject*>(this);
}
+SerializedBlob* SharedSerializedData::asBlob()
+{
+ return static_cast<SerializedBlob*>(this);
+}
+
+SerializedFile* SharedSerializedData::asFile()
+{
+ return static_cast<SerializedFile*>(this);
+}
+
SerializedFileList* SharedSerializedData::asFileList()
{
return static_cast<SerializedFileList*>(this);
@@ -570,6 +648,8 @@ struct SerializingTreeWalker : public BaseWalker {
JSObject* obj = asObject(value);
if (obj->inherits(&JSFile::s_info))
return SerializedScriptValueData(toFile(obj));
+ if (obj->inherits(&JSBlob::s_info))
+ return SerializedScriptValueData(toBlob(obj));
if (obj->inherits(&JSFileList::s_info))
return SerializedScriptValueData(toFileList(obj));
if (obj->inherits(&JSImageData::s_info))
@@ -736,12 +816,21 @@ struct DeserializingTreeWalker : public BaseWalker {
return jsNumber(m_exec, value.asDouble());
case SerializedScriptValueData::DateType:
return new (m_exec) DateInstance(m_exec, m_globalObject->dateStructure(), value.asDouble());
+ case SerializedScriptValueData::BlobType: {
+ if (!m_isDOMGlobalObject)
+ return jsNull();
+ SerializedBlob* serializedBlob = value.asBlob();
+ ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
+ ASSERT(scriptExecutionContext);
+ return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), Blob::create(scriptExecutionContext, serializedBlob->url(), serializedBlob->type(), serializedBlob->size()));
+ }
case SerializedScriptValueData::FileType: {
if (!m_isDOMGlobalObject)
return jsNull();
+ SerializedFile* serializedFile = value.asFile();
ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
ASSERT(scriptExecutionContext);
- return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), File::create(scriptExecutionContext, value.asString().crossThreadString()));
+ return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), File::create(scriptExecutionContext, serializedFile->path(), serializedFile->url(), serializedFile->type()));
}
case SerializedScriptValueData::FileListType: {
if (!m_isDOMGlobalObject)
@@ -751,8 +840,10 @@ struct DeserializingTreeWalker : public BaseWalker {
unsigned length = serializedFileList->length();
ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
ASSERT(scriptExecutionContext);
- for (unsigned i = 0; i < length; i++)
- result->append(File::create(scriptExecutionContext, serializedFileList->item(i)));
+ for (unsigned i = 0; i < length; i++) {
+ const SerializedFileList::FileData& fileData = serializedFileList->item(i);
+ result->append(File::create(scriptExecutionContext, fileData.path, fileData.url, fileData.type));
+ }
return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get());
}
case SerializedScriptValueData::ImageDataType: {
@@ -920,6 +1011,7 @@ struct TeardownTreeWalker {
case SerializedScriptValueData::NumberType:
case SerializedScriptValueData::DateType:
case SerializedScriptValueData::EmptyType:
+ case SerializedScriptValueData::BlobType:
case SerializedScriptValueData::FileType:
case SerializedScriptValueData::FileListType:
case SerializedScriptValueData::ImageDataType:
diff --git a/WebCore/bindings/js/SerializedScriptValue.h b/WebCore/bindings/js/SerializedScriptValue.h
index 93bd0de..2b7d222 100644
--- a/WebCore/bindings/js/SerializedScriptValue.h
+++ b/WebCore/bindings/js/SerializedScriptValue.h
@@ -33,10 +33,13 @@ typedef const struct OpaqueJSContext* JSContextRef;
typedef const struct OpaqueJSValue* JSValueRef;
namespace WebCore {
+ class Blob;
class File;
class FileList;
class ImageData;
class SerializedArray;
+ class SerializedBlob;
+ class SerializedFile;
class SerializedFileList;
class SerializedImageData;
class SerializedObject;
@@ -46,6 +49,8 @@ namespace WebCore {
virtual ~SharedSerializedData() { }
SerializedArray* asArray();
SerializedObject* asObject();
+ SerializedBlob* asBlob();
+ SerializedFile* asFile();
SerializedFileList* asFileList();
SerializedImageData* asImageData();
};
@@ -62,6 +67,7 @@ namespace WebCore {
ObjectType,
ArrayType,
StringType,
+ BlobType,
FileType,
FileListType,
ImageDataType
@@ -84,10 +90,11 @@ namespace WebCore {
explicit SerializedScriptValueData(const String& string)
: m_type(StringType)
- , m_string(string.crossThreadString()) // FIXME: Should be able to just share the Rep
+ , m_string(string.crossThreadString()) // FIXME: Should be able to just share the StringImpl
{
}
-
+
+ explicit SerializedScriptValueData(const Blob*);
explicit SerializedScriptValueData(const File*);
explicit SerializedScriptValueData(const FileList*);
explicit SerializedScriptValueData(const ImageData*);
@@ -122,7 +129,7 @@ namespace WebCore {
String asString() const
{
- ASSERT(m_type == StringType || m_type == FileType);
+ ASSERT(m_type == StringType);
return m_string;
}
@@ -140,6 +147,20 @@ namespace WebCore {
return m_sharedData->asArray();
}
+ SerializedBlob* asBlob() const
+ {
+ ASSERT(m_type == BlobType);
+ ASSERT(m_sharedData);
+ return m_sharedData->asBlob();
+ }
+
+ SerializedFile* asFile() const
+ {
+ ASSERT(m_type == FileType);
+ ASSERT(m_sharedData);
+ return m_sharedData->asFile();
+ }
+
SerializedFileList* asFileList() const
{
ASSERT(m_type == FileListType);
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm
index 37874ac..a26c315 100644
--- a/WebCore/bindings/objc/WebScriptObject.mm
+++ b/WebCore/bindings/objc/WebScriptObject.mm
@@ -557,7 +557,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
if (value.isString()) {
ExecState* exec = rootObject->globalObject()->globalExec();
const UString& u = asString(value)->value(exec);
- return [NSString stringWithCharacters:u.data() length:u.size()];
+ return [NSString stringWithCharacters:u.characters() length:u.length()];
}
if (value.isNumber())
diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index ff63615..6bafb1e 100644
--- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -149,6 +149,7 @@ sub GetClassName
return "WebDOMObject" if $name eq "DOMObject";
return "bool" if $name eq "boolean";
return $name if $codeGenerator->IsPrimitiveType($name);
+ return "WebDOMCustomVoidCallback" if $name eq "VoidCallback";
return "WebDOM$name";
}
@@ -284,7 +285,7 @@ sub AddIncludesForType
return if $type =~ /Constructor/;
if ($codeGenerator->IsStringType($type)) {
- $implIncludes{"AtomicString.h"} = 1;
+ $implIncludes{"wtf/text/AtomicString.h"} = 1;
$implIncludes{"KURL.h"} = 1;
$implIncludes{"WebDOMString.h"} = 1;
return;
@@ -304,6 +305,11 @@ sub AddIncludesForType
$implIncludes{"SerializedScriptValue.h"} = 1;
return;
}
+
+ if ($type eq "VoidCallback") {
+ $implIncludes{"WebDOMCustomVoidCallback.h"} = 1;
+ return;
+ }
$implIncludes{"Node.h"} = 1 if $type eq "NodeList";
$implIncludes{"CSSMutableStyleDeclaration.h"} = 1 if $type eq "CSSStyleDeclaration";
@@ -379,9 +385,10 @@ sub GenerateHeader
push(@headerContent, " $className();\n");
push(@headerContent, " explicit $className($implClassNameWithNamespace*);\n");
- # Copy constructor on classes which have the d-ptr
+ # Copy constructor and assignment operator on classes which have the d-ptr
if ($parentName eq "WebDOMObject") {
push(@headerContent, " $className(const $className&);\n");
+ push(@headerContent, " ${className}& operator=(const $className&);\n");
}
# Destructor
@@ -634,6 +641,13 @@ sub GenerateImplementation
push(@implContent, " m_impl = copy.impl() ? new ${className}Private(copy.impl()) : 0;\n");
push(@implContent, "}\n\n");
+ push(@implContent, "${className}& ${className}::operator\=(const ${className}& copy)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " delete m_impl;\n");
+ push(@implContent, " m_impl = copy.impl() ? new ${className}Private(copy.impl()) : 0;\n");
+ push(@implContent, " return *this;\n");
+ push(@implContent, "}\n\n");
+
push(@implContent, "$implClassNameWithNamespace* ${className}::impl() const\n");
push(@implContent, "{\n");
push(@implContent, " return m_impl ? m_impl->impl.get() : 0;\n");
@@ -774,9 +788,6 @@ sub GenerateImplementation
my $parameterIndex = 0;
- # FIXME: Handle Callback support, we're just passing 0 as ScriptExecutionContext for now.
- push(@parameterNames, "0") if ($dataNode->extendedAttributes->{"Callback"});
-
my $functionSig = "$returnType $className\:\:$functionName(";
foreach my $param (@{$function->parameters}) {
my $paramName = $param->name;
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 200a95d..0b18d95 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -426,7 +426,7 @@ sub GenerateGetOwnPropertySlotBody
if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
push(@getOwnPropertySlotImpl, " bool ok;\n");
- push(@getOwnPropertySlotImpl, " unsigned index = propertyName.toUInt32(&ok, false);\n");
+ push(@getOwnPropertySlotImpl, " unsigned index = propertyName.toUInt32(ok);\n");
# If the item function returns a string then we let the ConvertNullStringTo handle the cases
# where the index is out of range.
@@ -450,9 +450,9 @@ sub GenerateGetOwnPropertySlotBody
push(@getOwnPropertySlotImpl, " return true;\n");
push(@getOwnPropertySlotImpl, " }\n");
if ($inlined) {
- $headerIncludes{"AtomicString.h"} = 1;
+ $headerIncludes{"wtf/text/AtomicString.h"} = 1;
} else {
- $implIncludes{"AtomicString.h"} = 1;
+ $implIncludes{"wtf/text/AtomicString.h"} = 1;
}
}
@@ -520,7 +520,7 @@ sub GenerateGetOwnPropertyDescriptorBody
if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
push(@getOwnPropertyDescriptorImpl, " bool ok;\n");
- push(@getOwnPropertyDescriptorImpl, " unsigned index = propertyName.toUInt32(&ok, false);\n");
+ push(@getOwnPropertyDescriptorImpl, " unsigned index = propertyName.toUInt32(ok);\n");
push(@getOwnPropertyDescriptorImpl, " if (ok && index < static_cast<$implClassName*>(impl())->length()) {\n");
if ($dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
# Assume that if there's a setter, the index will be writable
@@ -551,9 +551,9 @@ sub GenerateGetOwnPropertyDescriptorBody
push(@getOwnPropertyDescriptorImpl, " return true;\n");
push(@getOwnPropertyDescriptorImpl, " }\n");
if ($inlined) {
- $headerIncludes{"AtomicString.h"} = 1;
+ $headerIncludes{"wtf/text/AtomicString.h"} = 1;
} else {
- $implIncludes{"AtomicString.h"} = 1;
+ $implIncludes{"wtf/text/AtomicString.h"} = 1;
}
}
@@ -1135,7 +1135,7 @@ sub GenerateParametersCheckExpression
# these are acceptable values for a DOMString argument (any Object can
# be converted to a string via .toString).
push(@andExpression, "(${value}.isNull() || ${value}.isUndefined() || ${value}.isString() || ${value}.isObject())") if $codeGenerator->IsStringType($type);
- push(@andExpression, "(${value}.isNull() || ${value}.isObject() && asObject(${value})->inherits(&JS${type}::s_info))") unless IsNativeType($type);
+ push(@andExpression, "(${value}.isNull() || (${value}.isObject() && asObject(${value})->inherits(&JS${type}::s_info)))") unless IsNativeType($type);
$parameterIndex++;
}
@@ -1648,7 +1648,7 @@ sub GenerateImplementation
push(@implContent, "{\n");
if ($dataNode->extendedAttributes->{"HasCustomIndexSetter"}) {
push(@implContent, " bool ok;\n");
- push(@implContent, " unsigned index = propertyName.toUInt32(&ok, false);\n");
+ push(@implContent, " unsigned index = propertyName.toUInt32(ok);\n");
push(@implContent, " if (ok) {\n");
push(@implContent, " indexSetter(exec, index, value);\n");
push(@implContent, " return;\n");
@@ -1993,7 +1993,7 @@ sub GenerateImplementation
if ($function->signature->extendedAttributes->{"NeedsUserGestureCheck"}) {
$functionString .= ", " if $paramIndex;
- $functionString .= "processingUserGesture(exec)";
+ $functionString .= "processingUserGesture()";
$paramIndex++;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 4da8150..ebbcf8b 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -172,7 +172,7 @@ sub AddIncludesForType
if ($type eq "Plugin" or $type eq "PluginArray" or $type eq "MimeTypeArray") {
# So we can get String -> AtomicString conversion for namedItem().
- $implIncludes{"AtomicString.h"} = 1;
+ $implIncludes{"wtf/text/AtomicString.h"} = 1;
}
}
@@ -231,7 +231,7 @@ sub GenerateHeader
my %headerInclues = ();
$headerIncludes{"$podType.h"} = 1 if $podType and ($podType ne "double" and $podType ne "float" and $podType ne "RGBA32");
- $headerIncludes{"StringHash.h"} = 1;
+ $headerIncludes{"wtf/text/StringHash.h"} = 1;
$headerIncludes{"WrapperTypeInfo.h"} = 1;
my $headerClassInclude = GetHeaderClassInclude($implClassName);
$headerIncludes{$headerClassInclude} = 1 if $headerClassInclude ne "";
@@ -275,6 +275,13 @@ END
END
}
+ if ($implClassName eq "HTMLDocument") {
+ push(@headerContent, <<END);
+ static v8::Local<v8::Object> WrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl);
+ static v8::Handle<v8::Value> GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key);
+END
+ }
+
my @enabledAtRuntime;
foreach my $function (@{$dataNode->functions}) {
my $name = $function->signature->name;
@@ -362,9 +369,6 @@ sub GetInternalFields
if (IsSubType($dataNode, "Document")) {
push(@customInternalFields, "implementationIndex");
- if ($name eq "HTMLDocument") {
- push(@customInternalFields, ("markerIndex", "shadowIndex"));
- }
} elsif ($name eq "DOMWindow") {
push(@customInternalFields, "enteredIsolatedWorldIndex");
}
@@ -401,7 +405,6 @@ END
my %indexerSpecialCases = (
"Storage" => 1,
"HTMLAppletElement" => 1,
- "HTMLDocument" => 1,
"HTMLEmbedElement" => 1,
"HTMLObjectElement" => 1
);
@@ -428,6 +431,10 @@ sub GenerateHeaderNamedAndIndexedPropertyAccessors
if ($interfaceName eq "HTMLSelectElement" || $interfaceName eq "HTMLAppletElement" || $interfaceName eq "HTMLEmbedElement" || $interfaceName eq "HTMLObjectElement") {
$hasCustomNamedGetter = 1;
}
+ if ($interfaceName eq "HTMLDocument") {
+ $hasCustomNamedGetter = 0;
+ $hasCustomIndexedGetter = 0;
+ }
my $isIndexerSpecialCase = exists $indexerSpecialCases{$interfaceName};
if ($hasCustomIndexedGetter || $isIndexerSpecialCase) {
@@ -456,7 +463,7 @@ END
static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&);
END
}
- if ($hasCustomDeleters || $interfaceName eq "HTMLDocument") {
+ if ($hasCustomDeleters) {
push(@headerContent, <<END);
static v8::Handle<v8::Boolean> namedPropertyDeleter(v8::Local<v8::String>, const v8::AccessorInfo&);
END
@@ -1503,6 +1510,10 @@ sub GenerateImplementationNamedPropertyGetter
$hasCustomGetter = 1;
}
+ if ($interfaceName eq "HTMLDocument") {
+ $hasCustomGetter = 0;
+ }
+
my $hasGetter = $dataNode->extendedAttributes->{"HasNameGetter"} || $hasCustomGetter || $namedPropertyGetter;
if (!$hasGetter) {
return;
@@ -1518,8 +1529,7 @@ END
}
my $hasSetter = $dataNode->extendedAttributes->{"DelegatingPutFunction"};
- # FIXME: Try to remove hard-coded HTMLDocument reference by aligning handling of document.all with JSC bindings.
- my $hasDeleter = $dataNode->extendedAttributes->{"CustomDeleteProperty"} || $interfaceName eq "HTMLDocument";
+ my $hasDeleter = $dataNode->extendedAttributes->{"CustomDeleteProperty"};
my $hasEnumerator = $dataNode->extendedAttributes->{"CustomGetPropertyNames"};
my $setOn = "Instance";
@@ -2004,6 +2014,11 @@ END
instance->SetAccessCheckCallbacks(V8DOMWindow::namedSecurityCheck, V8DOMWindow::indexedSecurityCheck, v8::External::Wrap(&V8DOMWindow::info), false);
END
}
+ if ($interfaceName eq "HTMLDocument") {
+ push(@implContent, <<END);
+ desc->SetHiddenPrototype(true);
+END
+ }
if ($interfaceName eq "Location") {
push(@implContent, <<END);
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp
index 7235793..a58da40 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp
@@ -24,7 +24,6 @@
#include "WebDOMTestCallback.h"
-#include "AtomicString.h"
#include "Class1.h"
#include "Class2.h"
#include "Class3.h"
@@ -35,6 +34,7 @@
#include "WebDOMClass3.h"
#include "WebDOMString.h"
#include "WebExceptionHandler.h"
+#include "wtf/text/AtomicString.h"
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
@@ -65,6 +65,13 @@ WebDOMTestCallback::WebDOMTestCallback(const WebDOMTestCallback& copy)
m_impl = copy.impl() ? new WebDOMTestCallbackPrivate(copy.impl()) : 0;
}
+WebDOMTestCallback& WebDOMTestCallback::operator=(const WebDOMTestCallback& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestCallbackPrivate(copy.impl()) : 0;
+ return *this;
+}
+
WebCore::TestCallback* WebDOMTestCallback::impl() const
{
return m_impl ? m_impl->impl.get() : 0;
@@ -81,7 +88,7 @@ bool WebDOMTestCallback::callbackWithClass1Param(const WebDOMClass1& class1Param
if (!impl())
return false;
- return impl()->callbackWithClass1Param(0, toWebCore(class1Param));
+ return impl()->callbackWithClass1Param(toWebCore(class1Param));
}
bool WebDOMTestCallback::callbackWithClass2Param(const WebDOMClass2& class2Param, const WebDOMString& strArg)
@@ -89,7 +96,7 @@ bool WebDOMTestCallback::callbackWithClass2Param(const WebDOMClass2& class2Param
if (!impl())
return false;
- return impl()->callbackWithClass2Param(0, toWebCore(class2Param), strArg);
+ return impl()->callbackWithClass2Param(toWebCore(class2Param), strArg);
}
int WebDOMTestCallback::callbackWithNonBoolReturnType(const WebDOMClass3& class3Param)
@@ -97,7 +104,7 @@ int WebDOMTestCallback::callbackWithNonBoolReturnType(const WebDOMClass3& class3
if (!impl())
return 0;
- return impl()->callbackWithNonBoolReturnType(0, toWebCore(class3Param));
+ return impl()->callbackWithNonBoolReturnType(toWebCore(class3Param));
}
WebCore::TestCallback* toWebCore(const WebDOMTestCallback& wrapper)
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h
index 3fe6837..a4d130e 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h
@@ -43,6 +43,7 @@ public:
WebDOMTestCallback();
explicit WebDOMTestCallback(WebCore::TestCallback*);
WebDOMTestCallback(const WebDOMTestCallback&);
+ WebDOMTestCallback& operator=(const WebDOMTestCallback&);
~WebDOMTestCallback();
bool callbackWithClass1Param(const WebDOMClass1& class1Param);
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
index 0436e13..7fa4af3 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
@@ -56,6 +56,13 @@ WebDOMTestInterface::WebDOMTestInterface(const WebDOMTestInterface& copy)
m_impl = copy.impl() ? new WebDOMTestInterfacePrivate(copy.impl()) : 0;
}
+WebDOMTestInterface& WebDOMTestInterface::operator=(const WebDOMTestInterface& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestInterfacePrivate(copy.impl()) : 0;
+ return *this;
+}
+
WebCore::TestInterface* WebDOMTestInterface::impl() const
{
return m_impl ? m_impl->impl.get() : 0;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
index 4e7af6d..ca20c4e 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
@@ -38,6 +38,7 @@ public:
WebDOMTestInterface();
explicit WebDOMTestInterface(WebCore::TestInterface*);
WebDOMTestInterface(const WebDOMTestInterface&);
+ WebDOMTestInterface& operator=(const WebDOMTestInterface&);
~WebDOMTestInterface();
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index 20de4fc..882e633 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -21,7 +21,6 @@
#include "config.h"
#include "WebDOMTestObj.h"
-#include "AtomicString.h"
#include "HTMLNames.h"
#include "IDBKey.h"
#include "KURL.h"
@@ -31,6 +30,7 @@
#include "WebDOMString.h"
#include "WebExceptionHandler.h"
#include "WebNativeEventListener.h"
+#include "wtf/text/AtomicString.h"
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
@@ -61,6 +61,13 @@ WebDOMTestObj::WebDOMTestObj(const WebDOMTestObj& copy)
m_impl = copy.impl() ? new WebDOMTestObjPrivate(copy.impl()) : 0;
}
+WebDOMTestObj& WebDOMTestObj::operator=(const WebDOMTestObj& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestObjPrivate(copy.impl()) : 0;
+ return *this;
+}
+
WebCore::TestObj* WebDOMTestObj::impl() const
{
return m_impl ? m_impl->impl.get() : 0;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index c3b65ca..2fedf41 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -40,6 +40,7 @@ public:
WebDOMTestObj();
explicit WebDOMTestObj(WebCore::TestObj*);
WebDOMTestObj(const WebDOMTestObj&);
+ WebDOMTestObj& operator=(const WebDOMTestObj&);
~WebDOMTestObj();
enum {
@@ -104,12 +105,18 @@ public:
int customAttr() const;
void setCustomAttr(int);
WebDOMString scriptStringAttr() const;
+#if ENABLE(Condition1)
int conditionalAttr1() const;
void setConditionalAttr1(int);
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
int conditionalAttr2() const;
void setConditionalAttr2(int);
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
int conditionalAttr3() const;
void setConditionalAttr3(int);
+#endif
int description() const;
int id() const;
void setId(int);
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
index 8f69a9f..e547d35 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
@@ -56,7 +56,7 @@ gpointer kit(WebCore::TestCallback* obj)
} // namespace WebKit //
gboolean
-webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param)
+webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
@@ -69,7 +69,7 @@ webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self,
}
gboolean
-webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, gchar* str_arg)
+webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, const gchar* str_arg)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
@@ -84,7 +84,7 @@ webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self,
}
glong
-webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param)
+webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h
index cfc883d..4f0ac91 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.h
@@ -47,13 +47,13 @@ WEBKIT_API GType
webkit_dom_test_callback_get_type (void);
WEBKIT_API gboolean
-webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param);
+webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param);
WEBKIT_API gboolean
-webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, gchar* str_arg);
+webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, const gchar* str_arg);
WEBKIT_API glong
-webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param);
+webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param);
G_END_DECLS
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index 8cad49d..56c6e14 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -62,7 +62,7 @@ webkit_dom_test_obj_void_method(WebKitDOMTestObj* self)
}
void
-webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
+webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, const gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -86,7 +86,7 @@ webkit_dom_test_obj_int_method(WebKitDOMTestObj* self)
}
glong
-webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
+webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, const gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
@@ -100,19 +100,19 @@ webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg,
return res;
}
-WebKitDOMTestObj*
+WebKitDOMTestObj*
webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethod());
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
-WebKitDOMTestObj*
-webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
+WebKitDOMTestObj*
+webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, const gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
@@ -123,12 +123,12 @@ webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg,
WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
g_return_val_if_fail(converted_obj_arg, 0);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg));
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
-WebKitDOMTestObj*
-webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg)
+WebKitDOMTestObj*
+webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
@@ -139,12 +139,12 @@ webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar*
WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
g_return_val_if_fail(converted_obj_arg, 0);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(converted_str_arg, converted_obj_arg));
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
-WebKitDOMTestObj*
-webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error)
+WebKitDOMTestObj*
+webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
@@ -161,12 +161,12 @@ webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* s
WebCore::getExceptionCodeDescription(ec, ecdesc);
g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
}
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
void
-webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg)
+webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -178,7 +178,7 @@ webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerialized
}
void
-webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key)
+webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -238,21 +238,21 @@ webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self,
}
void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg)
+webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg, gboolean isUserGesture)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- item->withDynamicFrameAndUserGesture(int_arg);
+ item->withDynamicFrameAndUserGesture(int_arg, false);
}
void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg)
+webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg, gboolean isUserGesture)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg);
+ item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg, false);
}
void
@@ -264,14 +264,14 @@ webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
item->withScriptStateVoid();
}
-WebKitDOMTestObj*
+WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObj());
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
@@ -290,7 +290,7 @@ webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GEr
}
}
-WebKitDOMTestObj*
+WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GError **error)
{
WebCore::JSMainThreadNullState state;
@@ -303,7 +303,7 @@ webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GErr
WebCore::getExceptionCodeDescription(ec, ecdesc);
g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
}
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
@@ -353,24 +353,24 @@ webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self)
return res;
}
-gchar*
+gchar*
webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->readOnlyStringAttr());
+ gchar* res = convertToUTF8String(item->readOnlyStringAttr());
return res;
}
-WebKitDOMTestObj*
+WebKitDOMTestObj*
webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->readOnlyTestObjAttr());
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
@@ -431,18 +431,18 @@ webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64
item->setUnsignedLongLongAttr(value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->stringAttr());
+ gchar* res = convertToUTF8String(item->stringAttr());
return res;
}
void
-webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -452,19 +452,19 @@ webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, gchar* value)
item->setStringAttr(converted_value);
}
-WebKitDOMTestObj*
+WebKitDOMTestObj*
webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->testObjAttr());
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
void
-webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
+webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -475,19 +475,19 @@ webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj*
item->setTestObjAttr(converted_value);
}
-WebKitDOMTestObj*
+WebKitDOMTestObj*
webkit_dom_test_obj_get_xml_obj_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->xmlObjAttr());
- WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
+ WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get()));
return res;
}
void
-webkit_dom_test_obj_set_xml_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
+webkit_dom_test_obj_set_xml_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -517,18 +517,18 @@ webkit_dom_test_obj_set_create(WebKitDOMTestObj* self, gboolean value)
item->setCreate(value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+ gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
return res;
}
void
-webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -576,18 +576,18 @@ webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean
item->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+ gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
return res;
}
void
-webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -597,18 +597,18 @@ webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value
item->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, converted_value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_reflected_non_empty_url_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->getNonEmptyURLAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr));
+ gchar* res = convertToUTF8String(item->getNonEmptyURLAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr));
return res;
}
void
-webkit_dom_test_obj_set_reflected_non_empty_url_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_reflected_non_empty_url_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -618,18 +618,18 @@ webkit_dom_test_obj_set_reflected_non_empty_url_attr(WebKitDOMTestObj* self, gch
item->setAttribute(WebCore::HTMLNames::reflectednonemptyurlattrAttr, converted_value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+ gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
return res;
}
void
-webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -677,18 +677,18 @@ webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gb
item->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_reflected_custom_url_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+ gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
return res;
}
void
-webkit_dom_test_obj_set_reflected_custom_url_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_reflected_custom_url_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -698,18 +698,18 @@ webkit_dom_test_obj_set_reflected_custom_url_attr(WebKitDOMTestObj* self, gchar*
item->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, converted_value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_reflected_custom_non_empty_url_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->getNonEmptyURLAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr));
+ gchar* res = convertToUTF8String(item->getNonEmptyURLAttribute(WebCore::HTMLNames::customContentNonEmptyURLAttrAttr));
return res;
}
void
-webkit_dom_test_obj_set_reflected_custom_non_empty_url_attr(WebKitDOMTestObj* self, gchar* value)
+webkit_dom_test_obj_set_reflected_custom_non_empty_url_attr(WebKitDOMTestObj* self, const gchar* value)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -775,19 +775,19 @@ webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong
}
}
-gchar*
+gchar*
webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
- gchar* res = convertToUTF8String(item->stringAttrWithGetterException(ec));
+ gchar* res = convertToUTF8String(item->stringAttrWithGetterException(ec));
return res;
}
void
-webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error)
+webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, const gchar* value, GError **error)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -803,18 +803,18 @@ webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self
}
}
-gchar*
+gchar*
webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->stringAttrWithSetterException());
+ gchar* res = convertToUTF8String(item->stringAttrWithSetterException());
return res;
}
void
-webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error)
+webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, const gchar* value, GError **error)
{
WebCore::JSMainThreadNullState state;
g_return_if_fail(self);
@@ -830,13 +830,13 @@ webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self
}
}
-gchar*
+gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->scriptStringAttr());
+ gchar* res = convertToUTF8String(item->scriptStringAttr());
return res;
}
@@ -938,13 +938,13 @@ webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value)
item->setId(value);
}
-gchar*
+gchar*
webkit_dom_test_obj_get_hash(WebKitDOMTestObj* self)
{
WebCore::JSMainThreadNullState state;
g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- gchar* res = convertToUTF8String(item->hash());
+ gchar* res = convertToUTF8String(item->hash());
return res;
}
@@ -1363,14 +1363,14 @@ G_MAXLONG, /* max */
PROP_READ_ONLY_STRING_ATTR,
g_param_spec_string("read-only-string-attr", /* name */
"test_obj_read-only-string-attr", /* short description */
- "read-only gchar* TestObj.read-only-string-attr", /* longer - could do with some extra doc stuff here */
+ "read-only gchar* TestObj.read-only-string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READABLE));
g_object_class_install_property(gobjectClass,
PROP_READ_ONLY_TEST_OBJ_ATTR,
g_param_spec_object("read-only-test-obj-attr", /* name */
"test_obj_read-only-test-obj-attr", /* short description */
- "read-only WebKitDOMTestObj* TestObj.read-only-test-obj-attr", /* longer - could do with some extra doc stuff here */
+ "read-only WebKitDOMTestObj* TestObj.read-only-test-obj-attr", /* longer - could do with some extra doc stuff here */
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READABLE));
g_object_class_install_property(gobjectClass,
@@ -1404,21 +1404,21 @@ G_MAXUINT64, /* min */
PROP_STRING_ATTR,
g_param_spec_string("string-attr", /* name */
"test_obj_string-attr", /* short description */
- "read-write gchar* TestObj.string-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_TEST_OBJ_ATTR,
g_param_spec_object("test-obj-attr", /* name */
"test_obj_test-obj-attr", /* short description */
- "read-write WebKitDOMTestObj* TestObj.test-obj-attr", /* longer - could do with some extra doc stuff here */
+ "read-write WebKitDOMTestObj* TestObj.test-obj-attr", /* longer - could do with some extra doc stuff here */
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_XML_OBJ_ATTR,
g_param_spec_object("xml-obj-attr", /* name */
"test_obj_xml-obj-attr", /* short description */
- "read-write WebKitDOMTestObj* TestObj.xml-obj-attr", /* longer - could do with some extra doc stuff here */
+ "read-write WebKitDOMTestObj* TestObj.xml-obj-attr", /* longer - could do with some extra doc stuff here */
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
@@ -1432,7 +1432,7 @@ G_MAXUINT64, /* min */
PROP_REFLECTED_STRING_ATTR,
g_param_spec_string("reflected-string-attr", /* name */
"test_obj_reflected-string-attr", /* short description */
- "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
@@ -1455,21 +1455,21 @@ G_MAXLONG, /* max */
PROP_REFLECTED_URL_ATTR,
g_param_spec_string("reflected-url-attr", /* name */
"test_obj_reflected-url-attr", /* short description */
- "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_REFLECTED_NON_EMPTY_URL_ATTR,
g_param_spec_string("reflected-non-empty-url-attr", /* name */
"test_obj_reflected-non-empty-url-attr", /* short description */
- "read-write gchar* TestObj.reflected-non-empty-url-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.reflected-non-empty-url-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_REFLECTED_STRING_ATTR,
g_param_spec_string("reflected-string-attr", /* name */
"test_obj_reflected-string-attr", /* short description */
- "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
@@ -1492,14 +1492,14 @@ G_MAXLONG, /* max */
PROP_REFLECTED_CUSTOM_URL_ATTR,
g_param_spec_string("reflected-custom-url-attr", /* name */
"test_obj_reflected-custom-url-attr", /* short description */
- "read-write gchar* TestObj.reflected-custom-url-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.reflected-custom-url-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_REFLECTED_CUSTOM_NON_EMPTY_URL_ATTR,
g_param_spec_string("reflected-custom-non-empty-url-attr", /* name */
"test_obj_reflected-custom-non-empty-url-attr", /* short description */
- "read-write gchar* TestObj.reflected-custom-non-empty-url-attr", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.reflected-custom-non-empty-url-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
@@ -1524,21 +1524,21 @@ G_MAXLONG, /* max */
PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
g_param_spec_string("string-attr-with-getter-exception", /* name */
"test_obj_string-attr-with-getter-exception", /* short description */
- "read-write gchar* TestObj.string-attr-with-getter-exception", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.string-attr-with-getter-exception", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
g_param_spec_string("string-attr-with-setter-exception", /* name */
"test_obj_string-attr-with-setter-exception", /* short description */
- "read-write gchar* TestObj.string-attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ "read-write gchar* TestObj.string-attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
PROP_SCRIPT_STRING_ATTR,
g_param_spec_string("script-string-attr", /* name */
"test_obj_script-string-attr", /* short description */
- "read-only gchar* TestObj.script-string-attr", /* longer - could do with some extra doc stuff here */
+ "read-only gchar* TestObj.script-string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READABLE));
#if ENABLE(Condition1)
@@ -1596,7 +1596,7 @@ G_MAXLONG, /* max */
PROP_HASH,
g_param_spec_string("hash", /* name */
"test_obj_hash", /* short description */
- "read-only gchar* TestObj.hash", /* longer - could do with some extra doc stuff here */
+ "read-only gchar* TestObj.hash", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READABLE));
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
index c9a1821..4cc796d 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
@@ -50,31 +50,31 @@ WEBKIT_API void
webkit_dom_test_obj_void_method(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg);
+webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, const gchar* str_arg, WebKitDOMTestObj* obj_arg);
WEBKIT_API glong
webkit_dom_test_obj_int_method(WebKitDOMTestObj* self);
WEBKIT_API glong
-webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg);
+webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, const gchar* str_arg, WebKitDOMTestObj* obj_arg);
-WEBKIT_API WebKitDOMTestObj*
+WEBKIT_API WebKitDOMTestObj*
webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self);
-WEBKIT_API WebKitDOMTestObj*
-webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg);
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, const gchar* str_arg, WebKitDOMTestObj* obj_arg);
-WEBKIT_API WebKitDOMTestObj*
-webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg);
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg);
-WEBKIT_API WebKitDOMTestObj*
-webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error);
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error);
WEBKIT_API void
-webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg);
+webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg);
WEBKIT_API void
-webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key);
+webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key);
WEBKIT_API void
webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error);
@@ -95,21 +95,21 @@ WEBKIT_API void
webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, glong int_arg, glong optional_arg);
WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg);
+webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg, gboolean isUserGesture);
WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg);
+webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg, gboolean isUserGesture);
WEBKIT_API void
webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self);
-WEBKIT_API WebKitDOMTestObj*
+WEBKIT_API WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GError **error);
-WEBKIT_API WebKitDOMTestObj*
+WEBKIT_API WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GError **error);
WEBKIT_API void
@@ -127,10 +127,10 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOM
WEBKIT_API glong
webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self);
-WEBKIT_API WebKitDOMTestObj*
+WEBKIT_API WebKitDOMTestObj*
webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self);
WEBKIT_API glong
@@ -151,23 +151,23 @@ webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64 value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, const gchar* value);
-WEBKIT_API WebKitDOMTestObj*
+WEBKIT_API WebKitDOMTestObj*
webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
+webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
-WEBKIT_API WebKitDOMTestObj*
+WEBKIT_API WebKitDOMTestObj*
webkit_dom_test_obj_get_xml_obj_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_xml_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
+webkit_dom_test_obj_set_xml_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
WEBKIT_API gboolean
webkit_dom_test_obj_get_create(WebKitDOMTestObj* self);
@@ -175,11 +175,11 @@ webkit_dom_test_obj_get_create(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_create(WebKitDOMTestObj* self, gboolean value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, const gchar* value);
WEBKIT_API glong
webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self);
@@ -193,23 +193,23 @@ webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, const gchar* value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_reflected_non_empty_url_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_reflected_non_empty_url_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_reflected_non_empty_url_attr(WebKitDOMTestObj* self, const gchar* value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, const gchar* value);
WEBKIT_API glong
webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self);
@@ -223,17 +223,17 @@ webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_reflected_custom_url_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_reflected_custom_url_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_reflected_custom_url_attr(WebKitDOMTestObj* self, const gchar* value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_reflected_custom_non_empty_url_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_reflected_custom_non_empty_url_attr(WebKitDOMTestObj* self, gchar* value);
+webkit_dom_test_obj_set_reflected_custom_non_empty_url_attr(WebKitDOMTestObj* self, const gchar* value);
WEBKIT_API glong
webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error);
@@ -247,19 +247,19 @@ webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error);
WEBKIT_API void
-webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error);
+webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, const gchar* value, GError **error);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error);
+webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, const gchar* value, GError **error);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self);
#if ENABLE(Condition1)
@@ -301,7 +301,7 @@ webkit_dom_test_obj_get_id(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value);
-WEBKIT_API gchar*
+WEBKIT_API gchar*
webkit_dom_test_obj_get_hash(WebKitDOMTestObj* self);
G_END_DECLS
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 01a860c..2a39ac4 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -1105,7 +1105,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGe
if (exec->hadException())
return JSValue::encode(jsUndefined());
- imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, processingUserGesture(exec));
+ imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, processingUserGesture());
return JSValue::encode(jsUndefined());
}
@@ -1133,7 +1133,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGe
if (exec->hadException())
return JSValue::encode(jsUndefined());
- imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, processingUserGesture(exec));
+ imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, processingUserGesture());
return JSValue::encode(jsUndefined());
}
@@ -1417,9 +1417,9 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
{
- if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
+ if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
- if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))
+ if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))))
return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject())))
return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index d2192ca..afdf381 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -23,9 +23,9 @@
#ifndef V8TestInterface_h
#define V8TestInterface_h
-#include "StringHash.h"
#include "TestInterface.h"
#include "WrapperTypeInfo.h"
+#include "wtf/text/StringHash.h"
#include <v8.h>
#include <wtf/HashMap.h>
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.h b/WebCore/bindings/scripts/test/V8/V8TestObj.h
index 5d6770a..d9715c9 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.h
@@ -21,9 +21,9 @@
#ifndef V8TestObj_h
#define V8TestObj_h
-#include "StringHash.h"
#include "TestObj.h"
#include "WrapperTypeInfo.h"
+#include "wtf/text/StringHash.h"
#include <v8.h>
#include <wtf/HashMap.h>
diff --git a/WebCore/bindings/v8/IDBBindingUtilities.cpp b/WebCore/bindings/v8/IDBBindingUtilities.cpp
index 4b38a61..a000a7d 100644
--- a/WebCore/bindings/v8/IDBBindingUtilities.cpp
+++ b/WebCore/bindings/v8/IDBBindingUtilities.cpp
@@ -29,7 +29,10 @@
#if ENABLE(INDEXED_DATABASE)
#include "IDBKey.h"
+#include "IDBKeyPath.h"
+#include "SerializedScriptValue.h"
#include "V8Binding.h"
+#include <wtf/Vector.h>
namespace WebCore {
@@ -45,6 +48,37 @@ PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value)
return 0;
}
+template<typename T>
+bool getValueFrom(T indexOrName, v8::Handle<v8::Value>& v8Value)
+{
+ v8::Local<v8::Object> object = v8Value->ToObject();
+ if (!object->Has(indexOrName))
+ return false;
+ v8Value = object->Get(indexOrName);
+ return true;
+}
+
+PassRefPtr<IDBKey> createIDBKeyFromSerializedValueAndKeyPath(PassRefPtr<SerializedScriptValue> value, const Vector<IDBKeyPathElement>& keyPath)
+{
+ v8::HandleScope scope;
+ v8::Handle<v8::Value> v8Value(value->deserialize());
+ for (size_t i = 0; i < keyPath.size(); ++i) {
+ switch (keyPath[i].type) {
+ case IDBKeyPathElement::IsIndexed:
+ if (!v8Value->IsArray() || !getValueFrom(keyPath[i].index, v8Value))
+ return 0;
+ break;
+ case IDBKeyPathElement::IsNamed:
+ if (!v8Value->IsObject() || !getValueFrom(v8String(keyPath[i].identifier), v8Value))
+ return 0;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+ return createIDBKeyFromValue(v8Value);
+}
+
} // namespace WebCore
#endif
diff --git a/WebCore/bindings/v8/IDBBindingUtilities.h b/WebCore/bindings/v8/IDBBindingUtilities.h
index 76f2bba..1a794b0 100644
--- a/WebCore/bindings/v8/IDBBindingUtilities.h
+++ b/WebCore/bindings/v8/IDBBindingUtilities.h
@@ -34,8 +34,11 @@
namespace WebCore {
class IDBKey;
+class SerializedScriptValue;
+struct IDBKeyPathElement;
PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value>);
+PassRefPtr<IDBKey> createIDBKeyFromSerializedValueAndKeyPath(PassRefPtr<SerializedScriptValue> value, const Vector<IDBKeyPathElement, 0>& keyPath);
}
diff --git a/WebCore/bindings/v8/ScriptCallStack.cpp b/WebCore/bindings/v8/ScriptCallStack.cpp
index 98ddb90..7c07829 100644
--- a/WebCore/bindings/v8/ScriptCallStack.cpp
+++ b/WebCore/bindings/v8/ScriptCallStack.cpp
@@ -171,7 +171,7 @@ bool ScriptCallStack::stackTrace(int frameLimit, const RefPtr<InspectorArray>& s
frameObject->setString("functionName", functionName.IsEmpty() ? "" : toWebCoreString(functionName));
frameObject->setNumber("lineNumber", frame->GetLineNumber());
frameObject->setNumber("column", frame->GetColumn());
- stackTrace->push(frameObject);
+ stackTrace->pushObject(frameObject);
}
return true;
#else
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index a27c5cf..903b11c 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -160,15 +160,18 @@ void ScriptController::updatePlatformScriptObjects()
notImplemented();
}
-bool ScriptController::processingUserGesture(DOMWrapperWorld*) const
+bool ScriptController::processingUserGesture()
{
+ Frame* activeFrame = V8Proxy::retrieveFrameForEnteredContext();
// No script is running, so it is user-initiated unless the gesture stack
// explicitly says it is not.
- if (!m_proxy->executingScript())
+ if (!activeFrame)
return UserGestureIndicator::getUserGestureState() != DefinitelyNotProcessingUserGesture;
+ V8Proxy* activeProxy = activeFrame->script()->proxy();
+
v8::HandleScope handleScope;
- v8::Handle<v8::Context> v8Context = m_proxy->mainWorldContext();
+ v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(activeFrame);
// FIXME: find all cases context can be empty:
// 1) JS is disabled;
// 2) page is NULL;
@@ -188,7 +191,11 @@ bool ScriptController::processingUserGesture(DOMWrapperWorld*) const
// Event::fromUserGesture will return false when UserGestureIndicator::processingUserGesture() returns false.
return event->fromUserGesture();
}
- if (m_sourceURL && m_sourceURL->isNull() && !m_proxy->timerCallback()) {
+ // FIXME: We check the javascript anchor navigation from the last entered
+ // frame becuase it should only be initiated on the last entered frame in
+ // which execution began if it does happen.
+ const String* sourceURL = activeFrame->script()->sourceURL();
+ if (sourceURL && sourceURL->isNull() && !activeProxy->timerCallback()) {
// This is the <a href="javascript:window.open('...')> case -> we let it through.
return true;
}
@@ -201,7 +208,7 @@ bool ScriptController::processingUserGesture(DOMWrapperWorld*) const
bool ScriptController::anyPageIsProcessingUserGesture() const
{
// FIXME: is this right?
- return processingUserGesture();
+ return ScriptController::processingUserGesture();
}
void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources)
@@ -484,10 +491,12 @@ void ScriptController::updateDocument()
void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& name)
{
+ m_proxy->windowShell()->namedItemAdded(doc, name);
}
void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& name)
{
+ m_proxy->windowShell()->namedItemRemoved(doc, name);
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index cd20cda..525476d 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -154,7 +154,7 @@ public:
void setProcessingTimerCallback(bool processingTimerCallback) { m_processingTimerCallback = processingTimerCallback; }
// FIXME: Currently we don't use the parameter world at all.
// See http://trac.webkit.org/changeset/54182
- bool processingUserGesture(DOMWrapperWorld* world = 0) const;
+ static bool processingUserGesture();
bool anyPageIsProcessingUserGesture() const;
void setPaused(bool paused) { m_paused = paused; }
diff --git a/WebCore/bindings/v8/ScriptDebugServer.cpp b/WebCore/bindings/v8/ScriptDebugServer.cpp
index 0a432b7..0c24678 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -44,6 +44,19 @@
namespace WebCore {
+namespace {
+
+class ClientDataImpl : public v8::Debug::ClientData {
+public:
+ ClientDataImpl(PassOwnPtr<ScriptDebugServer::Task> task) : m_task(task) { }
+ virtual ~ClientDataImpl() { }
+ ScriptDebugServer::Task* task() const { return m_task.get(); }
+private:
+ OwnPtr<ScriptDebugServer::Task> m_task;
+};
+
+}
+
static Frame* retrieveFrame(v8::Handle<v8::Context> context)
{
if (context.IsEmpty())
@@ -209,6 +222,12 @@ void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pauseOn
setPauseOnExceptionsFunction->Call(m_debuggerScript.get(), 1, argv);
}
+void ScriptDebugServer::pause()
+{
+ if (!m_pausedPage)
+ v8::Debug::DebugBreak();
+}
+
void ScriptDebugServer::continueProgram()
{
if (m_pausedPage)
@@ -294,6 +313,16 @@ bool ScriptDebugServer::isDebuggerAlwaysEnabled()
return m_enabled;
}
+void ScriptDebugServer::interruptAndRun(PassOwnPtr<Task> task)
+{
+ v8::Debug::DebugBreakForCommand(new ClientDataImpl(task));
+}
+
+void ScriptDebugServer::runPendingTasks()
+{
+ v8::Debug::ProcessDebugMessages();
+}
+
void ScriptDebugServer::v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails)
{
ScriptDebugServer::shared().handleV8DebugEvent(eventDetails);
@@ -302,6 +331,13 @@ void ScriptDebugServer::v8DebugEventCallback(const v8::Debug::EventDetails& even
void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails)
{
v8::DebugEvent event = eventDetails.GetEvent();
+
+ if (event == v8::BreakForCommand) {
+ ClientDataImpl* data = static_cast<ClientDataImpl*>(eventDetails.GetClientData());
+ data->task()->run();
+ return;
+ }
+
if (event != v8::Break && event != v8::Exception && event != v8::AfterCompile)
return;
diff --git a/WebCore/bindings/v8/ScriptDebugServer.h b/WebCore/bindings/v8/ScriptDebugServer.h
index a55388f..a1e0a47 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.h
+++ b/WebCore/bindings/v8/ScriptDebugServer.h
@@ -36,12 +36,12 @@
#include "JavaScriptCallFrame.h"
#include "PlatformString.h"
#include "ScriptBreakpoint.h"
-#include "StringHash.h"
#include "Timer.h"
#include <v8-debug.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
@@ -70,7 +70,7 @@ public:
PauseOnExceptionsState pauseOnExceptionsState();
void setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState);
- void pause() { }
+ void pause();
void continueProgram();
void stepIntoStatement();
void stepOverStatement();
@@ -99,6 +99,14 @@ public:
void setEnabled(bool);
bool isDebuggerAlwaysEnabled();
+ class Task {
+ public:
+ virtual ~Task() { }
+ virtual void run() = 0;
+ };
+ static void interruptAndRun(PassOwnPtr<Task>);
+ void runPendingTasks();
+
private:
ScriptDebugServer();
~ScriptDebugServer() { }
diff --git a/WebCore/bindings/v8/ScriptProfile.cpp b/WebCore/bindings/v8/ScriptProfile.cpp
index 32e0066..95ac0de 100644
--- a/WebCore/bindings/v8/ScriptProfile.cpp
+++ b/WebCore/bindings/v8/ScriptProfile.cpp
@@ -72,9 +72,9 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const v8::CpuProfileN
const int childrenCount = node->GetChildrenCount();
for (int i = 0; i < childrenCount; i++) {
const v8::CpuProfileNode* child = node->GetChild(i);
- children->push(buildInspectorObjectFor(child));
+ children->pushObject(buildInspectorObjectFor(child));
}
- result->set("children", children);
+ result->setArray("children", children);
return result;
}
diff --git a/WebCore/bindings/v8/ScriptValue.cpp b/WebCore/bindings/v8/ScriptValue.cpp
index 6d3fe20..ebe9ccc 100755
--- a/WebCore/bindings/v8/ScriptValue.cpp
+++ b/WebCore/bindings/v8/ScriptValue.cpp
@@ -93,7 +93,7 @@ static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value
ASSERT_NOT_REACHED();
element = InspectorValue::null();
}
- inspectorArray->push(element);
+ inspectorArray->pushValue(element);
}
return inspectorArray;
}
@@ -105,14 +105,14 @@ static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value
for (uint32_t i = 0; i < length; i++) {
v8::Local<v8::Value> name = propertyNames->Get(v8::Int32::New(i));
// FIXME(yurys): v8::Object should support GetOwnPropertyNames
- if (!object->HasRealNamedProperty(v8::Handle<v8::String>::Cast(name)))
+ if (name->IsString() && !object->HasRealNamedProperty(v8::Handle<v8::String>::Cast(name)))
continue;
RefPtr<InspectorValue> propertyValue = v8ToInspectorValue(object->Get(name));
if (!propertyValue) {
ASSERT_NOT_REACHED();
continue;
}
- inspectorObject->set(toWebCoreStringWithNullCheck(name), propertyValue);
+ inspectorObject->setValue(toWebCoreStringWithNullCheck(name), propertyValue);
}
return inspectorObject;
}
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index 9dc4d0f..395ef1a 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -183,16 +183,20 @@ public:
doWriteNumber(number);
}
- void writeBlob(const String& path)
+ void writeBlob(const String& url, const String& type, unsigned long long size)
{
append(BlobTag);
- doWriteWebCoreString(path);
+ doWriteWebCoreString(url);
+ doWriteWebCoreString(type);
+ doWriteUint64(size);
}
- void writeFile(const String& path)
+ void writeFile(const String& path, const String& url, const String& type)
{
append(FileTag);
doWriteWebCoreString(path);
+ doWriteWebCoreString(url);
+ doWriteWebCoreString(type);
}
void writeFileList(const FileList& fileList)
@@ -200,8 +204,11 @@ public:
append(FileListTag);
uint32_t length = fileList.length();
doWriteUint32(length);
- for (unsigned i = 0; i < length; ++i)
+ for (unsigned i = 0; i < length; ++i) {
doWriteWebCoreString(fileList.item(i)->path());
+ doWriteWebCoreString(fileList.item(i)->url().string());
+ doWriteWebCoreString(fileList.item(i)->type());
+ }
}
void writeImageData(uint32_t width, uint32_t height, const uint8_t* pixelData, uint32_t pixelDataLength)
@@ -251,7 +258,8 @@ private:
doWriteString(buffer->data(), buffer->size());
}
- void doWriteUint32(uint32_t value)
+ template<class T>
+ void doWriteUintHelper(T value)
{
while (true) {
uint8_t b = (value & varIntMask);
@@ -264,6 +272,16 @@ private:
}
}
+ void doWriteUint32(uint32_t value)
+ {
+ doWriteUintHelper(value);
+ }
+
+ void doWriteUint64(uint64_t value)
+ {
+ doWriteUintHelper(value);
+ }
+
void doWriteNumber(double number)
{
append(reinterpret_cast<uint8_t*>(&number), sizeof(number));
@@ -560,7 +578,7 @@ private:
Blob* blob = V8Blob::toNative(value.As<v8::Object>());
if (!blob)
return;
- m_writer.writeBlob(blob->path());
+ m_writer.writeBlob(blob->url().string(), blob->type(), blob->size());
}
void writeFile(v8::Handle<v8::Value> value)
@@ -568,7 +586,7 @@ private:
File* file = V8File::toNative(value.As<v8::Object>());
if (!file)
return;
- m_writer.writeFile(file->path());
+ m_writer.writeFile(file->path(), file->url().string(), file->type());
}
void writeFileList(v8::Handle<v8::Value> value)
@@ -852,10 +870,16 @@ private:
bool readBlob(v8::Handle<v8::Value>* value)
{
- String path;
- if (!readWebCoreString(&path))
+ String url;
+ String type;
+ uint64_t size;
+ if (!readWebCoreString(&url))
return false;
- PassRefPtr<Blob> blob = Blob::create(getScriptExecutionContext(), path);
+ if (!readWebCoreString(&type))
+ return false;
+ if (!doReadUint64(&size))
+ return false;
+ PassRefPtr<Blob> blob = Blob::create(getScriptExecutionContext(), KURL(ParsedURLString, url), type, size);
*value = toV8(blob);
return true;
}
@@ -863,9 +887,15 @@ private:
bool readFile(v8::Handle<v8::Value>* value)
{
String path;
+ String url;
+ String type;
if (!readWebCoreString(&path))
return false;
- PassRefPtr<File> file = File::create(getScriptExecutionContext(), path);
+ if (!readWebCoreString(&url))
+ return false;
+ if (!readWebCoreString(&type))
+ return false;
+ PassRefPtr<File> file = File::create(getScriptExecutionContext(), path, KURL(ParsedURLString, url), type);
*value = toV8(file);
return true;
}
@@ -878,15 +908,22 @@ private:
PassRefPtr<FileList> fileList = FileList::create();
for (unsigned i = 0; i < length; ++i) {
String path;
+ String urlString;
+ String type;
if (!readWebCoreString(&path))
return false;
- fileList->append(File::create(getScriptExecutionContext(), path));
+ if (!readWebCoreString(&urlString))
+ return false;
+ if (!readWebCoreString(&type))
+ return false;
+ fileList->append(File::create(getScriptExecutionContext(), path, KURL(ParsedURLString, urlString), type));
}
*value = toV8(fileList);
return true;
}
- bool doReadUint32(uint32_t* value)
+ template<class T>
+ bool doReadUintHelper(T* value)
{
*value = 0;
uint8_t currentByte;
@@ -901,6 +938,16 @@ private:
return true;
}
+ bool doReadUint32(uint32_t* value)
+ {
+ return doReadUintHelper(value);
+ }
+
+ bool doReadUint64(uint64_t* value)
+ {
+ return doReadUintHelper(value);
+ }
+
bool doReadNumber(double* number)
{
if (m_position + sizeof(double) > m_length)
diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp
index 1272fd4..3799cdb 100644
--- a/WebCore/bindings/v8/V8Binding.cpp
+++ b/WebCore/bindings/v8/V8Binding.cpp
@@ -31,18 +31,18 @@
#include "config.h"
#include "V8Binding.h"
-#include "AtomicString.h"
#include "Element.h"
#include "MathExtras.h"
#include "PlatformString.h"
#include "QualifiedName.h"
#include "StdLibExtras.h"
-#include "StringBuffer.h"
-#include "StringHash.h"
#include "Threading.h"
#include "V8Element.h"
#include "V8Proxy.h"
+#include <wtf/text/AtomicString.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringBuffer.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/bindings/v8/V8Binding.h b/WebCore/bindings/v8/V8Binding.h
index 4656aa2..087c128 100644
--- a/WebCore/bindings/v8/V8Binding.h
+++ b/WebCore/bindings/v8/V8Binding.h
@@ -31,11 +31,11 @@
#ifndef V8Binding_h
#define V8Binding_h
-#include "AtomicString.h"
#include "BindingSecurity.h"
#include "MathExtras.h"
#include "PlatformString.h"
#include "V8DOMWrapper.h"
+#include <wtf/text/AtomicString.h>
#include <v8.h>
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.cpp b/WebCore/bindings/v8/V8DOMWindowShell.cpp
index 6676f6c..435876c 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.cpp
+++ b/WebCore/bindings/v8/V8DOMWindowShell.cpp
@@ -50,6 +50,7 @@
#include "V8DOMWindow.h"
#include "V8Document.h"
#include "V8GCForContextDispose.h"
+#include "V8HTMLDocument.h"
#include "V8HiddenPropertyName.h"
#include "V8History.h"
#include "V8Location.h"
@@ -418,6 +419,12 @@ void V8DOMWindowShell::clearDocumentWrapper()
}
}
+static void checkDocumentWrapper(v8::Handle<v8::Object> wrapper, Document* document)
+{
+ ASSERT(V8Document::toNative(wrapper) == document);
+ ASSERT(!document->isHTMLDocument() || (V8Document::toNative(v8::Handle<v8::Object>::Cast(wrapper->GetPrototype())) == document));
+}
+
void V8DOMWindowShell::updateDocumentWrapperCache()
{
v8::HandleScope handleScope;
@@ -436,6 +443,10 @@ void V8DOMWindowShell::updateDocumentWrapperCache()
}
v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document());
+ ASSERT(documentWrapper == m_document || m_document.IsEmpty());
+ if (m_document.IsEmpty())
+ updateDocumentWrapper(v8::Handle<v8::Object>::Cast(documentWrapper));
+ checkDocumentWrapper(m_document, m_frame->document());
// If instantiation of the document wrapper fails, clear the cache
// and let the DOMWindow accessor handle access to the document.
@@ -513,6 +524,37 @@ void V8DOMWindowShell::updateDocument()
updateSecurityOrigin();
}
+v8::Handle<v8::Value> getter(v8::Local<v8::String> property, const v8::AccessorInfo& info)
+{
+ // FIXME(antonm): consider passing AtomicStringImpl directly.
+ AtomicString name = v8StringToAtomicWebCoreString(property);
+ HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
+ ASSERT(htmlDocument);
+ v8::Handle<v8::Value> result = V8HTMLDocument::GetNamedProperty(htmlDocument, name);
+ if (!result.IsEmpty())
+ return result;
+ v8::Handle<v8::Value> prototype = info.Holder()->GetPrototype();
+ if (prototype->IsObject())
+ return prototype.As<v8::Object>()->Get(property);
+ return v8::Undefined();
+}
+
+void V8DOMWindowShell::namedItemAdded(HTMLDocument* doc, const AtomicString& name)
+{
+ initContextIfNeeded();
+
+ v8::HandleScope handleScope;
+ v8::Context::Scope contextScope(m_context);
+
+ ASSERT(!m_document.IsEmpty());
+ checkDocumentWrapper(m_document, doc);
+ m_document->SetAccessor(v8String(name), getter);
+}
+
+void V8DOMWindowShell::namedItemRemoved(HTMLDocument* doc, const AtomicString& name)
+{
+}
+
void V8DOMWindowShell::updateSecurityOrigin()
{
v8::HandleScope scope;
diff --git a/WebCore/bindings/v8/V8DOMWindowShell.h b/WebCore/bindings/v8/V8DOMWindowShell.h
index 2ccb410..7958bf1 100644
--- a/WebCore/bindings/v8/V8DOMWindowShell.h
+++ b/WebCore/bindings/v8/V8DOMWindowShell.h
@@ -37,11 +37,13 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
class DOMWindow;
class Frame;
+class HTMLDocument;
// V8WindowShell represents all the per-global object state for a Frame that
// persist between navigations.
@@ -54,6 +56,9 @@ public:
// Update document object of the frame.
void updateDocument();
+ void namedItemAdded(HTMLDocument*, const AtomicString&);
+ void namedItemRemoved(HTMLDocument*, const AtomicString&);
+
// Update the security origin of a document
// (e.g., after setting docoument.domain).
void updateSecurityOrigin();
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index d6f05f4..8a72a3a 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -284,6 +284,8 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperT
if (!instance.IsEmpty()) {
// Avoid setting the DOM wrapper for failed allocations.
setDOMWrapper(instance, type, impl);
+ if (type == &V8HTMLDocument::info)
+ instance = V8HTMLDocument::WrapInShadowObject(instance, static_cast<Node*>(impl));
}
return instance;
}
diff --git a/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp b/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
index 26fc626..3491170 100644
--- a/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
@@ -63,13 +63,13 @@ static v8::Handle<v8::Value> toV8Object(CanvasStyle* style)
static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value)
{
if (value->IsString())
- return CanvasStyle::create(toWebCoreString(value));
+ return CanvasStyle::createFromString(toWebCoreString(value));
if (V8CanvasGradient::HasInstance(value))
- return CanvasStyle::create(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
+ return CanvasStyle::createFromGradient(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
if (V8CanvasPattern::HasInstance(value))
- return CanvasStyle::create(V8CanvasPattern::toNative(v8::Handle<v8::Object>::Cast(value)));
+ return CanvasStyle::createFromPattern(V8CanvasPattern::toNative(v8::Handle<v8::Object>::Cast(value)));
return 0;
}
diff --git a/WebCore/bindings/v8/custom/V8CustomPositionCallback.cpp b/WebCore/bindings/v8/custom/V8CustomPositionCallback.cpp
index 18f27cb..97d0dde 100644
--- a/WebCore/bindings/v8/custom/V8CustomPositionCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomPositionCallback.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "V8CustomPositionCallback.h"
+#if ENABLE(GEOLOCATION)
+
#include "ScriptExecutionContext.h"
#include "V8CustomVoidCallback.h" // For invokeCallback
#include "V8Geoposition.h"
@@ -76,3 +78,5 @@ void V8CustomPositionCallback::handleEvent(Geoposition* position)
}
} // namespace WebCore
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/bindings/v8/custom/V8CustomPositionErrorCallback.cpp b/WebCore/bindings/v8/custom/V8CustomPositionErrorCallback.cpp
index 36b5e04..906a909 100644
--- a/WebCore/bindings/v8/custom/V8CustomPositionErrorCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomPositionErrorCallback.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "V8CustomPositionErrorCallback.h"
+#if ENABLE(GEOLOCATION)
+
#include "ScriptExecutionContext.h"
#include "V8CustomVoidCallback.h" // For invokeCallback
#include "V8PositionError.h"
@@ -76,3 +78,5 @@ void V8CustomPositionErrorCallback::handleEvent(PositionError* error)
}
} // namespace WebCore
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index a74faee..45cb1b4 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -67,16 +67,6 @@
#if ENABLE(WEB_SOCKETS)
#include "WebSocket.h"
#endif
-#if ENABLE(3D_CANVAS)
-#include "V8ArrayBuffer.h"
-#include "V8Int8Array.h"
-#include "V8Float32Array.h"
-#include "V8Int32Array.h"
-#include "V8Int16Array.h"
-#include "V8Uint8Array.h"
-#include "V8Uint32Array.h"
-#include "V8Uint16Array.h"
-#endif
#include "WindowFeatures.h"
namespace WebCore {
@@ -253,61 +243,6 @@ v8::Handle<v8::Value> V8DOMWindow::OptionAccessorGetter(v8::Local<v8::String> na
return V8DOMWrapper::getConstructor(&V8HTMLOptionElementConstructor::info, window);
}
-#if ENABLE(3D_CANVAS)
-
-// Temporary aliases to keep current WebGL content working during transition period to TypedArray spec.
-// To be removed before WebGL spec is finalized. (FIXME)
-v8::Handle<v8::Value> V8DOMWindow::WebGLArrayBufferAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8ArrayBuffer::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLByteArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Int8Array::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLUnsignedByteArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Uint8Array::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLShortArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Int16Array::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLUnsignedShortArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Uint16Array::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLIntArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Int32Array::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLUnsignedIntArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Uint32Array::info, window);
-}
-
-v8::Handle<v8::Value> V8DOMWindow::WebGLFloatArrayAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- DOMWindow* window = V8DOMWindow::toNative(info.Holder());
- return V8DOMWrapper::getConstructor(&V8Float32Array::info, window);
-}
-
-#endif
-
-
v8::Handle<v8::Value> V8DOMWindow::addEventListenerCallback(const v8::Arguments& args)
{
INC_STATS("DOM.DOMWindow.addEventListener()");
diff --git a/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp b/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp
index 649c45f..54bd11c 100644
--- a/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "V8Geolocation.h"
+#if ENABLE(GEOLOCATION)
+
#include "Frame.h"
#include "Geolocation.h"
#include "V8Binding.h"
@@ -215,3 +217,5 @@ v8::Handle<v8::Value> V8Geolocation::watchPositionCallback(const v8::Arguments&
}
} // namespace WebCore
+
+#endif // ENABLE(GEOLOCATION)
diff --git a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index 86f2eb5..24ac47c 100644
--- a/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -49,48 +49,38 @@
namespace WebCore {
-v8::Handle<v8::Boolean> V8HTMLDocument::namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+v8::Local<v8::Object> V8HTMLDocument::WrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl)
{
- // Only handle document.all. Insert the marker object into the
- // shadow internal field to signal that document.all is no longer
- // shadowed.
- AtomicString key = v8StringToAtomicWebCoreString(name);
- DEFINE_STATIC_LOCAL(const AtomicString, all, ("all"));
- if (key != all)
- return deletionNotHandledByInterceptor();
-
- ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
- v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8HTMLDocument::markerIndex);
- info.Holder()->SetInternalField(V8HTMLDocument::shadowIndex, marker);
- return v8::True();
-}
-
-v8::Handle<v8::Value> V8HTMLDocument::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
-{
- INC_STATS("DOM.HTMLDocument.NamedPropertyGetter");
- AtomicString key = v8StringToAtomicWebCoreString(name);
-
- // Special case for document.all. If the value in the shadow
- // internal field is not the marker object, then document.all has
- // been temporarily shadowed and we return the value.
- DEFINE_STATIC_LOCAL(const AtomicString, all, ("all"));
- if (key == all) {
- ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
- v8::Local<v8::Value> marker = info.Holder()->GetInternalField(V8HTMLDocument::markerIndex);
- v8::Local<v8::Value> value = info.Holder()->GetInternalField(V8HTMLDocument::shadowIndex);
- if (marker != value)
- return value;
+ DEFINE_STATIC_LOCAL(v8::Persistent<v8::FunctionTemplate>, shadowTemplate, ());
+ if (shadowTemplate.IsEmpty()) {
+ shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
+ if (shadowTemplate.IsEmpty())
+ return v8::Local<v8::Object>();
+ shadowTemplate->SetClassName(v8::String::New("HTMLDocument"));
+ shadowTemplate->Inherit(V8HTMLDocument::GetTemplate());
+ shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument::internalFieldCount);
}
- HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
+ v8::Local<v8::Function> shadowConstructor = shadowTemplate->GetFunction();
+ if (shadowConstructor.IsEmpty())
+ return v8::Local<v8::Object>();
- // Fast case for named elements that are not there.
+ v8::Local<v8::Object> shadow = shadowConstructor->NewInstance();
+ if (shadow.IsEmpty())
+ return v8::Local<v8::Object>();
+ V8DOMWrapper::setDOMWrapper(shadow, &V8HTMLDocument::info, impl);
+ shadow->SetPrototype(wrapper);
+ return shadow;
+}
+
+v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key)
+{
if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedItem(key.impl()))
return v8::Handle<v8::Value>();
RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key);
if (!items->length())
- return notHandledByInterceptor();
+ return v8::Handle<v8::Value>();
if (items->length() == 1) {
Node* node = items->firstItem();
@@ -104,13 +94,6 @@ v8::Handle<v8::Value> V8HTMLDocument::namedPropertyGetter(v8::Local<v8::String>
return toV8(items.release());
}
-v8::Handle<v8::Value> V8HTMLDocument::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo &info)
-{
- INC_STATS("DOM.HTMLDocument.IndexedPropertyGetter");
- v8::Local<v8::Integer> indexV8 = v8::Integer::NewFromUnsigned(index);
- return namedPropertyGetter(indexV8->ToString(), info);
-}
-
// HTMLDocument ----------------------------------------------------------------
// Concatenates "args" to a string. If args is empty, returns empty string.
@@ -193,10 +176,8 @@ v8::Handle<v8::Value> V8HTMLDocument::allAccessorGetter(v8::Local<v8::String> na
void V8HTMLDocument::allAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.HTMLDocument.all._set");
- v8::Handle<v8::Object> holder = info.Holder();
- ASSERT(info.Holder()->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
- info.Holder()->SetInternalField(V8HTMLDocument::shadowIndex, value);
+ // Just emulate a normal JS behaviour---install a property on this.
+ info.This()->ForceSet(name, value);
}
v8::Handle<v8::Value> toV8(HTMLDocument* impl, bool forceNewObject)
@@ -210,12 +191,6 @@ v8::Handle<v8::Value> toV8(HTMLDocument* impl, bool forceNewObject)
if (V8Proxy* proxy = V8Proxy::retrieve(impl->frame()))
proxy->windowShell()->updateDocumentWrapper(wrapper);
}
- // Create marker object and insert it in two internal fields.
- // This is used to implement temporary shadowing of document.all.
- ASSERT(wrapper->InternalFieldCount() == V8HTMLDocument::internalFieldCount);
- v8::Local<v8::Object> marker = v8::Object::New();
- wrapper->SetInternalField(V8HTMLDocument::markerIndex, marker);
- wrapper->SetInternalField(V8HTMLDocument::shadowIndex, marker);
return wrapper;
}
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 435cf73..1b069cf 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -211,6 +211,9 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScrip
if (!val.IsEmpty() && val->IsObject())
return InjectedScript(ScriptObject(inspectedScriptState, v8::Local<v8::Object>::Cast(val)));
+ if (!canAccessInspectedWindow(inspectedScriptState))
+ return InjectedScript();
+
ASSERT(!m_injectedScriptSource.isEmpty());
pair<long, ScriptObject> injectedScript = injectScript(m_injectedScriptSource, inspectedScriptState);
InjectedScript result(injectedScript.second);
diff --git a/WebCore/bindings/v8/specialization/V8BindingState.cpp b/WebCore/bindings/v8/specialization/V8BindingState.cpp
index d95d578..ccdd7c8 100644
--- a/WebCore/bindings/v8/specialization/V8BindingState.cpp
+++ b/WebCore/bindings/v8/specialization/V8BindingState.cpp
@@ -81,8 +81,7 @@ void State<V8Binding>::immediatelyReportUnsafeAccessTo(Frame* target)
bool State<V8Binding>::processingUserGesture()
{
- Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
- return frame && frame->script()->processingUserGesture();
+ return ScriptController::processingUserGesture();
}
} // namespace WebCore
diff --git a/WebCore/bridge/IdentifierRep.cpp b/WebCore/bridge/IdentifierRep.cpp
index bc599de..fed47ca 100644
--- a/WebCore/bridge/IdentifierRep.cpp
+++ b/WebCore/bridge/IdentifierRep.cpp
@@ -78,7 +78,7 @@ IdentifierRep* IdentifierRep::get(int intID)
return result.first->second;
}
-typedef HashMap<RefPtr<JSC::UString::Rep>, IdentifierRep*> StringIdentifierMap;
+typedef HashMap<RefPtr<StringImpl>, IdentifierRep*> StringIdentifierMap;
static StringIdentifierMap& stringIdentifierMap()
{
@@ -93,7 +93,7 @@ IdentifierRep* IdentifierRep::get(const char* name)
return 0;
UString string = stringToUString(String::fromUTF8WithLatin1Fallback(name, strlen(name)));
- pair<StringIdentifierMap::iterator, bool> result = stringIdentifierMap().add(string.rep(), 0);
+ pair<StringIdentifierMap::iterator, bool> result = stringIdentifierMap().add(string.impl(), 0);
if (result.second) {
ASSERT(!result.first->second);
result.first->second = new IdentifierRep(name);
diff --git a/WebCore/bridge/NP_jsobject.cpp b/WebCore/bridge/NP_jsobject.cpp
index d454c74..17270eb 100644
--- a/WebCore/bridge/NP_jsobject.cpp
+++ b/WebCore/bridge/NP_jsobject.cpp
@@ -474,7 +474,7 @@ bool _NPN_Enumerate(NPP, NPObject* o, NPIdentifier** identifier, uint32_t* count
NPIdentifier* identifiers = static_cast<NPIdentifier*>(malloc(sizeof(NPIdentifier) * size));
for (unsigned i = 0; i < size; ++i)
- identifiers[i] = _NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().data());
+ identifiers[i] = _NPN_GetStringIdentifier(propertyNames[i].ustring().utf8().data());
*identifier = identifiers;
*count = size;
diff --git a/WebCore/bridge/c/c_class.cpp b/WebCore/bridge/c/c_class.cpp
index ea71638..f4ae5ca 100644
--- a/WebCore/bridge/c/c_class.cpp
+++ b/WebCore/bridge/c/c_class.cpp
@@ -75,20 +75,20 @@ MethodList CClass::methodsNamed(const Identifier& identifier, Instance* instance
{
MethodList methodList;
- Method* method = _methods.get(identifier.ustring().rep());
+ Method* method = _methods.get(identifier.ustring().impl());
if (method) {
methodList.append(method);
return methodList;
}
- NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii());
+ NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii().data());
const CInstance* inst = static_cast<const CInstance*>(instance);
NPObject* obj = inst->getObject();
if (_isa->hasMethod && _isa->hasMethod(obj, ident)){
Method* aMethod = new CMethod(ident); // deleted in the CClass destructor
{
JSLock lock(SilenceAssertionsOnly);
- _methods.set(identifier.ustring().rep(), aMethod);
+ _methods.set(identifier.ustring().impl(), aMethod);
}
methodList.append(aMethod);
}
@@ -98,18 +98,18 @@ MethodList CClass::methodsNamed(const Identifier& identifier, Instance* instance
Field* CClass::fieldNamed(const Identifier& identifier, Instance* instance) const
{
- Field* aField = _fields.get(identifier.ustring().rep());
+ Field* aField = _fields.get(identifier.ustring().impl());
if (aField)
return aField;
- NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii());
+ NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii().data());
const CInstance* inst = static_cast<const CInstance*>(instance);
NPObject* obj = inst->getObject();
if (_isa->hasProperty && _isa->hasProperty(obj, ident)){
aField = new CField(ident); // deleted in the CClass destructor
{
JSLock lock(SilenceAssertionsOnly);
- _fields.set(identifier.ustring().rep(), aField);
+ _fields.set(identifier.ustring().impl(), aField);
}
}
return aField;
diff --git a/WebCore/bridge/c/c_utility.cpp b/WebCore/bridge/c/c_utility.cpp
index 443ecca..b160f9f 100644
--- a/WebCore/bridge/c/c_utility.cpp
+++ b/WebCore/bridge/c/c_utility.cpp
@@ -74,7 +74,7 @@ void convertValueToNPVariant(ExecState* exec, JSValue value, NPVariant* result)
if (value.isString()) {
UString ustring = value.toString(exec);
- CString cstring = ustring.UTF8String();
+ CString cstring = ustring.utf8();
NPString string = { (const NPUTF8*)cstring.data(), static_cast<uint32_t>(cstring.length()) };
NPN_InitializeVariantWithStringCopy(result, &string);
} else if (value.isNumber()) {
diff --git a/WebCore/bridge/jni/JNIBridge.cpp b/WebCore/bridge/jni/JNIBridge.cpp
index 35a0d34..8fa2678 100644
--- a/WebCore/bridge/jni/JNIBridge.cpp
+++ b/WebCore/bridge/jni/JNIBridge.cpp
@@ -41,7 +41,7 @@ using namespace WebCore;
JavaParameter::JavaParameter(JNIEnv* env, jstring type)
{
m_type = JavaString(env, type);
- m_JNIType = JNITypeFromClassName(m_type.UTF8String());
+ m_JNIType = JNITypeFromClassName(m_type.utf8());
}
JavaMethod::JavaMethod(JNIEnv* env, jobject aMethod)
@@ -55,7 +55,7 @@ JavaMethod::JavaMethod(JNIEnv* env, jobject aMethod)
env->DeleteLocalRef(returnType);
}
m_returnType = JavaString(env, returnTypeName);
- m_JNIReturnType = JNITypeFromClassName(m_returnType.UTF8String());
+ m_JNIReturnType = JNITypeFromClassName(m_returnType.utf8());
env->DeleteLocalRef(returnTypeName);
// Get method name
@@ -148,7 +148,7 @@ const char* JavaMethod::signature() const
}
signatureBuilder.append(")");
- const char* returnType = m_returnType.UTF8String();
+ const char* returnType = m_returnType.utf8();
if (m_JNIReturnType == array_type)
appendClassName(signatureBuilder, returnType);
else {
@@ -174,7 +174,7 @@ JNIType JavaMethod::JNIReturnType() const
jmethodID JavaMethod::methodID(jobject obj) const
{
if (!m_methodID)
- m_methodID = getMethodID(obj, m_name.UTF8String(), signature());
+ m_methodID = getMethodID(obj, m_name.utf8(), signature());
return m_methodID;
}
diff --git a/WebCore/bridge/jni/JNIBridge.h b/WebCore/bridge/jni/JNIBridge.h
index 78202ae..4f5e6b7 100644
--- a/WebCore/bridge/jni/JNIBridge.h
+++ b/WebCore/bridge/jni/JNIBridge.h
@@ -61,7 +61,7 @@ public:
m_impl.init(getJNIEnv(), s);
}
- const char* UTF8String() const { return m_impl.UTF8String(); }
+ const char* utf8() const { return m_impl.utf8(); }
const jchar* uchars() const { return m_impl.uchars(); }
int length() const { return m_impl.length(); }
#if USE(JSC)
@@ -78,7 +78,7 @@ public:
JavaParameter(JNIEnv*, jstring type);
virtual ~JavaParameter() { }
- RuntimeType type() const { return m_type.UTF8String(); }
+ RuntimeType type() const { return m_type.utf8(); }
JNIType getJNIType() const { return m_JNIType; }
private:
@@ -92,7 +92,7 @@ public:
~JavaMethod();
const JavaString& name() const { return m_name; }
- RuntimeType returnType() const { return m_returnType.UTF8String(); }
+ RuntimeType returnType() const { return m_returnType.utf8(); }
JavaParameter* parameterAt(int i) const { return &m_parameters[i]; }
int numParameters() const { return m_numParameters; }
diff --git a/WebCore/bridge/jni/jni_jsobject.mm b/WebCore/bridge/jni/jni_jsobject.mm
index 7793070..d7d3a54 100644
--- a/WebCore/bridge/jni/jni_jsobject.mm
+++ b/WebCore/bridge/jni/jni_jsobject.mm
@@ -276,7 +276,7 @@ RootObject* JavaJSObject::rootObject() const
jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
{
- LOG(LiveConnect, "JavaJSObject::call methodName = %s", JavaString(methodName).UTF8String());
+ LOG(LiveConnect, "JavaJSObject::call methodName = %s", JavaString(methodName).utf8());
RootObject* rootObject = this->rootObject();
if (!rootObject)
@@ -305,7 +305,7 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
jobject JavaJSObject::eval(jstring script) const
{
- LOG(LiveConnect, "JavaJSObject::eval script = %s", JavaString(script).UTF8String());
+ LOG(LiveConnect, "JavaJSObject::eval script = %s", JavaString(script).utf8());
JSValue result;
@@ -332,7 +332,7 @@ jobject JavaJSObject::eval(jstring script) const
jobject JavaJSObject::getMember(jstring memberName) const
{
- LOG(LiveConnect, "JavaJSObject::getMember (%p) memberName = %s", _imp, JavaString(memberName).UTF8String());
+ LOG(LiveConnect, "JavaJSObject::getMember (%p) memberName = %s", _imp, JavaString(memberName).utf8());
RootObject* rootObject = this->rootObject();
if (!rootObject)
@@ -348,7 +348,7 @@ jobject JavaJSObject::getMember(jstring memberName) const
void JavaJSObject::setMember(jstring memberName, jobject value) const
{
- LOG(LiveConnect, "JavaJSObject::setMember memberName = %s, value = %p", JavaString(memberName).UTF8String(), value);
+ LOG(LiveConnect, "JavaJSObject::setMember memberName = %s, value = %p", JavaString(memberName).utf8(), value);
RootObject* rootObject = this->rootObject();
if (!rootObject)
@@ -364,7 +364,7 @@ void JavaJSObject::setMember(jstring memberName, jobject value) const
void JavaJSObject::removeMember(jstring memberName) const
{
- LOG(LiveConnect, "JavaJSObject::removeMember memberName = %s", JavaString(memberName).UTF8String());
+ LOG(LiveConnect, "JavaJSObject::removeMember memberName = %s", JavaString(memberName).utf8());
RootObject* rootObject = this->rootObject();
if (!rootObject)
@@ -500,7 +500,7 @@ jobject JavaJSObject::convertValueToJObject(JSValue value) const
} else if (value.isString()) {
UString stringValue = value.toString(exec);
JNIEnv *env = getJNIEnv();
- result = env->NewString ((const jchar *)stringValue.data(), stringValue.size());
+ result = env->NewString ((const jchar *)stringValue.characters(), stringValue.length());
} else if (value.isBoolean()) {
jclass JSObjectClass = env->FindClass ("java/lang/Boolean");
jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(Z)V");
@@ -572,7 +572,7 @@ JSValue JavaJSObject::convertJObjectToValue(ExecState* exec, jobject theObject)
// created above to wrap internal browser objects. The constructor of this class takes the native
// pointer and stores it in this object, so that it can be retrieved below.
jstring className = (jstring)callJNIMethod<jobject>(classOfInstance, "getName", "()Ljava/lang/String;");
- if (!className || (strcmp(JavaString(className).UTF8String(), "sun.plugin.javascript.webkit.JSObject") != 0)) {
+ if (!className || (strcmp(JavaString(className).utf8(), "sun.plugin.javascript.webkit.JSObject") != 0)) {
JSLock lock(SilenceAssertionsOnly);
return JavaInstance::create(theObject, _rootObject)->createRuntimeObject(exec);
}
diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
index d5dc1cb..8a34ced 100644
--- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
@@ -49,7 +49,7 @@ JavaField::JavaField(JNIEnv* env, jobject aField)
fieldTypeName = env->NewStringUTF("<Unknown>");
m_type = JavaString(env, fieldTypeName);
- m_JNIType = JNITypeFromClassName(m_type.UTF8String());
+ m_JNIType = JNITypeFromClassName(m_type.utf8());
// Get field name
jstring fieldName = static_cast<jstring>(callJNIMethod<jobject>(aField, "getName", "()Ljava/lang/String;"));
@@ -150,7 +150,7 @@ JSValue JavaField::valueFromInstance(ExecState* exec, const Instance* i) const
break;
}
- LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", UString(name()).UTF8String().data(), jsresult.toString(exec).ascii());
+ LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", UString(name()).utf8().data(), jsresult.toString(exec).ascii().data());
return jsresult;
}
@@ -186,7 +186,7 @@ void JavaField::setValueToInstance(ExecState* exec, const Instance* i, JSValue a
const JavaInstance* instance = static_cast<const JavaInstance*>(i);
jvalue javaValue = convertValueToJValue(exec, i->rootObject(), aValue, m_JNIType, type());
- LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", UString(name()).UTF8String().data(), aValue.toString(exec).ascii());
+ LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", UString(name()).utf8().data(), aValue.toString(exec).ascii().data());
switch (m_JNIType) {
case array_type:
diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.h b/WebCore/bridge/jni/jsc/JNIBridgeJSC.h
index dd65417..afb1bce 100644
--- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.h
+++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.h
@@ -45,7 +45,7 @@ public:
virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const;
const JavaString& name() const { return m_name; }
- virtual RuntimeType type() const { return m_type.UTF8String(); }
+ virtual RuntimeType type() const { return m_type.utf8(); }
JNIType getJNIType() const { return m_JNIType; }
diff --git a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
index 2048d8e..2fb72e9 100644
--- a/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
+++ b/WebCore/bridge/jni/jsc/JNIUtilityPrivate.cpp
@@ -63,7 +63,7 @@ static jobject convertArrayInstanceToJavaArray(ExecState* exec, JSArray* jsArray
JSValue item = jsArray->get(exec, i);
UString stringValue = item.toString(exec);
env->SetObjectArrayElement(jarray, i,
- env->functions->NewString(env, (const jchar *)stringValue.data(), stringValue.size()));
+ env->functions->NewString(env, (const jchar *)stringValue.characters(), stringValue.length()));
}
}
break;
@@ -98,8 +98,8 @@ static jobject convertArrayInstanceToJavaArray(ExecState* exec, JSArray* jsArray
JSValue item = jsArray->get(exec, i);
UString stringValue = item.toString(exec);
jchar value = 0;
- if (stringValue.size() > 0)
- value = ((const jchar*)stringValue.data())[0];
+ if (stringValue.length() > 0)
+ value = ((const jchar*)stringValue.characters())[0];
env->SetCharArrayRegion((jcharArray)jarray, (jsize)i, (jsize)1, &value);
}
break;
@@ -218,7 +218,7 @@ jvalue convertValueToJValue(ExecState* exec, RootObject* rootObject, JSValue val
if (value.isString()) {
UString stringValue = asString(value)->value(exec);
JNIEnv* env = getJNIEnv();
- jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.data(), stringValue.size());
+ jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.characters(), stringValue.length());
result.l = javaString;
} else if (value.isNumber()) {
double doubleValue = value.uncheckedGetNumber();
@@ -237,7 +237,7 @@ jvalue convertValueToJValue(ExecState* exec, RootObject* rootObject, JSValue val
} else if (value.isUndefined()) {
UString stringValue = "undefined";
JNIEnv* env = getJNIEnv();
- jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.data(), stringValue.size());
+ jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.characters(), stringValue.length());
result.l = javaString;
}
}
@@ -248,7 +248,7 @@ jvalue convertValueToJValue(ExecState* exec, RootObject* rootObject, JSValue val
if (!value.isNull()) {
UString stringValue = value.toString(exec);
JNIEnv* env = getJNIEnv();
- jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.data(), stringValue.size());
+ jobject javaString = env->functions->NewString(env, (const jchar*)stringValue.characters(), stringValue.length());
result.l = javaString;
}
}
diff --git a/WebCore/bridge/jni/jsc/JavaClassJSC.cpp b/WebCore/bridge/jni/jsc/JavaClassJSC.cpp
index 780c4fc..43cdc96 100644
--- a/WebCore/bridge/jni/jsc/JavaClassJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaClassJSC.cpp
@@ -63,7 +63,7 @@ JavaClass::JavaClass(jobject anInstance)
JavaField* aField = new JavaField(env, aJField); // deleted in the JavaClass destructor
{
JSLock lock(SilenceAssertionsOnly);
- m_fields.set(((UString)aField->name()).rep(), aField);
+ m_fields.set(((UString)aField->name()).impl(), aField);
}
env->DeleteLocalRef(aJField);
}
@@ -80,10 +80,10 @@ JavaClass::JavaClass(jobject anInstance)
{
JSLock lock(SilenceAssertionsOnly);
- methodList = m_methods.get(((UString)aMethod->name()).rep());
+ methodList = m_methods.get(((UString)aMethod->name()).impl());
if (!methodList) {
methodList = new MethodList();
- m_methods.set(((UString)aMethod->name()).rep(), methodList);
+ m_methods.set(((UString)aMethod->name()).impl(), methodList);
}
}
methodList->append(aMethod);
@@ -115,7 +115,7 @@ JavaClass::~JavaClass()
MethodList JavaClass::methodsNamed(const Identifier& identifier, Instance*) const
{
- MethodList* methodList = m_methods.get(identifier.ustring().rep());
+ MethodList* methodList = m_methods.get(identifier.ustring().impl());
if (methodList)
return *methodList;
@@ -124,7 +124,7 @@ MethodList JavaClass::methodsNamed(const Identifier& identifier, Instance*) cons
Field* JavaClass::fieldNamed(const Identifier& identifier, Instance*) const
{
- return m_fields.get(identifier.ustring().rep());
+ return m_fields.get(identifier.ustring().impl());
}
bool JavaClass::isNumberClass() const
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
index 2c9a4ad..1e584af 100644
--- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
@@ -167,14 +167,14 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod
}
const JavaMethod* jMethod = static_cast<const JavaMethod*>(method);
- LOG(LiveConnect, "JavaInstance::invokeMethod call %s %s on %p", UString(jMethod->name()).UTF8String().data(), jMethod->signature(), m_instance->m_instance);
+ LOG(LiveConnect, "JavaInstance::invokeMethod call %s %s on %p", UString(jMethod->name()).utf8().data(), jMethod->signature(), m_instance->m_instance);
Vector<jvalue> jArgs(count);
for (i = 0; i < count; i++) {
JavaParameter* aParameter = jMethod->parameterAt(i);
jArgs[i] = convertValueToJValue(exec, m_rootObject.get(), exec->argument(i), aParameter->getJNIType(), aParameter->type());
- LOG(LiveConnect, "JavaInstance::invokeMethod arg[%d] = %s", i, exec->argument(i).toString(exec).ascii());
+ LOG(LiveConnect, "JavaInstance::invokeMethod arg[%d] = %s", i, exec->argument(i).toString(exec).ascii().data());
}
jvalue result;
@@ -258,7 +258,7 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod
else {
jobject classOfInstance = callJNIMethod<jobject>(result.l, "getClass", "()Ljava/lang/Class;");
jstring className = static_cast<jstring>(callJNIMethod<jobject>(classOfInstance, "getName", "()Ljava/lang/String;"));
- if (!strcmp(JavaString(className).UTF8String(), "sun.plugin.javascript.webkit.JSObject")) {
+ if (!strcmp(JavaString(className).utf8(), "sun.plugin.javascript.webkit.JSObject")) {
// Pull the nativeJSObject value from the Java instance. This is a pointer to the JSObject.
JNIEnv* env = getJNIEnv();
jfieldID fieldID = env->GetFieldID(static_cast<jclass>(classOfInstance), "nativeJSObject", "J");
diff --git a/WebCore/bridge/jni/jsc/JavaStringJSC.h b/WebCore/bridge/jni/jsc/JavaStringJSC.h
index 0a7dad5..cf575b2 100644
--- a/WebCore/bridge/jni/jsc/JavaStringJSC.h
+++ b/WebCore/bridge/jni/jsc/JavaStringJSC.h
@@ -40,13 +40,13 @@ public:
~JavaStringImpl()
{
JSLock lock(SilenceAssertionsOnly);
- m_rep = 0;
+ m_impl = 0;
}
void init()
{
JSLock lock(SilenceAssertionsOnly);
- m_rep = UString().rep();
+ m_impl = UString().impl();
}
void init(JNIEnv* e, jstring s)
@@ -55,25 +55,25 @@ public:
const jchar* uc = getUCharactersFromJStringInEnv(e, s);
{
JSLock lock(SilenceAssertionsOnly);
- m_rep = UString(reinterpret_cast<const UChar*>(uc), size).rep();
+ m_impl = UString(reinterpret_cast<const UChar*>(uc), size).impl();
}
releaseUCharactersForJStringInEnv(e, s, uc);
}
- const char* UTF8String() const
+ const char* utf8() const
{
if (!m_utf8String.data()) {
JSLock lock(SilenceAssertionsOnly);
- m_utf8String = UString(m_rep).UTF8String();
+ m_utf8String = UString(m_impl).utf8();
}
return m_utf8String.data();
}
- const jchar* uchars() const { return (const jchar*)m_rep->characters(); }
- int length() const { return m_rep->length(); }
- UString uString() const { return UString(m_rep); }
+ const jchar* uchars() const { return (const jchar*)m_impl->characters(); }
+ int length() const { return m_impl->length(); }
+ UString uString() const { return UString(m_impl); }
private:
- RefPtr<UString::Rep> m_rep;
+ RefPtr<StringImpl> m_impl;
mutable CString m_utf8String;
};
diff --git a/WebCore/bridge/jni/v8/JavaClassV8.h b/WebCore/bridge/jni/v8/JavaClassV8.h
index b7447b2..0c1d627 100644
--- a/WebCore/bridge/jni/v8/JavaClassV8.h
+++ b/WebCore/bridge/jni/v8/JavaClassV8.h
@@ -28,9 +28,9 @@
#include "JNIBridgeV8.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace JSC {
diff --git a/WebCore/bridge/jsc/BridgeJSC.h b/WebCore/bridge/jsc/BridgeJSC.h
index 44ce4d1..9cc9140 100644
--- a/WebCore/bridge/jsc/BridgeJSC.h
+++ b/WebCore/bridge/jsc/BridgeJSC.h
@@ -140,9 +140,9 @@ protected:
const char* signatureForParameters(const ArgList&);
-typedef HashMap<RefPtr<UString::Rep>, MethodList*> MethodListMap;
-typedef HashMap<RefPtr<UString::Rep>, Method*> MethodMap;
-typedef HashMap<RefPtr<UString::Rep>, Field*> FieldMap;
+typedef HashMap<RefPtr<StringImpl>, MethodList*> MethodListMap;
+typedef HashMap<RefPtr<StringImpl>, Method*> MethodMap;
+typedef HashMap<RefPtr<StringImpl>, Field*> FieldMap;
} // namespace Bindings
diff --git a/WebCore/bridge/objc/objc_class.mm b/WebCore/bridge/objc/objc_class.mm
index 62f0a34..2d29499 100644
--- a/WebCore/bridge/objc/objc_class.mm
+++ b/WebCore/bridge/objc/objc_class.mm
@@ -78,11 +78,11 @@ MethodList ObjcClass::methodsNamed(const Identifier& identifier, Instance*) cons
MethodList methodList;
char fixedSizeBuffer[1024];
char* buffer = fixedSizeBuffer;
- const char* JSName = identifier.ascii();
- if (!convertJSMethodNameToObjc(JSName, buffer, sizeof(fixedSizeBuffer))) {
- int length = strlen(JSName) + 1;
+ CString jsName = identifier.ascii();
+ if (!convertJSMethodNameToObjc(jsName.data(), buffer, sizeof(fixedSizeBuffer))) {
+ int length = jsName.length() + 1;
buffer = new char[length];
- if (!buffer || !convertJSMethodNameToObjc(JSName, buffer, length))
+ if (!buffer || !convertJSMethodNameToObjc(jsName.data(), buffer, length))
return methodList;
}
@@ -153,8 +153,8 @@ Field* ObjcClass::fieldNamed(const Identifier& identifier, Instance* instance) c
{
ClassStructPtr thisClass = _isa;
- const char* name = identifier.ascii();
- RetainPtr<CFStringRef> fieldName(AdoptCF, CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII));
+ CString jsName = identifier.ascii();
+ RetainPtr<CFStringRef> fieldName(AdoptCF, CFStringCreateWithCString(NULL, jsName.data(), kCFStringEncodingASCII));
Field* aField = (Field*)CFDictionaryGetValue(_fields.get(), fieldName.get());
if (aField)
return aField;
@@ -220,7 +220,7 @@ Field* ObjcClass::fieldNamed(const Identifier& identifier, Instance* instance) c
if ([thisClass respondsToSelector:@selector(webScriptNameForKey:)])
mappedName = [thisClass webScriptNameForKey:objcIvarName];
- if ((mappedName && [mappedName isEqual:(NSString*)fieldName.get()]) || strcmp(objcIvarName, name) == 0) {
+ if ((mappedName && [mappedName isEqual:(NSString*)fieldName.get()]) || strcmp(objcIvarName, jsName.data()) == 0) {
aField = new ObjcField(objcIVar); // deleted when the dictionary is destroyed
CFDictionaryAddValue(_fields.get(), fieldName.get(), aField);
break;
diff --git a/WebCore/bridge/objc/objc_instance.mm b/WebCore/bridge/objc/objc_instance.mm
index 2b518b1..6c56458 100644
--- a/WebCore/bridge/objc/objc_instance.mm
+++ b/WebCore/bridge/objc/objc_instance.mm
@@ -391,7 +391,7 @@ bool ObjcInstance::setValueOfUndefinedField(ExecState* exec, const Identifier& p
ObjcValue objcValue = convertValueToObjcValue(exec, aValue, ObjcObjectType);
@try {
- [targetObject setValue:objcValue.objectValue forUndefinedKey:[NSString stringWithCString:property.ascii() encoding:NSASCIIStringEncoding]];
+ [targetObject setValue:objcValue.objectValue forUndefinedKey:[NSString stringWithCString:property.ascii().data() encoding:NSASCIIStringEncoding]];
} @catch(NSException* localException) {
// Do nothing. Class did not override valueForUndefinedKey:.
}
@@ -417,7 +417,7 @@ JSValue ObjcInstance::getValueOfUndefinedField(ExecState* exec, const Identifier
setGlobalException(nil);
@try {
- id objcValue = [targetObject valueForUndefinedKey:[NSString stringWithCString:property.ascii() encoding:NSASCIIStringEncoding]];
+ id objcValue = [targetObject valueForUndefinedKey:[NSString stringWithCString:property.ascii().data() encoding:NSASCIIStringEncoding]];
result = convertObjcValueToValue(exec, &objcValue, ObjcObjectType, m_rootObject.get());
} @catch(NSException* localException) {
// Do nothing. Class did not override valueForUndefinedKey:.
diff --git a/WebCore/bridge/objc/objc_runtime.mm b/WebCore/bridge/objc/objc_runtime.mm
index e86cb1e..3c4ba23 100644
--- a/WebCore/bridge/objc/objc_runtime.mm
+++ b/WebCore/bridge/objc/objc_runtime.mm
@@ -237,7 +237,7 @@ static EncodedJSValue JSC_HOST_CALL callObjCFallbackObject(ExecState* exec)
ObjcClass* objcClass = static_cast<ObjcClass*>(objcInstance->getClass());
OwnPtr<ObjcMethod> fallbackMethod(new ObjcMethod(objcClass->isa(), @selector(invokeUndefinedMethodFromWebScript:withArguments:)));
const Identifier& nameIdentifier = static_cast<ObjcFallbackObjectImp*>(exec->callee())->propertyName();
- RetainPtr<CFStringRef> name(AdoptCF, CFStringCreateWithCharacters(0, nameIdentifier.data(), nameIdentifier.size()));
+ RetainPtr<CFStringRef> name(AdoptCF, CFStringCreateWithCharacters(0, nameIdentifier.characters(), nameIdentifier.length()));
fallbackMethod->setJavaScriptName(name.get());
result = objcInstance->invokeObjcMethod(exec, fallbackMethod.get());
}
diff --git a/WebCore/bridge/qt/qt_class.cpp b/WebCore/bridge/qt/qt_class.cpp
index d809c81..4c29c69 100644
--- a/WebCore/bridge/qt/qt_class.cpp
+++ b/WebCore/bridge/qt/qt_class.cpp
@@ -71,8 +71,7 @@ JSValue QtClass::fallbackObject(ExecState* exec, Instance* inst, const Identifie
QtInstance* qtinst = static_cast<QtInstance*>(inst);
const UString& ustring = identifier.ustring();
- const QByteArray name = QString(reinterpret_cast<const QChar*>(ustring.data()),
- ustring.size()).toAscii();
+ const QByteArray name = QString(reinterpret_cast<const QChar*>(ustring.characters()), ustring.length()).toAscii();
// First see if we have a cache hit
JSObject* val = qtinst->m_methods.value(name);
@@ -131,7 +130,7 @@ Field* QtClass::fieldNamed(const Identifier& identifier, Instance* instance) con
QObject* obj = qtinst->getObject();
const UString& ustring = identifier.ustring();
- const QString name(reinterpret_cast<const QChar*>(ustring.data()), ustring.size());
+ const QString name(reinterpret_cast<const QChar*>(ustring.characters()), ustring.length());
const QByteArray ascii = name.toAscii();
// First check for a cached field
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index b9cf4b0..6881c2e 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -310,7 +310,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
dist = 6;
} else {
UString str = value.toString(exec);
- ret = QVariant(QChar(str.size() ? *(const ushort*)str.rep()->characters() : 0));
+ ret = QVariant(QChar(str.length() ? *(const ushort*)str.impl()->characters() : 0));
if (type == String)
dist = 3;
else
@@ -325,7 +325,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
return QString();
} else {
UString ustring = value.toString(exec);
- ret = QVariant(QString((const QChar*)ustring.rep()->characters(), ustring.size()));
+ ret = QVariant(QString((const QChar*)ustring.impl()->characters(), ustring.length()));
if (type == String)
dist = 0;
else
@@ -349,7 +349,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit);
if (objdist >= 0) {
UString ustring = (*it).ustring();
- QString id = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString id = QString((const QChar*)ustring.impl()->characters(), ustring.length());
result.insert(id, v);
}
}
@@ -424,7 +424,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
for (int i = 0; i < len; ++i) {
JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
UString ustring = val.toString(exec);
- QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
result.append(qstring);
}
@@ -438,7 +438,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
for (int i = 0; i < len; ++i) {
JSValue val = array->get(exec, i);
UString ustring = val.toString(exec);
- QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
result.append(qstring);
}
@@ -447,7 +447,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
} else {
// Make a single length array
UString ustring = value.toString(exec);
- QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
QStringList result;
result.append(qstring);
ret = QVariant(result);
@@ -463,7 +463,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
dist = 0;
} else {
UString ustring = value.toString(exec);
- ret = QVariant(QString((const QChar*)ustring.rep()->characters(), ustring.size()).toLatin1());
+ ret = QVariant(QString((const QChar*)ustring.impl()->characters(), ustring.length()).toLatin1());
if (type == String)
dist = 5;
else
@@ -503,9 +503,10 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
ret = QTime(gdt.hour, gdt.minute, gdt.second);
dist = 10;
}
+#ifndef QT_NO_DATESTRING
} else if (type == String) {
UString ustring = value.toString(exec);
- QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
if (hint == QMetaType::QDateTime) {
QDateTime dt = QDateTime::fromString(qstring, Qt::ISODate);
@@ -544,6 +545,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
dist = 3;
}
}
+#endif // QT_NO_DATESTRING
}
break;
@@ -554,7 +556,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
*/
// Attempt to convert.. a bit risky
UString ustring = value.toString(exec);
- QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
// this is of the form '/xxxxxx/i'
int firstSlash = qstring.indexOf(QLatin1Char('/'));
@@ -574,7 +576,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
}
} else if (type == String) {
UString ustring = value.toString(exec);
- QString qstring = QString((const QChar*)ustring.rep()->characters(), ustring.size());
+ QString qstring = QString((const QChar*)ustring.impl()->characters(), ustring.length());
QRegExp re(qstring);
if (re.isValid()) {
diff --git a/WebCore/bridge/runtime_array.cpp b/WebCore/bridge/runtime_array.cpp
index 2cd7d66..ca12f48 100644
--- a/WebCore/bridge/runtime_array.cpp
+++ b/WebCore/bridge/runtime_array.cpp
@@ -82,7 +82,7 @@ bool RuntimeArray::getOwnPropertySlot(ExecState* exec, const Identifier& propert
}
bool ok;
- unsigned index = propertyName.toArrayIndex(&ok);
+ unsigned index = propertyName.toArrayIndex(ok);
if (ok) {
if (index < getLength()) {
slot.setCustomIndex(this, index, indexGetter);
@@ -103,7 +103,7 @@ bool RuntimeArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& p
}
bool ok;
- unsigned index = propertyName.toArrayIndex(&ok);
+ unsigned index = propertyName.toArrayIndex(ok);
if (ok) {
if (index < getLength()) {
PropertySlot slot;
@@ -134,7 +134,7 @@ void RuntimeArray::put(ExecState* exec, const Identifier& propertyName, JSValue
}
bool ok;
- unsigned index = propertyName.toArrayIndex(&ok);
+ unsigned index = propertyName.toArrayIndex(ok);
if (ok) {
getConcreteArray()->setValueAt(exec, index, value);
return;
diff --git a/WebCore/combine-javascript-resources b/WebCore/combine-javascript-resources
index 96dfc88..428b6b7 100755
--- a/WebCore/combine-javascript-resources
+++ b/WebCore/combine-javascript-resources
@@ -31,12 +31,14 @@ use Getopt::Long;
use File::Basename;
use File::Path;
+my $generatedScriptsDirectory;
my $outputDirectory;
my $scriptName;
my $htmlFile;
GetOptions('output-dir=s' => \$outputDirectory,
'output-script-name=s' => \$scriptName,
+ 'generated-scripts-dir=s' => \$generatedScriptsDirectory,
'input-html=s' => \$htmlFile);
unless (defined $htmlFile and defined $scriptName and defined $outputDirectory) {
@@ -62,7 +64,7 @@ open SCRIPT_OUT, ">", "$outputDirectory/$scriptName" or die "Can't open $outputD
while ($headContents =~ m/<script.*src="([^"]*)"[^>]*>/gi) {
local $/;
- open SCRIPT_IN, "$htmlDirectory/$1" or die "Can't open $htmlDirectory/$1: $!";
+ open SCRIPT_IN, "$generatedScriptsDirectory/$1" or open SCRIPT_IN, "$htmlDirectory/$1" or die "Can't open $htmlDirectory/$1: $!";
print SCRIPT_OUT "/* $1 */\n\n";
print SCRIPT_OUT <SCRIPT_IN>;
close SCRIPT_IN;
diff --git a/WebCore/css/CSSCanvasValue.cpp b/WebCore/css/CSSCanvasValue.cpp
index 0c1c3f9..767c11e 100644
--- a/WebCore/css/CSSCanvasValue.cpp
+++ b/WebCore/css/CSSCanvasValue.cpp
@@ -90,7 +90,7 @@ Image* CSSCanvasValue::image(RenderObject* renderer, const IntSize& /*size*/)
HTMLCanvasElement* elt = element(renderer->document());
if (!elt || !elt->buffer())
return 0;
- return elt->buffer()->image();
+ return elt->copiedImage();
}
} // namespace WebCore
diff --git a/WebCore/css/CSSFontFaceSource.h b/WebCore/css/CSSFontFaceSource.h
index 278ba72..4ec54d6 100644
--- a/WebCore/css/CSSFontFaceSource.h
+++ b/WebCore/css/CSSFontFaceSource.h
@@ -26,10 +26,10 @@
#ifndef CSSFontFaceSource_h
#define CSSFontFaceSource_h
-#include "AtomicString.h"
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
#include <wtf/HashMap.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/css/CSSFontSelector.cpp b/WebCore/css/CSSFontSelector.cpp
index 752798d..b98dcae 100644
--- a/WebCore/css/CSSFontSelector.cpp
+++ b/WebCore/css/CSSFontSelector.cpp
@@ -27,7 +27,6 @@
#include "config.h"
#include "CSSFontSelector.h"
-#include "AtomicString.h"
#include "CachedFont.h"
#include "CSSFontFace.h"
#include "CSSFontFaceRule.h"
@@ -48,6 +47,7 @@
#include "RenderObject.h"
#include "Settings.h"
#include "SimpleFontData.h"
+#include <wtf/text/AtomicString.h>
#if ENABLE(SVG)
#include "SVGFontFaceElement.h"
diff --git a/WebCore/css/CSSFontSelector.h b/WebCore/css/CSSFontSelector.h
index d9cce1c..abf82cd 100644
--- a/WebCore/css/CSSFontSelector.h
+++ b/WebCore/css/CSSFontSelector.h
@@ -27,10 +27,10 @@
#define CSSFontSelector_h
#include "FontSelector.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/css/CSSNamespace.h b/WebCore/css/CSSNamespace.h
index 0a1119d..d7fab4c 100644
--- a/WebCore/css/CSSNamespace.h
+++ b/WebCore/css/CSSNamespace.h
@@ -22,7 +22,7 @@
#ifndef CSSNamespace_h
#define CSSNamespace_h
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index cdd6294..7528cd8 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -66,12 +66,12 @@
#include "Pair.h"
#include "Rect.h"
#include "ShadowValue.h"
-#include "StringBuffer.h"
#include "WebKitCSSKeyframeRule.h"
#include "WebKitCSSKeyframesRule.h"
#include "WebKitCSSTransformValue.h"
#include <limits.h>
#include <wtf/dtoa.h>
+#include <wtf/text/StringBuffer.h>
#if ENABLE(DASHBOARD_SUPPORT)
#include "DashboardRegion.h"
@@ -319,7 +319,7 @@ bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int id, cons
// possible to set up a default color.
bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
{
- // First try creating a color specified by name, rgb() or "#" syntax.
+ // First try creating a color specified by name, rgba(), rgb() or "#" syntax.
if (parseColor(string, color, strict))
return true;
@@ -3830,6 +3830,63 @@ static inline bool parseColorInt(const UChar*& string, const UChar* end, UChar t
return true;
}
+static inline bool isTenthAlpha(const UChar* string, const int length)
+{
+ // "0.X"
+ if (length == 3 && string[0] == '0' && string[1] == '.' && isASCIIDigit(string[2]))
+ return true;
+
+ // ".X"
+ if (length == 2 && string[0] == '.' && isASCIIDigit(string[1]))
+ return true;
+
+ return false;
+}
+
+static inline bool parseAlphaValue(const UChar*& string, const UChar* end, UChar terminator, int& value)
+{
+ while (string != end && isCSSWhitespace(*string))
+ string++;
+
+ value = 0;
+
+ int length = end - string;
+ if (length < 2)
+ return false;
+
+ if (string[0] != '0' && string[0] != '1' && string[0] != '.')
+ return false;
+
+ if (string[length - 1] != terminator)
+ return false;
+
+ if (length == 2 && string[0] != '.') {
+ value = string[0] == '1' ? 255 : 0;
+ string = end;
+ return true;
+ }
+
+ if (isTenthAlpha(string, length - 1)) {
+ static const int tenthAlphaValues[] = { 0, 25, 51, 76, 102, 127, 153, 179, 204, 230 };
+ value = tenthAlphaValues[string[length - 2] - '0'];
+ string = end;
+ return true;
+ }
+
+ Vector<char, 8> bytes(length + 1);
+ for (int i = 0; i < length; ++i) {
+ if (!isASCIIDigit(string[i]) && string[i] != '.' && string[i] != terminator)
+ return false;
+ bytes[i] = string[i];
+ }
+ bytes[length] = '\0';
+ char* foundTerminator;
+ double d = WTF::strtod(bytes.data(), &foundTerminator);
+ value = static_cast<int>(d * nextafter(256.0, 0.0));
+ string += (foundTerminator - bytes.data()) + 1;
+ return *foundTerminator == terminator;
+}
+
bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict)
{
const UChar* characters = name.characters();
@@ -3845,6 +3902,28 @@ bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict)
}
}
+ // Try rgba() syntax.
+ if (name.startsWith("rgba(")) {
+ const UChar* current = characters + 5;
+ const UChar* end = characters + length;
+ int red;
+ int green;
+ int blue;
+ int alpha;
+ if (!parseColorInt(current, end, ',', red))
+ return false;
+ if (!parseColorInt(current, end, ',', green))
+ return false;
+ if (!parseColorInt(current, end, ',', blue))
+ return false;
+ if (!parseAlphaValue(current, end, ')', alpha))
+ return false;
+ if (current != end)
+ return false;
+ rgb = makeRGBA(red, green, blue, alpha);
+ return true;
+ }
+
// Try rgb() syntax.
if (name.startsWith("rgb(")) {
const UChar* current = characters + 4;
@@ -3863,6 +3942,7 @@ bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict)
rgb = makeRGB(red, green, blue);
return true;
}
+
// Try named colors.
Color tc;
tc.setNamedColor(name);
diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h
index 5d76a41..1e233c8 100644
--- a/WebCore/css/CSSParser.h
+++ b/WebCore/css/CSSParser.h
@@ -23,7 +23,6 @@
#ifndef CSSParser_h
#define CSSParser_h
-#include "AtomicString.h"
#include "Color.h"
#include "CSSParserValues.h"
#include "CSSSelectorList.h"
@@ -31,6 +30,7 @@
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/css/CSSParserValues.h b/WebCore/css/CSSParserValues.h
index a421fe0..5c6f55e 100644
--- a/WebCore/css/CSSParserValues.h
+++ b/WebCore/css/CSSParserValues.h
@@ -21,7 +21,7 @@
#ifndef CSSParserValues_h
#define CSSParserValues_h
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index 03974d9..1f336a2 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -67,42 +67,46 @@ private:
Vector<CSSSelector*, 16> m_stack;
};
-unsigned int CSSSelector::specificity()
+unsigned CSSSelector::specificity() const
{
- if (m_isForPage)
- return specificityForPage();
+ // make sure the result doesn't overflow
+ static const unsigned maxValueMask = 0xffffff;
+ unsigned total = 0;
+ for (const CSSSelector* selector = this; selector; selector = selector->tagHistory()) {
+ if (selector->m_isForPage)
+ return (total + selector->specificityForPage()) & maxValueMask;
+ total = (total + selector->specificityForOneSelector()) & maxValueMask;
+ }
+ return total;
+}
+inline unsigned CSSSelector::specificityForOneSelector() const
+{
// FIXME: Pseudo-elements and pseudo-classes do not have the same specificity. This function
// isn't quite correct.
- int s = (m_tag.localName() == starAtom ? 0 : 1);
+ unsigned s = (m_tag.localName() == starAtom ? 0 : 1);
switch (m_match) {
- case Id:
- s += 0x10000;
- break;
- case Exact:
- case Class:
- case Set:
- case List:
- case Hyphen:
- case PseudoClass:
- case PseudoElement:
- case Contain:
- case Begin:
- case End:
- s += 0x100;
- case None:
- break;
+ case Id:
+ s += 0x10000;
+ break;
+ case Exact:
+ case Class:
+ case Set:
+ case List:
+ case Hyphen:
+ case PseudoClass:
+ case PseudoElement:
+ case Contain:
+ case Begin:
+ case End:
+ s += 0x100;
+ case None:
+ break;
}
-
- // FIXME: Avoid recursive calls to prevent possible stack overflow.
- if (CSSSelector* tagHistory = this->tagHistory())
- s += tagHistory->specificity();
-
- // make sure it doesn't overflow
- return s & 0xffffff;
+ return s;
}
-unsigned CSSSelector::specificityForPage()
+unsigned CSSSelector::specificityForPage() const
{
// See http://dev.w3.org/csswg/css3-page/#cascading-and-page-context
unsigned s = (m_tag.localName() == starAtom ? 0 : 4);
@@ -902,8 +906,8 @@ bool CSSSelector::RareData::parseNth()
m_a = 2;
m_b = 0;
} else {
- int n = argument.find('n');
- if (n != -1) {
+ size_t n = argument.find('n');
+ if (n != notFound) {
if (argument[0] == '-') {
if (n == 1)
m_a = -1; // -n == -1n
@@ -914,12 +918,12 @@ bool CSSSelector::RareData::parseNth()
else
m_a = argument.substring(0, n).toInt();
- int p = argument.find('+', n);
- if (p != -1)
+ size_t p = argument.find('+', n);
+ if (p != notFound)
m_b = argument.substring(p + 1, argument.length() - p - 1).toInt();
else {
p = argument.find('-', n);
- if (p != -1)
+ if (p != notFound)
m_b = -argument.substring(p + 1, argument.length() - p - 1).toInt();
}
} else
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h
index 34e4af0..e253949 100644
--- a/WebCore/css/CSSSelector.h
+++ b/WebCore/css/CSSSelector.h
@@ -85,7 +85,7 @@ namespace WebCore {
// tag == -1 means apply to all elements (Selector = *)
- unsigned specificity();
+ unsigned specificity() const;
/* how the attribute value has to match.... Default is Exact */
enum Match {
@@ -294,7 +294,8 @@ namespace WebCore {
void releaseOwnedSelectorsToBag(CSSSelectorBag&);
void deleteReachableSelectors();
- unsigned specificityForPage();
+ unsigned specificityForOneSelector() const;
+ unsigned specificityForPage() const;
void extractPseudoType() const;
struct RareData : Noncopyable {
diff --git a/WebCore/css/CSSStyleDeclaration.cpp b/WebCore/css/CSSStyleDeclaration.cpp
index 404a978..996d573 100644
--- a/WebCore/css/CSSStyleDeclaration.cpp
+++ b/WebCore/css/CSSStyleDeclaration.cpp
@@ -82,8 +82,8 @@ bool CSSStyleDeclaration::isPropertyImplicit(const String& propertyName)
void CSSStyleDeclaration::setProperty(const String& propertyName, const String& value, ExceptionCode& ec)
{
- int important = value.find("!important", 0, false);
- if (important == -1)
+ size_t important = value.find("!important", 0, false);
+ if (important == notFound)
setProperty(propertyName, value, "", ec);
else
setProperty(propertyName, value.left(important - 1), "important", ec);
@@ -96,7 +96,7 @@ void CSSStyleDeclaration::setProperty(const String& propertyName, const String&
// FIXME: Should we raise an exception here?
return;
}
- bool important = priority.find("important", 0, false) != -1;
+ bool important = priority.find("important", 0, false) != notFound;
setProperty(propID, value, important, ec);
}
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index bd94b68..fd411d9 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -125,8 +125,6 @@ namespace WebCore {
using namespace HTMLNames;
-// #define STYLE_SHARING_STATS 1
-
#define HANDLE_INHERIT(prop, Prop) \
if (isInherit) { \
m_style->set##Prop(m_parentStyle->prop()); \
@@ -460,32 +458,37 @@ CSSStyleSelector::CSSStyleSelector(Document* doc, StyleSheetList* styleSheets, C
m_medium = new MediaQueryEvaluator(view->mediaType(), view->frame(), m_rootDefaultStyle.get());
}
+ m_authorStyle = new CSSRuleSet();
+
// FIXME: This sucks! The user sheet is reparsed every time!
- if (pageUserSheet || pageGroupUserSheets) {
- m_userStyle = new CSSRuleSet();
- if (pageUserSheet)
- m_userStyle->addRulesFromSheet(pageUserSheet, *m_medium, this);
- if (pageGroupUserSheets) {
- unsigned length = pageGroupUserSheets->size();
- for (unsigned i = 0; i < length; i++)
- m_userStyle->addRulesFromSheet(pageGroupUserSheets->at(i).get(), *m_medium, this);
+ OwnPtr<CSSRuleSet> tempUserStyle(new CSSRuleSet);
+ if (pageUserSheet)
+ tempUserStyle->addRulesFromSheet(pageUserSheet, *m_medium, this);
+ if (pageGroupUserSheets) {
+ unsigned length = pageGroupUserSheets->size();
+ for (unsigned i = 0; i < length; i++) {
+ if (pageGroupUserSheets->at(i)->isUserStyleSheet())
+ tempUserStyle->addRulesFromSheet(pageGroupUserSheets->at(i).get(), *m_medium, this);
+ else
+ m_authorStyle->addRulesFromSheet(pageGroupUserSheets->at(i).get(), *m_medium, this);
}
}
- // add stylesheets from document
- m_authorStyle = new CSSRuleSet();
-
+ if (tempUserStyle->m_ruleCount > 0 || tempUserStyle->m_pageRuleCount > 0)
+ m_userStyle = tempUserStyle.leakPtr();
+
// Add rules from elements like SVG's <font-face>
if (mappedElementSheet)
m_authorStyle->addRulesFromSheet(mappedElementSheet, *m_medium, this);
+ // add stylesheets from document
unsigned length = styleSheets->length();
for (unsigned i = 0; i < length; i++) {
StyleSheet* sheet = styleSheets->item(i);
if (sheet->isCSSStyleSheet() && !sheet->disabled())
m_authorStyle->addRulesFromSheet(static_cast<CSSStyleSheet*>(sheet), *m_medium, this);
}
-
+
if (doc->renderer() && doc->renderer()->style())
doc->renderer()->style()->font().update(fontSelector());
}
@@ -948,11 +951,6 @@ bool CSSStyleSelector::SelectorChecker::checkSelector(CSSSelector* sel, Element*
return checkSelector(sel, element, 0, dynamicPseudo, false, false) == SelectorMatches;
}
-#ifdef STYLE_SHARING_STATS
-static int fraction = 0;
-static int total = 0;
-#endif
-
static const unsigned cStyleSearchThreshold = 10;
Node* CSSStyleSelector::locateCousinList(Element* parent, unsigned depth)
@@ -1737,23 +1735,17 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
style->hasTransformRelatedProperty() || style->hasMask() || style->boxReflect()))
style->setZIndex(0);
- // Button, legend, input, select and textarea all consider width values of 'auto' to be 'intrinsic'.
- // This will be important when we use block flows for all form controls.
- if (e && (e->hasTagName(legendTag) || e->hasTagName(buttonTag) || e->hasTagName(inputTag) ||
- e->hasTagName(selectTag) || e->hasTagName(textareaTag) || e->hasTagName(datagridTag)
#if ENABLE(WML)
- || e->hasTagName(WMLNames::insertedLegendTag)
- || e->hasTagName(WMLNames::inputTag)
+ if (e && (e->hasTagName(WMLNames::insertedLegendTag)
+ || e->hasTagName(WMLNames::inputTag))
+ && style->width().isAuto())
+ style->setWidth(Length(Intrinsic));
#endif
- )) {
- if (style->width().isAuto())
- style->setWidth(Length(Intrinsic));
- // Textarea considers overflow visible as auto.
- if (e && e->hasTagName(textareaTag)) {
- style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->overflowX());
- style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->overflowY());
- }
+ // Textarea considers overflow visible as auto.
+ if (e && e->hasTagName(textareaTag)) {
+ style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->overflowX());
+ style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->overflowY());
}
// Finally update our text decorations in effect, but don't allow text-decoration to percolate through
@@ -2127,18 +2119,18 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
if (sel->m_value.contains(' ') || sel->m_value.isEmpty())
return false;
- int startSearchAt = 0;
+ unsigned startSearchAt = 0;
while (true) {
- int foundPos = value.find(sel->m_value, startSearchAt, caseSensitive);
- if (foundPos == -1)
+ size_t foundPos = value.find(sel->m_value, startSearchAt, caseSensitive);
+ if (foundPos == notFound)
return false;
- if (foundPos == 0 || value[foundPos-1] == ' ') {
+ if (foundPos == 0 || value[foundPos - 1] == ' ') {
unsigned endStr = foundPos + sel->m_value.length();
if (endStr == value.length() || value[endStr] == ' ')
break; // We found a match.
}
- // No match. Keep looking.
+ // No match. Keep looking.
startSearchAt = foundPos + 1;
}
break;
@@ -2623,7 +2615,7 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
n = n->parent();
}
const AtomicString& argument = sel->argument();
- if (value.isNull() || !value.startsWith(argument, false))
+ if (value.isEmpty() || !value.startsWith(argument, false))
break;
if (value.length() != argument.length() && value[argument.length()] != '-')
break;
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index 6e4a26b..ad801da 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -26,11 +26,11 @@
#include "LinkHash.h"
#include "MediaQueryExp.h"
#include "RenderStyle.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/css/CSSVariablesDeclaration.h b/WebCore/css/CSSVariablesDeclaration.h
index f16b011..6838743 100644
--- a/WebCore/css/CSSVariablesDeclaration.h
+++ b/WebCore/css/CSSVariablesDeclaration.h
@@ -27,11 +27,11 @@
#define CSSVariablesDeclaration_h
#include "PlatformString.h"
-#include "StringHash.h"
#include "StyleBase.h"
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/css/MediaFeatureNames.h b/WebCore/css/MediaFeatureNames.h
index b8f2720..1daa4e9 100644
--- a/WebCore/css/MediaFeatureNames.h
+++ b/WebCore/css/MediaFeatureNames.h
@@ -20,7 +20,7 @@
#ifndef MediaFeatureNames_h
#define MediaFeatureNames_h
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
namespace MediaFeatureNames {
diff --git a/WebCore/css/MediaQueryExp.h b/WebCore/css/MediaQueryExp.h
index 24f2207..4b42611 100644
--- a/WebCore/css/MediaQueryExp.h
+++ b/WebCore/css/MediaQueryExp.h
@@ -29,10 +29,10 @@
#ifndef MediaQueryExp_h
#define MediaQueryExp_h
-#include "AtomicString.h"
#include "CSSValue.h"
#include "MediaFeatureNames.h"
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
class CSSParserValueList;
diff --git a/WebCore/css/WebKitCSSKeyframesRule.h b/WebCore/css/WebKitCSSKeyframesRule.h
index 2836942..6ac0243 100644
--- a/WebCore/css/WebKitCSSKeyframesRule.h
+++ b/WebCore/css/WebKitCSSKeyframesRule.h
@@ -29,7 +29,7 @@
#include "CSSRule.h"
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/css/mathml.css b/WebCore/css/mathml.css
index fd125c0..a5df17c 100644
--- a/WebCore/css/mathml.css
+++ b/WebCore/css/mathml.css
@@ -25,6 +25,9 @@ math > * {
mrow, mfenced {
display: inline-block;
white-space: nowrap;
+}
+
+mfenced {
padding-left: 1px;
padding-right: 1px;
}
diff --git a/WebCore/css/mediaControlsQt.css b/WebCore/css/mediaControlsQt.css
index d49fe96..4ea444c 100644
--- a/WebCore/css/mediaControlsQt.css
+++ b/WebCore/css/mediaControlsQt.css
@@ -47,7 +47,7 @@ audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
}
video:-webkit-full-page-media::-webkit-media-controls-panel {
- display: none;
+ bottom: 0px;
}
audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button {
diff --git a/WebCore/dom/ActiveDOMObject.cpp b/WebCore/dom/ActiveDOMObject.cpp
index 31afe98..98c9761 100644
--- a/WebCore/dom/ActiveDOMObject.cpp
+++ b/WebCore/dom/ActiveDOMObject.cpp
@@ -37,8 +37,10 @@ ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext,
: m_scriptExecutionContext(scriptExecutionContext)
, m_pendingActivityCount(0)
{
- ASSERT(m_scriptExecutionContext->isContextThread());
- m_scriptExecutionContext->createdActiveDOMObject(this, upcastPointer);
+ if (m_scriptExecutionContext) {
+ ASSERT(m_scriptExecutionContext->isContextThread());
+ m_scriptExecutionContext->createdActiveDOMObject(this, upcastPointer);
+ }
}
ActiveDOMObject::~ActiveDOMObject()
diff --git a/WebCore/dom/CustomEvent.h b/WebCore/dom/CustomEvent.h
index d287a65..8372af2 100644
--- a/WebCore/dom/CustomEvent.h
+++ b/WebCore/dom/CustomEvent.h
@@ -26,9 +26,9 @@
#ifndef CustomEvent_h
#define CustomEvent_h
-#include "AtomicString.h"
#include "Event.h"
#include "ScriptValue.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 539d43f..20c6b16 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -89,7 +89,6 @@
#include "InspectorController.h"
#include "InspectorTimelineAgent.h"
#include "KeyboardEvent.h"
-#include "LegacyHTMLDocumentParser.h"
#include "LegacyHTMLTreeBuilder.h"
#include "Logging.h"
#include "MessageEvent.h"
@@ -122,7 +121,6 @@
#include "SelectionController.h"
#include "Settings.h"
#include "StaticHashSetNodeList.h"
-#include "StringBuffer.h"
#include "StyleSheetList.h"
#include "TextEvent.h"
#include "TextIterator.h"
@@ -146,6 +144,7 @@
#include <wtf/MainThread.h>
#include <wtf/PassRefPtr.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringBuffer.h>
#if ENABLE(SHARED_WORKERS)
#include "SharedWorkerRepository.h"
@@ -431,7 +430,8 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
m_pageGroupUserSheetCacheValid = false;
m_printing = false;
-
+ m_paginatedForScreen = false;
+
m_ignoreAutofocus = false;
m_frame = frame;
@@ -860,7 +860,7 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
}
default:
if (source->hasTagName(iframeTag))
- static_cast<HTMLIFrameElement*>(source.get())->setRemainsAliveOnRemovalFromTree(attached());
+ static_cast<HTMLIFrameElement*>(source.get())->setRemainsAliveOnRemovalFromTree(attached() && source->attached());
if (source->parentNode())
source->parentNode()->removeChild(source.get(), ec);
@@ -2271,7 +2271,7 @@ const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const
if (!UserContentURLPattern::matchesPatterns(url(), sheet->whitelist(), sheet->blacklist()))
continue;
RefPtr<CSSStyleSheet> parsedSheet = CSSStyleSheet::createInline(const_cast<Document*>(this), sheet->url());
- parsedSheet->setIsUserStyleSheet(true);
+ parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleSheet::UserLevel);
parsedSheet->parseString(sheet->source(), !inCompatMode());
if (!m_pageGroupUserSheets)
m_pageGroupUserSheets.set(new Vector<RefPtr<CSSStyleSheet> >);
@@ -3707,8 +3707,8 @@ HTMLMapElement* Document::getImageMap(const String& url) const
{
if (url.isNull())
return 0;
- int hashPos = url.find('#');
- String name = (hashPos < 0 ? url : url.substring(hashPos + 1)).impl();
+ size_t hashPos = url.find('#');
+ String name = (hashPos == notFound ? url : url.substring(hashPos + 1)).impl();
AtomicString mapName = isHTMLDocument() ? name.lower() : name;
m_imageMapsByName.checkConsistency();
return m_imageMapsByName.get(mapName.impl());
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index ebe22cb..fc57ddb 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -32,7 +32,6 @@
#include "CollectionType.h"
#include "Color.h"
#include "ContainerNode.h"
-#include "Document.h"
#include "DocumentMarker.h"
#include "QualifiedName.h"
#include "ScriptExecutionContext.h"
@@ -571,6 +570,11 @@ public:
bool printing() const { return m_printing; }
void setPrinting(bool p) { m_printing = p; }
+ bool paginatedForScreen() const { return m_paginatedForScreen; }
+ void setPaginatedForScreen(bool p) { m_paginatedForScreen = p; }
+
+ bool paginated() const { return printing() || paginatedForScreen(); }
+
enum ParseMode { Compat, AlmostStrict, Strict };
void setParseMode(ParseMode m) { m_parseMode = m; }
@@ -1121,7 +1125,8 @@ private:
mutable bool m_pageGroupUserSheetCacheValid;
bool m_printing;
-
+ bool m_paginatedForScreen;
+
bool m_ignoreAutofocus;
ParseMode m_parseMode;
diff --git a/WebCore/dom/DocumentFragment.cpp b/WebCore/dom/DocumentFragment.cpp
index 47485b7..70e57b9 100644
--- a/WebCore/dom/DocumentFragment.cpp
+++ b/WebCore/dom/DocumentFragment.cpp
@@ -25,7 +25,6 @@
#include "Document.h"
#include "HTMLDocumentParser.h"
-#include "LegacyHTMLDocumentParser.h"
#include "Page.h"
#include "Settings.h"
#include "XMLDocumentParser.h"
@@ -84,8 +83,6 @@ bool DocumentFragment::shouldUseLegacyHTMLParser() const
void DocumentFragment::parseHTML(const String& source, Element* contextElement, FragmentScriptingPermission scriptingPermission)
{
- if (shouldUseLegacyHTMLParser())
- return LegacyHTMLDocumentParser::parseDocumentFragment(source, this, scriptingPermission);
HTMLDocumentParser::parseDocumentFragment(source, this, contextElement, scriptingPermission);
}
diff --git a/WebCore/dom/DocumentParser.h b/WebCore/dom/DocumentParser.h
index a3545b6..e942d1f 100644
--- a/WebCore/dom/DocumentParser.h
+++ b/WebCore/dom/DocumentParser.h
@@ -58,8 +58,8 @@ public:
virtual void stopParsing() { m_parserStopped = true; }
// FIXME: processingData() is only used by DocumentLoader::isLoadingInAPISense
- // and is very unclear as to what it actually means. Only LegacyHTMLDocumentParser
- // actually implements it.
+ // and is very unclear as to what it actually means. The LegacyHTMLDocumentParser
+ // used to implements it.
virtual bool processingData() const { return false; }
// FIXME: Exposed for HTMLFormControlElement::removedFromTree. HTML DOM
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 0e89e93..849b900 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -50,6 +50,7 @@
#include "RenderLayer.h"
#include "RenderView.h"
#include "RenderWidget.h"
+#include "Settings.h"
#include "TextIterator.h"
#include "XMLNames.h"
#include <wtf/text/CString.h>
@@ -90,7 +91,7 @@ NodeRareData* Element::createRareData()
return new ElementRareData;
}
-PassRefPtr<DocumentFragment> Element::createContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
+PassRefPtr<DocumentFragment> Element::deprecatedCreateContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
{
RefPtr<DocumentFragment> fragment = document()->createDocumentFragment();
@@ -101,14 +102,14 @@ PassRefPtr<DocumentFragment> Element::createContextualFragment(const String& mar
// FIXME: We should propagate a syntax error exception out here.
return 0;
}
-
+
// Exceptions are ignored because none ought to happen here.
ExceptionCode ignoredExceptionCode;
-
+
// We need to pop <html> and <body> elements and remove <head> to
// accommodate folks passing complete HTML documents to make the
// child of an element.
-
+
RefPtr<Node> nextNode;
for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
nextNode = node->nextSibling();
@@ -131,7 +132,6 @@ PassRefPtr<DocumentFragment> Element::createContextualFragment(const String& mar
ASSERT(!ignoredExceptionCode);
}
}
-
return fragment.release();
}
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index a66809a..694db98 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -95,7 +95,7 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel);
#endif
- virtual PassRefPtr<DocumentFragment> createContextualFragment(const String&, FragmentScriptingPermission = FragmentScriptingAllowed);
+ virtual PassRefPtr<DocumentFragment> deprecatedCreateContextualFragment(const String&, FragmentScriptingPermission = FragmentScriptingAllowed);
bool hasAttribute(const QualifiedName&) const;
const AtomicString& getAttribute(const QualifiedName&) const;
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index 1aab5c7..c76f951 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -23,9 +23,9 @@
#include "config.h"
#include "Event.h"
-#include "AtomicString.h"
#include "UserGestureIndicator.h"
#include <wtf/CurrentTime.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index e18258c..b992237 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -24,9 +24,9 @@
#ifndef Event_h
#define Event_h
-#include "AtomicString.h"
#include "EventTarget.h"
#include <wtf/RefCounted.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h
index 6c67b9f..4c5a08a 100644
--- a/WebCore/dom/EventNames.h
+++ b/WebCore/dom/EventNames.h
@@ -22,8 +22,8 @@
#ifndef EventNames_h
#define EventNames_h
-#include "AtomicString.h"
#include "ThreadGlobalData.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/EventTarget.h b/WebCore/dom/EventTarget.h
index 406c2fd..b4aa542 100644
--- a/WebCore/dom/EventTarget.h
+++ b/WebCore/dom/EventTarget.h
@@ -32,11 +32,11 @@
#ifndef EventTarget_h
#define EventTarget_h
-#include "AtomicStringHash.h"
#include "EventNames.h"
#include "RegisteredEventListener.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/dom/InputElement.h b/WebCore/dom/InputElement.h
index dc87b3d..56fc99d 100644
--- a/WebCore/dom/InputElement.h
+++ b/WebCore/dom/InputElement.h
@@ -21,8 +21,8 @@
#ifndef InputElement_h
#define InputElement_h
-#include "AtomicString.h"
#include "PlatformString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -43,6 +43,9 @@ public:
virtual bool isPasswordField() const = 0;
virtual bool isSearchField() const = 0;
virtual bool isTextField() const = 0;
+ virtual bool isRadioButton() const = 0;
+ virtual bool isCheckbox() const = 0;
+
virtual bool supportsMaxLength() const = 0;
virtual bool hasSpinButton() const { return false; }
#if ENABLE(INPUT_SPEECH)
diff --git a/WebCore/dom/MessagePort.cpp b/WebCore/dom/MessagePort.cpp
index 1051920..1b7aea7 100644
--- a/WebCore/dom/MessagePort.cpp
+++ b/WebCore/dom/MessagePort.cpp
@@ -20,14 +20,13 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (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 "MessagePort.h"
-#include "AtomicString.h"
#include "DOMWindow.h"
#include "Document.h"
#include "EventException.h"
@@ -35,6 +34,7 @@
#include "MessageEvent.h"
#include "SecurityOrigin.h"
#include "Timer.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -72,7 +72,7 @@ void MessagePort::postMessage(PassRefPtr<SerializedScriptValue> message, Excepti
void MessagePort::postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, ExceptionCode& ec)
{
- if (!m_entangledChannel)
+ if (!isEntangled())
return;
ASSERT(m_scriptExecutionContext);
@@ -118,8 +118,8 @@ void MessagePort::messageAvailable()
void MessagePort::start()
{
- // Do nothing if we've been cloned
- if (!m_entangledChannel)
+ // Do nothing if we've been cloned or closed.
+ if (!isEntangled())
return;
ASSERT(m_scriptExecutionContext);
@@ -133,7 +133,7 @@ void MessagePort::start()
void MessagePort::close()
{
m_closed = true;
- if (!m_entangledChannel)
+ if (!isEntangled())
return;
m_entangledChannel->close();
}
@@ -152,8 +152,9 @@ void MessagePort::entangle(PassOwnPtr<MessagePortChannel> remote)
void MessagePort::contextDestroyed()
{
ASSERT(m_scriptExecutionContext);
- // Must close port before blowing away the cached context, to ensure that we get no more calls to messageAvailable().
- close();
+ // Must be closed before blowing away the cached context, to ensure that we get no more calls to messageAvailable().
+ // ScriptExecutionContext::closeMessagePorts() takes care of that.
+ ASSERT(m_closed);
m_scriptExecutionContext = 0;
}
diff --git a/WebCore/dom/MessagePort.h b/WebCore/dom/MessagePort.h
index 10426e5..1287834 100644
--- a/WebCore/dom/MessagePort.h
+++ b/WebCore/dom/MessagePort.h
@@ -27,7 +27,6 @@
#ifndef MessagePort_h
#define MessagePort_h
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventTarget.h"
#include "MessagePortChannel.h"
@@ -37,6 +36,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/dom/NameNodeList.h b/WebCore/dom/NameNodeList.h
index b7f5bfc..6a1b22e 100644
--- a/WebCore/dom/NameNodeList.h
+++ b/WebCore/dom/NameNodeList.h
@@ -24,9 +24,9 @@
#ifndef NameNodeList_h
#define NameNodeList_h
-#include "AtomicString.h"
#include "DynamicNodeList.h"
#include <wtf/Forward.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 6e1bd13..98fb2e5 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -784,11 +784,6 @@ void Node::lazyAttach()
}
}
-bool Node::canLazyAttach()
-{
- return shadowAncestorNode() == this;
-}
-
void Node::setFocus(bool b)
{
if (b || hasRareData())
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index b407ac4..a1a8878 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -86,14 +86,6 @@ enum StyleChangeType {
SyntheticStyleChange = 3 << nodeStyleChangeShift
};
-const unsigned short DOCUMENT_POSITION_EQUIVALENT = 0x00;
-const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
-const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
-const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
-const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
-const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
-const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
-
// this class implements nodes, which can have a parent but no children:
class Node : public EventTarget, public TreeShared<Node>, public ScriptWrappable {
friend class Document;
@@ -113,7 +105,16 @@ public:
NOTATION_NODE = 12,
XPATH_NAMESPACE_NODE = 13
};
-
+ enum DocumentPosition {
+ DOCUMENT_POSITION_EQUIVALENT = 0x00,
+ DOCUMENT_POSITION_DISCONNECTED = 0x01,
+ DOCUMENT_POSITION_PRECEDING = 0x02,
+ DOCUMENT_POSITION_FOLLOWING = 0x04,
+ DOCUMENT_POSITION_CONTAINS = 0x08,
+ DOCUMENT_POSITION_CONTAINED_BY = 0x10,
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20,
+ };
+
static bool isSupported(const String& feature, const String& version);
static void startIgnoringLeaks();
@@ -316,7 +317,7 @@ public:
void clearIsLink() { clearFlag(IsLinkFlag); }
void lazyAttach();
- virtual bool canLazyAttach();
+ virtual bool canLazyAttach() { return true; }
virtual void setFocus(bool b = true);
virtual void setActive(bool f = true, bool /*pause*/ = false) { setFlag(f, IsActiveFlag); }
diff --git a/WebCore/dom/Node.idl b/WebCore/dom/Node.idl
index e15b210..07046d1 100644
--- a/WebCore/dom/Node.idl
+++ b/WebCore/dom/Node.idl
@@ -28,8 +28,7 @@ module core {
EventTarget,
GenerateNativeConverter,
InlineGetOwnPropertySlot,
- Polymorphic,
- DontCheckEnums
+ Polymorphic
] Node
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
: Object, EventTarget
diff --git a/WebCore/dom/NodeRareData.h b/WebCore/dom/NodeRareData.h
index 531fc57..ab208d2 100644
--- a/WebCore/dom/NodeRareData.h
+++ b/WebCore/dom/NodeRareData.h
@@ -26,11 +26,11 @@
#include "DynamicNodeList.h"
#include "NameNodeList.h"
#include "QualifiedName.h"
-#include "StringHash.h"
#include "TagNodeList.h"
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/dom/OverflowEvent.h b/WebCore/dom/OverflowEvent.h
index 9fd0ea1..f1cd2f3 100644
--- a/WebCore/dom/OverflowEvent.h
+++ b/WebCore/dom/OverflowEvent.h
@@ -33,8 +33,8 @@ namespace WebCore {
class OverflowEvent : public Event {
public:
enum orientType {
- VERTICAL = 0,
- HORIZONTAL = 1,
+ HORIZONTAL = 0,
+ VERTICAL = 1,
BOTH = 2
};
diff --git a/WebCore/dom/OverflowEvent.idl b/WebCore/dom/OverflowEvent.idl
index 74cf56b..0c1fd50 100644
--- a/WebCore/dom/OverflowEvent.idl
+++ b/WebCore/dom/OverflowEvent.idl
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
module events {
- // FIXME: Converge these consts and OverflowEvent::orientType values and remove DontCheckEnums attribute.
- interface [DontCheckEnums] OverflowEvent : Event {
+ interface OverflowEvent : Event {
const unsigned short HORIZONTAL = 0;
const unsigned short VERTICAL = 1;
const unsigned short BOTH = 2;
diff --git a/WebCore/dom/PendingScript.h b/WebCore/dom/PendingScript.h
index 805f7ff..44e1e49 100644
--- a/WebCore/dom/PendingScript.h
+++ b/WebCore/dom/PendingScript.h
@@ -28,7 +28,6 @@
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
-#include <wtf/Noncopyable.h>
#include <wtf/PassRefPtr.h>
namespace WebCore {
@@ -41,7 +40,7 @@ class Element;
// A CachedResourceHandle alone does not prevent the underlying CachedResource
// from purging its data buffer. This class holds a dummy client open for its
// lifetime in order to guarantee that the data buffer will not be purged.
-class PendingScript : public Noncopyable, CachedResourceClient {
+class PendingScript : public CachedResourceClient {
public:
PendingScript()
: m_startingLineNumber(0)
@@ -49,8 +48,30 @@ public:
{
}
+ PendingScript(const PendingScript& other)
+ : CachedResourceClient(other)
+ , m_startingLineNumber(other.m_startingLineNumber)
+ , m_watchingForLoad(other.m_watchingForLoad)
+ , m_element(other.m_element)
+ {
+ setCachedScript(other.cachedScript());
+ }
+
~PendingScript();
+ PendingScript& operator=(const PendingScript& other)
+ {
+ if (this == &other)
+ return *this;
+
+ m_startingLineNumber = other.m_startingLineNumber;
+ m_watchingForLoad = other.m_watchingForLoad;
+ m_element = other.m_element;
+ setCachedScript(other.cachedScript());
+
+ return *this;
+ }
+
// FIXME: No setter means this is never set to anything other than 0.
// This is either unnecessary or incorrect.
int startingLineNumber() const { return m_startingLineNumber; }
diff --git a/WebCore/dom/QualifiedName.h b/WebCore/dom/QualifiedName.h
index 4391570..ee90408 100644
--- a/WebCore/dom/QualifiedName.h
+++ b/WebCore/dom/QualifiedName.h
@@ -21,8 +21,8 @@
#ifndef QualifiedName_h
#define QualifiedName_h
-#include "AtomicString.h"
#include <wtf/HashTraits.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/Range.cpp b/WebCore/dom/Range.cpp
index 33a21bb..d93a58e 100644
--- a/WebCore/dom/Range.cpp
+++ b/WebCore/dom/Range.cpp
@@ -1061,7 +1061,10 @@ PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& marku
return 0;
}
- RefPtr<DocumentFragment> fragment = static_cast<HTMLElement*>(element)->createContextualFragment(markup);
+ // Logic from deprecatedCreateContextualFragment should just be moved into
+ // this function. Range::createContextualFragment semantics do not make
+ // sense for the rest of the DOM implementation to use.
+ RefPtr<DocumentFragment> fragment = static_cast<HTMLElement*>(element)->deprecatedCreateContextualFragment(markup);
if (!fragment) {
ec = NOT_SUPPORTED_ERR;
return 0;
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 0262e48..8626bb4 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -39,9 +39,9 @@
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
#include "Settings.h"
-#include "StringHash.h"
#include "Text.h"
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(SVG)
#include "SVGNames.h"
diff --git a/WebCore/dom/ScriptExecutionContext.cpp b/WebCore/dom/ScriptExecutionContext.cpp
index f7ac603..d014d47 100644
--- a/WebCore/dom/ScriptExecutionContext.cpp
+++ b/WebCore/dom/ScriptExecutionContext.cpp
@@ -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.
*
*/
@@ -28,14 +28,15 @@
#include "ScriptExecutionContext.h"
#include "ActiveDOMObject.h"
+#include "Blob.h"
+#include "BlobURL.h"
#include "Database.h"
#include "DatabaseTask.h"
#include "DatabaseThread.h"
-#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
#include "FileThread.h"
-#endif
#include "MessagePort.h"
#include "SecurityOrigin.h"
+#include "ThreadableBlobRegistry.h"
#include "WorkerContext.h"
#include "WorkerThread.h"
#include <wtf/MainThread.h>
@@ -92,6 +93,15 @@ ScriptExecutionContext::~ScriptExecutionContext()
m_fileThread = 0;
}
#endif
+
+ HashSet<Blob*>::iterator blobsEnd = m_blobs.end();
+ for (HashSet<Blob*>::iterator iter = m_blobs.begin(); iter != blobsEnd; ++iter)
+ (*iter)->contextDestroyed();
+#if ENABLE(BLOB)
+ HashSet<String>::iterator publicBlobURLsEnd = m_publicBlobURLs.end();
+ for (HashSet<String>::iterator iter = m_publicBlobURLs.begin(); iter != publicBlobURLsEnd; ++iter)
+ ThreadableBlobRegistry::unregisterBlobURL(this, KURL(ParsedURLString, *iter));
+#endif
}
#if ENABLE(DATABASE)
@@ -165,6 +175,18 @@ void ScriptExecutionContext::destroyedMessagePort(MessagePort* port)
m_messagePorts.remove(port);
}
+void ScriptExecutionContext::addBlob(Blob* blob)
+{
+ ASSERT(blob);
+ m_blobs.add(blob);
+}
+
+void ScriptExecutionContext::removeBlob(Blob* blob)
+{
+ ASSERT(blob);
+ m_blobs.remove(blob);
+}
+
bool ScriptExecutionContext::canSuspendActiveDOMObjects()
{
// No protection against m_activeDOMObjects changing during iteration: canSuspend() shouldn't execute arbitrary JS.
@@ -205,6 +227,9 @@ void ScriptExecutionContext::stopActiveDOMObjects()
ASSERT(iter->first->scriptExecutionContext() == this);
iter->first->stop();
}
+
+ // Also close MessagePorts. If they were ActiveDOMObjects (they could be) then they could be stopped instead.
+ closeMessagePorts();
}
void ScriptExecutionContext::createdActiveDOMObject(ActiveDOMObject* object, void* upcastPointer)
@@ -220,6 +245,14 @@ void ScriptExecutionContext::destroyedActiveDOMObject(ActiveDOMObject* object)
m_activeDOMObjects.remove(object);
}
+void ScriptExecutionContext::closeMessagePorts() {
+ HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
+ for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
+ ASSERT((*iter)->scriptExecutionContext() == this);
+ (*iter)->close();
+ }
+}
+
void ScriptExecutionContext::setSecurityOrigin(PassRefPtr<SecurityOrigin> securityOrigin)
{
m_securityOrigin = securityOrigin;
@@ -241,6 +274,24 @@ DOMTimer* ScriptExecutionContext::findTimeout(int timeoutId)
return m_timeouts.get(timeoutId);
}
+#if ENABLE(BLOB)
+KURL ScriptExecutionContext::createPublicBlobURL(Blob* blob)
+{
+ KURL publicURL = BlobURL::createURL(this);
+ ThreadableBlobRegistry::registerBlobURL(this, publicURL, blob->url());
+ m_publicBlobURLs.add(publicURL.string());
+ return publicURL;
+}
+
+void ScriptExecutionContext::revokePublicBlobURL(const KURL& url)
+{
+ if (m_publicBlobURLs.contains(url.string())) {
+ ThreadableBlobRegistry::unregisterBlobURL(this, url);
+ m_publicBlobURLs.remove(url.string());
+ }
+}
+#endif
+
#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
FileThread* ScriptExecutionContext::fileThread()
{
diff --git a/WebCore/dom/ScriptExecutionContext.h b/WebCore/dom/ScriptExecutionContext.h
index d2da307..30c12e5 100644
--- a/WebCore/dom/ScriptExecutionContext.h
+++ b/WebCore/dom/ScriptExecutionContext.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.
*
*/
@@ -36,10 +36,16 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Threading.h>
+#include <wtf/text/StringHash.h>
+
+#if USE(JSC)
+#include <runtime/JSGlobalData.h>
+#endif
namespace WebCore {
class ActiveDOMObject;
+ class Blob;
#if ENABLE(DATABASE)
class Database;
class DatabaseTaskSynchronizer;
@@ -88,7 +94,7 @@ namespace WebCore {
virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
-
+
// Active objects are not garbage collected even if inaccessible, e.g. because their activity may result in callbacks being invoked.
bool canSuspendActiveDOMObjects();
// Active objects can be asked to suspend even if canSuspendActiveDOMObjects() returns 'false' -
@@ -125,6 +131,13 @@ namespace WebCore {
void removeTimeout(int timeoutId);
DOMTimer* findTimeout(int timeoutId);
+ void addBlob(Blob*);
+ void removeBlob(Blob*);
+#if ENABLE(BLOB)
+ KURL createPublicBlobURL(Blob*);
+ void revokePublicBlobURL(const KURL&);
+#endif
+
#if USE(JSC)
JSC::JSGlobalData* globalData();
#endif
@@ -144,6 +157,8 @@ namespace WebCore {
virtual const KURL& virtualURL() const = 0;
virtual KURL virtualCompleteURL(const String&) const = 0;
+ void closeMessagePorts();
+
RefPtr<SecurityOrigin> m_securityOrigin;
HashSet<MessagePort*> m_messagePorts;
@@ -152,6 +167,11 @@ namespace WebCore {
HashMap<int, DOMTimer*> m_timeouts;
+ HashSet<Blob*> m_blobs;
+#if ENABLE(BLOB)
+ HashSet<String> m_publicBlobURLs;
+#endif
+
virtual void refScriptExecutionContext() = 0;
virtual void derefScriptExecutionContext() = 0;
diff --git a/WebCore/dom/SpaceSplitString.h b/WebCore/dom/SpaceSplitString.h
index 9fd1832..f49670b 100644
--- a/WebCore/dom/SpaceSplitString.h
+++ b/WebCore/dom/SpaceSplitString.h
@@ -21,10 +21,10 @@
#ifndef SpaceSplitString_h
#define SpaceSplitString_h
-#include "AtomicString.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/TagNodeList.h b/WebCore/dom/TagNodeList.h
index 1b1a038..9053b53 100644
--- a/WebCore/dom/TagNodeList.h
+++ b/WebCore/dom/TagNodeList.h
@@ -24,8 +24,8 @@
#ifndef TagNodeList_h
#define TagNodeList_h
-#include "AtomicString.h"
#include "DynamicNodeList.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/dom/TextEvent.cpp b/WebCore/dom/TextEvent.cpp
index 5dc39e3..68ed4b2 100644
--- a/WebCore/dom/TextEvent.cpp
+++ b/WebCore/dom/TextEvent.cpp
@@ -31,43 +31,63 @@
namespace WebCore {
+TextEvent::InputType TextEvent::selectInputType(bool isLineBreak, bool isBackTab)
+{
+ if (isLineBreak)
+ return TextEvent::InputTypeLineBreak;
+ if (isBackTab)
+ return TextEvent::InputTypeBackTab;
+ return TextEvent::InputTypeKeyboard;
+}
+
PassRefPtr<TextEvent> TextEvent::create()
{
return adoptRef(new TextEvent);
}
-PassRefPtr<TextEvent> TextEvent::create(PassRefPtr<AbstractView> view, const String& data)
+PassRefPtr<TextEvent> TextEvent::create(PassRefPtr<AbstractView> view, const String& data, TextEvent::InputType inputType)
{
- return adoptRef(new TextEvent(view, data));
+ return adoptRef(new TextEvent(view, data, inputType));
}
PassRefPtr<TextEvent> TextEvent::createForPlainTextPaste(PassRefPtr<AbstractView> view, const String& data, bool shouldSmartReplace)
{
- return adoptRef(new TextEvent(view, data, 0, true, shouldSmartReplace));
+ return adoptRef(new TextEvent(view, data, 0, shouldSmartReplace, false));
}
PassRefPtr<TextEvent> TextEvent::createForFragmentPaste(PassRefPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle)
{
- return adoptRef(new TextEvent(view, "", data, true, shouldSmartReplace, shouldMatchStyle));
+ return adoptRef(new TextEvent(view, "", data, shouldSmartReplace, shouldMatchStyle));
+}
+
+PassRefPtr<TextEvent> TextEvent::createForDrop(PassRefPtr<AbstractView> view, const String& data)
+{
+ return adoptRef(new TextEvent(view, data, TextEvent::InputTypeDrop));
}
TextEvent::TextEvent()
- : m_isLineBreak(false)
- , m_isBackTab(false)
- , m_isPaste(false)
+ : m_inputType(TextEvent::InputTypeKeyboard)
+ , m_shouldSmartReplace(false)
+ , m_shouldMatchStyle(false)
+{
+}
+
+TextEvent::TextEvent(PassRefPtr<AbstractView> view, const String& data, InputType inputType)
+ : UIEvent(eventNames().textInputEvent, true, true, view, 0)
+ , m_inputType(inputType)
+ , m_data(data)
+ , m_pastingFragment(0)
, m_shouldSmartReplace(false)
, m_shouldMatchStyle(false)
{
}
TextEvent::TextEvent(PassRefPtr<AbstractView> view, const String& data, PassRefPtr<DocumentFragment> pastingFragment,
- bool isPaste, bool shouldSmartReplace, bool shouldMatchStyle)
+ bool shouldSmartReplace, bool shouldMatchStyle)
: UIEvent(eventNames().textInputEvent, true, true, view, 0)
+ , m_inputType(TextEvent::InputTypePaste)
, m_data(data)
- , m_isLineBreak(false)
- , m_isBackTab(false)
, m_pastingFragment(pastingFragment)
- , m_isPaste(isPaste)
, m_shouldSmartReplace(shouldSmartReplace)
, m_shouldMatchStyle(shouldMatchStyle)
{
diff --git a/WebCore/dom/TextEvent.h b/WebCore/dom/TextEvent.h
index 2e2eb95..f1d24e9 100644
--- a/WebCore/dom/TextEvent.h
+++ b/WebCore/dom/TextEvent.h
@@ -34,10 +34,20 @@ namespace WebCore {
class TextEvent : public UIEvent {
public:
+ enum InputType {
+ InputTypeKeyboard, // any newline characters in the text are line breaks only, not paragraph separators.
+ InputTypeLineBreak, // any tab characters in the text are backtabs.
+ InputTypeBackTab,
+ InputTypePaste,
+ InputTypeDrop,
+ };
+
+ static InputType selectInputType(bool isLineBreak, bool isBackTab);
static PassRefPtr<TextEvent> create();
- static PassRefPtr<TextEvent> create(PassRefPtr<AbstractView> view, const String& data);
+ static PassRefPtr<TextEvent> create(PassRefPtr<AbstractView> view, const String& data, InputType = InputTypeKeyboard);
static PassRefPtr<TextEvent> createForPlainTextPaste(PassRefPtr<AbstractView> view, const String& data, bool shouldSmartReplace);
static PassRefPtr<TextEvent> createForFragmentPaste(PassRefPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle);
+ static PassRefPtr<TextEvent> createForDrop(PassRefPtr<AbstractView> view, const String& data);
virtual ~TextEvent();
@@ -47,30 +57,26 @@ namespace WebCore {
virtual bool isTextEvent() const;
- // If true, any newline characters in the text are line breaks only, not paragraph separators.
- bool isLineBreak() const { return m_isLineBreak; }
- void setIsLineBreak(bool isLineBreak) { m_isLineBreak = isLineBreak; }
-
- // If true, any tab characters in the text are backtabs.
- bool isBackTab() const { return m_isBackTab; }
- void setIsBackTab(bool isBackTab) { m_isBackTab = isBackTab; }
+ bool isLineBreak() const { return m_inputType == InputTypeLineBreak; }
+ bool isBackTab() const { return m_inputType == InputTypeBackTab; }
+ bool isPaste() const { return m_inputType == InputTypePaste; }
+ bool isDrop() const { return m_inputType == InputTypeDrop; }
- bool isPaste() const { return m_isPaste; }
bool shouldSmartReplace() const { return m_shouldSmartReplace; }
bool shouldMatchStyle() const { return m_shouldMatchStyle; }
DocumentFragment* pastingFragment() const { return m_pastingFragment.get(); }
private:
TextEvent();
- TextEvent(PassRefPtr<AbstractView>, const String& data, PassRefPtr<DocumentFragment> = 0,
- bool isPaste = false, bool shouldSmartReplace = false, bool shouldMatchStyle = false);
+ TextEvent(PassRefPtr<AbstractView>, const String& data, InputType = InputTypeKeyboard);
+ TextEvent(PassRefPtr<AbstractView>, const String& data, PassRefPtr<DocumentFragment>,
+ bool shouldSmartReplace, bool shouldMatchStyle);
+
+ InputType m_inputType;
String m_data;
- bool m_isLineBreak;
- bool m_isBackTab;
RefPtr<DocumentFragment> m_pastingFragment;
- bool m_isPaste; // FIXME: Should use inputMode after it be available: http://webkit.org/b/42805
bool m_shouldSmartReplace;
bool m_shouldMatchStyle;
};
diff --git a/WebCore/dom/XMLDocumentParser.h b/WebCore/dom/XMLDocumentParser.h
index e7e209a..141adf7 100644
--- a/WebCore/dom/XMLDocumentParser.h
+++ b/WebCore/dom/XMLDocumentParser.h
@@ -139,9 +139,9 @@ bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent
#include "FragmentScriptingPermission.h"
#include "ScriptableDocumentParser.h"
#include "SegmentedString.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
+#include <wtf/text/StringHash.h>
#if USE(QXMLSTREAM)
#include <qxmlstream.h>
diff --git a/WebCore/dom/XMLDocumentParserLibxml2.cpp b/WebCore/dom/XMLDocumentParserLibxml2.cpp
index a6e9cd0..1309827 100644
--- a/WebCore/dom/XMLDocumentParserLibxml2.cpp
+++ b/WebCore/dom/XMLDocumentParserLibxml2.cpp
@@ -36,9 +36,9 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameView.h"
+#include "HTMLEntityParser.h"
#include "HTMLLinkElement.h"
#include "HTMLStyleElement.h"
-#include "LegacyHTMLDocumentParser.h" // for decodeNamedEntity
#include "ProcessingInstruction.h"
#include "ResourceError.h"
#include "ResourceHandle.h"
diff --git a/WebCore/dom/XMLDocumentParserQt.cpp b/WebCore/dom/XMLDocumentParserQt.cpp
index 678d141..715856c 100644
--- a/WebCore/dom/XMLDocumentParserQt.cpp
+++ b/WebCore/dom/XMLDocumentParserQt.cpp
@@ -36,9 +36,9 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameView.h"
+#include "HTMLEntityParser.h"
#include "HTMLLinkElement.h"
#include "HTMLStyleElement.h"
-#include "LegacyHTMLDocumentParser.h"
#include "ProcessingInstruction.h"
#include "ResourceError.h"
#include "ResourceHandle.h"
diff --git a/WebCore/dom/make_names.pl b/WebCore/dom/make_names.pl
index 4b4c7e3..e111eb7 100755
--- a/WebCore/dom/make_names.pl
+++ b/WebCore/dom/make_names.pl
@@ -647,13 +647,17 @@ printLicenseHeader($F);
print F <<END
#include "config.h"
-#include "$parameters{namespace}ElementFactory.h"
-#include "$parameters{namespace}Names.h"
END
;
print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
+print F <<END
+#include "$parameters{namespace}ElementFactory.h"
+#include "$parameters{namespace}Names.h"
+END
+;
+
printElementIncludes($F);
print F <<END
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index a9d1509..bfbfab8 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -1311,6 +1311,9 @@ bool ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLEl
}
}
+ if (mode == RemoveNone)
+ return removed;
+
// No need to serialize <foo style=""> if we just removed the last css property
if (decl->isEmpty())
removeNodeAttribute(elem, styleAttr);
@@ -1321,24 +1324,17 @@ bool ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLEl
return removed;
}
-static bool hasTextDecorationProperty(Node *node)
+HTMLElement* ApplyStyleCommand::highestAncestorWithConflictingInlineStyle(CSSMutableStyleDeclaration* style, Node* node)
{
- if (!node->isElementNode())
- return false;
-
- RefPtr<CSSValue> value = computedStyle(node)->getPropertyCSSValue(CSSPropertyTextDecoration, DoNotUpdateLayout);
- return value && !equalIgnoringCase(value->cssText(), "none");
-}
+ if (!node)
+ return 0;
-static Node* highestAncestorWithTextDecoration(Node *node)
-{
- ASSERT(node);
- Node* result = 0;
+ HTMLElement* result = 0;
Node* unsplittableElement = unsplittableElementForPosition(Position(node, 0));
for (Node *n = node; n; n = n->parentNode()) {
- if (hasTextDecorationProperty(n))
- result = n;
+ if (n->isHTMLElement() && shouldRemoveInlineStyleFromElement(style, static_cast<HTMLElement*>(n)))
+ result = static_cast<HTMLElement*>(n);
// Should stop at the editable root (cannot cross editing boundary) and
// also stop at the unsplittable element to be consistent with other UAs
if (n == unsplittableElement)
@@ -1348,7 +1344,7 @@ static Node* highestAncestorWithTextDecoration(Node *node)
return result;
}
-PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractTextDecorationStyle(Node* node)
+PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPushDown(Node* node, const Vector<int>& properties)
{
ASSERT(node);
ASSERT(node->isElementNode());
@@ -1362,72 +1358,108 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractTextDecorationS
if (!style)
return 0;
- int properties[1] = { CSSPropertyTextDecoration };
- RefPtr<CSSMutableStyleDeclaration> textDecorationStyle = style->copyPropertiesInSet(properties, 1);
+ style = style->copyPropertiesInSet(properties.data(), properties.size());
+
+ for (size_t i = 0; i < properties.size(); i++) {
+ RefPtr<CSSValue> property = style->getPropertyCSSValue(properties[i]);
+ if (property)
+ removeCSSProperty(element, static_cast<CSSPropertyID>(properties[i]));
+ }
- RefPtr<CSSValue> property = style->getPropertyCSSValue(CSSPropertyTextDecoration);
- if (property && !equalIgnoringCase(property->cssText(), "none"))
- removeCSSProperty(element, CSSPropertyTextDecoration);
+ if (element->inlineStyleDecl() && element->inlineStyleDecl()->isEmpty())
+ removeNodeAttribute(element, styleAttr);
- return textDecorationStyle.release();
+ if (isSpanWithoutAttributesOrUnstyleStyleSpan(element))
+ removeNodePreservingChildren(element);
+
+ return style.release();
}
-void ApplyStyleCommand::applyTextDecorationStyle(Node *node, CSSMutableStyleDeclaration *style)
+void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, CSSMutableStyleDeclaration* style)
{
ASSERT(node);
- if (!style || style->cssText().isEmpty())
+ if (!style || !style->length() || !node->renderer())
return;
- StyleChange styleChange(style, Position(node, 0));
- if (styleChange.cssStyle().length()) {
- if (node->isTextNode()) {
- RefPtr<HTMLElement> styleSpan = createStyleSpanElement(document());
- surroundNodeRangeWithElement(node, node, styleSpan.get());
- node = styleSpan.get();
- }
+ // Since addInlineStyleIfNeeded can't add styles to block-flow render objects, add style attribute instead.
+ // FIXME: applyInlineStyleToRange should be used here instead.
+ if ((node->renderer()->isBlockFlow() || node->childNodeCount()) && node->isHTMLElement()) {
+ HTMLElement* element = static_cast<HTMLElement*>(node);
+ CSSMutableStyleDeclaration* existingInlineStyle = element->inlineStyleDecl();
+
+ // Avoid overriding existing styles of node
+ if (existingInlineStyle) {
+ RefPtr<CSSMutableStyleDeclaration> newInlineStyle = existingInlineStyle->copy();
+ CSSMutableStyleDeclaration::const_iterator end = style->end();
+ for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
+ ExceptionCode ec;
+ if (!existingInlineStyle->getPropertyCSSValue(it->id()))
+ newInlineStyle->setProperty(it->id(), it->value()->cssText(), it->isImportant(), ec);
+
+ // text-decorations adds up
+ if (it->id() == CSSPropertyTextDecoration) {
+ ASSERT(it->value()->isValueList());
+ RefPtr<CSSValue> textDecoration = newInlineStyle->getPropertyCSSValue(CSSPropertyTextDecoration);
+ if (textDecoration) {
+ ASSERT(textDecoration->isValueList());
+ CSSValueList* textDecorationOfInlineStyle = static_cast<CSSValueList*>(textDecoration.get());
+ CSSValueList* textDecorationOfStyleApplied = static_cast<CSSValueList*>(it->value());
+
+ DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
+ DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
+
+ if (textDecorationOfStyleApplied->hasValue(underline.get()) && !textDecorationOfInlineStyle->hasValue(underline.get()))
+ textDecorationOfInlineStyle->append(underline.get());
+
+ if (textDecorationOfStyleApplied->hasValue(lineThrough.get()) && !textDecorationOfInlineStyle->hasValue(lineThrough.get()))
+ textDecorationOfInlineStyle->append(lineThrough.get());
+ }
+ }
+ }
- if (!node->isElementNode())
- return;
+ setNodeAttribute(element, styleAttr, newInlineStyle->cssText());
+ } else
+ setNodeAttribute(element, styleAttr, style->cssText());
- HTMLElement *element = static_cast<HTMLElement *>(node);
- String cssText = styleChange.cssStyle();
- CSSMutableStyleDeclaration *decl = element->inlineStyleDecl();
- if (decl)
- cssText += decl->cssText();
- setNodeAttribute(element, styleAttr, cssText);
+ return;
}
- if (styleChange.applyUnderline())
- surroundNodeRangeWithElement(node, node, createHTMLElement(document(), uTag));
+ if (node->renderer()->isText() && static_cast<RenderText*>(node->renderer())->isAllCollapsibleWhitespace())
+ return;
- if (styleChange.applyLineThrough())
- surroundNodeRangeWithElement(node, node, createHTMLElement(document(), sTag));
+ // FIXME: addInlineStyleIfNeeded may override the style of node
+ addInlineStyleIfNeeded(style, node, node);
}
-void ApplyStyleCommand::pushDownTextDecorationStyleAroundNode(Node* targetNode)
+void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration* style, Node* targetNode)
{
- ASSERT(targetNode);
- Node* highestAncestor = highestAncestorWithTextDecoration(targetNode);
+ HTMLElement* highestAncestor = highestAncestorWithConflictingInlineStyle(style, targetNode);
if (!highestAncestor)
return;
+ Vector<int> properties;
+ CSSMutableStyleDeclaration::const_iterator end = style->end();
+ for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it)
+ properties.append(it->id());
+
// The outer loop is traversing the tree vertically from highestAncestor to targetNode
Node* current = highestAncestor;
while (current != targetNode) {
ASSERT(current);
+ ASSERT(current->isHTMLElement());
ASSERT(current->contains(targetNode));
- RefPtr<CSSMutableStyleDeclaration> decoration = extractTextDecorationStyle(current);
+ Node* child = current->firstChild();
+ RefPtr<CSSMutableStyleDeclaration> styleToPushDown = extractInlineStyleToPushDown(current, properties);
// The inner loop will go through children on each level
- Node* child = current->firstChild();
while (child) {
Node* nextChild = child->nextSibling();
// Apply text decoration to all nodes containing targetNode and their siblings but NOT to targetNode
if (child != targetNode)
- applyTextDecorationStyle(child, decoration.get());
-
+ applyInlineStyleToPushDown(child, styleToPushDown.get());
+
// We found the next node for the outer loop (contains targetNode)
// When reached targetNode, stop the outer loop upon the completion of the current inner loop
if (child == targetNode || child->contains(targetNode))
@@ -1447,19 +1479,23 @@ void ApplyStyleCommand::removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration>
ASSERT(comparePositions(start, end) <= 0);
RefPtr<CSSValue> textDecorationSpecialProperty = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
-
if (textDecorationSpecialProperty) {
- pushDownTextDecorationStyleAroundNode(start.downstream().node());
- pushDownTextDecorationStyleAroundNode(end.upstream().node());
style = style->copy();
style->setProperty(CSSPropertyTextDecoration, textDecorationSpecialProperty->cssText(), style->getPropertyPriority(CSSPropertyWebkitTextDecorationsInEffect));
}
+ Position pushDownStart = start.downstream();
+ Position pushDownEnd = end.upstream();
+ pushDownInlineStyleAroundNode(style.get(), pushDownStart.node());
+ pushDownInlineStyleAroundNode(style.get(), pushDownEnd.node());
+
// The s and e variables store the positions used to set the ending selection after style removal
// takes place. This will help callers to recognize when either the start node or the end node
// are removed from the document during the work of this function.
- Position s = start;
- Position e = end;
+ // If pushDownInlineStyleAroundNode has pruned start.node() or end.node(),
+ // use pushDownStart or pushDownEnd instead, which pushDownInlineStyleAroundNode won't prune.
+ Position s = start.isNull() || start.isOrphan() ? pushDownStart : start;
+ Position e = end.isNull() || end.isOrphan() ? pushDownEnd : end;
Node* node = start.node();
while (node) {
diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h
index 86c24da..f4ecc7c 100644
--- a/WebCore/editing/ApplyStyleCommand.h
+++ b/WebCore/editing/ApplyStyleCommand.h
@@ -78,12 +78,13 @@ private:
bool removeHTMLFontStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements);
bool removeHTMLBidiEmbeddingStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements);
bool removeCSSStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements);
+ HTMLElement* highestAncestorWithConflictingInlineStyle(CSSMutableStyleDeclaration*, Node*);
+ PassRefPtr<CSSMutableStyleDeclaration> extractInlineStyleToPushDown(Node*, const Vector<int>&);
+ void applyInlineStyleToPushDown(Node*, CSSMutableStyleDeclaration *style);
+ void pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration*, Node*);
void removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration>, const Position& start, const Position& end);
bool nodeFullySelected(Node*, const Position& start, const Position& end) const;
bool nodeFullyUnselected(Node*, const Position& start, const Position& end) const;
- PassRefPtr<CSSMutableStyleDeclaration> extractTextDecorationStyle(Node*);
- void applyTextDecorationStyle(Node*, CSSMutableStyleDeclaration *style);
- void pushDownTextDecorationStyleAroundNode(Node*);
// style-application helpers
void applyBlockStyle(CSSMutableStyleDeclaration*);
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index 5ec87d6..f50929a 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -294,24 +294,24 @@ void CompositeEditCommand::joinTextNodes(PassRefPtr<Text> text1, PassRefPtr<Text
void CompositeEditCommand::inputText(const String& text, bool selectInsertedText)
{
- int offset = 0;
- int length = text.length();
+ unsigned offset = 0;
+ unsigned length = text.length();
RefPtr<Range> startRange = Range::create(document(), Position(document()->documentElement(), 0), endingSelection().start());
- int startIndex = TextIterator::rangeLength(startRange.get());
- int newline;
+ unsigned startIndex = TextIterator::rangeLength(startRange.get());
+ size_t newline;
do {
newline = text.find('\n', offset);
if (newline != offset) {
RefPtr<InsertTextCommand> command = InsertTextCommand::create(document());
applyCommandToComposite(command);
- int substringLength = newline == -1 ? length - offset : newline - offset;
+ int substringLength = newline == notFound ? length - offset : newline - offset;
command->input(text.substring(offset, substringLength), false);
}
- if (newline != -1)
+ if (newline != notFound)
insertLineBreak();
offset = newline + 1;
- } while (newline != -1 && offset != length);
+ } while (newline != notFound && offset != length);
if (selectInsertedText) {
RefPtr<Range> selectedRange = TextIterator::rangeFromLocationAndLength(document()->documentElement(), startIndex, length);
@@ -489,7 +489,18 @@ void CompositeEditCommand::deleteInsignificantText(PassRefPtr<Text> textNode, un
if (!textRenderer)
return;
- InlineTextBox* box = textRenderer->firstTextBox();
+ Vector<InlineTextBox*> sortedTextBoxes;
+ size_t sortedTextBoxesPosition = 0;
+
+ for (InlineTextBox* textBox = textRenderer->firstTextBox(); textBox; textBox = textBox->nextTextBox())
+ sortedTextBoxes.append(textBox);
+
+ // If there is mixed directionality text, the boxes can be out of order,
+ // (like Arabic with embedded LTR), so sort them first.
+ if (textRenderer->containsReversedText())
+ std::sort(sortedTextBoxes.begin(), sortedTextBoxes.end(), InlineTextBox::compareByStart);
+ InlineTextBox* box = sortedTextBoxes.isEmpty() ? 0 : sortedTextBoxes[sortedTextBoxesPosition];
+
if (!box) {
// whole text node is empty
removeNode(textNode);
@@ -526,8 +537,12 @@ void CompositeEditCommand::deleteInsignificantText(PassRefPtr<Text> textNode, un
}
prevBox = box;
- if (box)
- box = box->nextTextBox();
+ if (box) {
+ if (++sortedTextBoxesPosition < sortedTextBoxes.size())
+ box = sortedTextBoxes[sortedTextBoxesPosition];
+ else
+ box = 0;
+ }
}
if (!str.isNull()) {
diff --git a/WebCore/editing/DeleteSelectionCommand.cpp b/WebCore/editing/DeleteSelectionCommand.cpp
index c37b0fc..5e025eb 100644
--- a/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/WebCore/editing/DeleteSelectionCommand.cpp
@@ -630,7 +630,8 @@ void DeleteSelectionCommand::mergeParagraphs()
// moveParagraphs will insert placeholders if it removes blocks that would require their use, don't let block
// removals that it does cause the insertion of *another* placeholder.
bool needPlaceholder = m_needPlaceholder;
- moveParagraph(startOfParagraphToMove, endOfParagraphToMove, mergeDestination);
+ bool paragraphToMergeIsEmpty = (startOfParagraphToMove == endOfParagraphToMove);
+ moveParagraph(startOfParagraphToMove, endOfParagraphToMove, mergeDestination, false, !paragraphToMergeIsEmpty);
m_needPlaceholder = needPlaceholder;
// The endingPosition was likely clobbered by the move, so recompute it (moveParagraph selects the moved paragraph).
m_endingPosition = endingSelection().start();
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 7a1ad4d..196384a 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -130,6 +130,11 @@ void Editor::handleInputMethodKeydown(KeyboardEvent* event)
bool Editor::handleTextEvent(TextEvent* event)
{
+ // Default event handling for Drag and Drop will be handled by DragController
+ // so we leave the event for it.
+ if (event->isDrop())
+ return false;
+
if (event->isPaste()) {
if (event->pastingFragment())
replaceSelectionWithFragment(event->pastingFragment(), false, event->shouldSmartReplace(), event->shouldMatchStyle());
@@ -762,14 +767,20 @@ bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPoli
return !noDefaultProcessing;
}
-Node* Editor::findEventTargetFromSelection() const
+Node* Editor::findEventTargetFrom(const VisibleSelection& selection) const
{
- Node* target = m_frame->selection()->start().element();
+ Node* target = selection.start().element();
if (!target)
target = m_frame->document()->body();
if (!target)
return 0;
return target->shadowAncestorNode();
+
+}
+
+Node* Editor::findEventTargetFromSelection() const
+{
+ return findEventTargetFrom(m_frame->selection()->selection());
}
void Editor::applyStyle(CSSStyleDeclaration* style, EditAction editingAction)
@@ -1514,10 +1525,13 @@ void Editor::setComposition(const String& text, const Vector<CompositionUnderlin
if (!text.isEmpty()) {
TypingCommand::insertText(m_frame->document(), text, true, true);
- Node* baseNode = m_frame->selection()->base().node();
- unsigned baseOffset = m_frame->selection()->base().deprecatedEditingOffset();
- Node* extentNode = m_frame->selection()->extent().node();
- unsigned extentOffset = m_frame->selection()->extent().deprecatedEditingOffset();
+ // Find out what node has the composition now.
+ Position base = m_frame->selection()->base().downstream();
+ Position extent = m_frame->selection()->extent();
+ Node* baseNode = base.node();
+ unsigned baseOffset = base.deprecatedEditingOffset();
+ Node* extentNode = extent.node();
+ unsigned extentOffset = extent.deprecatedEditingOffset();
if (baseNode && baseNode == extentNode && baseNode->isTextNode() && baseOffset + text.length() == extentOffset) {
m_compositionNode = static_cast<Text*>(baseNode);
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 13e6df5..06e7513 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -299,6 +299,7 @@ public:
void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle);
void pasteAsPlainText(const String&, bool smartReplace);
+ Node* findEventTargetFrom(const VisibleSelection& selection) const;
private:
Frame* m_frame;
OwnPtr<DeleteButtonController> m_deleteButtonController;
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 1a77642..eb89593 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -28,7 +28,6 @@
#include "config.h"
#include "Editor.h"
-#include "AtomicString.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSPropertyNames.h"
@@ -58,6 +57,7 @@
#include "UnlinkCommand.h"
#include "htmlediting.h"
#include "markup.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/editing/InsertTextCommand.cpp b/WebCore/editing/InsertTextCommand.cpp
index f10d71b..52eb12f 100644
--- a/WebCore/editing/InsertTextCommand.cpp
+++ b/WebCore/editing/InsertTextCommand.cpp
@@ -109,7 +109,7 @@ bool InsertTextCommand::performTrivialReplace(const String& text, bool selectIns
void InsertTextCommand::input(const String& text, bool selectInsertedText)
{
- ASSERT(text.find('\n') == -1);
+ ASSERT(text.find('\n') == notFound);
if (endingSelection().isNone())
return;
diff --git a/WebCore/editing/TextIterator.cpp b/WebCore/editing/TextIterator.cpp
index 9589bff..39013c1 100644
--- a/WebCore/editing/TextIterator.cpp
+++ b/WebCore/editing/TextIterator.cpp
@@ -442,11 +442,6 @@ void TextIterator::advance()
}
}
-static inline bool compareBoxStart(const InlineTextBox* first, const InlineTextBox* second)
-{
- return first->start() < second->start();
-}
-
bool TextIterator::handleTextNode()
{
if (m_fullyClippedStack.top())
@@ -507,7 +502,7 @@ bool TextIterator::handleTextNode()
for (InlineTextBox* textBox = renderer->firstTextBox(); textBox; textBox = textBox->nextTextBox()) {
m_sortedTextBoxes.append(textBox);
}
- std::sort(m_sortedTextBoxes.begin(), m_sortedTextBoxes.end(), compareBoxStart);
+ std::sort(m_sortedTextBoxes.begin(), m_sortedTextBoxes.end(), InlineTextBox::compareByStart);
m_sortedTextBoxesPosition = 0;
}
@@ -526,11 +521,11 @@ void TextIterator::handleTextBox()
return;
}
String str = renderer->text();
- int start = m_offset;
- int end = (m_node == m_endContainer) ? m_endOffset : INT_MAX;
+ unsigned start = m_offset;
+ unsigned end = (m_node == m_endContainer) ? m_endOffset : UINT_MAX;
while (m_textBox) {
- int textBoxStart = m_textBox->start();
- int runStart = max(textBoxStart, start);
+ unsigned textBoxStart = m_textBox->start();
+ unsigned runStart = max(textBoxStart, start);
// Check for collapsed space at the start of this run.
InlineTextBox* firstTextBox = renderer->containsReversedText() ? m_sortedTextBoxes[0] : renderer->firstTextBox();
@@ -546,8 +541,8 @@ void TextIterator::handleTextBox()
emitCharacter(' ', m_node, 0, runStart, runStart);
return;
}
- int textBoxEnd = textBoxStart + m_textBox->len();
- int runEnd = min(textBoxEnd, end);
+ unsigned textBoxEnd = textBoxStart + m_textBox->len();
+ unsigned runEnd = min(textBoxEnd, end);
// Determine what the next text box will be, but don't advance yet
InlineTextBox* nextTextBox = 0;
@@ -565,8 +560,8 @@ void TextIterator::handleTextBox()
emitCharacter(' ', m_node, 0, runStart, runStart + 1);
m_offset = runStart + 1;
} else {
- int subrunEnd = str.find('\n', runStart);
- if (subrunEnd == -1 || subrunEnd > runEnd)
+ size_t subrunEnd = str.find('\n', runStart);
+ if (subrunEnd == notFound || subrunEnd > runEnd)
subrunEnd = runEnd;
m_offset = subrunEnd;
@@ -575,11 +570,11 @@ void TextIterator::handleTextBox()
// If we are doing a subrun that doesn't go to the end of the text box,
// come back again to finish handling this text box; don't advance to the next one.
- if (m_positionEndOffset < textBoxEnd)
+ if (static_cast<unsigned>(m_positionEndOffset) < textBoxEnd)
return;
// Advance and return
- int nextRunStart = nextTextBox ? nextTextBox->start() : str.length();
+ unsigned nextRunStart = nextTextBox ? nextTextBox->start() : str.length();
if (nextRunStart > runEnd)
m_lastTextNodeEndedWithCollapsedSpace = true; // collapsed space between runs or at the end
m_textBox = nextTextBox;
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index 7680084..bab3111 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -332,9 +332,9 @@ void TypingCommand::insertText(const String &text, bool selectInsertedText)
// an existing selection; at the moment they can either put the caret after what's inserted or
// select what's inserted, but there's no way to "extend selection" to include both an old selection
// that ends just before where we want to insert text and the newly inserted text.
- int offset = 0;
- int newline;
- while ((newline = text.find('\n', offset)) != -1) {
+ unsigned offset = 0;
+ size_t newline;
+ while ((newline = text.find('\n', offset)) != notFound) {
if (newline != offset)
insertTextRunWithoutNewlines(text.substring(offset, newline - offset), false);
insertParagraphSeparator();
@@ -343,7 +343,7 @@ void TypingCommand::insertText(const String &text, bool selectInsertedText)
if (!offset)
insertTextRunWithoutNewlines(text, selectInsertedText);
else {
- int length = text.length();
+ unsigned length = text.length();
if (length != offset)
insertTextRunWithoutNewlines(text.substring(offset, length - offset), selectInsertedText);
}
diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp
index 26989c3..b1ec07c 100644
--- a/WebCore/editing/markup.cpp
+++ b/WebCore/editing/markup.cpp
@@ -591,52 +591,6 @@ static void appendEndMarkup(Vector<UChar>& result, const Node* node)
result.append('>');
}
-class MarkupAccumulator {
-public:
- MarkupAccumulator(Node* nodeToSkip, Vector<Node*>* nodes)
- : m_nodeToSkip(nodeToSkip)
- , m_nodes(nodes)
- {
- }
-
- void appendMarkup(Node* startNode, EChildrenOnly, EAbsoluteURLs, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0);
-
- String takeResult() { return String::adopt(m_result); }
-
-private:
- Vector<UChar> m_result;
- Node* m_nodeToSkip;
- Vector<Node*>* m_nodes;
-};
-
-// FIXME: Would be nice to do this in a non-recursive way.
-void MarkupAccumulator::appendMarkup(Node* startNode, EChildrenOnly childrenOnly, EAbsoluteURLs absoluteURLs, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces)
-{
- if (startNode == m_nodeToSkip)
- return;
-
- HashMap<AtomicStringImpl*, AtomicStringImpl*> namespaceHash;
- if (namespaces)
- namespaceHash = *namespaces;
-
- // start tag
- if (!childrenOnly) {
- if (m_nodes)
- m_nodes->append(startNode);
- appendStartMarkup(m_result, startNode, 0, DoNotAnnotateForInterchange, absoluteURLs, false, &namespaceHash);
- }
-
- // children
- if (!(startNode->document()->isHTMLDocument() && doesHTMLForbidEndTag(startNode))) {
- for (Node* current = startNode->firstChild(); current; current = current->nextSibling())
- appendMarkup(current, IncludeNode, absoluteURLs, &namespaceHash);
- }
-
- // end tag
- if (!childrenOnly)
- appendEndMarkup(m_result, startNode);
-}
-
static void completeURLs(Node* node, const String& baseURL)
{
Vector<AttributeChange> changes;
@@ -737,7 +691,8 @@ static bool shouldIncludeWrapperForFullySelectedRoot(Node* fullySelectedRoot, CS
class MarkupAccumulatorWrapper {
public:
- MarkupAccumulatorWrapper()
+ MarkupAccumulatorWrapper(Vector<Node*>* nodes)
+ : m_nodes(nodes)
{
}
@@ -746,11 +701,13 @@ public:
postMarkups.append(s);
}
- void insertOpenTag(const Node* node, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs, bool convertBlocksToInlines = false, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
+ void insertOpenTag(const Node* node, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs, bool convertBlocksToInlines = false, HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
{
Vector<UChar> result;
- appendStartMarkup(result, node, range, annotate, absoluteURLs, convertBlocksToInlines, 0, rangeFullySelectsNode);
+ appendStartMarkup(result, node, range, annotate, absoluteURLs, convertBlocksToInlines, namespaces, rangeFullySelectsNode);
postMarkups.append(String::adopt(result));
+ if (m_nodes)
+ m_nodes->append(const_cast<Node*>(node));
}
void insertEndTag(const Node* node)
@@ -760,12 +717,14 @@ public:
postMarkups.append(String::adopt(result));
}
- void wrapWithNode(const Node* node, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs, bool convertBlocksToInlines = false, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
+ void wrapWithNode(const Node* node, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs, bool convertBlocksToInlines = false, HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
{
Vector<UChar> result;
- appendStartMarkup(result, node, range, annotate, absoluteURLs, convertBlocksToInlines, 0, rangeFullySelectsNode);
+ appendStartMarkup(result, node, range, annotate, absoluteURLs, convertBlocksToInlines, namespaces, rangeFullySelectsNode);
preMarkups.append(String::adopt(result));
insertEndTag(node);
+ if (m_nodes)
+ m_nodes->append(const_cast<Node*>(node));
}
void wrapWithStyleNode(CSSStyleDeclaration* style, Document* document, bool isBlock = false)
@@ -814,11 +773,12 @@ public:
}
private:
+ Vector<Node*>* m_nodes;
Vector<String> preMarkups;
Vector<String> postMarkups;
};
-static Node* serializeNodes(MarkupAccumulatorWrapper& accumulator, Node* startNode, Node* pastEnd, Vector<Node*>* nodes, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs)
+static Node* serializeNodes(MarkupAccumulatorWrapper& accumulator, Node* startNode, Node* pastEnd, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs)
{
Vector<Node*> ancestorsToClose;
Node* next;
@@ -847,8 +807,6 @@ static Node* serializeNodes(MarkupAccumulatorWrapper& accumulator, Node* startNo
} else {
// Add the node to the markup if we're not skipping the descendants
accumulator.insertOpenTag(n, range, annotate, absoluteURLs);
- if (nodes)
- nodes->append(n);
// If node has no children, close the tag now.
if (!n->childNodeCount()) {
@@ -885,8 +843,6 @@ static Node* serializeNodes(MarkupAccumulatorWrapper& accumulator, Node* startNo
// or b) ancestors that we never encountered during a pre-order traversal starting at startNode:
ASSERT(startNode->isDescendantOf(parent));
accumulator.wrapWithNode(parent, range, annotate, absoluteURLs);
- if (nodes)
- nodes->append(parent);
lastClosed = parent;
}
}
@@ -932,7 +888,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
document->updateLayoutIgnorePendingStylesheets();
- MarkupAccumulatorWrapper accumulator;
+ MarkupAccumulatorWrapper accumulator(nodes);
Node* pastEnd = updatedRange->pastLastNode();
Node* startNode = updatedRange->firstNode();
@@ -955,7 +911,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
}
}
- Node* lastClosed = serializeNodes(accumulator, startNode, pastEnd, nodes, range, annotate, absoluteURLs);
+ Node* lastClosed = serializeNodes(accumulator, startNode, pastEnd, range, annotate, absoluteURLs);
// Include ancestors that aren't completely inside the range but are required to retain
// the structure and appearance of the copied markup.
@@ -1030,7 +986,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
} else {
// Since this node and all the other ancestors are not in the selection we want to set RangeFullySelectsNode to DoesNotFullySelectNode
// so that styles that affect the exterior of the node are not included.
- accumulator.wrapWithNode(ancestor, updatedRange.get(), annotate, absoluteURLs, convertBlocksToInlines, DoesNotFullySelectNode);
+ accumulator.wrapWithNode(ancestor, updatedRange.get(), annotate, absoluteURLs, convertBlocksToInlines, 0, DoesNotFullySelectNode);
}
if (nodes)
nodes->append(ancestor);
@@ -1087,7 +1043,8 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document* document, const String& markup, const String& baseURL, FragmentScriptingPermission scriptingPermission)
{
- RefPtr<DocumentFragment> fragment = document->documentElement()->createContextualFragment(markup, scriptingPermission);
+ // FIXME: This should not use deprecatedCreateContextualFragment
+ RefPtr<DocumentFragment> fragment = document->documentElement()->deprecatedCreateContextualFragment(markup, scriptingPermission);
if (fragment && !baseURL.isEmpty() && baseURL != blankURL() && baseURL != document->baseURL())
completeURLs(fragment.get(), baseURL);
@@ -1095,6 +1052,27 @@ PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document* document, const
return fragment.release();
}
+static void serializeNodesWithNamespaces(MarkupAccumulatorWrapper& accumulator, const Node* node, Node* nodeToSkip, EChildrenOnly childrenOnly, EAbsoluteURLs absoluteURLs, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces)
+{
+ if (node == nodeToSkip)
+ return;
+
+ HashMap<AtomicStringImpl*, AtomicStringImpl*> namespaceHash;
+ if (namespaces)
+ namespaceHash = *namespaces;
+
+ if (!childrenOnly)
+ accumulator.insertOpenTag(node, 0, DoNotAnnotateForInterchange, absoluteURLs, false, &namespaceHash);
+
+ if (!(node->document()->isHTMLDocument() && doesHTMLForbidEndTag(node))) {
+ for (Node* current = node->firstChild(); current; current = current->nextSibling())
+ serializeNodesWithNamespaces(accumulator, current, nodeToSkip, IncludeNode, absoluteURLs, &namespaceHash);
+ }
+
+ if (!childrenOnly)
+ accumulator.insertEndTag(node);
+}
+
String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs absoluteURLs)
{
if (!node)
@@ -1107,9 +1085,9 @@ String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>*
return "";
}
- MarkupAccumulator accumulator(deleteButtonContainerElement, nodes);
- accumulator.appendMarkup(const_cast<Node*>(node), childrenOnly, absoluteURLs);
- return accumulator.takeResult();
+ MarkupAccumulatorWrapper accumulator(nodes);
+ serializeNodesWithNamespaces(accumulator, node, deleteButtonContainerElement, childrenOnly, absoluteURLs, 0);
+ return accumulator.takeResults();
}
static void fillContainerFromString(ContainerNode* paragraph, const String& string)
@@ -1123,7 +1101,7 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
return;
}
- ASSERT(string.find('\n') == -1);
+ ASSERT(string.find('\n') == notFound);
Vector<String> tabList;
string.split('\t', true, tabList);
@@ -1206,7 +1184,7 @@ PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String
}
// A string with no newlines gets added inline, rather than being put into a paragraph.
- if (string.find('\n') == -1) {
+ if (string.find('\n') == notFound) {
fillContainerFromString(fragment.get(), string);
return fragment.release();
}
diff --git a/WebCore/history/mac/HistoryItemMac.mm b/WebCore/history/mac/HistoryItemMac.mm
index 52ae7be..09bf78d 100644
--- a/WebCore/history/mac/HistoryItemMac.mm
+++ b/WebCore/history/mac/HistoryItemMac.mm
@@ -26,7 +26,7 @@
#include "config.h"
#include "HistoryItem.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/html/Blob.cpp b/WebCore/html/Blob.cpp
index 977ffa6..3a62ab1 100644
--- a/WebCore/html/Blob.cpp
+++ b/WebCore/html/Blob.cpp
@@ -31,29 +31,93 @@
#include "config.h"
#include "Blob.h"
+#include "BlobData.h"
#include "BlobItem.h"
+#include "BlobURL.h"
#include "FileSystem.h"
+#include "ScriptExecutionContext.h"
+#include "ThreadableBlobRegistry.h"
namespace WebCore {
-Blob::Blob(ScriptExecutionContext*, const String& type, const BlobItemList& items)
- : m_type(type)
+// FIXME: To be removed when we switch to using BlobData.
+Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const String& type, const BlobItemList& items)
+ : m_scriptExecutionContext(scriptExecutionContext)
+ , m_type(type)
+ , m_size(0)
{
+ m_scriptExecutionContext->addBlob(this);
for (size_t i = 0; i < items.size(); ++i)
m_items.append(items[i]);
}
-Blob::Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>& item)
+// FIXME: To be removed when we switch to using BlobData.
+Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const PassRefPtr<BlobItem>& item)
+ : m_scriptExecutionContext(scriptExecutionContext)
+ , m_size(0)
{
+ m_scriptExecutionContext->addBlob(this);
m_items.append(item);
}
-Blob::Blob(ScriptExecutionContext*, const String& path)
+// FIXME: To be removed when we switch to using BlobData.
+Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const String& path)
+ : m_scriptExecutionContext(scriptExecutionContext)
+ , m_size(0)
{
+ m_scriptExecutionContext->addBlob(this);
// Note: this doesn't initialize the type unlike File(path).
m_items.append(FileBlobItem::create(path));
}
+Blob::Blob(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<BlobData> blobData, long long size)
+ : m_scriptExecutionContext(scriptExecutionContext)
+ , m_type(blobData->contentType())
+ , m_size(size)
+{
+ ASSERT(blobData.get() && !blobData->items().isEmpty());
+
+ m_scriptExecutionContext->addBlob(this);
+
+ // Create a new internal URL and register it with the provided blob data.
+ m_url = BlobURL::createURL(scriptExecutionContext);
+ ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext, m_url, blobData);
+}
+
+Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const KURL& srcURL, const String& type, long long size)
+ : m_scriptExecutionContext(scriptExecutionContext)
+ , m_type(type)
+ , m_size(size)
+{
+ m_scriptExecutionContext->addBlob(this);
+
+ // FIXME: To be removed when we switch to using BlobData.
+ if (srcURL.isEmpty())
+ return;
+
+ // Create a new internal URL and register it with the same blob data as the source URL.
+ m_url = BlobURL::createURL(scriptExecutionContext);
+ ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext, m_url, srcURL);
+}
+
+Blob::~Blob()
+{
+ // The internal URL is only used to refer to the Blob object. So we need to unregister the URL when the object is GC-ed.
+ if (m_scriptExecutionContext) {
+ m_scriptExecutionContext->removeBlob(this);
+ ThreadableBlobRegistry::unregisterBlobURL(m_scriptExecutionContext, m_url);
+ }
+}
+
+void Blob::contextDestroyed()
+{
+ ASSERT(m_scriptExecutionContext);
+
+ // Unregister the internal URL before the context is gone.
+ ThreadableBlobRegistry::unregisterBlobURL(m_scriptExecutionContext, m_url);
+ m_scriptExecutionContext = 0;
+}
+
unsigned long long Blob::size() const
{
// FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to
@@ -64,6 +128,7 @@ unsigned long long Blob::size() const
return size;
}
+// FIXME: To be removed when we switch to using BlobData.
const String& Blob::path() const
{
ASSERT(m_items.size() == 1 && m_items[0]->toFileBlobItem());
diff --git a/WebCore/html/Blob.h b/WebCore/html/Blob.h
index 7afc7a0..374a401 100644
--- a/WebCore/html/Blob.h
+++ b/WebCore/html/Blob.h
@@ -32,39 +32,45 @@
#define Blob_h
#include "BlobItem.h"
+#include "KURL.h"
#include "PlatformString.h"
+#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
namespace WebCore {
+class BlobData;
class ScriptExecutionContext;
class Blob : public RefCounted<Blob> {
public:
+ // FIXME: To be removed when we switch to using BlobData.
static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& type, const BlobItemList& items)
{
return adoptRef(new Blob(scriptExecutionContext, type, items));
}
- // FIXME: Deprecated method. This is called only from
- // bindings/v8/SerializedScriptValue.cpp and the usage in it will become invalid once
- // BlobBuilder is introduced.
- static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& path)
+ // For deserialization.
+ static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const KURL& srcURL, const String& type, long long size)
{
- return adoptRef(new Blob(scriptExecutionContext, path));
+ return adoptRef(new Blob(scriptExecutionContext, srcURL, type, size));
}
- virtual ~Blob() { }
+ virtual ~Blob();
+ void contextDestroyed();
+
+ const KURL& url() const { return m_url; }
unsigned long long size() const;
const String& type() const { return m_type; }
virtual bool isFile() const { return false; }
- // FIXME: Deprecated method.
+ // FIXME: To be removed when we switch to using BlobData.
const String& path() const;
+ // FIXME: To be removed when we switch to using BlobData.
const BlobItemList& items() const { return m_items; }
#if ENABLE(BLOB)
@@ -72,14 +78,26 @@ public:
#endif
protected:
+ // FIXME: To be removed when we switch to using BlobData.
Blob(ScriptExecutionContext*, const String& type, const BlobItemList&);
Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>&);
-
- // FIXME: Deprecated constructor. See also the comment for Blob::create(path).
Blob(ScriptExecutionContext*, const String& path);
+ Blob(ScriptExecutionContext*, PassOwnPtr<BlobData>, long long size);
+
+ // For deserialization.
+ Blob(ScriptExecutionContext*, const KURL& srcURL, const String& type, long long size);
+
+ // FIXME: To be removed when we switch to using BlobData.
BlobItemList m_items;
+
+ // This is an internal URL referring to the blob data associated with this object.
+ // It is only used by FileReader to read the blob data via loading from the blob URL resource.
+ KURL m_url;
+
+ ScriptExecutionContext* m_scriptExecutionContext;
String m_type;
+ long long m_size;
};
} // namespace WebCore
diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/html/BlobBuilder.cpp
index 0592ff0..29a7595 100644
--- a/WebCore/html/BlobBuilder.cpp
+++ b/WebCore/html/BlobBuilder.cpp
@@ -32,11 +32,11 @@
#include "BlobBuilder.h"
-#include "AtomicString.h"
#include "Blob.h"
#include "ExceptionCode.h"
#include "LineEnding.h"
#include "TextEncoding.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/inspector/front-end/ObjectProxy.js b/WebCore/html/BlobURL.cpp
index ef139c6..610aac4 100644
--- a/WebCore/inspector/front-end/ObjectProxy.js
+++ b/WebCore/html/BlobURL.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,43 +28,39 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.ObjectProxy = function(injectedScriptId, objectId, path, description, hasChildren)
-{
- this.objectId = objectId;
- this.injectedScriptId = injectedScriptId;
- this.path = path || [];
- this.description = description;
- this.hasChildren = hasChildren;
-}
+#include "config.h"
+
+#include "BlobURL.h"
+
+#include "KURL.h"
+#include "PlatformString.h"
+#include "ScriptExecutionContext.h"
+#include "SecurityOrigin.h"
+#include "UUID.h"
-WebInspector.ObjectProxy.wrapPrimitiveValue = function(value)
+namespace WebCore {
+
+KURL BlobURL::createURL(ScriptExecutionContext* scriptExecutionContext)
{
- var proxy = new WebInspector.ObjectProxy();
- proxy.type = typeof value;
- proxy.description = value;
- return proxy;
+ // Create the blob URL in the following format:
+ // blob:%escaped_origin%/%UUID%
+ // The origin of the host page is encoded in the URL value to allow easy lookup of the origin when the security check needs
+ // to be performed.
+ String urlString = "blob:";
+ urlString += encodeWithURLEscapeSequences(scriptExecutionContext->securityOrigin()->toString());
+ urlString += "/";
+ urlString += createCanonicalUUIDString();
+ return KURL(ParsedURLString, urlString);
}
-WebInspector.ObjectProxy.getPropertiesAsync = function(objectProxy, propertiesToQueryFor, callback)
+KURL BlobURL::getOrigin(const KURL& url)
{
- function createPropertiesMapThenCallback(propertiesPayload)
- {
- if (!propertiesPayload) {
- callback();
- return;
- }
+ ASSERT(url.protocolIs("blob"));
- var result = [];
- for (var i = 0; i < propertiesPayload.length; ++i)
- if (propertiesToQueryFor.indexOf(propertiesPayload[i].name) !== -1)
- result[propertiesPayload[i].name] = propertiesPayload[i].value.description;
- callback(result);
- };
- InjectedScriptAccess.get(objectProxy.injectedScriptId).getProperties(objectProxy, true, false, createPropertiesMapThenCallback);
+ unsigned startIndex = url.pathStart();
+ unsigned afterEndIndex = url.pathAfterLastSlash();
+ String origin = url.string().substring(startIndex, afterEndIndex - startIndex);
+ return KURL(ParsedURLString, decodeURLEscapeSequences(origin));
}
-WebInspector.ObjectPropertyProxy = function(name, value)
-{
- this.name = name;
- this.value = value;
-}
+} // namespace WebCore
diff --git a/WebCore/html/BlobURL.h b/WebCore/html/BlobURL.h
new file mode 100644
index 0000000..2ce2c85
--- /dev/null
+++ b/WebCore/html/BlobURL.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BlobURL_h
+#define BlobURL_h
+
+#include "KURL.h"
+
+namespace WebCore {
+
+class ScriptExecutionContext;
+
+class BlobURL {
+public:
+ static KURL createURL(ScriptExecutionContext*);
+ static KURL getOrigin(const KURL&);
+};
+
+}
+
+#endif // BlobURL_h
diff --git a/WebCore/html/DataGridColumn.h b/WebCore/html/DataGridColumn.h
index 3d480a9..555389c 100644
--- a/WebCore/html/DataGridColumn.h
+++ b/WebCore/html/DataGridColumn.h
@@ -28,10 +28,10 @@
#if ENABLE(DATAGRID)
-#include "AtomicString.h"
#include "RenderStyle.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/html/DataGridColumnList.cpp b/WebCore/html/DataGridColumnList.cpp
index 9613402..15590b2 100644
--- a/WebCore/html/DataGridColumnList.cpp
+++ b/WebCore/html/DataGridColumnList.cpp
@@ -27,11 +27,11 @@
#if ENABLE(DATAGRID)
-#include "AtomicString.h"
#include "DataGridColumnList.h"
#include "HTMLDataGridElement.h"
#include "PlatformString.h"
#include "RenderObject.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp
index 109e0d3..253cb4d 100644
--- a/WebCore/html/File.cpp
+++ b/WebCore/html/File.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "File.h"
+#include "BlobData.h"
#include "FileSystem.h"
#include "MIMETypeRegistry.h"
@@ -37,6 +38,13 @@ File::File(ScriptExecutionContext* scriptExecutionContext, const String& path)
Init();
}
+File::File(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& url, const String& type)
+ : Blob(scriptExecutionContext, url, type, BlobDataItem::toEndOfFile)
+{
+ // FIXME: To be removed when we switch to using BlobData.
+ m_items.append(FileBlobItem::create(path));
+}
+
#if ENABLE(DIRECTORY_UPLOAD)
File::File(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& filePath)
: Blob(scriptExecutionContext, FileBlobItem::create(filePath, relativePath))
@@ -49,8 +57,8 @@ void File::Init()
{
// We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure.
const String& fileName = name();
- int index = fileName.reverseFind('.');
- if (index != -1)
+ size_t index = fileName.reverseFind('.');
+ if (index != notFound)
m_type = MIMETypeRegistry::getMIMETypeForExtension(fileName.substring(index + 1));
}
diff --git a/WebCore/html/File.h b/WebCore/html/File.h
index c0aecc8..06a73c5 100644
--- a/WebCore/html/File.h
+++ b/WebCore/html/File.h
@@ -39,6 +39,12 @@ public:
return adoptRef(new File(scriptExecutionContext, path));
}
+ // For deserialization.
+ static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& url, const String& type)
+ {
+ return adoptRef(new File(scriptExecutionContext, path, url, type));
+ }
+
#if ENABLE(DIRECTORY_UPLOAD)
static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& path)
{
@@ -60,11 +66,15 @@ public:
private:
File(ScriptExecutionContext*, const String& path);
- void Init();
+
+ // For deserialization.
+ File(ScriptExecutionContext*, const String& path, const KURL&, const String& type);
#if ENABLE(DIRECTORY_UPLOAD)
File(ScriptExecutionContext*, const String& relativePath, const String& path);
#endif
+
+ void Init();
};
} // namespace WebCore
diff --git a/WebCore/html/FileReader.cpp b/WebCore/html/FileReader.cpp
index 88f218f..e99fdc4 100644
--- a/WebCore/html/FileReader.cpp
+++ b/WebCore/html/FileReader.cpp
@@ -160,33 +160,70 @@ void FileReader::terminate()
void FileReader::didStart()
{
m_state = Opening;
- m_streamProxy->openForRead(m_fileBlob.get());
+
+ ASSERT(m_fileBlob->items().size() == 1 && m_fileBlob->items().at(0)->toFileBlobItem());
+ const FileRangeBlobItem* fileRangeItem = m_fileBlob->items().at(0)->toFileRangeBlobItem();
+ double expectedModificationTime = fileRangeItem ? fileRangeItem->snapshotModificationTime() : 0;
+
+ m_streamProxy->getSize(m_fileBlob->path(), expectedModificationTime);
}
void FileReader::didGetSize(long long size)
{
+ // If the size is -1, it means the file has been moved or changed. Fail now.
+ if (size == -1) {
+ didFail(NOT_FOUND_ERR);
+ return;
+ }
+
m_state = Reading;
fireEvent(eventNames().loadstartEvent);
- m_totalBytes = size;
- m_streamProxy->read(&m_buffer.at(0), m_buffer.size());
+ ASSERT(m_fileBlob->items().size() == 1 && m_fileBlob->items().at(0)->toFileBlobItem());
+ const FileRangeBlobItem* fileRangeItem = m_fileBlob->items().at(0)->toFileRangeBlobItem();
+ long long start = fileRangeItem ? fileRangeItem->start() : 0;
+
+ // The size passed back is the size of the whole file. If the underlying item is a sliced file, we need to use the slice length.
+ m_totalBytes = fileRangeItem ? fileRangeItem->size() : size;
+
+ m_streamProxy->openForRead(m_fileBlob->path(), start, m_totalBytes);
}
-void FileReader::didRead(const char* data, int bytesRead)
+void FileReader::didOpen(ExceptionCode ec)
{
- ASSERT(data && bytesRead);
+ if (ec) {
+ didFail(ec);
+ return;
+ }
+
+ m_streamProxy->read(m_buffer.data(), m_buffer.size());
+}
+void FileReader::didRead(int bytesRead)
+{
// Bail out if we have aborted the reading.
if (m_state == Completed)
- return;
+ return;
+
+ // If bytesRead is -1, it means an error happens.
+ if (bytesRead == -1) {
+ didFail(NOT_READABLE_ERR);
+ return;
+ }
+
+ // If bytesRead is 0, it means the reading is done.
+ if (!bytesRead) {
+ didFinish();
+ return;
+ }
switch (m_readType) {
case ReadFileAsBinaryString:
- m_result += String(data, static_cast<unsigned>(bytesRead));
+ m_result += String(m_buffer.data(), static_cast<unsigned>(bytesRead));
break;
case ReadFileAsText:
case ReadFileAsDataURL:
- m_rawData.append(data, static_cast<unsigned>(bytesRead));
+ m_rawData.append(m_buffer.data(), static_cast<unsigned>(bytesRead));
m_isRawDataConverted = false;
break;
default:
@@ -205,7 +242,7 @@ void FileReader::didRead(const char* data, int bytesRead)
}
// Continue reading.
- m_streamProxy->read(&m_buffer.at(0), m_buffer.size());
+ m_streamProxy->read(m_buffer.data(), m_buffer.size());
}
void FileReader::didFinish()
@@ -240,15 +277,15 @@ FileReader::ReadyState FileReader::readyState() const
switch (m_state) {
case None:
case Starting:
- return Empty;
+ return EMPTY;
case Opening:
case Reading:
- return Loading;
+ return LOADING;
case Completed:
- return Done;
+ return DONE;
}
ASSERT_NOT_REACHED();
- return Empty;
+ return EMPTY;
}
const ScriptString& FileReader::result()
diff --git a/WebCore/html/FileReader.h b/WebCore/html/FileReader.h
index a5339a9..2237af5 100644
--- a/WebCore/html/FileReader.h
+++ b/WebCore/html/FileReader.h
@@ -63,9 +63,9 @@ public:
virtual ~FileReader();
enum ReadyState {
- Empty = 0,
- Loading = 1,
- Done = 2
+ EMPTY = 0,
+ LOADING = 1,
+ DONE = 2
};
void readAsBinaryString(Blob*);
@@ -89,9 +89,8 @@ public:
// FileStreamClient
virtual void didStart();
virtual void didGetSize(long long);
- virtual void didRead(const char*, int);
- virtual void didFinish();
- virtual void didFail(ExceptionCode);
+ virtual void didOpen(ExceptionCode);
+ virtual void didRead(int);
using RefCounted<FileReader>::ref;
using RefCounted<FileReader>::deref;
@@ -130,6 +129,8 @@ private:
void fireEvent(const AtomicString& type);
void convertToText();
void convertToDataURL();
+ void didFinish();
+ void didFail(ExceptionCode);
InternalState m_state;
EventTargetData m_eventTargetData;
diff --git a/WebCore/html/FileReader.idl b/WebCore/html/FileReader.idl
index fb3b979..b36e9d3 100644
--- a/WebCore/html/FileReader.idl
+++ b/WebCore/html/FileReader.idl
@@ -34,8 +34,7 @@ module html {
CanBeConstructed,
CallWith=ScriptExecutionContext,
EventTarget,
- NoStaticTables,
- DontCheckEnums
+ NoStaticTables
] FileReader {
// ready states
const unsigned short EMPTY = 0;
diff --git a/WebCore/html/FileStream.cpp b/WebCore/html/FileStream.cpp
index abe7bad..a89c67a 100644
--- a/WebCore/html/FileStream.cpp
+++ b/WebCore/html/FileStream.cpp
@@ -39,9 +39,8 @@
namespace WebCore {
-FileStream::FileStream(FileStreamClient* client)
- : m_client(client)
- , m_handle(invalidPlatformFileHandle)
+FileStream::FileStream()
+ : m_handle(invalidPlatformFileHandle)
, m_bytesProcessed(0)
, m_totalBytesToRead(0)
{
@@ -52,130 +51,99 @@ FileStream::~FileStream()
ASSERT(!isHandleValid(m_handle));
}
+// FIXME: To be removed when we switch to using BlobData.
void FileStream::start()
{
- ASSERT(!isMainThread());
- m_client->didStart();
}
void FileStream::stop()
{
- ASSERT(!isMainThread());
close();
- m_client->didStop();
}
-void FileStream::openForRead(Blob* blob)
+long long FileStream::getSize(const String& path, double expectedModificationTime)
{
- ASSERT(!isMainThread());
+ // Check the modification time for the possible file change.
+ time_t modificationTime;
+ if (!getFileModificationTime(path, modificationTime))
+ return -1;
+ if (expectedModificationTime) {
+ if (static_cast<time_t>(expectedModificationTime) != modificationTime)
+ return -1;
+ }
+
+ // Now get the file size.
+ long long length;
+ if (!getFileSize(path, length))
+ return -1;
+
+ return length;
+}
+ExceptionCode FileStream::openForRead(const String& path, long long offset, long long length)
+{
if (isHandleValid(m_handle))
- return;
-
- // FIXME: Need to handle multiple items that may include non-file ones when BlobBuilder is introduced.
- ASSERT(blob->items().size() >= 1);
- const FileBlobItem* fileItem = blob->items().at(0)->toFileBlobItem();
- if (!fileItem) {
- ASSERT(false);
- m_client->didFail(NOT_READABLE_ERR);
- return;
- }
+ return 0;
- // Check if the file exists by querying its modification time. We choose not to call fileExists() in order to save an
- // extra file system call when the modification time is needed to check the validity of the sliced file blob.
- // Per the spec, we need to return different error codes to differentiate between non-existent file and permission error.
- // openFile() could not tell use the failure reason.
- time_t currentModificationTime;
- if (!getFileModificationTime(fileItem->path(), currentModificationTime)) {
- m_client->didFail(NOT_FOUND_ERR);
- return;
- }
+ // Open the file.
+ m_handle = openFile(path, OpenForRead);
+ if (!isHandleValid(m_handle))
+ return NOT_READABLE_ERR;
- // Open the file blob.
- m_handle = openFile(fileItem->path(), OpenForRead);
- if (!isHandleValid(m_handle)) {
- m_client->didFail(NOT_READABLE_ERR);
- return;
+ // Jump to the beginning position if the file has been sliced.
+ if (offset > 0) {
+ if (seekFile(m_handle, offset, SeekFromBeginning) < 0)
+ return NOT_READABLE_ERR;
}
- const FileRangeBlobItem* fileRangeItem = fileItem->toFileRangeBlobItem();
- if (fileRangeItem) {
- // Check the modificationt time for the possible file change.
- if (static_cast<time_t>(fileRangeItem->snapshotModificationTime()) != currentModificationTime) {
- m_client->didFail(NOT_READABLE_ERR);
- return;
- }
-
- // Jump to the beginning position if the file has been sliced.
- if (fileRangeItem->start() > 0) {
- if (seekFile(m_handle, fileRangeItem->start(), SeekFromBeginning) < 0) {
- m_client->didFail(NOT_READABLE_ERR);
- return;
- }
- }
- }
+ m_totalBytesToRead = length;
+ m_bytesProcessed = 0;
- // Get the size.
- m_totalBytesToRead = blob->size();
- m_client->didGetSize(m_totalBytesToRead);
+ return 0;
}
-void FileStream::openForWrite(const String&)
+ExceptionCode FileStream::openForWrite(const String&)
{
- ASSERT(!isMainThread());
// FIXME: to be implemented.
+ return NOT_SUPPORTED_ERR;
}
void FileStream::close()
{
- ASSERT(!isMainThread());
if (isHandleValid(m_handle)) {
closeFile(m_handle);
m_handle = invalidPlatformFileHandle;
}
}
-void FileStream::read(char* buffer, int length)
+int FileStream::read(char* buffer, int bufferSize)
{
- ASSERT(!isMainThread());
-
- if (!isHandleValid(m_handle)) {
- m_client->didFail(NOT_READABLE_ERR);
- return;
- }
-
- if (m_bytesProcessed >= m_totalBytesToRead) {
- m_client->didFinish();
- return;
- }
+ if (!isHandleValid(m_handle))
+ return -1;
long long remaining = m_totalBytesToRead - m_bytesProcessed;
- int bytesToRead = (remaining < length) ? static_cast<int>(remaining) : length;
- int bytesRead = readFromFile(m_handle, buffer, bytesToRead);
- if (bytesRead < 0) {
- m_client->didFail(NOT_READABLE_ERR);
- return;
- }
-
- if (!bytesRead) {
- m_client->didFinish();
- return;
- }
-
- m_bytesProcessed += bytesRead;
- m_client->didRead(buffer, bytesRead);
+ int bytesToRead = (remaining < bufferSize) ? static_cast<int>(remaining) : bufferSize;
+ int bytesRead = 0;
+ if (bytesToRead > 0)
+ bytesRead = readFromFile(m_handle, buffer, bytesToRead);
+ if (bytesRead < 0)
+ return -1;
+ if (bytesRead > 0)
+ m_bytesProcessed += bytesRead;
+
+ return bytesRead;
}
-void FileStream::write(Blob*, long long, int)
+int FileStream::write(Blob*, long long, int)
{
- ASSERT(!isMainThread());
// FIXME: to be implemented.
+ return -1;
}
-void FileStream::truncate(long long)
+ExceptionCode FileStream::truncate(long long)
{
- ASSERT(!isMainThread());
// FIXME: to be implemented.
+ return NOT_SUPPORTED_ERR;
}
} // namespace WebCore
diff --git a/WebCore/html/FileStream.h b/WebCore/html/FileStream.h
index b5eccd4..e299fe4 100644
--- a/WebCore/html/FileStream.h
+++ b/WebCore/html/FileStream.h
@@ -33,7 +33,7 @@
#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
-#include "FileStreamClient.h"
+#include "ExceptionCode.h"
#include "FileSystem.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
@@ -43,29 +43,52 @@ namespace WebCore {
class Blob;
-// All methods are synchronous and should be called on File or Worker thread.
+// All methods are synchronous.
class FileStream : public RefCounted<FileStream> {
public:
- static PassRefPtr<FileStream> create(FileStreamClient* client)
+ static PassRefPtr<FileStream> create()
{
- return adoptRef(new FileStream(client));
+ return adoptRef(new FileStream());
}
virtual ~FileStream();
+ // FIXME: To be removed when we switch to using BlobData.
void start();
+
+ // Aborts the operation.
void stop();
- void openForRead(Blob*);
- void openForWrite(const String& path);
+ // Gets the size of a file. Also validates if the file has been changed or not if the expected modification time is provided, i.e. non-zero.
+ // Returns total number of bytes if successful. -1 otherwise.
+ long long getSize(const String& path, double expectedModificationTime);
+
+ // Opens a file for reading. The reading starts at the specified offset and lasts till the specified length.
+ // Returns 0 on success. Exception code otherwise.
+ ExceptionCode openForRead(const String& path, long long offset, long long length);
+
+ // Opens a file for writing.
+ // Returns 0 on success. Exception code otherwise.
+ ExceptionCode openForWrite(const String& path);
+
+ // Closes the file.
void close();
- void read(char* buffer, int length);
- void write(Blob* blob, long long position, int length);
- void truncate(long long position);
+
+ // Reads a file into the provided data buffer.
+ // Returns number of bytes being read on success. -1 otherwise.
+ // If 0 is returned, it means that the reading is completed.
+ int read(char* buffer, int length);
+
+ // Writes a blob to the file.
+ // Returns number of bytes being written on success. -1 otherwise.
+ int write(Blob*, long long position, int length);
+
+ // Truncates the file to the specified position.
+ // Returns 0 on success. Exception code otherwise.
+ ExceptionCode truncate(long long position);
private:
- FileStream(FileStreamClient*);
+ FileStream();
- FileStreamClient* m_client;
PlatformFileHandle m_handle;
long long m_bytesProcessed;
long long m_totalBytesToRead;
diff --git a/WebCore/html/FileStreamClient.h b/WebCore/html/FileStreamClient.h
index 2e7091f..440d2fb 100644
--- a/WebCore/html/FileStreamClient.h
+++ b/WebCore/html/FileStreamClient.h
@@ -40,16 +40,18 @@ namespace WebCore {
class FileStreamClient {
public:
// For reading.
- virtual void didRead(const char*, int) { }
+ virtual void didRead(int) { }
// For writing.
virtual void didWrite(int) { }
+ virtual void didTruncate(ExceptionCode) { }
- // For both reading and writing.
+ // FIXME: To be removed when we switch to using BlobData.
virtual void didStart() { }
+
+ // For both reading and writing.
+ virtual void didOpen(ExceptionCode) { }
virtual void didStop() { }
- virtual void didFinish() { }
- virtual void didFail(ExceptionCode) { }
virtual void didGetSize(long long) { }
protected:
diff --git a/WebCore/html/FileStreamProxy.cpp b/WebCore/html/FileStreamProxy.cpp
index e3b9e79..f50b7e8 100644
--- a/WebCore/html/FileStreamProxy.cpp
+++ b/WebCore/html/FileStreamProxy.cpp
@@ -37,6 +37,7 @@
#include "Blob.h"
#include "CrossThreadTask.h"
#include "FileStream.h"
+#include "FileStreamClient.h"
#include "FileThread.h"
#include "FileThreadTask.h"
#include "PlatformString.h"
@@ -47,7 +48,7 @@ namespace WebCore {
inline FileStreamProxy::FileStreamProxy(ScriptExecutionContext* context, FileStreamClient* client)
: m_context(context)
, m_client(client)
- , m_stream(FileStream::create(this))
+ , m_stream(FileStream::create())
{
}
@@ -59,7 +60,7 @@ PassRefPtr<FileStreamProxy> FileStreamProxy::create(ScriptExecutionContext* cont
// This is balanced by the deref in derefProxyOnContext below.
proxy->ref();
- proxy->fileThread()->postTask(createFileThreadTask(proxy->m_stream.get(), &FileStream::start));
+ proxy->fileThread()->postTask(createFileThreadTask(proxy.get(), &FileStreamProxy::startOnFileThread));
return proxy.release();
}
@@ -68,133 +69,150 @@ FileStreamProxy::~FileStreamProxy()
{
}
-void FileStreamProxy::openForRead(Blob* blob)
+FileThread* FileStreamProxy::fileThread()
{
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::openForRead, blob));
+ ASSERT(m_context->isContextThread());
+ ASSERT(m_context->fileThread());
+ return m_context->fileThread();
}
-void FileStreamProxy::openForWrite(const String& path)
+static void didStart(ScriptExecutionContext*, FileStreamProxy* proxy)
{
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::openForWrite, path));
+ if (proxy->client())
+ proxy->client()->didStart();
}
-void FileStreamProxy::close()
+void FileStreamProxy::startOnFileThread()
{
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::close));
+ m_stream->start();
+ m_context->postTask(createCallbackTask(&didStart, this));
}
-void FileStreamProxy::read(char* buffer, int length)
+void FileStreamProxy::stop()
{
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::read, buffer, length));
+ // Clear the client so that we won't be calling callbacks on the client.
+ m_client = 0;
+
+ fileThread()->unscheduleTasks(m_stream.get());
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::stopOnFileThread));
}
-void FileStreamProxy::write(Blob* blob, long long position, int length)
+static void derefProxyOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
{
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::write, blob, position, length));
+ ASSERT(proxy->hasOneRef());
+ proxy->deref();
}
-void FileStreamProxy::truncate(long long position)
+void FileStreamProxy::stopOnFileThread()
{
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::truncate, position));
+ m_stream->stop();
+ m_context->postTask(createCallbackTask(&derefProxyOnContext, this));
}
-FileThread* FileStreamProxy::fileThread()
+static void didGetSize(ScriptExecutionContext*, FileStreamProxy* proxy, long long size)
{
- ASSERT(m_context->isContextThread());
- ASSERT(m_context->fileThread());
- return m_context->fileThread();
+ if (proxy->client())
+ proxy->client()->didGetSize(size);
}
-void FileStreamProxy::stop()
+void FileStreamProxy::getSize(const String& path, double expectedModificationTime)
{
- // Clear the client so that we won't be calling callbacks on the client.
- m_client = 0;
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::getSizeOnFileThread, path, expectedModificationTime));
+}
- fileThread()->unscheduleTasks(m_stream.get());
- fileThread()->postTask(createFileThreadTask(m_stream.get(), &FileStream::stop));
+void FileStreamProxy::getSizeOnFileThread(const String& path, double expectedModificationTime)
+{
+ long long size = m_stream->getSize(path, expectedModificationTime);
+ m_context->postTask(createCallbackTask(&didGetSize, this, size));
}
-static void notifyGetSizeOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, long long size)
+static void didOpen(ScriptExecutionContext*, FileStreamProxy* proxy, ExceptionCode ec)
{
if (proxy->client())
- proxy->client()->didGetSize(size);
+ proxy->client()->didOpen(ec);
}
-void FileStreamProxy::didGetSize(long long size)
+void FileStreamProxy::openForRead(const String& path, long long offset, long long length)
{
- ASSERT(!m_context->isContextThread());
- m_context->postTask(createCallbackTask(&notifyGetSizeOnContext, this, size));
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::openForReadOnFileThread, path, offset, length));
}
-static void notifyReadOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, const char* data, int bytesRead)
+void FileStreamProxy::openForReadOnFileThread(const String& path, long long offset, long long length)
{
- if (proxy->client())
- proxy->client()->didRead(data, bytesRead);
+ ExceptionCode ec = m_stream->openForRead(path, offset, length);
+ m_context->postTask(createCallbackTask(&didOpen, this, ec));
+}
+
+void FileStreamProxy::openForWrite(const String& path)
+{
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::openForWriteOnFileThread, path));
}
-void FileStreamProxy::didRead(const char* data, int bytesRead)
+void FileStreamProxy::openForWriteOnFileThread(const String& path)
{
- ASSERT(!m_context->isContextThread());
- m_context->postTask(createCallbackTask(&notifyReadOnContext, this, data, bytesRead));
+ ExceptionCode ec = m_stream->openForWrite(path);
+ m_context->postTask(createCallbackTask(&didOpen, this, ec));
}
-static void notifyWriteOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, int bytesWritten)
+void FileStreamProxy::close()
{
- if (proxy->client())
- proxy->client()->didWrite(bytesWritten);
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::closeOnFileThread));
}
-void FileStreamProxy::didWrite(int bytesWritten)
+void FileStreamProxy::closeOnFileThread()
{
- ASSERT(!m_context->isContextThread());
- m_context->postTask(createCallbackTask(&notifyWriteOnContext, this, bytesWritten));
+ m_stream->close();
}
-static void notifyStartOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
+static void didRead(ScriptExecutionContext*, FileStreamProxy* proxy, int bytesRead)
{
if (proxy->client())
- proxy->client()->didStart();
+ proxy->client()->didRead(bytesRead);
}
-void FileStreamProxy::didStart()
+void FileStreamProxy::read(char* buffer, int length)
+{
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::readOnFileThread, buffer, length));
+}
+
+void FileStreamProxy::readOnFileThread(char* buffer, int length)
{
- ASSERT(!m_context->isContextThread());
- m_context->postTask(createCallbackTask(&notifyStartOnContext, this));
+ int bytesRead = m_stream->read(buffer, length);
+ m_context->postTask(createCallbackTask(&didRead, this, bytesRead));
}
-static void notifyFinishOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
+static void didWrite(ScriptExecutionContext*, FileStreamProxy* proxy, int bytesWritten)
{
if (proxy->client())
- proxy->client()->didFinish();
+ proxy->client()->didWrite(bytesWritten);
}
-void FileStreamProxy::didFinish()
+void FileStreamProxy::write(Blob* blob, long long position, int length)
{
- ASSERT(!m_context->isContextThread());
- m_context->postTask(createCallbackTask(&notifyFinishOnContext, this));
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::writeOnFileThread, blob, position, length));
}
-static void notifyFailOnContext(ScriptExecutionContext*, FileStreamProxy* proxy, ExceptionCode ec)
+void FileStreamProxy::writeOnFileThread(Blob* blob, long long position, int length)
{
- if (proxy->client())
- proxy->client()->didFail(ec);
+ int bytesWritten = m_stream->write(blob, position, length);
+ m_context->postTask(createCallbackTask(&didWrite, this, bytesWritten));
}
-void FileStreamProxy::didFail(ExceptionCode ec)
+static void didTruncate(ScriptExecutionContext*, FileStreamProxy* proxy, ExceptionCode ec)
{
- ASSERT(!m_context->isContextThread());
- m_context->postTask(createCallbackTask(&notifyFailOnContext, this, ec));
+ if (proxy->client())
+ proxy->client()->didTruncate(ec);
}
-static void derefProxyOnContext(ScriptExecutionContext*, FileStreamProxy* proxy)
+void FileStreamProxy::truncate(long long position)
{
- ASSERT(proxy->hasOneRef());
- proxy->deref();
+ fileThread()->postTask(createFileThreadTask(this, &FileStreamProxy::truncateOnFileThread, position));
}
-void FileStreamProxy::didStop()
+void FileStreamProxy::truncateOnFileThread(long long position)
{
- m_context->postTask(createCallbackTask(&derefProxyOnContext, this));
+ ExceptionCode ec = m_stream->truncate(position);
+ m_context->postTask(createCallbackTask(&didTruncate, this, ec));
}
} // namespace WebCore
diff --git a/WebCore/html/FileStreamProxy.h b/WebCore/html/FileStreamProxy.h
index 8523d4a..1d03a58 100644
--- a/WebCore/html/FileStreamProxy.h
+++ b/WebCore/html/FileStreamProxy.h
@@ -34,7 +34,6 @@
#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
-#include "FileStreamClient.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -44,20 +43,22 @@ namespace WebCore {
class Blob;
class FileStream;
+class FileStreamClient;
class FileThread;
class ScriptExecutionContext;
-// A proxy module that calls corresponding FileStream methods on the file thread. Note: you must call stop() first and then release the reference to destruct the FileStreamProxy instance.
-class FileStreamProxy : public RefCounted<FileStreamProxy>, public FileStreamClient {
+// A proxy module that asynchronously calls corresponding FileStream methods on the file thread. Note: you must call stop() first and then release the reference to destruct the FileStreamProxy instance.
+class FileStreamProxy : public RefCounted<FileStreamProxy> {
public:
static PassRefPtr<FileStreamProxy> create(ScriptExecutionContext*, FileStreamClient*);
virtual ~FileStreamProxy();
- void openForRead(Blob* blob);
+ void getSize(const String& path, double expectedModificationTime);
+ void openForRead(const String& path, long long offset, long long length);
void openForWrite(const String& path);
void close();
void read(char* buffer, int length);
- void write(Blob* blob, long long position, int length);
+ void write(Blob*, long long position, int length);
void truncate(long long position);
// Stops the proxy and scedules it to be destructed. All the pending tasks will be aborted and the file stream will be closed.
@@ -69,17 +70,19 @@ public:
private:
FileStreamProxy(ScriptExecutionContext*, FileStreamClient*);
- // FileStreamClient methods.
- virtual void didGetSize(long long);
- virtual void didRead(const char*, int);
- virtual void didWrite(int);
- virtual void didFinish();
- virtual void didFail(ExceptionCode);
- virtual void didStart();
- virtual void didStop();
-
FileThread* fileThread();
+ // Called on File thread.
+ void startOnFileThread();
+ void stopOnFileThread();
+ void getSizeOnFileThread(const String& path, double expectedModificationTime);
+ void openForReadOnFileThread(const String& path, long long offset, long long length);
+ void openForWriteOnFileThread(const String& path);
+ void closeOnFileThread();
+ void readOnFileThread(char* buffer, int length);
+ void writeOnFileThread(Blob*, long long position, int length);
+ void truncateOnFileThread(long long position);
+
RefPtr<ScriptExecutionContext> m_context;
FileStreamClient* m_client;
RefPtr<FileStream> m_stream;
diff --git a/WebCore/html/FileThreadTask.h b/WebCore/html/FileThreadTask.h
index 09b647f..3443457 100644
--- a/WebCore/html/FileThreadTask.h
+++ b/WebCore/html/FileThreadTask.h
@@ -39,11 +39,11 @@
namespace WebCore {
-template<typename R, typename T>
+template<typename T>
class FileThreadTask0 : public FileThread::Task {
public:
- typedef R (T::*Method)();
- typedef FileThreadTask0<R, T> FileThreadTaskImpl;
+ typedef void (T::*Method)();
+ typedef FileThreadTask0<T> FileThreadTaskImpl;
static PassOwnPtr<FileThreadTaskImpl> create(T* instance, Method method)
{
@@ -66,11 +66,11 @@ private:
Method m_method;
};
-template<typename R, typename T, typename P1, typename MP1>
+template<typename T, typename P1, typename MP1>
class FileThreadTask1 : public FileThread::Task {
public:
- typedef R (T::*Method)(MP1);
- typedef FileThreadTask1<R, T, P1, MP1> FileThreadTaskImpl;
+ typedef void (T::*Method)(MP1);
+ typedef FileThreadTask1<T, P1, MP1> FileThreadTaskImpl;
typedef typename CrossThreadTaskTraits<P1>::ParamType Param1;
static PassOwnPtr<FileThreadTaskImpl> create(T* instance, Method method, Param1 parameter1)
@@ -96,11 +96,11 @@ private:
P1 m_parameter1;
};
-template<typename R, typename T, typename P1, typename MP1, typename P2, typename MP2>
+template<typename T, typename P1, typename MP1, typename P2, typename MP2>
class FileThreadTask2 : public FileThread::Task {
public:
- typedef R (T::*Method)(MP1, MP2);
- typedef FileThreadTask2<R, T, P1, MP1, P2, MP2> FileThreadTaskImpl;
+ typedef void (T::*Method)(MP1, MP2);
+ typedef FileThreadTask2<T, P1, MP1, P2, MP2> FileThreadTaskImpl;
typedef typename CrossThreadTaskTraits<P1>::ParamType Param1;
typedef typename CrossThreadTaskTraits<P2>::ParamType Param2;
@@ -129,11 +129,11 @@ private:
P2 m_parameter2;
};
-template<typename R, typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
class FileThreadTask3 : public FileThread::Task {
public:
typedef void (T::*Method)(MP1, MP2, MP3);
- typedef FileThreadTask3<R, T, P1, MP1, P2, MP2, P3, MP3> FileThreadTaskImpl;
+ typedef FileThreadTask3<T, P1, MP1, P2, MP2, P3, MP3> FileThreadTaskImpl;
typedef typename CrossThreadTaskTraits<P1>::ParamType Param1;
typedef typename CrossThreadTaskTraits<P2>::ParamType Param2;
typedef typename CrossThreadTaskTraits<P3>::ParamType Param3;
@@ -165,56 +165,56 @@ private:
P3 m_parameter3;
};
-template<typename R, typename T>
+template<typename T>
PassOwnPtr<FileThread::Task> createFileThreadTask(
T* const callee,
- R (T::*method)());
+ void (T::*method)());
-template<typename R, typename T>
+template<typename T>
PassOwnPtr<FileThread::Task> createFileThreadTask(
T* const callee,
- R (T::*method)())
+ void (T::*method)())
{
- return FileThreadTask0<R, T>::create(
+ return FileThreadTask0<T>::create(
callee,
method);
}
-template<typename R, typename T, typename P1, typename MP1>
+template<typename T, typename P1, typename MP1>
PassOwnPtr<FileThread::Task> createFileThreadTask(
T* const callee,
- R (T::*method)(MP1),
+ void (T::*method)(MP1),
const P1& parameter1)
{
- return FileThreadTask1<R, T, typename CrossThreadCopier<P1>::Type, MP1>::create(
+ return FileThreadTask1<T, typename CrossThreadCopier<P1>::Type, MP1>::create(
callee,
method,
CrossThreadCopier<P1>::copy(parameter1));
}
-template<typename R, typename T, typename P1, typename MP1, typename P2, typename MP2>
+template<typename T, typename P1, typename MP1, typename P2, typename MP2>
PassOwnPtr<FileThread::Task> createFileThreadTask(
T* const callee,
- R (T::*method)(MP1, MP2),
+ void (T::*method)(MP1, MP2),
const P1& parameter1,
const P2& parameter2)
{
- return FileThreadTask2<R, T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create(
+ return FileThreadTask2<T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2>::create(
callee,
method,
CrossThreadCopier<P1>::copy(parameter1),
CrossThreadCopier<P2>::copy(parameter2));
}
-template<typename R, typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
PassOwnPtr<FileThread::Task> createFileThreadTask(
T* const callee,
- R (T::*method)(MP1, MP2, MP3),
+ void (T::*method)(MP1, MP2, MP3),
const P1& parameter1,
const P2& parameter2,
const P3& parameter3)
{
- return FileThreadTask3<R, T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create(
+ return FileThreadTask3<T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3>::create(
callee,
method,
CrossThreadCopier<P1>::copy(parameter1),
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index 0d2e92d..e1ee86a 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -381,11 +381,11 @@ void HTMLAnchorElement::setHost(const String& value)
if (!url.canSetHostOrPort())
return;
- int separator = value.find(':');
+ size_t separator = value.find(':');
if (!separator)
return;
- if (separator == -1)
+ if (separator == notFound)
url.setHostAndPort(value);
else {
unsigned portEnd;
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index ef5574a..84ab227 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -209,8 +209,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas
void HTMLCanvasElement::willDraw(const FloatRect& rect)
{
- if (m_imageBuffer)
- m_imageBuffer->clearImage();
+ m_copiedImage.clear(); // Clear our image snapshot if we have one.
if (RenderBox* ro = renderBox()) {
FloatRect destRect = ro->contentBoxRect();
@@ -233,6 +232,7 @@ void HTMLCanvasElement::reset()
return;
bool ok;
+ bool hadImageBuffer = hasCreatedImageBuffer();
int w = getAttribute(widthAttr).toInt(&ok);
if (!ok || w < 0)
w = DefaultWidth;
@@ -241,14 +241,13 @@ void HTMLCanvasElement::reset()
h = DefaultHeight;
IntSize oldSize = size();
- setSurfaceSize(IntSize(w, h));
+ setSurfaceSize(IntSize(w, h)); // The image buffer gets cleared here.
#if ENABLE(3D_CANVAS)
- if (m_context && m_context->is3d())
+ if (m_context && m_context->is3d() && oldSize != size())
static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height());
#endif
- bool hadImageBuffer = hasCreatedImageBuffer();
if (m_context && m_context->is2d())
static_cast<CanvasRenderingContext2D*>(m_context.get())->reset();
@@ -277,23 +276,21 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r)
WebGLRenderingContext* context3D = 0;
if (m_context && m_context->is3d()) {
context3D = static_cast<WebGLRenderingContext*>(m_context.get());
- context3D->beginPaint();
+ if (!context3D->paintsIntoCanvasBuffer())
+ return;
+ context3D->paintRenderingResultsToCanvas();
}
#endif
if (hasCreatedImageBuffer()) {
ImageBuffer* imageBuffer = buffer();
if (imageBuffer) {
- Image* image = imageBuffer->imageForRendering();
- if (image)
- context->drawImage(image, DeviceColorSpace, r);
+ if (imageBuffer->drawsUsingCopy())
+ context->drawImage(copiedImage(), DeviceColorSpace, r);
+ else
+ context->drawImageBuffer(imageBuffer, DeviceColorSpace, r);
}
}
-
-#if ENABLE(3D_CANVAS)
- if (context3D)
- context3D->endPaint();
-#endif
}
#if ENABLE(3D_CANVAS)
@@ -325,6 +322,7 @@ void HTMLCanvasElement::setSurfaceSize(const IntSize& size)
m_size = size;
m_hasCreatedImageBuffer = false;
m_imageBuffer.clear();
+ m_copiedImage.clear();
}
String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionCode& ec)
@@ -405,6 +403,7 @@ void HTMLCanvasElement::createImageBuffer() const
return;
m_imageBuffer->context()->scale(FloatSize(size.width() / unscaledSize.width(), size.height() / unscaledSize.height()));
m_imageBuffer->context()->setShadowsIgnoreTransforms(true);
+ m_imageBuffer->context()->setImageInterpolationQuality(CanvasInterpolationQuality);
}
GraphicsContext* HTMLCanvasElement::drawingContext() const
@@ -419,6 +418,18 @@ ImageBuffer* HTMLCanvasElement::buffer() const
return m_imageBuffer.get();
}
+Image* HTMLCanvasElement::copiedImage() const
+{
+ if (!m_copiedImage && buffer())
+ m_copiedImage = buffer()->copyImage();
+ return m_copiedImage.get();
+}
+
+void HTMLCanvasElement::clearCopiedImage()
+{
+ m_copiedImage.clear();
+}
+
AffineTransform HTMLCanvasElement::baseTransform() const
{
ASSERT(m_hasCreatedImageBuffer);
diff --git a/WebCore/html/HTMLCanvasElement.h b/WebCore/html/HTMLCanvasElement.h
index 2e3570d..3270667 100644
--- a/WebCore/html/HTMLCanvasElement.h
+++ b/WebCore/html/HTMLCanvasElement.h
@@ -38,6 +38,7 @@ class CanvasContextAttributes;
class CanvasRenderingContext;
class GraphicsContext;
class HTMLCanvasElement;
+class Image;
class ImageBuffer;
class IntSize;
@@ -93,6 +94,8 @@ public:
CanvasRenderingContext* renderingContext() const { return m_context.get(); }
ImageBuffer* buffer() const;
+ Image* copiedImage() const;
+ void clearCopiedImage();
IntRect convertLogicalToDevice(const FloatRect&) const;
IntSize convertLogicalToDevice(const FloatSize&) const;
@@ -165,6 +168,8 @@ private:
// m_createdImageBuffer means we tried to malloc the buffer. We didn't necessarily get it.
mutable bool m_hasCreatedImageBuffer;
mutable OwnPtr<ImageBuffer> m_imageBuffer;
+
+ mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platforms that have to copy the image buffer to render (and for CSSCanvasValue).
};
} //namespace
diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/HTMLConstructionSite.cpp
index 1a9a373..a25c7d9 100644
--- a/WebCore/html/HTMLConstructionSite.cpp
+++ b/WebCore/html/HTMLConstructionSite.cpp
@@ -39,7 +39,6 @@
#include "HTMLScriptElement.h"
#include "HTMLToken.h"
#include "HTMLTokenizer.h"
-#include "LegacyHTMLDocumentParser.h"
#include "LegacyHTMLTreeBuilder.h"
#include "LocalizedStrings.h"
#if ENABLE(MATHML)
@@ -93,11 +92,17 @@ PassRefPtr<ChildType> HTMLConstructionSite::attach(Node* parent, PassRefPtr<Chil
// doesn't. It feels like we're missing a concept somehow.
if (shouldFosterParent()) {
fosterParent(child.get());
- ASSERT(child->attached());
+ ASSERT(child->attached() || !child->parent()->attached());
return child.release();
}
parent->parserAddChild(child);
+
+ // An event handler (DOM Mutation, beforeload, et al.) could have removed
+ // the child, in which case we shouldn't try attaching it.
+ if (!child->parentNode())
+ return child.release();
+
// It's slightly unfortunate that we need to hold a reference to child
// here to call attach(). We should investigate whether we can rely on
// |parent| to hold a ref at this point. In the common case (at least
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index bc9de97..4e26c02 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -68,7 +68,6 @@
#include "HTMLBodyElement.h"
#include "HTMLElementFactory.h"
#include "HTMLNames.h"
-#include "LegacyHTMLDocumentParser.h"
#include "InspectorController.h"
#include "KURL.h"
#include "Page.h"
@@ -290,11 +289,7 @@ DocumentParser* HTMLDocument::createParser()
if (Page* page = this->page())
reportErrors = page->inspectorController()->windowVisible();
#endif
-
- if (settings() && settings()->html5ParserEnabled())
- return new HTMLDocumentParser(this, reportErrors);
-
- return new LegacyHTMLDocumentParser(this, reportErrors);
+ return new HTMLDocumentParser(this, reportErrors);
}
// --------------------------------------------------------------------------
@@ -328,9 +323,9 @@ void HTMLDocument::removeItemFromMap(HashCountedSet<AtomicStringImpl*>& map, con
{
if (name.isEmpty())
return;
+ map.remove(name.impl());
if (Frame* f = frame())
f->script()->namedItemRemoved(this, name);
- map.remove(name.impl());
}
void HTMLDocument::addNamedItem(const AtomicString& name)
diff --git a/WebCore/html/HTMLDocument.h b/WebCore/html/HTMLDocument.h
index 646e100..3b5fdfa 100644
--- a/WebCore/html/HTMLDocument.h
+++ b/WebCore/html/HTMLDocument.h
@@ -23,10 +23,10 @@
#ifndef HTMLDocument_h
#define HTMLDocument_h
-#include "AtomicStringHash.h"
#include "CachedResourceClient.h"
#include "Document.h"
#include <wtf/HashCountedSet.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/html/HTMLDocumentParser.h b/WebCore/html/HTMLDocumentParser.h
index d055861..d35cfaf 100644
--- a/WebCore/html/HTMLDocumentParser.h
+++ b/WebCore/html/HTMLDocumentParser.h
@@ -62,12 +62,14 @@ public:
static void parseDocumentFragment(const String&, DocumentFragment*, Element* contextElement, FragmentScriptingPermission = FragmentScriptingAllowed);
+protected:
+ virtual void insert(const SegmentedString&);
+ virtual void finish();
+
private:
// DocumentParser
virtual bool hasInsertionPoint();
- virtual void insert(const SegmentedString&);
virtual void append(const SegmentedString&);
- virtual void finish();
virtual bool finishWasCalled();
virtual bool processingData() const;
virtual void stopParsing();
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 6fc53a2..ff25e62 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -275,18 +275,23 @@ String HTMLElement::outerHTML() const
return createMarkup(this);
}
-// FIXME: This method is unecessary with the new HTMLDocumentParser.
-PassRefPtr<DocumentFragment> HTMLElement::createContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
+static bool useLegacyTreeBuilder(Document* document)
+{
+ return !document || !document->settings() || !document->settings()->html5TreeBuilderEnabled();
+}
+
+// FIXME: This logic should move into Range::createContextualFragment
+PassRefPtr<DocumentFragment> HTMLElement::deprecatedCreateContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
{
// The following is in accordance with the definition as used by IE.
if (endTagRequirement() == TagStatusForbidden)
return 0;
- if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
- hasLocalName(headTag) || hasLocalName(styleTag) || hasLocalName(titleTag))
+ if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag)
+ || hasLocalName(headTag) || hasLocalName(styleTag) || hasLocalName(titleTag))
return 0;
- return Element::createContextualFragment(markup, scriptingPermission);
+ return Element::deprecatedCreateContextualFragment(markup, scriptingPermission);
}
static inline bool hasOneChild(ContainerNode* node)
@@ -339,23 +344,46 @@ static void replaceChildrenWithText(HTMLElement* element, const String& text, Ex
element->appendChild(textNode.release(), ec);
}
+// We may want to move a version of this function into DocumentFragment.h/cpp
+static PassRefPtr<DocumentFragment> createFragmentFromSource(const String& markup, Element* contextElement, ExceptionCode& ec)
+{
+ Document* document = contextElement->document();
+ RefPtr<DocumentFragment> fragment;
+
+ if (useLegacyTreeBuilder(document)) {
+ fragment = contextElement->deprecatedCreateContextualFragment(markup);
+ if (!fragment)
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return fragment;
+ }
+
+ fragment = DocumentFragment::create(document);
+ if (document->isHTMLDocument()) {
+ fragment->parseHTML(markup, contextElement);
+ return fragment;
+ }
+
+ bool wasValid = fragment->parseXML(markup, contextElement);
+ if (!wasValid) {
+ ec = INVALID_STATE_ERR;
+ return 0;
+ }
+ return fragment;
+}
+
void HTMLElement::setInnerHTML(const String& html, ExceptionCode& ec)
{
// FIXME: This code can be removed, it's handled by the HTMLDocumentParser correctly.
- if (hasLocalName(scriptTag) || hasLocalName(styleTag)) {
+ if (useLegacyTreeBuilder(document()) && (hasLocalName(scriptTag) || hasLocalName(styleTag))) {
// Script and CSS source shouldn't be parsed as HTML.
removeChildren();
appendChild(document()->createTextNode(html), ec);
return;
}
- RefPtr<DocumentFragment> fragment = createContextualFragment(html);
- if (!fragment) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return;
- }
-
- replaceChildrenWithFragment(this, fragment.release(), ec);
+ RefPtr<DocumentFragment> fragment = createFragmentFromSource(html, this, ec);
+ if (fragment)
+ replaceChildrenWithFragment(this, fragment.release(), ec);
}
void HTMLElement::setOuterHTML(const String& html, ExceptionCode& ec)
@@ -365,17 +393,13 @@ void HTMLElement::setOuterHTML(const String& html, ExceptionCode& ec)
ec = NO_MODIFICATION_ALLOWED_ERR;
return;
}
-
HTMLElement* parent = static_cast<HTMLElement*>(p);
- RefPtr<DocumentFragment> fragment = parent->createContextualFragment(html);
- if (!fragment) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return;
- }
- // FIXME: Why doesn't this have code to merge neighboring text nodes the way setOuterText does?
-
- parent->replaceChild(fragment.release(), this, ec);
+ RefPtr<DocumentFragment> fragment = createFragmentFromSource(html, parent, ec);
+ if (fragment) {
+ // FIXME: Why doesn't this have code to merge neighboring text nodes the way setOuterText does?
+ parent->replaceChild(fragment.release(), this, ec);
+ }
}
void HTMLElement::setInnerText(const String& text, ExceptionCode& ec)
@@ -549,13 +573,35 @@ Element* HTMLElement::insertAdjacentElement(const String& where, Element* newChi
return static_cast<Element*>(returnValue);
}
+// Step 3 of http://www.whatwg.org/specs/web-apps/current-work/multipage/apis-in-html-documents.html#insertadjacenthtml()
+static Element* contextElementForInsertion(const String& where, Element* element, ExceptionCode& ec)
+{
+ if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "afterEnd")) {
+ Node* parent = element->parentNode();
+ if (parent && parent->isDocumentNode()) {
+ ec = NO_MODIFICATION_ALLOWED_ERR;
+ return 0;
+ }
+ ASSERT(!parent || parent->isElementNode());
+ return static_cast<Element*>(parent);
+ }
+ if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "beforeEnd"))
+ return element;
+ ec = SYNTAX_ERR;
+ return 0;
+}
+
void HTMLElement::insertAdjacentHTML(const String& where, const String& markup, ExceptionCode& ec)
{
RefPtr<DocumentFragment> fragment = document()->createDocumentFragment();
+ Element* contextElement = contextElementForInsertion(where, this, ec);
+ if (!contextElement)
+ return;
+
if (document()->isHTMLDocument())
- fragment->parseHTML(markup, this);
+ fragment->parseHTML(markup, contextElement);
else {
- if (!fragment->parseXML(markup, this))
+ if (!fragment->parseXML(markup, contextElement))
// FIXME: We should propagate a syntax error exception out here.
return;
}
diff --git a/WebCore/html/HTMLElement.h b/WebCore/html/HTMLElement.h
index 03449c9..8f54d3e 100644
--- a/WebCore/html/HTMLElement.h
+++ b/WebCore/html/HTMLElement.h
@@ -46,7 +46,8 @@ public:
String innerHTML() const;
String outerHTML() const;
- PassRefPtr<DocumentFragment> createContextualFragment(const String&, FragmentScriptingPermission = FragmentScriptingAllowed);
+ // deprecatedCreateContextualFragment logic should be moved into Range::createContextualFragment
+ PassRefPtr<DocumentFragment> deprecatedCreateContextualFragment(const String&, FragmentScriptingPermission = FragmentScriptingAllowed);
void setInnerHTML(const String&, ExceptionCode&);
void setOuterHTML(const String&, ExceptionCode&);
void setInnerText(const String&, ExceptionCode&);
diff --git a/WebCore/html/HTMLEmbedElement.cpp b/WebCore/html/HTMLEmbedElement.cpp
index 3f700ef..afa56d4 100644
--- a/WebCore/html/HTMLEmbedElement.cpp
+++ b/WebCore/html/HTMLEmbedElement.cpp
@@ -89,8 +89,8 @@ void HTMLEmbedElement::parseMappedAttribute(Attribute* attr)
if (attr->name() == typeAttr) {
m_serviceType = value.string().lower();
- int pos = m_serviceType.find(";");
- if (pos != -1)
+ size_t pos = m_serviceType.find(";");
+ if (pos != notFound)
m_serviceType = m_serviceType.left(pos);
if (!isImageType() && m_imageLoader)
m_imageLoader.clear();
diff --git a/WebCore/html/HTMLEntityNames.gperf b/WebCore/html/HTMLEntityNames.gperf
deleted file mode 100644
index c665efe..0000000
--- a/WebCore/html/HTMLEntityNames.gperf
+++ /dev/null
@@ -1,303 +0,0 @@
-%{
-/*
- Copyright (C) 1999 Lars Knoll (knoll@mpi-hd.mpg.de)
- Copyright (C) 2002, 2003, 2004, 2005 Apple Inc. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- 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.
-
- ----------------------------------------------------------------------------
-
- HTMLEntityNames.gperf: input file to generate a hash table for entities
- HTMLEntityNames.cpp: DO NOT EDIT! generated by WebCore/make-hash-tools.pl
-*/
-%}
-%struct-type
-struct Entity {
- const char *name;
- int code;
-};
-%language=ANSI-C
-%readonly-tables
-%global-table
-%compare-strncmp
-%define lookup-function-name findEntity
-%define hash-function-name entity_hash_function
-%includes
-%enum
-%%
-AElig, 0x00c6
-AMP, 38
-Aacute, 0x00c1
-Acirc, 0x00c2
-Agrave, 0x00c0
-Alpha, 0x0391
-Aring, 0x00c5
-Atilde, 0x00c3
-Auml, 0x00c4
-Beta, 0x0392
-COPY, 0x00a9
-Ccedil, 0x00c7
-Chi, 0x03a7
-Dagger, 0x2021
-Delta, 0x0394
-ETH, 0x00d0
-Eacute, 0x00c9
-Ecirc, 0x00ca
-Egrave, 0x00c8
-Epsilon, 0x0395
-Eta, 0x0397
-Euml, 0x00cb
-GT, 62
-Gamma, 0x0393
-Iacute, 0x00cd
-Icirc, 0x00ce
-Igrave, 0x00cc
-Iota, 0x0399
-Iuml, 0x00cf
-Kappa, 0x039a
-LT, 60
-Lambda, 0x039b
-Mu, 0x039c
-Ntilde, 0x00d1
-Nu, 0x039d
-OElig, 0x0152
-Oacute, 0x00d3
-Ocirc, 0x00d4
-Ograve, 0x00d2
-Omega, 0x03a9
-Omicron, 0x039f
-Oslash, 0x00d8
-Otilde, 0x00d5
-Ouml, 0x00d6
-Phi, 0x03a6
-Pi, 0x03a0
-Prime, 0x2033
-Psi, 0x03a8
-QUOT, 34
-REG, 0x00ae
-Rho, 0x03a1
-Scaron, 0x0160
-Sigma, 0x03a3
-THORN, 0x00de
-Tau, 0x03a4
-Theta, 0x0398
-Uacute, 0x00da
-Ucirc, 0x00db
-Ugrave, 0x00d9
-Upsilon, 0x03a5
-Uuml, 0x00dc
-Xi, 0x039e
-Yacute, 0x00dd
-Yuml, 0x0178
-Zeta, 0x0396
-aacute, 0x00e1
-acirc, 0x00e2
-acute, 0x00b4
-aelig, 0x00e6
-agrave, 0x00e0
-alefsym, 0x2135
-alpha, 0x03b1
-amp, 38
-and, 0x2227
-ang, 0x2220
-apos, 0x0027
-aring, 0x00e5
-asymp, 0x2248
-atilde, 0x00e3
-auml, 0x00e4
-bdquo, 0x201e
-beta, 0x03b2
-brvbar, 0x00a6
-bull, 0x2022
-cap, 0x2229
-ccedil, 0x00e7
-cedil, 0x00b8
-cent, 0x00a2
-chi, 0x03c7
-circ, 0x02c6
-clubs, 0x2663
-cong, 0x2245
-copy, 0x00a9
-crarr, 0x21b5
-cup, 0x222a
-curren, 0x00a4
-dArr, 0x21d3
-dagger, 0x2020
-darr, 0x2193
-deg, 0x00b0
-delta, 0x03b4
-diams, 0x2666
-divide, 0x00f7
-eacute, 0x00e9
-ecirc, 0x00ea
-egrave, 0x00e8
-empty, 0x2205
-emsp, 0x2003
-ensp, 0x2002
-epsilon, 0x03b5
-equiv, 0x2261
-eta, 0x03b7
-eth, 0x00f0
-euml, 0x00eb
-euro, 0x20ac
-exist, 0x2203
-fnof, 0x0192
-forall, 0x2200
-frac12, 0x00bd
-frac14, 0x00bc
-frac34, 0x00be
-frasl, 0x2044
-gamma, 0x03b3
-ge, 0x2265
-gt, 62
-hArr, 0x21d4
-harr, 0x2194
-hearts, 0x2665
-hellip, 0x2026
-iacute, 0x00ed
-icirc, 0x00ee
-iexcl, 0x00a1
-igrave, 0x00ec
-image, 0x2111
-infin, 0x221e
-int, 0x222b
-iota, 0x03b9
-iquest, 0x00bf
-isin, 0x2208
-iuml, 0x00ef
-kappa, 0x03ba
-lArr, 0x21d0
-lambda, 0x03bb
-lang, 0x3008
-laquo, 0x00ab
-larr, 0x2190
-lceil, 0x2308
-ldquo, 0x201c
-le, 0x2264
-lfloor, 0x230a
-lowast, 0x2217
-loz, 0x25ca
-lrm, 0x200e
-lsaquo, 0x2039
-lsquo, 0x2018
-lt, 60
-macr, 0x00af
-mdash, 0x2014
-micro, 0x00b5
-middot, 0x00b7
-minus, 0x2212
-mu, 0x03bc
-nabla, 0x2207
-nbsp, 0x00a0
-ndash, 0x2013
-ne, 0x2260
-ni, 0x220b
-not, 0x00ac
-notin, 0x2209
-nsub, 0x2284
-nsup, 0x2285
-ntilde, 0x00f1
-nu, 0x03bd
-oacute, 0x00f3
-ocirc, 0x00f4
-oelig, 0x0153
-ograve, 0x00f2
-oline, 0x203e
-omega, 0x03c9
-omicron, 0x03bf
-oplus, 0x2295
-or, 0x2228
-ordf, 0x00aa
-ordm, 0x00ba
-oslash, 0x00f8
-otilde, 0x00f5
-otimes, 0x2297
-ouml, 0x00f6
-para, 0x00b6
-part, 0x2202
-percnt, 0x0025
-permil, 0x2030
-perp, 0x22a5
-phi, 0x03c6
-pi, 0x03c0
-piv, 0x03d6
-plusmn, 0x00b1
-pound, 0x00a3
-prime, 0x2032
-prod, 0x220f
-prop, 0x221d
-psi, 0x03c8
-quot, 34
-rArr, 0x21d2
-radic, 0x221a
-rang, 0x3009
-raquo, 0x00bb
-rarr, 0x2192
-rceil, 0x2309
-rdquo, 0x201d
-real, 0x211c
-reg, 0x00ae
-rfloor, 0x230b
-rho, 0x03c1
-rlm, 0x200f
-rsaquo, 0x203a
-rsquo, 0x2019
-sbquo, 0x201a
-scaron, 0x0161
-sdot, 0x22c5
-sect, 0x00a7
-shy, 0x00ad
-sigma, 0x03c3
-sigmaf, 0x03c2
-sim, 0x223c
-spades, 0x2660
-sub, 0x2282
-sube, 0x2286
-sum, 0x2211
-sup, 0x2283
-sup1, 0x00b9
-sup2, 0x00b2
-sup3, 0x00b3
-supe, 0x2287
-supl, 0x00b9
-szlig, 0x00df
-tau, 0x03c4
-there4, 0x2234
-theta, 0x03b8
-thetasym, 0x03d1
-thinsp, 0x2009
-thorn, 0x00fe
-tilde, 0x02dc
-times, 0x00d7
-trade, 0x2122
-uArr, 0x21d1
-uacute, 0x00fa
-uarr, 0x2191
-ucirc, 0x00fb
-ugrave, 0x00f9
-uml, 0x00a8
-upsih, 0x03d2
-upsilon, 0x03c5
-uuml, 0x00fc
-weierp, 0x2118
-xi, 0x03be
-yacute, 0x00fd
-yen, 0x00a5
-yuml, 0x00ff
-zeta, 0x03b6
-zwj, 0x200d
-zwnj, 0x200c
-%%
diff --git a/WebCore/html/HTMLEntityParser.cpp b/WebCore/html/HTMLEntityParser.cpp
index 84b2006..f675844 100644
--- a/WebCore/html/HTMLEntityParser.cpp
+++ b/WebCore/html/HTMLEntityParser.cpp
@@ -28,21 +28,10 @@
#include "config.h"
#include "HTMLEntityParser.h"
+#include "HTMLEntitySearch.h"
+#include "HTMLEntityTable.h"
#include <wtf/Vector.h>
-// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
-#ifdef __GNUC__
-// The main parser includes this too so we are getting two copies of the data. However, this way the code gets inlined.
-#include "HTMLEntityNames.cpp"
-#else
-// Not inlined for non-GCC compilers
-struct Entity {
- const char* name;
- int code;
-};
-const struct Entity* findEntity(register const char* str, register unsigned int len);
-#endif
-
using namespace WTF;
namespace WebCore {
@@ -113,7 +102,6 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U
EntityState entityState = Initial;
unsigned result = 0;
Vector<UChar, 10> consumedCharacters;
- Vector<char, 10> entityName;
while (!source.isEmpty()) {
UChar cc = *source;
@@ -177,7 +165,7 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U
else if (cc == ';') {
source.advancePastNonNewline();
return legalEntityFor(result);
- } else
+ } else
return legalEntityFor(result);
break;
}
@@ -192,48 +180,48 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U
break;
}
case Named: {
- // FIXME: This code is wrong. We need to find the longest matching entity.
- // The examples from the spec are:
- // I'm &notit; I tell you
- // I'm &notin; I tell you
- // In the first case, "&not" is the entity. In the second
- // case, "&notin;" is the entity.
- // FIXME: Our list of HTML entities is incomplete.
- // FIXME: The number 8 below is bogus.
- while (!source.isEmpty() && entityName.size() <= 8) {
+ HTMLEntitySearch entitySearch;
+ while (!source.isEmpty()) {
cc = *source;
- if (cc == ';') {
- const Entity* entity = findEntity(entityName.data(), entityName.size());
- if (entity) {
- source.advanceAndASSERT(';');
- return entity->code;
- }
- break;
- }
- if (!isAlphaNumeric(cc)) {
- const Entity* entity = findEntity(entityName.data(), entityName.size());
- if (entity) {
- // HTML5 tells us to ignore this entity, for historical reasons,
- // if the lookhead character is '='.
- if (additionalAllowedCharacter && cc == '=')
- break;
- // Some entities require a terminating semicolon, whereas other
- // entities do not. The HTML5 spec has a giant list:
- //
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/named-character-references.html#named-character-references
- //
- // However, the list seems to boil down to this branch:
- if (entity->code > 255)
- break;
- return entity->code;
- }
+ entitySearch.advance(cc);
+ if (!entitySearch.isEntityPrefix())
break;
- }
- entityName.append(cc);
consumedCharacters.append(cc);
source.advanceAndASSERT(cc);
}
notEnoughCharacters = source.isEmpty();
+ if (notEnoughCharacters) {
+ // We can't an entity because there might be a longer entity
+ // that we could match if we had more data.
+ unconsumeCharacters(source, consumedCharacters);
+ return 0;
+ }
+ if (!entitySearch.mostRecentMatch()) {
+ ASSERT(!entitySearch.currentValue());
+ unconsumeCharacters(source, consumedCharacters);
+ return 0;
+ }
+ if (entitySearch.mostRecentMatch()->length != entitySearch.currentLength()) {
+ // We've consumed too many characters. We need to walk the
+ // source back to the point at which we had consumed an
+ // actual entity.
+ unconsumeCharacters(source, consumedCharacters);
+ consumedCharacters.clear();
+ const int length = entitySearch.mostRecentMatch()->length;
+ const UChar* reference = entitySearch.mostRecentMatch()->entity;
+ for (int i = 0; i < length; ++i) {
+ cc = *source;
+ ASSERT_UNUSED(reference, cc == *reference++);
+ consumedCharacters.append(cc);
+ source.advanceAndASSERT(cc);
+ ASSERT(!source.isEmpty());
+ }
+ cc = *source;
+ }
+ if (entitySearch.mostRecentMatch()->lastCharacter() == ';')
+ return entitySearch.mostRecentMatch()->value;
+ if (!additionalAllowedCharacter || !(isAlphaNumeric(cc) || cc == '='))
+ return entitySearch.mostRecentMatch()->value;
unconsumeCharacters(source, consumedCharacters);
return 0;
}
@@ -247,4 +235,23 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U
return 0;
}
+UChar decodeNamedEntity(const char* name)
+{
+ HTMLEntitySearch search;
+ while (*name) {
+ search.advance(*name++);
+ if (!search.isEntityPrefix())
+ return 0;
+ }
+ search.advance(';');
+ UChar32 entityValue = search.currentValue();
+ if (U16_LENGTH(entityValue) != 1) {
+ // Callers need to move off this API if the entity table has values
+ // which do no fit in a 16 bit UChar!
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+ return static_cast<UChar>(entityValue);
+}
+
} // namespace WebCore
diff --git a/WebCore/html/HTMLEntityParser.h b/WebCore/html/HTMLEntityParser.h
index d37b0c3..1059b24 100644
--- a/WebCore/html/HTMLEntityParser.h
+++ b/WebCore/html/HTMLEntityParser.h
@@ -33,6 +33,9 @@ namespace WebCore {
unsigned consumeHTMLEntity(SegmentedString&, bool& notEnoughCharacters, UChar additionalAllowedCharacter = '\0');
+// Used by the XML parser. Not suitable for use in HTML parsing. Use consumeHTMLEntity instead.
+UChar decodeNamedEntity(const char*);
+
}
#endif
diff --git a/WebCore/html/HTMLEntitySearch.cpp b/WebCore/html/HTMLEntitySearch.cpp
new file mode 100644
index 0000000..580609e
--- /dev/null
+++ b/WebCore/html/HTMLEntitySearch.cpp
@@ -0,0 +1,132 @@
+/*
+ * 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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "HTMLEntitySearch.h"
+
+#include "HTMLEntityTable.h"
+
+namespace WebCore {
+
+namespace {
+
+const HTMLEntityTableEntry* halfway(const HTMLEntityTableEntry* left, const HTMLEntityTableEntry* right)
+{
+ return &left[(right - left) / 2];
+}
+
+}
+
+HTMLEntitySearch::HTMLEntitySearch()
+ : m_currentLength(0)
+ , m_currentValue(0)
+ , m_mostRecentMatch(0)
+ , m_first(HTMLEntityTable::firstEntry())
+ , m_last(HTMLEntityTable::lastEntry())
+{
+}
+
+HTMLEntitySearch::CompareResult HTMLEntitySearch::compare(const HTMLEntityTableEntry* entry, UChar nextCharacter) const
+{
+ if (entry->length < m_currentLength + 1)
+ return Before;
+ UChar entryNextCharacter = entry->entity[m_currentLength];
+ if (entryNextCharacter == nextCharacter)
+ return Prefix;
+ return entryNextCharacter < nextCharacter ? Before : After;
+}
+
+const HTMLEntityTableEntry* HTMLEntitySearch::findFirst(UChar nextCharacter) const
+{
+ const HTMLEntityTableEntry* left = m_first;
+ const HTMLEntityTableEntry* right = m_last;
+ if (left == right)
+ return left;
+ CompareResult result = compare(left, nextCharacter);
+ if (result == Prefix)
+ return left;
+ if (result == After)
+ return right;
+ while (left + 1 < right) {
+ const HTMLEntityTableEntry* probe = halfway(left, right);
+ result = compare(probe, nextCharacter);
+ if (result == Before)
+ left = probe;
+ else {
+ ASSERT(result == After || result == Prefix);
+ right = probe;
+ }
+ }
+ ASSERT(left + 1 == right);
+ return right;
+}
+
+const HTMLEntityTableEntry* HTMLEntitySearch::findLast(UChar nextCharacter) const
+{
+ const HTMLEntityTableEntry* left = m_first;
+ const HTMLEntityTableEntry* right = m_last;
+ if (left == right)
+ return right;
+ CompareResult result = compare(right, nextCharacter);
+ if (result == Prefix)
+ return right;
+ if (result == Before)
+ return left;
+ while (left + 1 < right) {
+ const HTMLEntityTableEntry* probe = halfway(left, right);
+ result = compare(probe, nextCharacter);
+ if (result == After)
+ right = probe;
+ else {
+ ASSERT(result == Before || result == Prefix);
+ left = probe;
+ }
+ }
+ ASSERT(left + 1 == right);
+ return left;
+}
+
+void HTMLEntitySearch::advance(UChar nextCharacter)
+{
+ ASSERT(isEntityPrefix());
+ if (!m_currentLength) {
+ m_first = HTMLEntityTable::firstEntryStartingWith(nextCharacter);
+ m_last = HTMLEntityTable::lastEntryStartingWith(nextCharacter);
+ } else {
+ m_first = findFirst(nextCharacter);
+ m_last = findLast(nextCharacter);
+ if (m_first == m_last && compare(m_first, nextCharacter) != Prefix)
+ return fail();
+ }
+ ++m_currentLength;
+ if (m_first->length != m_currentLength) {
+ m_currentValue = 0;
+ return;
+ }
+ m_mostRecentMatch = m_first;
+ m_currentValue = m_mostRecentMatch->value;
+}
+
+}
diff --git a/WebCore/html/HTMLEntitySearch.h b/WebCore/html/HTMLEntitySearch.h
new file mode 100644
index 0000000..11a23ae
--- /dev/null
+++ b/WebCore/html/HTMLEntitySearch.h
@@ -0,0 +1,75 @@
+/*
+ * 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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HTMLEntitySearch_h
+#define HTMLEntitySearch_h
+
+#include "PlatformString.h"
+
+namespace WebCore {
+
+struct HTMLEntityTableEntry;
+
+class HTMLEntitySearch {
+public:
+ HTMLEntitySearch();
+
+ void advance(UChar);
+
+ bool isEntityPrefix() const { return !!m_first; }
+ int currentValue() const { return m_currentValue; }
+ int currentLength() const { return m_currentLength; }
+
+ const HTMLEntityTableEntry* mostRecentMatch() const { return m_mostRecentMatch; }
+
+private:
+ enum CompareResult {
+ Before,
+ Prefix,
+ After,
+ };
+
+ CompareResult compare(const HTMLEntityTableEntry*, UChar) const;
+ const HTMLEntityTableEntry* findFirst(UChar) const;
+ const HTMLEntityTableEntry* findLast(UChar) const;
+
+ void fail()
+ {
+ m_currentValue = 0;
+ m_first = 0;
+ m_last = 0;
+ }
+
+ int m_currentLength;
+ int m_currentValue;
+
+ const HTMLEntityTableEntry* m_mostRecentMatch;
+ const HTMLEntityTableEntry* m_first;
+ const HTMLEntityTableEntry* m_last;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/canvas/CanvasNumberArray.h b/WebCore/html/HTMLEntityTable.h
index 09714a0..3734c34 100644
--- a/WebCore/html/canvas/CanvasNumberArray.h
+++ b/WebCore/html/HTMLEntityTable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 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
@@ -10,10 +10,10 @@
* 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
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -23,32 +23,30 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CanvasNumberArray_h
-#define CanvasNumberArray_h
+#ifndef HTMLEntityTable_h
+#define HTMLEntityTable_h
-#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-#include <limits>
+#include "PlatformString.h"
namespace WebCore {
- class CanvasNumberArray : public RefCounted<CanvasNumberArray> {
- public:
- static PassRefPtr<CanvasNumberArray> create(unsigned length);
-
- Vector<float>& data() { return m_data; }
- const Vector<float>& data() const { return m_data; }
+struct HTMLEntityTableEntry {
+ UChar lastCharacter() const { return entity[length - 1]; }
- unsigned length() const { return m_data.size(); }
- float item(unsigned index) const { return (index >= m_data.size()) ? 0 : m_data[index]; }
+ const UChar* entity;
+ int length;
+ int value;
+};
- private:
- CanvasNumberArray(unsigned length);
- Vector<float> m_data;
- };
-
-} // namespace WebCore
+class HTMLEntityTable {
+public:
+ static const HTMLEntityTableEntry* firstEntry();
+ static const HTMLEntityTableEntry* lastEntry();
-#endif // CanvasNumberArray_h
+ static const HTMLEntityTableEntry* firstEntryStartingWith(UChar);
+ static const HTMLEntityTableEntry* lastEntryStartingWith(UChar);
+};
+
+}
+
+#endif
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 5103bfa..ae1ac62 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -30,6 +30,7 @@
#include "Chrome.h"
#include "ChromeClient.h"
#include "Document.h"
+#include "DocumentParser.h"
#include "ElementRareData.h"
#include "Event.h"
#include "EventHandler.h"
@@ -39,7 +40,6 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "LegacyHTMLTreeBuilder.h"
-#include "LegacyHTMLDocumentParser.h"
#include "LabelsNodeList.h"
#include "Page.h"
#include "RenderBox.h"
@@ -526,7 +526,7 @@ static bool isNotLineBreak(UChar ch) { return ch != newlineCharacter && ch != ca
bool HTMLTextFormControlElement::isPlaceholderEmpty() const
{
const AtomicString& attributeValue = getAttribute(placeholderAttr);
- return attributeValue.string().find(isNotLineBreak) == -1;
+ return attributeValue.string().find(isNotLineBreak) == notFound;
}
bool HTMLTextFormControlElement::placeholderShouldBeVisible() const
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 8c759cb..50b6ed0 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -65,7 +65,6 @@
#include "RenderTheme.h"
#include "ScriptEventListener.h"
#include "StepRange.h"
-#include "StringHash.h"
#include "TextEvent.h"
#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
#include "WebViewCore.h"
@@ -74,6 +73,7 @@
#include <wtf/HashMap.h>
#include <wtf/MathExtras.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
using namespace std;
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index 72ac589..18cbaa4 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -101,6 +101,7 @@ public:
virtual bool isSearchField() const { return m_type == SEARCH; }
virtual bool isInputTypeHidden() const { return m_type == HIDDEN; }
virtual bool isPasswordField() const { return m_type == PASSWORD; }
+ virtual bool isCheckbox() const { return m_type == CHECKBOX; }
bool isTelephoneField() const { return m_type == TELEPHONE; }
bool isNumberField() const { return m_type == NUMBER; }
bool isEmailField() const { return m_type == EMAIL; }
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index a638572..c778b6f 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -51,7 +51,6 @@ inline HTMLLinkElement::HTMLLinkElement(const QualifiedName& tagName, Document*
, m_disabledState(Unset)
, m_loading(false)
, m_createdByParser(createdByParser)
- , m_shouldProcessAfterAttach(false)
{
ASSERT(hasTagName(linkTag));
}
@@ -260,28 +259,12 @@ void HTMLLinkElement::process()
document()->updateStyleSelector();
}
}
-
-void HTMLLinkElement::processCallback(Node* node)
-{
- ASSERT_ARG(node, node && node->hasTagName(linkTag));
- static_cast<HTMLLinkElement*>(node)->process();
-}
void HTMLLinkElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
document()->addStyleSheetCandidateNode(this, m_createdByParser);
- // Since processing a stylesheet link causes a beforeload event
- // to fire, it is possible for JavaScript to remove the element in the midst
- // of it being inserted into the DOM, which can lead to assertion failures
- // and crashes. Avoid this by postponing the beforeload/load until after
- // attach if there are beforeload listeners.
- if (document()->hasListenerType(Document::BEFORELOAD_LISTENER)) {
- m_shouldProcessAfterAttach = true;
- return;
- }
-
process();
}
@@ -294,20 +277,8 @@ void HTMLLinkElement::removedFromDocument()
// FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
if (document()->renderer())
document()->updateStyleSelector();
-
- m_shouldProcessAfterAttach = false;
}
-void HTMLLinkElement::attach()
-{
- if (m_shouldProcessAfterAttach) {
- m_shouldProcessAfterAttach = false;
- queuePostAttachCallback(&HTMLLinkElement::processCallback, this);
- }
-
- HTMLElement::attach();
-}
-
void HTMLLinkElement::finishParsingChildren()
{
m_createdByParser = false;
diff --git a/WebCore/html/HTMLLinkElement.h b/WebCore/html/HTMLLinkElement.h
index 057cccc..6d7643a 100644
--- a/WebCore/html/HTMLLinkElement.h
+++ b/WebCore/html/HTMLLinkElement.h
@@ -77,9 +77,6 @@ public:
bool isDisabled() const { return m_disabledState == Disabled; }
bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript; }
bool isIcon() const { return m_relAttribute.m_isIcon; }
-
- virtual void attach();
- virtual bool canLazyAttach() { return false; }
private:
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
@@ -137,7 +134,6 @@ private:
RelAttribute m_relAttribute;
bool m_loading;
bool m_createdByParser;
- bool m_shouldProcessAfterAttach;
};
} //namespace
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 94c0dd2..13b7807 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -112,7 +112,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
, m_processingMediaPlayerCallback(0)
, m_playing(false)
, m_isWaitingUntilMediaCanStart(false)
- , m_processingLoad(false)
, m_delayingTheLoadEvent(false)
, m_haveFiredLoadedData(false)
, m_inActiveDocument(true)
@@ -512,7 +511,10 @@ void HTMLMediaElement::prepareForLoad()
#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
m_player = MediaPlayer::create(this);
#else
- createMediaPlayerProxy();
+ if (m_player)
+ m_player->cancelLoad();
+ else
+ createMediaPlayerProxy();
#endif
// 4 - If the media element's networkState is not set to NETWORK_EMPTY, then run these substeps
@@ -532,6 +534,16 @@ void HTMLMediaElement::prepareForLoad()
m_error = 0;
m_autoplaying = true;
+ // 7 - Invoke the media element's resource selection algorithm.
+
+ // 8 - Note: Playback of any previously playing media resource for this element stops.
+
+ // The resource selection algorithm
+ // 1 - Set the networkState to NETWORK_NO_SOURCE
+ m_networkState = NETWORK_NO_SOURCE;
+
+ // 2 - Asynchronously await a stable state.
+
m_playedTimeRanges = TimeRanges::create();
m_lastSeekTime = 0;
m_closedCaptionsVisible = false;
@@ -549,11 +561,7 @@ void HTMLMediaElement::loadInternal()
return;
}
- // Steps 1 - 6 were done in prepareForLoad
-
- // 7 - Invoke the media element's resource selection algorithm.
selectMediaResource();
- m_processingLoad = false;
}
void HTMLMediaElement::selectMediaResource()
@@ -561,11 +569,6 @@ void HTMLMediaElement::selectMediaResource()
enum Mode { attribute, children };
Mode mode = attribute;
- // 1 - Set the networkState to NETWORK_NO_SOURCE
- m_networkState = NETWORK_NO_SOURCE;
-
- // 2 - Asynchronously await a stable state.
-
// 3 - ... the media element has neither a src attribute ...
if (!hasAttribute(srcAttr)) {
// ... nor a source element child: ...
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index aeec188..a73abba 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -340,7 +340,6 @@ private:
bool m_playing : 1;
bool m_isWaitingUntilMediaCanStart : 1;
- bool m_processingLoad : 1;
bool m_delayingTheLoadEvent : 1;
bool m_haveFiredLoadedData : 1;
bool m_inActiveDocument : 1;
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index d4bccc3..5989ec7 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -70,11 +70,11 @@ RenderWidget* HTMLObjectElement::renderWidgetForJSBindings() const
void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
{
String val = attr->value();
- int pos;
+ size_t pos;
if (attr->name() == typeAttr) {
m_serviceType = val.lower();
pos = m_serviceType.find(";");
- if (pos != -1)
+ if (pos != notFound)
m_serviceType = m_serviceType.left(pos);
if (renderer())
m_needWidgetUpdate = true;
diff --git a/WebCore/html/HTMLScriptRunner.cpp b/WebCore/html/HTMLScriptRunner.cpp
index 4a9058f..0d603ed 100644
--- a/WebCore/html/HTMLScriptRunner.cpp
+++ b/WebCore/html/HTMLScriptRunner.cpp
@@ -43,23 +43,22 @@ namespace WebCore {
using namespace HTMLNames;
-class NestScript : public Noncopyable {
+// FIXME: Factor out to avoid duplication with HTMLDocumentParser.
+class NestingLevelIncrementer : public Noncopyable {
public:
- NestScript(unsigned& nestingLevel, HTMLInputStream& inputStream)
+ explicit NestingLevelIncrementer(unsigned& nestingLevel)
: m_nestingLevel(&nestingLevel)
- , m_savedInsertionPoint(inputStream)
{
++(*m_nestingLevel);
}
- ~NestScript()
+ ~NestingLevelIncrementer()
{
--(*m_nestingLevel);
}
private:
unsigned* m_nestingLevel;
- InsertionPointRecord m_savedInsertionPoint;
};
HTMLScriptRunner::HTMLScriptRunner(Document* document, HTMLScriptRunnerHost* host)
@@ -97,7 +96,7 @@ inline PassRefPtr<Event> createScriptErrorEvent()
return Event::create(eventNames().errorEvent, true, false);
}
-ScriptSourceCode HTMLScriptRunner::sourceFromPendingScript(const PendingScript& script, bool& errorOccurred)
+ScriptSourceCode HTMLScriptRunner::sourceFromPendingScript(const PendingScript& script, bool& errorOccurred) const
{
if (script.cachedScript()) {
errorOccurred = script.cachedScript()->errorOccurred();
@@ -118,22 +117,29 @@ bool HTMLScriptRunner::isPendingScriptReady(const PendingScript& script)
return true;
}
-void HTMLScriptRunner::executePendingScript()
+void HTMLScriptRunner::executeParsingBlockingScript()
{
ASSERT(!m_scriptNestingLevel);
ASSERT(m_document->haveStylesheetsLoaded());
- bool errorOccurred = false;
ASSERT(isPendingScriptReady(m_parsingBlockingScript));
- ScriptSourceCode sourceCode = sourceFromPendingScript(m_parsingBlockingScript, errorOccurred);
// Stop watching loads before executeScript to prevent recursion if the script reloads itself.
if (m_parsingBlockingScript.cachedScript() && m_parsingBlockingScript.watchingForLoad())
stopWatchingForLoad(m_parsingBlockingScript);
+ InsertionPointRecord insertionPointRecord(m_host->inputStream());
+ executePendingScriptAndDispatchEvent(m_parsingBlockingScript);
+}
+
+void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendingScript)
+{
+ bool errorOccurred = false;
+ ScriptSourceCode sourceCode = sourceFromPendingScript(pendingScript, errorOccurred);
+
// Clear the pending script before possible rentrancy from executeScript()
- RefPtr<Element> scriptElement = m_parsingBlockingScript.releaseElementAndClear();
+ RefPtr<Element> scriptElement = pendingScript.releaseElementAndClear();
{
- NestScript nestingLevel(m_scriptNestingLevel, m_host->inputStream());
+ NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
if (errorOccurred)
scriptElement->dispatchEvent(createScriptErrorEvent());
else {
@@ -144,12 +150,8 @@ void HTMLScriptRunner::executePendingScript()
ASSERT(!m_scriptNestingLevel);
}
-void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode)
+void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode) const
{
- // FIXME: We do not block inline <script> tags on stylesheets for now.
- // When we do, || !element->hasAttribute(srcAttr) should be removed from
- // the ASSERT below. See https://bugs.webkit.org/show_bug.cgi?id=40047
- ASSERT(m_document->haveStylesheetsLoaded() || !element->hasAttribute(srcAttr));
ScriptElement* scriptElement = toScriptElement(element);
ASSERT(scriptElement);
if (!scriptElement->shouldExecuteAsJavaScript())
@@ -204,7 +206,7 @@ bool HTMLScriptRunner::executeParsingBlockingScripts()
// We only really need to check once.
if (!isPendingScriptReady(m_parsingBlockingScript))
return false;
- executePendingScript();
+ executeParsingBlockingScript();
}
return true;
}
@@ -228,31 +230,39 @@ bool HTMLScriptRunner::executeScriptsWaitingForStylesheets()
return executeParsingBlockingScripts();
}
-void HTMLScriptRunner::requestScript(Element* script)
+void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
{
- ASSERT(!m_parsingBlockingScript.element());
- AtomicString srcValue = script->getAttribute(srcAttr);
+ if (!requestPendingScript(m_parsingBlockingScript, element))
+ return;
+
+ ASSERT(m_parsingBlockingScript.cachedScript());
+
+ // We only care about a load callback if cachedScript is not already
+ // in the cache. Callers will attempt to run the m_parsingBlockingScript
+ // if possible before returning control to the parser.
+ if (!m_parsingBlockingScript.cachedScript()->isLoaded())
+ watchForLoad(m_parsingBlockingScript);
+}
+
+bool HTMLScriptRunner::requestPendingScript(PendingScript& pendingScript, Element* script) const
+{
+ ASSERT(!pendingScript.element());
+ const AtomicString& srcValue = script->getAttribute(srcAttr);
// Allow the host to disllow script loads (using the XSSAuditor, etc.)
if (!m_host->shouldLoadExternalScriptFromSrc(srcValue))
- return;
+ return false;
// FIXME: We need to resolve the url relative to the element.
if (!script->dispatchBeforeLoadEvent(srcValue))
- return;
- m_parsingBlockingScript.adoptElement(script);
+ return false;
+ pendingScript.adoptElement(script);
// This should correctly return 0 for empty or invalid srcValues.
CachedScript* cachedScript = m_document->docLoader()->requestScript(srcValue, toScriptElement(script)->scriptCharset());
if (!cachedScript) {
notImplemented(); // Dispatch error event.
- return;
+ return false;
}
-
- m_parsingBlockingScript.setCachedScript(cachedScript);
-
- // We only care about a load callback if cachedScript is not already
- // in the cache. Callers will attempt to run the m_parsingBlockingScript
- // if possible before returning control to the parser.
- if (!m_parsingBlockingScript.cachedScript()->isLoaded())
- watchForLoad(m_parsingBlockingScript);
+ pendingScript.setCachedScript(cachedScript);
+ return true;
}
// This method is meant to match the HTML5 definition of "running a script"
@@ -261,17 +271,21 @@ void HTMLScriptRunner::runScript(Element* script, int startingLineNumber)
{
ASSERT(!haveParsingBlockingScript());
{
- NestScript nestingLevel(m_scriptNestingLevel, m_host->inputStream());
+ InsertionPointRecord insertionPointRecord(m_host->inputStream());
+ NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
// Check script type and language, current code uses ScriptElement::shouldExecuteAsJavaScript(), but that may not be HTML5 compliant.
notImplemented(); // event for support
if (script->hasAttribute(srcAttr)) {
// FIXME: Handle defer and async
- requestScript(script);
+ requestParsingBlockingScript(script);
} else {
// FIXME: We do not block inline <script> tags on stylesheets to match the
- // old parser for now. See https://bugs.webkit.org/show_bug.cgi?id=40047
+ // old parser for now. When we do, the ASSERT below should be added.
+ // See https://bugs.webkit.org/show_bug.cgi?id=40047
+ // ASSERT(document()->haveStylesheetsLoaded());
+ ASSERT(isExecutingScript());
ScriptSourceCode sourceCode(script->textContent(), documentURLForScriptExecution(m_document), startingLineNumber);
executeScript(script, sourceCode);
}
diff --git a/WebCore/html/HTMLScriptRunner.h b/WebCore/html/HTMLScriptRunner.h
index 85801b2..981d433 100644
--- a/WebCore/html/HTMLScriptRunner.h
+++ b/WebCore/html/HTMLScriptRunner.h
@@ -52,25 +52,27 @@ public:
bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
bool executeScriptsWaitingForStylesheets();
- bool isExecutingScript() { return !!m_scriptNestingLevel; }
+ bool isExecutingScript() const { return !!m_scriptNestingLevel; }
private:
Frame* frame() const;
+ void executeParsingBlockingScript();
+ void executePendingScriptAndDispatchEvent(PendingScript&);
+ void executeScript(Element*, const ScriptSourceCode&) const;
bool haveParsingBlockingScript() const;
bool executeParsingBlockingScripts();
- void executePendingScript();
- void requestScript(Element*);
+ void requestParsingBlockingScript(Element*);
+ bool requestPendingScript(PendingScript&, Element*) const;
+
void runScript(Element*, int startingLineNumber);
// Helpers for dealing with HTMLScriptRunnerHost
void watchForLoad(PendingScript&);
void stopWatchingForLoad(PendingScript&);
- void executeScript(Element*, const ScriptSourceCode&);
-
bool isPendingScriptReady(const PendingScript&);
- ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOccurred);
+ ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOccurred) const;
Document* m_document;
HTMLScriptRunnerHost* m_host;
diff --git a/WebCore/html/HTMLSourceElement.cpp b/WebCore/html/HTMLSourceElement.cpp
index 6c26610..96c9829 100644
--- a/WebCore/html/HTMLSourceElement.cpp
+++ b/WebCore/html/HTMLSourceElement.cpp
@@ -52,9 +52,9 @@ PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(const QualifiedName& tag
return adoptRef(new HTMLSourceElement(tagName, document));
}
-void HTMLSourceElement::insertedIntoDocument()
+void HTMLSourceElement::insertedIntoTree(bool deep)
{
- HTMLElement::insertedIntoDocument();
+ HTMLElement::insertedIntoTree(deep);
if (parentNode() && (parentNode()->hasTagName(audioTag) || parentNode()->hasTagName(videoTag))) {
HTMLMediaElement* media = static_cast<HTMLMediaElement*>(parentNode());
if (media->networkState() == HTMLMediaElement::NETWORK_EMPTY)
diff --git a/WebCore/html/HTMLSourceElement.h b/WebCore/html/HTMLSourceElement.h
index 20049cc..7d49a3e 100644
--- a/WebCore/html/HTMLSourceElement.h
+++ b/WebCore/html/HTMLSourceElement.h
@@ -52,7 +52,7 @@ private:
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
- virtual void insertedIntoDocument();
+ virtual void insertedIntoTree(bool);
virtual bool isURLAttribute(Attribute*) const;
void errorEventTimerFired(Timer<HTMLSourceElement>*);
diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/HTMLToken.h
index 5f2869b..e42a829 100644
--- a/WebCore/html/HTMLToken.h
+++ b/WebCore/html/HTMLToken.h
@@ -45,8 +45,16 @@ public:
EndOfFile,
};
+ class Range {
+ public:
+ int m_start;
+ int m_end;
+ };
+
class Attribute {
public:
+ Range m_nameRange;
+ Range m_valueRange;
WTF::Vector<UChar, 32> m_name;
WTF::Vector<UChar, 32> m_value;
};
@@ -56,12 +64,22 @@ public:
HTMLToken() { clear(); }
- void clear()
+ void clear(int startIndex = 0)
{
m_type = Uninitialized;
+ m_range.m_start = startIndex;
+ m_range.m_end = startIndex;
m_data.clear();
}
+ int startIndex() const { return m_range.m_start; }
+ int endIndex() const { return m_range.m_end; }
+
+ void end(int endIndex)
+ {
+ m_range.m_end = endIndex;
+ }
+
void makeEndOfFile()
{
ASSERT(m_type == Uninitialized);
@@ -146,12 +164,44 @@ public:
ASSERT(m_type == StartTag || m_type == EndTag);
m_attributes.grow(m_attributes.size() + 1);
m_currentAttribute = &m_attributes.last();
+#ifndef NDEBUG
+ m_currentAttribute->m_nameRange.m_start = 0;
+ m_currentAttribute->m_nameRange.m_end = 0;
+ m_currentAttribute->m_valueRange.m_start = 0;
+ m_currentAttribute->m_valueRange.m_end = 0;
+#endif
+ }
+
+ void beginAttributeName(int index)
+ {
+ m_currentAttribute->m_nameRange.m_start = index;
+ }
+
+ void endAttributeName(int index)
+ {
+ m_currentAttribute->m_nameRange.m_end = index;
+ m_currentAttribute->m_valueRange.m_start = index;
+ m_currentAttribute->m_valueRange.m_end = index;
+ }
+
+ void beginAttributeValue(int index)
+ {
+ m_currentAttribute->m_valueRange.m_start = index;
+#ifndef NDEBUG
+ m_currentAttribute->m_valueRange.m_end = 0;
+#endif
+ }
+
+ void endAttributeValue(int index)
+ {
+ m_currentAttribute->m_valueRange.m_end = index;
}
void appendToAttributeName(UChar character)
{
ASSERT(character);
ASSERT(m_type == StartTag || m_type == EndTag);
+ ASSERT(m_currentAttribute->m_nameRange.m_start);
m_currentAttribute->m_name.append(character);
}
@@ -159,6 +209,7 @@ public:
{
ASSERT(character);
ASSERT(m_type == StartTag || m_type == EndTag);
+ ASSERT(m_currentAttribute->m_valueRange.m_start);
m_currentAttribute->m_value.append(character);
}
@@ -280,6 +331,9 @@ private:
Type m_type;
+ // Which characters from the input stream are represented by this token.
+ Range m_range;
+
// "name" for DOCTYPE, StartTag, and EndTag
// "characters" for Character
// "data" for Comment
@@ -323,6 +377,10 @@ public:
if (!iter->m_name.isEmpty()) {
String name(iter->m_name.data(), iter->m_name.size());
String value(iter->m_value.data(), iter->m_value.size());
+ ASSERT(iter->m_nameRange.m_start);
+ ASSERT(iter->m_nameRange.m_end);
+ ASSERT(iter->m_valueRange.m_start);
+ ASSERT(iter->m_valueRange.m_end);
RefPtr<Attribute> mappedAttribute = Attribute::createMapped(name, value);
if (!m_attributes) {
m_attributes = NamedNodeMap::create();
diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/HTMLTokenizer.cpp
index a52aba6..a18701a 100644
--- a/WebCore/html/HTMLTokenizer.cpp
+++ b/WebCore/html/HTMLTokenizer.cpp
@@ -28,7 +28,6 @@
#include "config.h"
#include "HTMLTokenizer.h"
-#include "AtomicString.h"
#include "HTMLEntityParser.h"
#include "HTMLToken.h"
#include "HTMLNames.h"
@@ -36,6 +35,7 @@
#include <wtf/ASCIICType.h>
#include <wtf/CurrentTime.h>
#include <wtf/UnusedParam.h>
+#include <wtf/text/AtomicString.h>
#include <wtf/text/CString.h>
#include <wtf/unicode/Unicode.h>
@@ -152,7 +152,7 @@ inline bool HTMLTokenizer::processEntity(SegmentedString& source)
do { \
m_state = stateName; \
if (!m_inputStreamPreprocessor.advance(source, m_lineNumber)) \
- return shouldEmitBufferedCharacterToken(source); \
+ return haveBufferedCharacterToken(); \
cc = m_inputStreamPreprocessor.nextInputCharacter(); \
goto stateName; \
} while (false)
@@ -165,7 +165,7 @@ inline bool HTMLTokenizer::processEntity(SegmentedString& source)
do { \
m_state = stateName; \
if (source.isEmpty() || !m_inputStreamPreprocessor.peek(source, m_lineNumber)) \
- return shouldEmitBufferedCharacterToken(source); \
+ return haveBufferedCharacterToken(); \
cc = m_inputStreamPreprocessor.nextInputCharacter(); \
goto stateName; \
} while (false)
@@ -202,7 +202,7 @@ bool HTMLTokenizer::emitAndReconsumeIn(SegmentedString&, State state)
// Check if we have buffered characters to emit first before emitting the EOF.
bool HTMLTokenizer::emitEndOfFile(SegmentedString& source)
{
- if (shouldEmitBufferedCharacterToken(source))
+ if (haveBufferedCharacterToken())
return true;
m_state = DataState;
source.advance(m_lineNumber);
@@ -229,7 +229,7 @@ bool HTMLTokenizer::flushBufferedEndTag(SegmentedString& source)
return true; \
if (source.isEmpty() \
|| !m_inputStreamPreprocessor.peek(source, m_lineNumber)) \
- return shouldEmitBufferedCharacterToken(source); \
+ return haveBufferedCharacterToken(); \
cc = m_inputStreamPreprocessor.nextInputCharacter(); \
goto stateName; \
} while (false)
@@ -260,7 +260,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
}
if (source.isEmpty() || !m_inputStreamPreprocessor.peek(source, m_lineNumber))
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
UChar cc = m_inputStreamPreprocessor.nextInputCharacter();
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
@@ -308,7 +308,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
BEGIN_STATE(CharacterReferenceInDataState) {
if (!processEntity(source))
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
SWITCH_TO(DataState);
}
END_STATE()
@@ -329,7 +329,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
BEGIN_STATE(CharacterReferenceInRCDATAState) {
if (!processEntity(source))
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
SWITCH_TO(RCDATAState);
}
END_STATE()
@@ -864,6 +864,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
return emitAndResumeIn(source, DataState);
else if (isASCIIUpper(cc)) {
m_token->addNewAttribute();
+ m_token->beginAttributeName(source.numberOfCharactersConsumed());
m_token->appendToAttributeName(toLowerCase(cc));
ADVANCE_TO(AttributeNameState);
} else if (cc == InputStreamPreprocessor::endOfFileMarker) {
@@ -873,6 +874,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
if (cc == '"' || cc == '\'' || cc == '<' || cc == '=')
parseError();
m_token->addNewAttribute();
+ m_token->beginAttributeName(source.numberOfCharactersConsumed());
m_token->appendToAttributeName(cc);
ADVANCE_TO(AttributeNameState);
}
@@ -880,19 +882,24 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
END_STATE()
BEGIN_STATE(AttributeNameState) {
- if (isTokenizerWhitespace(cc))
+ if (isTokenizerWhitespace(cc)) {
+ m_token->endAttributeName(source.numberOfCharactersConsumed());
ADVANCE_TO(AfterAttributeNameState);
- else if (cc == '/')
+ } else if (cc == '/') {
+ m_token->endAttributeName(source.numberOfCharactersConsumed());
ADVANCE_TO(SelfClosingStartTagState);
- else if (cc == '=')
+ } else if (cc == '=') {
+ m_token->endAttributeName(source.numberOfCharactersConsumed());
ADVANCE_TO(BeforeAttributeValueState);
- else if (cc == '>')
+ } else if (cc == '>') {
+ m_token->endAttributeName(source.numberOfCharactersConsumed());
return emitAndResumeIn(source, DataState);
- else if (isASCIIUpper(cc)) {
+ } else if (isASCIIUpper(cc)) {
m_token->appendToAttributeName(toLowerCase(cc));
ADVANCE_TO(AttributeNameState);
} else if (cc == InputStreamPreprocessor::endOfFileMarker) {
parseError();
+ m_token->endAttributeName(source.numberOfCharactersConsumed());
RECONSUME_IN(DataState);
} else {
if (cc == '"' || cc == '\'' || cc == '<' || cc == '=')
@@ -914,6 +921,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
return emitAndResumeIn(source, DataState);
else if (isASCIIUpper(cc)) {
m_token->addNewAttribute();
+ m_token->beginAttributeName(source.numberOfCharactersConsumed());
m_token->appendToAttributeName(toLowerCase(cc));
ADVANCE_TO(AttributeNameState);
} else if (cc == InputStreamPreprocessor::endOfFileMarker) {
@@ -923,6 +931,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
if (cc == '"' || cc == '\'' || cc == '<')
parseError();
m_token->addNewAttribute();
+ m_token->beginAttributeName(source.numberOfCharactersConsumed());
m_token->appendToAttributeName(cc);
ADVANCE_TO(AttributeNameState);
}
@@ -932,13 +941,16 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
BEGIN_STATE(BeforeAttributeValueState) {
if (isTokenizerWhitespace(cc))
ADVANCE_TO(BeforeAttributeValueState);
- else if (cc == '"')
+ else if (cc == '"') {
+ m_token->beginAttributeValue(source.numberOfCharactersConsumed() + 1);
ADVANCE_TO(AttributeValueDoubleQuotedState);
- else if (cc == '&')
+ } else if (cc == '&') {
+ m_token->beginAttributeValue(source.numberOfCharactersConsumed());
RECONSUME_IN(AttributeValueUnquotedState);
- else if (cc == '\'')
+ } else if (cc == '\'') {
+ m_token->beginAttributeValue(source.numberOfCharactersConsumed() + 1);
ADVANCE_TO(AttributeValueSingleQuotedState);
- else if (cc == '>') {
+ } else if (cc == '>') {
parseError();
return emitAndResumeIn(source, DataState);
} else if (cc == InputStreamPreprocessor::endOfFileMarker) {
@@ -947,6 +959,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
} else {
if (cc == '<' || cc == '=' || cc == '`')
parseError();
+ m_token->beginAttributeValue(source.numberOfCharactersConsumed());
m_token->appendToAttributeValue(cc);
ADVANCE_TO(AttributeValueUnquotedState);
}
@@ -954,13 +967,15 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
END_STATE()
BEGIN_STATE(AttributeValueDoubleQuotedState) {
- if (cc == '"')
+ if (cc == '"') {
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
ADVANCE_TO(AfterAttributeValueQuotedState);
- else if (cc == '&') {
+ } else if (cc == '&') {
m_additionalAllowedCharacter = '"';
ADVANCE_TO(CharacterReferenceInAttributeValueState);
} else if (cc == InputStreamPreprocessor::endOfFileMarker) {
parseError();
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
RECONSUME_IN(DataState);
} else {
m_token->appendToAttributeValue(cc);
@@ -970,13 +985,15 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
END_STATE()
BEGIN_STATE(AttributeValueSingleQuotedState) {
- if (cc == '\'')
+ if (cc == '\'') {
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
ADVANCE_TO(AfterAttributeValueQuotedState);
- else if (cc == '&') {
+ } else if (cc == '&') {
m_additionalAllowedCharacter = '\'';
ADVANCE_TO(CharacterReferenceInAttributeValueState);
} else if (cc == InputStreamPreprocessor::endOfFileMarker) {
parseError();
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
RECONSUME_IN(DataState);
} else {
m_token->appendToAttributeValue(cc);
@@ -986,15 +1003,18 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
END_STATE()
BEGIN_STATE(AttributeValueUnquotedState) {
- if (isTokenizerWhitespace(cc))
+ if (isTokenizerWhitespace(cc)) {
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
ADVANCE_TO(BeforeAttributeNameState);
- else if (cc == '&') {
+ } else if (cc == '&') {
m_additionalAllowedCharacter = '>';
ADVANCE_TO(CharacterReferenceInAttributeValueState);
- } else if (cc == '>')
+ } else if (cc == '>') {
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
return emitAndResumeIn(source, DataState);
- else if (cc == InputStreamPreprocessor::endOfFileMarker) {
+ } else if (cc == InputStreamPreprocessor::endOfFileMarker) {
parseError();
+ m_token->endAttributeValue(source.numberOfCharactersConsumed());
RECONSUME_IN(DataState);
} else {
if (cc == '"' || cc == '\'' || cc == '<' || cc == '=' || cc == '`')
@@ -1009,7 +1029,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
bool notEnoughCharacters = false;
unsigned value = consumeHTMLEntity(source, notEnoughCharacters, m_additionalAllowedCharacter);
if (notEnoughCharacters)
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
if (!value)
m_token->appendToAttributeValue('&');
else if (value < 0xFFFF)
@@ -1093,14 +1113,14 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
m_token->beginComment();
SWITCH_TO(CommentStartState);
} else if (result == SegmentedString::NotEnoughCharacters)
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
} else if (cc == 'D' || cc == 'd') {
SegmentedString::LookAheadResult result = source.lookAheadIgnoringCase(doctypeString);
if (result == SegmentedString::DidMatch) {
advanceStringAndASSERTIgnoringCase(source, "doctype");
SWITCH_TO(DOCTYPEState);
} else if (result == SegmentedString::NotEnoughCharacters)
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
}
notImplemented();
// FIXME: We're still missing the bits about the insertion mode being in foreign content:
@@ -1313,14 +1333,14 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
advanceStringAndASSERTIgnoringCase(source, "public");
SWITCH_TO(AfterDOCTYPEPublicKeywordState);
} else if (result == SegmentedString::NotEnoughCharacters)
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
} else if (cc == 'S' || cc == 's') {
SegmentedString::LookAheadResult result = source.lookAheadIgnoringCase(systemString);
if (result == SegmentedString::DidMatch) {
advanceStringAndASSERTIgnoringCase(source, "system");
SWITCH_TO(AfterDOCTYPESystemKeywordState);
} else if (result == SegmentedString::NotEnoughCharacters)
- return shouldEmitBufferedCharacterToken(source);
+ return haveBufferedCharacterToken();
}
parseError();
m_token->setForceQuirks();
@@ -1629,10 +1649,9 @@ inline void HTMLTokenizer::parseError()
notImplemented();
}
-inline bool HTMLTokenizer::shouldEmitBufferedCharacterToken(const SegmentedString& source)
+inline bool HTMLTokenizer::haveBufferedCharacterToken()
{
- return source.isClosed() && m_token->type() == HTMLToken::Character;
+ return m_token->type() == HTMLToken::Character;
}
}
-
diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/HTMLTokenizer.h
index 0e9ba3a..6fb3053 100644
--- a/WebCore/html/HTMLTokenizer.h
+++ b/WebCore/html/HTMLTokenizer.h
@@ -27,10 +27,10 @@
#ifndef HTMLTokenizer_h
#define HTMLTokenizer_h
-#include "AtomicString.h"
#include "SegmentedString.h"
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -254,7 +254,7 @@ private:
inline void saveEndTagNameIfNeeded();
inline bool isAppropriateEndTag();
- inline bool shouldEmitBufferedCharacterToken(const SegmentedString&);
+ inline bool haveBufferedCharacterToken();
State m_state;
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
index 2c7d40d..fd0b62e 100644
--- a/WebCore/html/HTMLTreeBuilder.cpp
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -39,7 +39,6 @@
#include "HTMLScriptElement.h"
#include "HTMLToken.h"
#include "HTMLTokenizer.h"
-#include "LegacyHTMLDocumentParser.h"
#include "LegacyHTMLTreeBuilder.h"
#include "LocalizedStrings.h"
#include "MathMLNames.h"
@@ -67,6 +66,11 @@ inline bool isTreeBuilderWhitepace(UChar c)
return c == '\t' || c == '\x0A' || c == '\x0C' || c == '\x0D' || c == ' ';
}
+inline bool isNotTreeBuilderWhitepace(UChar c)
+{
+ return !isTreeBuilderWhitepace(c);
+}
+
inline bool isTreeBuilderWhitepaceOrReplacementCharacter(UChar c)
{
return isTreeBuilderWhitepace(c) || c == 0xFFFD;
@@ -303,21 +307,17 @@ public:
void skipLeadingWhitespace()
{
- ASSERT(!isEmpty());
- while (isTreeBuilderWhitepace(*m_current)) {
- if (++m_current == m_end)
- return;
- }
+ skipLeading<isTreeBuilderWhitepace>();
}
String takeLeadingWhitespace()
{
- ASSERT(!isEmpty());
- const UChar* start = m_current;
- skipLeadingWhitespace();
- if (start == m_current)
- return String();
- return String(start, m_current - start);
+ return takeLeading<isTreeBuilderWhitepace>();
+ }
+
+ String takeLeadingNonWhitespace()
+ {
+ return takeLeading<isNotTreeBuilderWhitepace>();
}
String takeRemaining()
@@ -352,6 +352,27 @@ public:
}
private:
+ template<bool characterPredicate(UChar)>
+ void skipLeading()
+ {
+ ASSERT(!isEmpty());
+ while (characterPredicate(*m_current)) {
+ if (++m_current == m_end)
+ return;
+ }
+ }
+
+ template<bool characterPredicate(UChar)>
+ String takeLeading()
+ {
+ ASSERT(!isEmpty());
+ const UChar* start = m_current;
+ skipLeading<characterPredicate>();
+ if (start == m_current)
+ return String();
+ return String(start, m_current - start);
+ }
+
const UChar* m_current;
const UChar* m_end;
};
@@ -391,13 +412,14 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fra
{
if (shouldUseLegacyTreeBuilder(fragment->document()))
return;
- // This is steps 2-6 of the HTML5 Fragment Case parsing algorithm:
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#fragment-case
- if (contextElement)
+ if (contextElement) {
+ // Steps 4.2-4.6 of the HTML5 Fragment Case parsing algorithm:
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#fragment-case
m_document->setParseMode(contextElement->document()->parseMode());
- processFakeStartTag(htmlTag);
- resetInsertionModeAppropriately();
- m_tree.setForm(closestFormAncestor(contextElement));
+ processFakeStartTag(htmlTag);
+ resetInsertionModeAppropriately();
+ m_tree.setForm(closestFormAncestor(contextElement));
+ }
}
HTMLTreeBuilder::~HTMLTreeBuilder()
@@ -1997,7 +2019,9 @@ void HTMLTreeBuilder::processEndTagForInCell(AtomicHTMLToken& token)
m_tree.openElements()->popUntilPopped(token.name());
m_tree.activeFormattingElements()->clearToLastMarker();
setInsertionMode(InRowMode);
- ASSERT(m_tree.currentElement()->hasTagName(trTag));
+ // FIXME: The fragment case of this ASSERT is a spec bug:
+ // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10338
+ ASSERT(m_tree.currentElement()->hasTagName(trTag) || (isParsingFragment() && m_fragmentContext.contextElement()->hasTagName(trTag)));
return;
}
if (token.name() == bodyTag
@@ -2628,7 +2652,10 @@ ReprocessBuffer:
return;
if (!processColgroupEndTagForInColumnGroup()) {
ASSERT(isParsingFragment());
- return;
+ // The spec tells us to drop these characters on the floor.
+ buffer.takeLeadingNonWhitespace();
+ if (buffer.isEmpty())
+ return;
}
goto ReprocessBuffer;
}
diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp
index e1b959b..e0e71ee 100644
--- a/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/WebCore/html/HTMLViewSourceDocument.cpp
@@ -36,7 +36,9 @@
#include "HTMLTableElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLTableSectionElement.h"
-#include "LegacyHTMLDocumentParser.h"
+#include "HTMLToken.h"
+#include "HTMLViewSourceParser.h"
+#include "SegmentedString.h"
#include "Text.h"
#include "TextDocument.h"
@@ -53,15 +55,13 @@ HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const KURL& url, co
DocumentParser* HTMLViewSourceDocument::createParser()
{
- // Use LegacyHTMLDocumentParser if applicable, otherwise use TextDocumentParser.
+ // Use HTMLDocumentParser if applicable, otherwise use TextDocumentParser.
if (m_type == "text/html" || m_type == "application/xhtml+xml" || m_type == "image/svg+xml" || DOMImplementation::isXMLMIMEType(m_type)
#if ENABLE(XHTMLMP)
|| m_type == "application/vnd.wap.xhtml+xml"
#endif
- ) {
- // FIXME: Should respect Settings::html5ParserEnabled()
- return new LegacyHTMLDocumentParser(this);
- }
+ )
+ return new HTMLViewSourceParser(this);
return createTextDocumentParser(this);
}
@@ -100,107 +100,91 @@ void HTMLViewSourceDocument::addViewSourceText(const String& text)
addText(text, "");
}
-void HTMLViewSourceDocument::addViewSourceToken(Token* token)
+void HTMLViewSourceDocument::addSource(const String& source, HTMLToken& token)
{
if (!m_current)
createContainingTable();
- if (token->tagName == textAtom)
- addText(token->text.get(), "");
- else if (token->tagName == commentAtom) {
- if (token->beginTag) {
- m_current = addSpanWithClassName("webkit-html-comment");
- addText(String("<!--") + token->text.get() + "-->", "webkit-html-comment");
- }
- } else {
- // Handle the tag.
- String classNameStr = "webkit-html-tag";
- m_current = addSpanWithClassName(classNameStr);
-
- String text = "<";
- if (!token->beginTag)
- text += "/";
- text += token->tagName;
- Vector<UChar>* guide = token->m_sourceInfo.get();
- if (!guide || !guide->size())
- text += ">";
-
- addText(text, classNameStr);
-
- // Walk our guide string that tells us where attribute names/values should go.
- if (guide && guide->size()) {
- unsigned size = guide->size();
- unsigned begin = 0;
- unsigned currAttr = 0;
- RefPtr<Attribute> attr = 0;
- for (unsigned i = 0; i < size; i++) {
- if (guide->at(i) == 'a' || guide->at(i) == 'x' || guide->at(i) == 'v') {
- // Add in the string.
- addText(String(static_cast<UChar*>(guide->data()) + begin, i - begin), classNameStr);
-
- begin = i + 1;
-
- if (guide->at(i) == 'a') {
- if (token->attrs && currAttr < token->attrs->length())
- attr = token->attrs->attributeItem(currAttr++);
- else
- attr = 0;
- }
- if (attr) {
- if (guide->at(i) == 'a') {
- String name = attr->name().toString();
-
- m_current = addSpanWithClassName("webkit-html-attribute-name");
- addText(name, "webkit-html-attribute-name");
- if (m_current != m_tbody)
- m_current = static_cast<Element*>(m_current->parent());
- } else {
- const String& value = attr->value().string();
-
- // Compare ignoring case since LegacyHTMLDocumentParser doesn't
- // lower names when passing in tokens to
- // HTMLViewSourceDocument.
- if (equalIgnoringCase(token->tagName, "base") && equalIgnoringCase(attr->name().localName(), "href")) {
- // Catch the href attribute in the base element.
- // It will be used for rendering anchors created
- // by addLink() below.
- setBaseElementURL(KURL(url(), value));
- }
-
- // FIXME: XML could use namespace prefixes and confuse us.
- if (equalIgnoringCase(attr->name().localName(), "src") || equalIgnoringCase(attr->name().localName(), "href"))
- m_current = addLink(value, equalIgnoringCase(token->tagName, "a"));
- else
- m_current = addSpanWithClassName("webkit-html-attribute-value");
- addText(value, "webkit-html-attribute-value");
- if (m_current != m_tbody)
- m_current = static_cast<Element*>(m_current->parent());
- }
- }
- }
- }
-
- // Add in any string that might be left.
- if (begin < size)
- addText(String(static_cast<UChar*>(guide->data()) + begin, size - begin), classNameStr);
-
- // Add in the end tag.
- addText(">", classNameStr);
- }
-
- m_current = m_td;
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::DOCTYPE:
+ processDoctypeToken(source, token);
+ break;
+ case HTMLToken::EndOfFile:
+ break;
+ case HTMLToken::StartTag:
+ case HTMLToken::EndTag:
+ processTagToken(source, token);
+ break;
+ case HTMLToken::Comment:
+ processCommentToken(source, token);
+ break;
+ case HTMLToken::Character:
+ processCharacterToken(source, token);
+ break;
}
}
-void HTMLViewSourceDocument::addViewSourceDoctypeToken(DoctypeToken* doctypeToken)
+void HTMLViewSourceDocument::processDoctypeToken(const String& source, HTMLToken&)
{
if (!m_current)
createContainingTable();
m_current = addSpanWithClassName("webkit-html-doctype");
- String text = "<";
- text += String::adopt(doctypeToken->m_source);
- text += ">";
- addText(text, "webkit-html-doctype");
+ addText(source, "webkit-html-doctype");
+ m_current = m_td;
+}
+
+void HTMLViewSourceDocument::processTagToken(const String& source, HTMLToken& token)
+{
+ String classNameStr = "webkit-html-tag";
+ m_current = addSpanWithClassName(classNameStr);
+
+ AtomicString tagName(token.name().data(), token.name().size());
+
+ unsigned index = 0;
+ HTMLToken::AttributeList::const_iterator iter = token.attributes().begin();
+ while (index < source.length()) {
+ if (iter == token.attributes().end()) {
+ // We want to show the remaining characters in the token.
+ index = addRange(source, index, source.length(), "");
+ ASSERT(index == source.length());
+ break;
+ }
+
+ AtomicString name(iter->m_name.data(), iter->m_name.size());
+ String value(iter->m_value.data(), iter->m_value.size());
+
+ index = addRange(source, index, iter->m_nameRange.m_start - token.startIndex(), "");
+ index = addRange(source, index, iter->m_nameRange.m_end - token.startIndex(), "webkit-html-attribute-name");
+
+ if (tagName == baseTag && name == hrefAttr) {
+ // Catch the href attribute in the base element. It will be used
+ // for rendering anchors created by addLink() below.
+ setBaseElementURL(KURL(url(), value));
+ }
+
+ index = addRange(source, index, iter->m_valueRange.m_start - token.startIndex(), "");
+
+ bool isLink = name == srcAttr || name == hrefAttr;
+ index = addRange(source, index, iter->m_valueRange.m_end - token.startIndex(), "webkit-html-attribute-value", isLink, tagName == aTag);
+
+ ++iter;
+ }
+ m_current = m_td;
+}
+
+void HTMLViewSourceDocument::processCommentToken(const String& source, HTMLToken&)
+{
+ m_current = addSpanWithClassName("webkit-html-comment");
+ addText(source, "webkit-html-comment");
+ m_current = m_td;
+}
+
+void HTMLViewSourceDocument::processCharacterToken(const String& source, HTMLToken&)
+{
+ addText(source, "");
}
PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const String& className)
@@ -287,6 +271,25 @@ void HTMLViewSourceDocument::addText(const String& text, const String& className
m_current = m_tbody;
}
+int HTMLViewSourceDocument::addRange(const String& source, int start, int end, const String& className, bool isLink, bool isAnchor)
+{
+ ASSERT(start <= end);
+ if (start == end)
+ return start;
+
+ String text = source.substring(start, end - start);
+ if (!className.isEmpty()) {
+ if (isLink)
+ m_current = addLink(text, isAnchor);
+ else
+ m_current = addSpanWithClassName(className);
+ }
+ addText(text, className);
+ if (!className.isEmpty() && m_current != m_tbody)
+ m_current = static_cast<Element*>(m_current->parent());
+ return end;
+}
+
PassRefPtr<Element> HTMLViewSourceDocument::addLink(const String& url, bool isAnchor)
{
if (m_current == m_tbody)
diff --git a/WebCore/html/HTMLViewSourceDocument.h b/WebCore/html/HTMLViewSourceDocument.h
index cf6cfc1..8805848 100644
--- a/WebCore/html/HTMLViewSourceDocument.h
+++ b/WebCore/html/HTMLViewSourceDocument.h
@@ -29,11 +29,9 @@
namespace WebCore {
-class DoctypeToken;
class HTMLTableCellElement;
class HTMLTableSectionElement;
-
-struct Token;
+class HTMLToken;
class HTMLViewSourceDocument : public HTMLDocument {
public:
@@ -42,20 +40,27 @@ public:
return adoptRef(new HTMLViewSourceDocument(frame, url, mimeType));
}
- void addViewSourceToken(Token*); // Used by the LegacyHTMLDocumentParser.
+ void addSource(const String&, HTMLToken&);
+
+ void addViewSourceToken(HTMLToken&); // Used by the HTMLDocumentParser.
void addViewSourceText(const String&); // Used by the TextDocumentParser.
- void addViewSourceDoctypeToken(DoctypeToken*);
private:
HTMLViewSourceDocument(Frame*, const KURL&, const String& mimeType);
- // Returns LegacyHTMLDocumentParser or TextDocumentParser based on m_type.
+ // Returns HTMLViewSourceParser or TextDocumentParser based on m_type.
virtual DocumentParser* createParser();
+ void processDoctypeToken(const String& source, HTMLToken&);
+ void processTagToken(const String& source, HTMLToken&);
+ void processCommentToken(const String& source, HTMLToken&);
+ void processCharacterToken(const String& source, HTMLToken&);
+
void createContainingTable();
PassRefPtr<Element> addSpanWithClassName(const String&);
void addLine(const String& className);
void addText(const String& text, const String& className);
+ int addRange(const String& source, int start, int end, const String& className, bool isLink = false, bool isAnchor = false);
PassRefPtr<Element> addLink(const String& url, bool isAnchor);
String m_type;
diff --git a/WebCore/html/HTMLViewSourceParser.cpp b/WebCore/html/HTMLViewSourceParser.cpp
new file mode 100644
index 0000000..3da4c23
--- /dev/null
+++ b/WebCore/html/HTMLViewSourceParser.cpp
@@ -0,0 +1,106 @@
+/*
+ * 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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "HTMLViewSourceParser.h"
+
+#include "HTMLNames.h"
+#include "HTMLTreeBuilder.h"
+#include "HTMLViewSourceDocument.h"
+
+namespace WebCore {
+
+HTMLViewSourceParser::~HTMLViewSourceParser()
+{
+}
+
+void HTMLViewSourceParser::insert(const SegmentedString&)
+{
+ ASSERT_NOT_REACHED();
+}
+
+void HTMLViewSourceParser::pumpTokenizer()
+{
+ while (m_tokenizer.nextToken(m_input.current(), m_token)) {
+ m_token.end(m_input.current().numberOfCharactersConsumed());
+ document()->addSource(sourceForToken(), m_token);
+ updateTokenizerState();
+ m_token.clear(m_input.current().numberOfCharactersConsumed());
+ }
+}
+
+void HTMLViewSourceParser::append(const SegmentedString& input)
+{
+ m_input.appendToEnd(input);
+ m_source.append(input);
+ pumpTokenizer();
+}
+
+String HTMLViewSourceParser::sourceForToken()
+{
+ if (m_token.type() == HTMLToken::EndOfFile)
+ return String();
+
+ ASSERT(m_source.numberOfCharactersConsumed() == m_token.startIndex());
+ UChar* data = 0;
+ int length = m_token.endIndex() - m_token.startIndex();
+ String source = String::createUninitialized(length, data);
+ for (int i = 0; i < length; ++i) {
+ data[i] = *m_source;
+ m_source.advance();
+ }
+ return source;
+}
+
+void HTMLViewSourceParser::updateTokenizerState()
+{
+ // FIXME: The tokenizer should do this work for us.
+ if (m_token.type() != HTMLToken::StartTag)
+ return;
+
+ AtomicString tagName(m_token.name().data(), m_token.name().size());
+ m_tokenizer.setState(HTMLTreeBuilder::adjustedLexerState(m_tokenizer.state(), tagName, m_document->frame()));
+ if (tagName == HTMLNames::scriptTag) {
+ // The tree builder handles scriptTag separately from the other tokenizer
+ // state adjustments, so we need to handle it separately too.
+ ASSERT(m_tokenizer.state() == HTMLTokenizer::DataState);
+ m_tokenizer.setState(HTMLTokenizer::ScriptDataState);
+ }
+}
+
+void HTMLViewSourceParser::finish()
+{
+ if (!m_input.haveSeenEndOfFile())
+ m_input.markEndOfFile();
+ pumpTokenizer();
+ document()->finishedParsing();
+}
+
+bool HTMLViewSourceParser::finishWasCalled()
+{
+ return m_input.haveSeenEndOfFile();
+}
+
+}
diff --git a/WebCore/html/HTMLViewSourceParser.h b/WebCore/html/HTMLViewSourceParser.h
new file mode 100644
index 0000000..2571301
--- /dev/null
+++ b/WebCore/html/HTMLViewSourceParser.h
@@ -0,0 +1,77 @@
+/*
+ * 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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HTMLViewSourceParser_h
+#define HTMLViewSourceParser_h
+
+#include "DecodedDataDocumentParser.h"
+#include "HTMLInputStream.h"
+#include "HTMLToken.h"
+#include "HTMLTokenizer.h"
+#include "HTMLViewSourceDocument.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class HTMLTokenizer;
+class HTMLScriptRunner;
+class HTMLTreeBuilder;
+class HTMLPreloadScanner;
+class LegacyHTMLTreeBuilder;
+class ScriptController;
+class ScriptSourceCode;
+
+class HTMLViewSourceParser : public DecodedDataDocumentParser {
+public:
+ // FIXME: Make private with a create method.
+ HTMLViewSourceParser(HTMLViewSourceDocument* document)
+ : DecodedDataDocumentParser(document)
+ {
+ }
+
+ virtual ~HTMLViewSourceParser();
+
+private:
+ // DocumentParser
+ virtual void insert(const SegmentedString&);
+ virtual void append(const SegmentedString&);
+ virtual void finish();
+ virtual bool finishWasCalled();
+
+ HTMLViewSourceDocument* document() const { return static_cast<HTMLViewSourceDocument*>(m_document); }
+
+ void pumpTokenizer();
+ String sourceForToken();
+ void updateTokenizerState();
+
+ HTMLInputStream m_input;
+ SegmentedString m_source;
+ HTMLToken m_token;
+ HTMLTokenizer m_tokenizer;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/LegacyHTMLDocumentParser.cpp b/WebCore/html/LegacyHTMLDocumentParser.cpp
deleted file mode 100644
index 980d6ed..0000000
--- a/WebCore/html/LegacyHTMLDocumentParser.cpp
+++ /dev/null
@@ -1,2126 +0,0 @@
-/*
- Copyright (C) 1997 Martin Jones (mjones@kde.org)
- (C) 1997 Torben Weis (weis@kde.org)
- (C) 1998 Waldo Bastian (bastian@kde.org)
- (C) 1999 Lars Knoll (knoll@kde.org)
- (C) 1999 Antti Koivisto (koivisto@kde.org)
- (C) 2001 Dirk Mueller (mueller@kde.org)
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- Copyright (C) 2005, 2006 Alexey Proskuryakov (ap@nypop.com)
- Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
-
- 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 "LegacyHTMLDocumentParser.h"
-
-#include "Attribute.h"
-#include "CSSHelper.h"
-#include "Cache.h"
-#include "CachedScript.h"
-#include "DocLoader.h"
-#include "DocumentFragment.h"
-#include "Event.h"
-#include "EventNames.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "FrameView.h"
-#include "HTMLElement.h"
-#include "HTMLNames.h"
-#include "LegacyHTMLTreeBuilder.h"
-#include "HTMLScriptElement.h"
-#include "HTMLViewSourceDocument.h"
-#include "ImageLoader.h"
-#include "InspectorTimelineAgent.h"
-#include "Page.h"
-#include "LegacyPreloadScanner.h"
-#include "ScriptSourceCode.h"
-#include "ScriptValue.h"
-#include "XSSAuditor.h"
-#include <wtf/ASCIICType.h>
-#include <wtf/CurrentTime.h>
-
-#include "HTMLEntityNames.cpp"
-
-#define PRELOAD_SCANNER_ENABLED 1
-
-using namespace WTF;
-using namespace std;
-
-namespace WebCore {
-
-using namespace HTMLNames;
-
-// This value is used to define how many loops (approximately tokens)
-// the parser will make before checking if it should yield.
-// To increase responsiveness reduce both ChunkSize and TimeDelay contants.
-static const int defaultTokenizerChunkSize = 4096;
-
-// FIXME: We would like this constant to be 200ms.
-// Yielding more aggressively results in increased responsiveness and better incremental rendering.
-// It slows down overall page-load on slower machines, though, so for now we set a value of 500.
-// TimeDelay controls the maximum time the parser will run before yielding.
-// Inline script execution can cause the parser to excede this limit.
-static const double defaultTokenizerTimeDelay = 0.500;
-
-static const char commentStart [] = "<!--";
-static const char doctypeStart [] = "<!doctype";
-static const char publicStart [] = "public";
-static const char systemStart [] = "system";
-static const char scriptEnd [] = "</script";
-static const char xmpEnd [] = "</xmp";
-static const char styleEnd [] = "</style";
-static const char textareaEnd [] = "</textarea";
-static const char titleEnd [] = "</title";
-static const char iframeEnd [] = "</iframe";
-
-// Full support for MS Windows extensions to Latin-1.
-// Technically these extensions should only be activated for pages
-// marked "windows-1252" or "cp1252", but
-// in the standard Microsoft way, these extensions infect hundreds of thousands
-// of web pages. Note that people with non-latin-1 Microsoft extensions
-// are SOL.
-//
-// See: http://www.microsoft.com/globaldev/reference/WinCP.asp
-// http://www.bbsinc.com/iso8859.html
-// http://www.obviously.com/
-//
-// There may be better equivalents
-
-// We only need this for entities. For non-entity text, we handle this in the text encoding.
-
-static const UChar windowsLatin1ExtensionArray[32] = {
- 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, // 80-87
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, // 88-8F
- 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, // 90-97
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178 // 98-9F
-};
-
-static inline UChar fixUpChar(UChar c)
-{
- if ((c & ~0x1F) != 0x0080)
- return c;
- return windowsLatin1ExtensionArray[c - 0x80];
-}
-
-static inline bool tagMatch(const char* s1, const UChar* s2, unsigned length)
-{
- for (unsigned i = 0; i != length; ++i) {
- unsigned char c1 = s1[i];
- unsigned char uc1 = toASCIIUpper(static_cast<char>(c1));
- UChar c2 = s2[i];
- if (c1 != c2 && uc1 != c2)
- return false;
- }
- return true;
-}
-
-inline void Token::addAttribute(AtomicString& attrName, const AtomicString& attributeValue, bool viewSourceMode)
-{
- if (!attrName.isEmpty()) {
- ASSERT(!attrName.contains('/'));
- RefPtr<Attribute> a = Attribute::createMapped(attrName, attributeValue);
- if (!attrs) {
- attrs = NamedNodeMap::create();
- attrs->reserveInitialCapacity(10);
- }
- attrs->insertAttribute(a.release(), viewSourceMode);
- }
-
- attrName = emptyAtom;
-}
-
-// ----------------------------------------------------------------------------
-
-LegacyHTMLDocumentParser::LegacyHTMLDocumentParser(HTMLDocument* document, bool reportErrors)
- : ScriptableDocumentParser(document)
- , m_buffer(0)
- , m_scriptCode(0)
- , m_scriptCodeSize(0)
- , m_scriptCodeCapacity(0)
- , m_scriptCodeResync(0)
- , m_executingScript(0)
- , m_requestingScript(false)
- , m_hasScriptsWaitingForStylesheets(false)
- , m_timer(this, &LegacyHTMLDocumentParser::timerFired)
- , m_externalScriptsTimer(this, &LegacyHTMLDocumentParser::executeExternalScriptsTimerFired)
- , m_treeBuilder(new LegacyHTMLTreeBuilder(document, reportErrors))
- , m_inWrite(false)
- , m_fragment(false)
- , m_scriptingPermission(FragmentScriptingAllowed)
-{
- begin();
-}
-
-LegacyHTMLDocumentParser::LegacyHTMLDocumentParser(HTMLViewSourceDocument* document)
- : ScriptableDocumentParser(document, true)
- , m_buffer(0)
- , m_scriptCode(0)
- , m_scriptCodeSize(0)
- , m_scriptCodeCapacity(0)
- , m_scriptCodeResync(0)
- , m_executingScript(0)
- , m_requestingScript(false)
- , m_hasScriptsWaitingForStylesheets(false)
- , m_timer(this, &LegacyHTMLDocumentParser::timerFired)
- , m_externalScriptsTimer(this, &LegacyHTMLDocumentParser::executeExternalScriptsTimerFired)
- , m_inWrite(false)
- , m_fragment(false)
- , m_scriptingPermission(FragmentScriptingAllowed)
-{
- begin();
-}
-
-LegacyHTMLDocumentParser::LegacyHTMLDocumentParser(DocumentFragment* frag, FragmentScriptingPermission scriptingPermission)
- : ScriptableDocumentParser(frag->document())
- , m_buffer(0)
- , m_scriptCode(0)
- , m_scriptCodeSize(0)
- , m_scriptCodeCapacity(0)
- , m_scriptCodeResync(0)
- , m_executingScript(0)
- , m_requestingScript(false)
- , m_hasScriptsWaitingForStylesheets(false)
- , m_timer(this, &LegacyHTMLDocumentParser::timerFired)
- , m_externalScriptsTimer(this, &LegacyHTMLDocumentParser::executeExternalScriptsTimerFired)
- , m_treeBuilder(new LegacyHTMLTreeBuilder(frag, scriptingPermission))
- , m_inWrite(false)
- , m_fragment(true)
- , m_scriptingPermission(scriptingPermission)
-{
- begin();
-}
-
-void LegacyHTMLDocumentParser::reset()
-{
- ASSERT(m_executingScript == 0);
-
- while (!m_pendingScripts.isEmpty()) {
- CachedResourceHandle<CachedScript> cs = m_pendingScripts.takeFirst();
- ASSERT(cache()->disabled() || cs->accessCount() > 0);
- cs->removeClient(this);
- }
-
- fastFree(m_buffer);
- m_buffer = m_dest = 0;
- m_bufferSize = 0;
-
- fastFree(m_scriptCode);
- m_scriptCode = 0;
- m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
-
- m_timer.stop();
- m_externalScriptsTimer.stop();
-
- m_state.setAllowYield(false);
- m_state.setForceSynchronous(false);
-
- m_currentToken.reset();
- m_doctypeToken.reset();
- m_doctypeSearchCount = 0;
- m_doctypeSecondarySearchCount = 0;
- m_hasScriptsWaitingForStylesheets = false;
-}
-
-void LegacyHTMLDocumentParser::begin()
-{
- m_executingScript = 0;
- m_requestingScript = false;
- m_hasScriptsWaitingForStylesheets = false;
- m_state.setLoadingExtScript(false);
- reset();
- m_bufferSize = 254;
- m_buffer = static_cast<UChar*>(fastMalloc(sizeof(UChar) * 254));
- m_dest = m_buffer;
- tquote = NoQuote;
- searchCount = 0;
- m_state.setEntityState(NoEntity);
- m_scriptTagSrcAttrValue = String();
- m_pendingSrc.clear();
- m_currentPrependingSrc = 0;
- m_noMoreData = false;
- m_brokenComments = false;
- m_brokenServer = false;
- m_lineNumber = 0;
- m_currentScriptTagStartLineNumber = 0;
- m_currentTagStartLineNumber = 0;
- m_state.setForceSynchronous(false);
-
- Page* page = document()->page();
- if (page && page->hasCustomHTMLTokenizerTimeDelay())
- m_tokenizerTimeDelay = page->customHTMLTokenizerTimeDelay();
- else
- m_tokenizerTimeDelay = defaultTokenizerTimeDelay;
-
- if (page && page->hasCustomHTMLTokenizerChunkSize())
- m_tokenizerChunkSize = page->customHTMLTokenizerChunkSize();
- else
- m_tokenizerChunkSize = defaultTokenizerChunkSize;
-}
-
-void LegacyHTMLDocumentParser::setForceSynchronous(bool force)
-{
- m_state.setForceSynchronous(force);
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::processListing(SegmentedString list, State state)
-{
- // This function adds the listing 'list' as
- // preformatted text-tokens to the token-collection
- while (!list.isEmpty()) {
- if (state.skipLF()) {
- state.setSkipLF(false);
- if (*list == '\n') {
- list.advance();
- continue;
- }
- }
-
- checkBuffer();
-
- if (*list == '\n' || *list == '\r') {
- if (state.discardLF())
- // Ignore this LF
- state.setDiscardLF(false); // We have discarded 1 LF
- else
- *m_dest++ = '\n';
-
- /* Check for MS-DOS CRLF sequence */
- if (*list == '\r')
- state.setSkipLF(true);
-
- list.advance();
- } else {
- state.setDiscardLF(false);
- *m_dest++ = *list;
- list.advance();
- }
- }
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseNonHTMLText(SegmentedString& src, State state)
-{
- ASSERT(state.inTextArea() || state.inTitle() || state.inIFrame() || !state.hasEntityState());
- ASSERT(!state.hasTagState());
- ASSERT(state.inXmp() + state.inTextArea() + state.inTitle() + state.inStyle() + state.inScript() + state.inIFrame() == 1);
- if (state.inScript() && !m_currentScriptTagStartLineNumber)
- m_currentScriptTagStartLineNumber = m_lineNumber;
-
- if (state.inComment())
- state = parseComment(src, state);
-
- int lastDecodedEntityPosition = -1;
- while (!src.isEmpty()) {
- checkScriptBuffer();
- UChar ch = *src;
-
- if (!m_scriptCodeResync && !m_brokenComments &&
- !state.inXmp() && ch == '-' && m_scriptCodeSize >= 3 && !src.escaped() &&
- m_scriptCode[m_scriptCodeSize - 3] == '<' && m_scriptCode[m_scriptCodeSize - 2] == '!' && m_scriptCode[m_scriptCodeSize - 1] == '-' &&
- (lastDecodedEntityPosition < m_scriptCodeSize - 3)) {
- state.setInComment(true);
- state = parseComment(src, state);
- continue;
- }
- if (m_scriptCodeResync && !tquote && ch == '>') {
- src.advancePastNonNewline();
- m_scriptCodeSize = m_scriptCodeResync - 1;
- m_scriptCodeResync = 0;
- m_scriptCode[m_scriptCodeSize] = m_scriptCode[m_scriptCodeSize + 1] = 0;
- if (state.inScript())
- state = scriptHandler(state);
- else {
- state = processListing(SegmentedString(String(m_scriptCode, m_scriptCodeSize)), state);
- processToken();
- if (state.inStyle()) {
- m_currentToken.tagName = styleTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inTextArea()) {
- m_currentToken.tagName = textareaTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inTitle()) {
- m_currentToken.tagName = titleTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inXmp()) {
- m_currentToken.tagName = xmpTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inIFrame()) {
- m_currentToken.tagName = iframeTag.localName();
- m_currentToken.beginTag = false;
- }
- processToken();
- state.setInStyle(false);
- state.setInScript(false);
- state.setInTextArea(false);
- state.setInTitle(false);
- state.setInXmp(false);
- state.setInIFrame(false);
- tquote = NoQuote;
- m_scriptCodeSize = m_scriptCodeResync = 0;
- }
- return state;
- }
- // possible end of tagname, lets check.
- if (!m_scriptCodeResync && !state.escaped() && !src.escaped() && (ch == '>' || ch == '/' || isASCIISpace(ch)) &&
- m_scriptCodeSize >= m_searchStopperLength &&
- tagMatch(m_searchStopper, m_scriptCode + m_scriptCodeSize - m_searchStopperLength, m_searchStopperLength) &&
- (lastDecodedEntityPosition < m_scriptCodeSize - m_searchStopperLength)) {
- m_scriptCodeResync = m_scriptCodeSize-m_searchStopperLength+1;
- tquote = NoQuote;
- continue;
- }
- if (m_scriptCodeResync && !state.escaped()) {
- if (ch == '\"')
- tquote = (tquote == NoQuote) ? DoubleQuote : ((tquote == SingleQuote) ? SingleQuote : NoQuote);
- else if (ch == '\'')
- tquote = (tquote == NoQuote) ? SingleQuote : (tquote == DoubleQuote) ? DoubleQuote : NoQuote;
- else if (tquote != NoQuote && (ch == '\r' || ch == '\n'))
- tquote = NoQuote;
- }
- state.setEscaped(!state.escaped() && ch == '\\');
- if (!m_scriptCodeResync && (state.inTextArea() || state.inTitle() || state.inIFrame()) && !src.escaped() && ch == '&') {
- UChar* scriptCodeDest = m_scriptCode + m_scriptCodeSize;
- src.advancePastNonNewline();
- state = parseEntity(src, scriptCodeDest, state, m_cBufferPos, true, false);
- if (scriptCodeDest == m_scriptCode + m_scriptCodeSize)
- lastDecodedEntityPosition = m_scriptCodeSize;
- else
- m_scriptCodeSize = scriptCodeDest - m_scriptCode;
- } else {
- m_scriptCode[m_scriptCodeSize++] = ch;
- src.advance(m_lineNumber);
- }
- }
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::scriptHandler(State state)
-{
- // We are inside a <script>
- bool doScriptExec = false;
- int startLine = m_currentScriptTagStartLineNumber + 1; // Script line numbers are 1 based, HTMLTokenzier line numbers are 0 based
-
- // Reset m_currentScriptTagStartLineNumber to indicate that we've finished parsing the current script element
- m_currentScriptTagStartLineNumber = 0;
-
- // (Bugzilla 3837) Scripts following a frameset element should not execute or,
- // in the case of extern scripts, even load.
- bool followingFrameset = (document()->body() && document()->body()->hasTagName(framesetTag));
-
- CachedScript* cs = 0;
- // don't load external scripts for standalone documents (for now)
- if (!inViewSourceMode()) {
- if (!m_scriptTagSrcAttrValue.isEmpty() && document()->frame()) {
- // forget what we just got; load from src url instead
- if (!m_treeBuilder->skipMode() && !followingFrameset) {
- // The parser might have been stopped by for example a window.close call in an earlier script.
- // If so, we don't want to load scripts.
- if (!m_parserStopped && m_scriptNode->dispatchBeforeLoadEvent(m_scriptTagSrcAttrValue) &&
- (cs = document()->docLoader()->requestScript(m_scriptTagSrcAttrValue, m_scriptTagCharsetAttrValue)))
- m_pendingScripts.append(cs);
- else
- m_scriptNode = 0;
- } else
- m_scriptNode = 0;
- m_scriptTagSrcAttrValue = String();
- } else {
- // Parse m_scriptCode containing <script> info
- doScriptExec = m_scriptNode->shouldExecuteAsJavaScript();
-#if ENABLE(XHTMLMP)
- if (!doScriptExec)
- document()->setShouldProcessNoscriptElement(true);
-#endif
- m_scriptNode = 0;
- }
- }
-
- state = processListing(SegmentedString(String(m_scriptCode, m_scriptCodeSize)), state);
- RefPtr<Node> node = processToken();
-
- if (node && m_scriptingPermission == FragmentScriptingNotAllowed) {
- ExceptionCode ec;
- node->remove(ec);
- node = 0;
- }
-
- String scriptString = node ? node->textContent() : "";
- m_currentToken.tagName = scriptTag.localName();
- m_currentToken.beginTag = false;
- processToken();
-
- state.setInScript(false);
- m_scriptCodeSize = m_scriptCodeResync = 0;
-
- // FIXME: The script should be syntax highlighted.
- if (inViewSourceMode())
- return state;
-
- SegmentedString* savedPrependingSrc = m_currentPrependingSrc;
- SegmentedString prependingSrc;
- m_currentPrependingSrc = &prependingSrc;
-
- if (!m_treeBuilder->skipMode() && !followingFrameset) {
- if (cs) {
- if (savedPrependingSrc)
- savedPrependingSrc->append(m_src);
- else
- m_pendingSrc.prepend(m_src);
- setSrc(SegmentedString());
-
- // the ref() call below may call notifyFinished if the script is already in cache,
- // and that mucks with the state directly, so we must write it back to the object.
- m_state = state;
- bool savedRequestingScript = m_requestingScript;
- m_requestingScript = true;
- cs->addClient(this);
- m_requestingScript = savedRequestingScript;
- state = m_state;
- // will be 0 if script was already loaded and ref() executed it
- if (!m_pendingScripts.isEmpty())
- state.setLoadingExtScript(true);
- } else if (!m_fragment && doScriptExec) {
- if (!m_executingScript)
- m_pendingSrc.prepend(m_src);
- else
- prependingSrc = m_src;
- setSrc(SegmentedString());
- state = scriptExecution(ScriptSourceCode(scriptString, document()->frame() ? document()->frame()->document()->url() : KURL(), startLine), state);
- }
- }
-
- if (!m_executingScript && !state.loadingExtScript()) {
- m_src.append(m_pendingSrc);
- m_pendingSrc.clear();
- } else if (!prependingSrc.isEmpty()) {
- // restore first so that the write appends in the right place
- // (does not hurt to do it again below)
- m_currentPrependingSrc = savedPrependingSrc;
-
- // we need to do this slightly modified bit of one of the write() cases
- // because we want to prepend to m_pendingSrc rather than appending
- // if there's no previous prependingSrc
- if (!m_pendingScripts.isEmpty()) {
- if (m_currentPrependingSrc)
- m_currentPrependingSrc->append(prependingSrc);
- else
- m_pendingSrc.prepend(prependingSrc);
- } else {
- m_state = state;
- write(prependingSrc, false);
- state = m_state;
- }
- }
-
-#if PRELOAD_SCANNER_ENABLED
- if (!m_pendingScripts.isEmpty() && !m_executingScript) {
- if (!m_preloadScanner)
- m_preloadScanner.set(new LegacyPreloadScanner(document()));
- if (!m_preloadScanner->inProgress()) {
- m_preloadScanner->begin();
- m_preloadScanner->write(m_pendingSrc);
- }
- }
-#endif
- m_currentPrependingSrc = savedPrependingSrc;
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::scriptExecution(const ScriptSourceCode& sourceCode, State state)
-{
- if (m_fragment || !document()->frame())
- return state;
- m_executingScript++;
-
- SegmentedString* savedPrependingSrc = m_currentPrependingSrc;
- SegmentedString prependingSrc;
- m_currentPrependingSrc = &prependingSrc;
-
- m_state = state;
- document()->frame()->script()->executeScript(sourceCode);
- state = m_state;
-
- state.setAllowYield(true);
-
- m_executingScript--;
-
- if (!m_executingScript && !state.loadingExtScript()) {
- m_pendingSrc.prepend(prependingSrc);
- m_src.append(m_pendingSrc);
- m_pendingSrc.clear();
- } else if (!prependingSrc.isEmpty()) {
- // restore first so that the write appends in the right place
- // (does not hurt to do it again below)
- m_currentPrependingSrc = savedPrependingSrc;
-
- // we need to do this slightly modified bit of one of the write() cases
- // because we want to prepend to m_pendingSrc rather than appending
- // if there's no previous prependingSrc
- if (!m_pendingScripts.isEmpty()) {
- if (m_currentPrependingSrc)
- m_currentPrependingSrc->append(prependingSrc);
- else
- m_pendingSrc.prepend(prependingSrc);
-
-#if PRELOAD_SCANNER_ENABLED
- // We are stuck waiting for another script. Lets check the source that
- // was just document.write()n for anything to load.
- LegacyPreloadScanner documentWritePreloadScanner(document());
- documentWritePreloadScanner.begin();
- documentWritePreloadScanner.write(prependingSrc);
- documentWritePreloadScanner.end();
-#endif
- } else {
- m_state = state;
- write(prependingSrc, false);
- state = m_state;
- }
- }
-
- m_currentPrependingSrc = savedPrependingSrc;
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseComment(SegmentedString& src, State state)
-{
- // FIXME: Why does this code even run for comments inside <script> and <style>? This seems bogus.
- checkScriptBuffer(src.length());
- while (!src.isEmpty()) {
- UChar ch = *src;
- m_scriptCode[m_scriptCodeSize++] = ch;
- if (ch == '>') {
- bool handleBrokenComments = m_brokenComments && !(state.inScript() || state.inStyle());
- int endCharsCount = 1; // start off with one for the '>' character
- if (m_scriptCodeSize > 2 && m_scriptCode[m_scriptCodeSize-3] == '-' && m_scriptCode[m_scriptCodeSize-2] == '-') {
- endCharsCount = 3;
- } else if (m_scriptCodeSize > 3 && m_scriptCode[m_scriptCodeSize-4] == '-' && m_scriptCode[m_scriptCodeSize-3] == '-' &&
- m_scriptCode[m_scriptCodeSize-2] == '!') {
- // Other browsers will accept --!> as a close comment, even though it's
- // not technically valid.
- endCharsCount = 4;
- }
- if (handleBrokenComments || endCharsCount > 1) {
- src.advancePastNonNewline();
- if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() || state.inIFrame())) {
- checkScriptBuffer();
- m_scriptCode[m_scriptCodeSize] = 0;
- m_scriptCode[m_scriptCodeSize + 1] = 0;
- m_currentToken.tagName = commentAtom;
- m_currentToken.beginTag = true;
- state = processListing(SegmentedString(String(m_scriptCode, m_scriptCodeSize - endCharsCount)), state);
- processToken();
- m_currentToken.tagName = commentAtom;
- m_currentToken.beginTag = false;
- processToken();
- m_scriptCodeSize = 0;
- }
- state.setInComment(false);
- return state; // Finished parsing comment
- }
- }
- src.advance(m_lineNumber);
- }
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseServer(SegmentedString& src, State state)
-{
- checkScriptBuffer(src.length());
- while (!src.isEmpty()) {
- UChar ch = *src;
- m_scriptCode[m_scriptCodeSize++] = ch;
- if (ch == '>' && m_scriptCodeSize > 1 && m_scriptCode[m_scriptCodeSize - 2] == '%') {
- src.advancePastNonNewline();
- state.setInServer(false);
- m_scriptCodeSize = 0;
- return state; // Finished parsing server include
- }
- src.advance(m_lineNumber);
- }
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseProcessingInstruction(SegmentedString& src, State state)
-{
- UChar oldchar = 0;
- while (!src.isEmpty()) {
- UChar chbegin = *src;
- if (chbegin == '\'')
- tquote = tquote == SingleQuote ? NoQuote : SingleQuote;
- else if (chbegin == '\"')
- tquote = tquote == DoubleQuote ? NoQuote : DoubleQuote;
- // Look for '?>'
- // Some crappy sites omit the "?" before it, so
- // we look for an unquoted '>' instead. (IE compatible)
- else if (chbegin == '>' && (!tquote || oldchar == '?')) {
- // We got a '?>' sequence
- state.setInProcessingInstruction(false);
- src.advancePastNonNewline();
- state.setDiscardLF(true);
- return state; // Finished parsing comment!
- }
- src.advance(m_lineNumber);
- oldchar = chbegin;
- }
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseText(SegmentedString& src, State state)
-{
- while (!src.isEmpty()) {
- UChar cc = *src;
-
- if (state.skipLF()) {
- state.setSkipLF(false);
- if (cc == '\n') {
- src.advancePastNewline(m_lineNumber);
- continue;
- }
- }
-
- // do we need to enlarge the buffer?
- checkBuffer();
-
- if (cc == '\r') {
- state.setSkipLF(true);
- *m_dest++ = '\n';
- } else
- *m_dest++ = cc;
- src.advance(m_lineNumber);
- }
-
- return state;
-}
-
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseEntity(SegmentedString& src, UChar*& dest, State state, unsigned& cBufferPos, bool start, bool parsingTag)
-{
- if (start) {
- cBufferPos = 0;
- state.setEntityState(SearchEntity);
- EntityUnicodeValue = 0;
- }
-
- while (!src.isEmpty()) {
- UChar cc = *src;
- switch (state.entityState()) {
- case NoEntity:
- ASSERT(state.entityState() != NoEntity);
- return state;
-
- case SearchEntity:
- if (cc == '#') {
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- state.setEntityState(NumericSearch);
- } else
- state.setEntityState(EntityName);
- break;
-
- case NumericSearch:
- if (cc == 'x' || cc == 'X') {
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- state.setEntityState(Hexadecimal);
- } else if (cc >= '0' && cc <= '9')
- state.setEntityState(Decimal);
- else
- state.setEntityState(SearchSemicolon);
- break;
-
- case Hexadecimal: {
- int ll = min(src.length(), 10 - cBufferPos);
- while (ll--) {
- cc = *src;
- if (!((cc >= '0' && cc <= '9') || (cc >= 'a' && cc <= 'f') || (cc >= 'A' && cc <= 'F'))) {
- state.setEntityState(SearchSemicolon);
- break;
- }
- int digit;
- if (cc < 'A')
- digit = cc - '0';
- else
- digit = (cc - 'A' + 10) & 0xF; // handle both upper and lower case without a branch
- EntityUnicodeValue = EntityUnicodeValue * 16 + digit;
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- }
- if (cBufferPos == 10)
- state.setEntityState(SearchSemicolon);
- break;
- }
- case Decimal:
- {
- int ll = min(src.length(), 9-cBufferPos);
- while (ll--) {
- cc = *src;
-
- if (!(cc >= '0' && cc <= '9')) {
- state.setEntityState(SearchSemicolon);
- break;
- }
-
- EntityUnicodeValue = EntityUnicodeValue * 10 + (cc - '0');
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- }
- if (cBufferPos == 9)
- state.setEntityState(SearchSemicolon);
- break;
- }
- case EntityName:
- {
- int ll = min(src.length(), 9-cBufferPos);
- while (ll--) {
- cc = *src;
-
- if (!((cc >= 'a' && cc <= 'z') || (cc >= '0' && cc <= '9') || (cc >= 'A' && cc <= 'Z'))) {
- state.setEntityState(SearchSemicolon);
- break;
- }
-
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- }
- if (cBufferPos == 9)
- state.setEntityState(SearchSemicolon);
- if (state.entityState() == SearchSemicolon) {
- if (cBufferPos > 1) {
- // Since the maximum length of entity name is 9,
- // so a single char array which is allocated on
- // the stack, its length is 10, should be OK.
- // Also if we have an illegal character, we treat it
- // as illegal entity name.
- unsigned testedEntityNameLen = 0;
- char tmpEntityNameBuffer[10];
-
- ASSERT(cBufferPos < 10);
- for (; testedEntityNameLen < cBufferPos; ++testedEntityNameLen) {
- if (m_cBuffer[testedEntityNameLen] > 0x7e)
- break;
- tmpEntityNameBuffer[testedEntityNameLen] = m_cBuffer[testedEntityNameLen];
- }
-
- const Entity *e;
-
- if (testedEntityNameLen == cBufferPos)
- e = findEntity(tmpEntityNameBuffer, cBufferPos);
- else
- e = 0;
-
- if (e)
- EntityUnicodeValue = e->code;
-
- // be IE compatible
- if (parsingTag && EntityUnicodeValue > 255 && *src != ';')
- EntityUnicodeValue = 0;
- }
- }
- else
- break;
- }
- case SearchSemicolon:
- // Don't allow values that are more than 21 bits.
- if (EntityUnicodeValue > 0 && EntityUnicodeValue <= 0x10FFFF) {
- if (!inViewSourceMode()) {
- if (*src == ';')
- src.advancePastNonNewline();
- if (EntityUnicodeValue <= 0xFFFF) {
- checkBuffer();
- src.push(fixUpChar(EntityUnicodeValue));
- } else {
- // Convert to UTF-16, using surrogate code points.
- checkBuffer(2);
- src.push(U16_LEAD(EntityUnicodeValue));
- src.push(U16_TRAIL(EntityUnicodeValue));
- }
- } else {
- // FIXME: We should eventually colorize entities by sending them as a special token.
- // 12 bytes required: up to 10 bytes in m_cBuffer plus the
- // leading '&' and trailing ';'
- checkBuffer(12);
- *dest++ = '&';
- for (unsigned i = 0; i < cBufferPos; i++)
- dest[i] = m_cBuffer[i];
- dest += cBufferPos;
- if (*src == ';') {
- *dest++ = ';';
- src.advancePastNonNewline();
- }
- }
- } else {
- // 11 bytes required: up to 10 bytes in m_cBuffer plus the
- // leading '&'
- checkBuffer(11);
- // ignore the sequence, add it to the buffer as plaintext
- *dest++ = '&';
- for (unsigned i = 0; i < cBufferPos; i++)
- dest[i] = m_cBuffer[i];
- dest += cBufferPos;
- }
-
- state.setEntityState(NoEntity);
- return state;
- }
- }
-
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseDoctype(SegmentedString& src, State state)
-{
- ASSERT(state.inDoctype());
- while (!src.isEmpty() && state.inDoctype()) {
- UChar c = *src;
- bool isWhitespace = c == '\r' || c == '\n' || c == '\t' || c == ' ';
- switch (m_doctypeToken.state()) {
- case DoctypeBegin: {
- m_doctypeToken.setState(DoctypeBeforeName);
- if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeBeforeName: {
- if (c == '>') {
- // Malformed. Just exit.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeName);
- break;
- }
- case DoctypeName: {
- if (c == '>') {
- // Valid doctype. Emit it.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (isWhitespace) {
- m_doctypeSearchCount = 0; // Used now to scan for PUBLIC
- m_doctypeSecondarySearchCount = 0; // Used now to scan for SYSTEM
- m_doctypeToken.setState(DoctypeAfterName);
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else {
- src.advancePastNonNewline();
- m_doctypeToken.m_name.append(c);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeAfterName: {
- if (c == '>') {
- // Valid doctype. Emit it.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (!isWhitespace) {
- src.advancePastNonNewline();
- if (toASCIILower(c) == publicStart[m_doctypeSearchCount]) {
- m_doctypeSearchCount++;
- if (m_doctypeSearchCount == 6)
- // Found 'PUBLIC' sequence
- m_doctypeToken.setState(DoctypeBeforePublicID);
- } else if (m_doctypeSearchCount > 0) {
- m_doctypeSearchCount = 0;
- m_doctypeToken.setState(DoctypeBogus);
- } else if (toASCIILower(c) == systemStart[m_doctypeSecondarySearchCount]) {
- m_doctypeSecondarySearchCount++;
- if (m_doctypeSecondarySearchCount == 6)
- // Found 'SYSTEM' sequence
- m_doctypeToken.setState(DoctypeBeforeSystemID);
- } else {
- m_doctypeSecondarySearchCount = 0;
- m_doctypeToken.setState(DoctypeBogus);
- }
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else {
- src.advance(m_lineNumber); // Whitespace keeps us in the after name state.
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeBeforePublicID: {
- if (c == '\"' || c == '\'') {
- tquote = c == '\"' ? DoubleQuote : SingleQuote;
- m_doctypeToken.setState(DoctypePublicID);
- src.advancePastNonNewline();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- }
- case DoctypePublicID: {
- if ((c == '\"' && tquote == DoubleQuote) || (c == '\'' && tquote == SingleQuote)) {
- src.advancePastNonNewline();
- m_doctypeToken.setState(DoctypeAfterPublicID);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else {
- m_doctypeToken.m_publicID.append(c);
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeAfterPublicID:
- if (c == '\"' || c == '\'') {
- tquote = c == '\"' ? DoubleQuote : SingleQuote;
- m_doctypeToken.setState(DoctypeSystemID);
- src.advancePastNonNewline();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Valid doctype. Emit it now.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- case DoctypeBeforeSystemID:
- if (c == '\"' || c == '\'') {
- tquote = c == '\"' ? DoubleQuote : SingleQuote;
- m_doctypeToken.setState(DoctypeSystemID);
- src.advancePastNonNewline();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- case DoctypeSystemID:
- if ((c == '\"' && tquote == DoubleQuote) || (c == '\'' && tquote == SingleQuote)) {
- src.advancePastNonNewline();
- m_doctypeToken.setState(DoctypeAfterSystemID);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else {
- m_doctypeToken.m_systemID.append(c);
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- case DoctypeAfterSystemID:
- if (c == '>') {
- // Valid doctype. Emit it now.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- case DoctypeBogus:
- if (c == '>') {
- // Done with the bogus doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else {
- src.advance(m_lineNumber); // Just keep scanning for '>'
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- default:
- break;
- }
- }
- return state;
-}
-
-LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseTag(SegmentedString& src, State state)
-{
- ASSERT(!state.hasEntityState());
-
- unsigned cBufferPos = m_cBufferPos;
-
- bool lastIsSlash = false;
-
- while (!src.isEmpty()) {
- checkBuffer();
- switch (state.tagState()) {
- case NoTag:
- {
- m_cBufferPos = cBufferPos;
- return state;
- }
- case TagName:
- {
- if (searchCount > 0) {
- if (*src == commentStart[searchCount]) {
- searchCount++;
- if (searchCount == 2)
- m_doctypeSearchCount++; // A '!' is also part of a doctype, so we are moving through that still as well.
- else
- m_doctypeSearchCount = 0;
- if (searchCount == 4) {
- // Found '<!--' sequence
- src.advancePastNonNewline();
- m_dest = m_buffer; // ignore the previous part of this tag
- state.setInComment(true);
- state.setTagState(NoTag);
-
- // Fix bug 34302 at kde.bugs.org. Go ahead and treat
- // <!--> as a valid comment, since both mozilla and IE on windows
- // can handle this case. Only do this in quirks mode. -dwh
- if (!src.isEmpty() && *src == '>' && document()->inCompatMode()) {
- state.setInComment(false);
- src.advancePastNonNewline();
- if (!src.isEmpty())
- m_cBuffer[cBufferPos++] = *src;
- } else
- state = parseComment(src, state);
-
- m_cBufferPos = cBufferPos;
- return state; // Finished parsing tag!
- }
- m_cBuffer[cBufferPos++] = *src;
- src.advancePastNonNewline();
- break;
- } else
- searchCount = 0; // Stop looking for '<!--' sequence
- }
-
- if (m_doctypeSearchCount > 0) {
- if (toASCIILower(*src) == doctypeStart[m_doctypeSearchCount]) {
- m_doctypeSearchCount++;
- m_cBuffer[cBufferPos++] = *src;
- src.advancePastNonNewline();
- if (m_doctypeSearchCount == 9) {
- // Found '<!DOCTYPE' sequence
- state.setInDoctype(true);
- state.setTagState(NoTag);
- m_doctypeToken.reset();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(m_cBuffer, cBufferPos);
- state = parseDoctype(src, state);
- m_cBufferPos = cBufferPos;
- return state;
- }
- break;
- } else
- m_doctypeSearchCount = 0; // Stop looking for '<!DOCTYPE' sequence
- }
-
- bool finish = false;
- unsigned int ll = min(src.length(), CBUFLEN - cBufferPos);
- while (ll--) {
- UChar curchar = *src;
- if (isASCIISpace(curchar) || curchar == '>' || curchar == '<') {
- finish = true;
- break;
- }
-
- // tolower() shows up on profiles. This is faster!
- if (curchar >= 'A' && curchar <= 'Z' && !inViewSourceMode())
- m_cBuffer[cBufferPos++] = curchar + ('a' - 'A');
- else
- m_cBuffer[cBufferPos++] = curchar;
- src.advancePastNonNewline();
- }
-
- // Disadvantage: we add the possible rest of the tag
- // as attribute names. ### judge if this causes problems
- if (finish || CBUFLEN == cBufferPos) {
- bool beginTag;
- UChar* ptr = m_cBuffer;
- unsigned int len = cBufferPos;
- m_cBuffer[cBufferPos] = '\0';
- if ((cBufferPos > 0) && (*ptr == '/')) {
- // End Tag
- beginTag = false;
- ptr++;
- len--;
- }
- else
- // Start Tag
- beginTag = true;
-
- // Ignore the / in fake xml tags like <br/>. We trim off the "/" so that we'll get "br" as the tag name and not "br/".
- if (len > 1 && ptr[len-1] == '/' && !inViewSourceMode())
- ptr[--len] = '\0';
-
- // Now that we've shaved off any invalid / that might have followed the name), make the tag.
- // FIXME: FireFox and WinIE turn !foo nodes into comments, we ignore comments. (fast/parser/tag-with-exclamation-point.html)
- if (ptr[0] != '!' || inViewSourceMode()) {
- m_currentToken.tagName = AtomicString(ptr);
- m_currentToken.beginTag = beginTag;
- }
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- cBufferPos = 0;
- }
- break;
- }
- case SearchAttribute:
- while (!src.isEmpty()) {
- UChar curchar = *src;
- // In this mode just ignore any quotes we encounter and treat them like spaces.
- if (!isASCIISpace(curchar) && curchar != '\'' && curchar != '"') {
- if (curchar == '<' || curchar == '>')
- state.setTagState(SearchEnd);
- else
- state.setTagState(AttributeName);
-
- cBufferPos = 0;
- break;
- }
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- src.advance(m_lineNumber);
- }
- break;
- case AttributeName:
- {
- m_rawAttributeBeforeValue.clear();
- int ll = min(src.length(), CBUFLEN - cBufferPos);
- while (ll--) {
- UChar curchar = *src;
- // If we encounter a "/" when scanning an attribute name, treat it as a delimiter. This allows the
- // cases like <input type=checkbox checked/> to work (and accommodates XML-style syntax as per HTML5).
- if (curchar <= '>' && (curchar >= '<' || isASCIISpace(curchar) || curchar == '/')) {
- m_cBuffer[cBufferPos] = '\0';
- m_attrName = AtomicString(m_cBuffer);
- m_dest = m_buffer;
- *m_dest++ = 0;
- state.setTagState(SearchEqual);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('a');
- break;
- }
-
- // tolower() shows up on profiles. This is faster!
- if (curchar >= 'A' && curchar <= 'Z' && !inViewSourceMode())
- m_cBuffer[cBufferPos++] = curchar + ('a' - 'A');
- else
- m_cBuffer[cBufferPos++] = curchar;
-
- m_rawAttributeBeforeValue.append(curchar);
- src.advance(m_lineNumber);
- }
- if (cBufferPos == CBUFLEN) {
- m_cBuffer[cBufferPos] = '\0';
- m_attrName = AtomicString(m_cBuffer);
- m_dest = m_buffer;
- *m_dest++ = 0;
- state.setTagState(SearchEqual);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('a');
- }
- break;
- }
- case SearchEqual:
- while (!src.isEmpty()) {
- UChar curchar = *src;
-
- if (lastIsSlash && curchar == '>') {
- // This is a quirk (with a long sad history). We have to do this
- // since widgets do <script src="foo.js"/> and expect the tag to close.
- if (m_currentToken.tagName == scriptTag)
- m_currentToken.selfClosingTag = true;
- m_currentToken.brokenXMLStyle = true;
- }
-
- // In this mode just ignore any quotes or slashes we encounter and treat them like spaces.
- if (!isASCIISpace(curchar) && curchar != '\'' && curchar != '"' && curchar != '/') {
- if (curchar == '=') {
- state.setTagState(SearchValue);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advancePastNonNewline();
- } else {
- m_currentToken.addAttribute(m_attrName, emptyAtom, inViewSourceMode());
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- lastIsSlash = false;
- }
- break;
- }
-
- lastIsSlash = curchar == '/';
-
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advance(m_lineNumber);
- }
- break;
- case SearchValue:
- while (!src.isEmpty()) {
- UChar curchar = *src;
- if (!isASCIISpace(curchar)) {
- if (curchar == '\'' || curchar == '\"') {
- tquote = curchar == '\"' ? DoubleQuote : SingleQuote;
- state.setTagState(QuotedValue);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advancePastNonNewline();
- } else
- state.setTagState(Value);
-
- break;
- }
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advance(m_lineNumber);
- }
- break;
- case QuotedValue:
- while (!src.isEmpty()) {
- checkBuffer();
-
- UChar curchar = *src;
- if (curchar <= '>' && !src.escaped()) {
- if (curchar == '>' && m_attrName.isEmpty()) {
- // Handle a case like <img '>. Just go ahead and be willing
- // to close the whole tag. Don't consume the character and
- // just go back into SearchEnd while ignoring the whole
- // value.
- // FIXME: Note that this is actually not a very good solution.
- // It doesn't handle the general case of
- // unmatched quotes among attributes that have names. -dwh
- while (m_dest > m_buffer + 1 && (m_dest[-1] == '\n' || m_dest[-1] == '\r'))
- m_dest--; // remove trailing newlines
- AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
- if (!attributeValue.contains('/'))
- m_attrName = attributeValue; // Just make the name/value match. (FIXME: Is this some WinIE quirk?)
- m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('x');
- state.setTagState(SearchAttribute);
- m_dest = m_buffer;
- tquote = NoQuote;
- break;
- }
-
- if (curchar == '&') {
- src.advancePastNonNewline();
- state = parseEntity(src, m_dest, state, cBufferPos, true, true);
- break;
- }
-
- if ((tquote == SingleQuote && curchar == '\'') || (tquote == DoubleQuote && curchar == '\"')) {
- // some <input type=hidden> rely on trailing spaces. argh
- while (m_dest > m_buffer + 1 && (m_dest[-1] == '\n' || m_dest[-1] == '\r'))
- m_dest--; // remove trailing newlines
- AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
- if (m_attrName.isEmpty() && !attributeValue.contains('/')) {
- m_attrName = attributeValue; // Make the name match the value. (FIXME: Is this a WinIE quirk?)
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('x');
- } else if (inViewSourceMode())
- m_currentToken.addViewSourceChar('v');
-
- if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeBuilder->skipMode() && m_attrName == srcAttr) {
- String context(m_rawAttributeBeforeValue.data(), m_rawAttributeBeforeValue.size());
- if (xssAuditor() && !xssAuditor()->canLoadExternalScriptFromSrc(attributeValue))
- attributeValue = blankURL().string();
- }
-
- m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- tquote = NoQuote;
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- src.advancePastNonNewline();
- break;
- }
- }
-
- *m_dest++ = curchar;
- src.advance(m_lineNumber);
- }
- break;
- case Value:
- while (!src.isEmpty()) {
- checkBuffer();
- UChar curchar = *src;
- if (curchar <= '>' && !src.escaped()) {
- // parse Entities
- if (curchar == '&') {
- src.advancePastNonNewline();
- state = parseEntity(src, m_dest, state, cBufferPos, true, true);
- break;
- }
- // no quotes. Every space means end of value
- // '/' does not delimit in IE!
- if (isASCIISpace(curchar) || curchar == '>') {
- AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
-
- if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeBuilder->skipMode() && m_attrName == srcAttr) {
- String context(m_rawAttributeBeforeValue.data(), m_rawAttributeBeforeValue.size());
- if (xssAuditor() && !xssAuditor()->canLoadExternalScriptFromSrc(attributeValue))
- attributeValue = blankURL().string();
- }
-
- m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('v');
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- break;
- }
- }
-
- *m_dest++ = curchar;
- src.advance(m_lineNumber);
- }
- break;
- case SearchEnd:
- {
- while (!src.isEmpty()) {
- UChar ch = *src;
- if (ch == '>' || ch == '<')
- break;
- if (ch == '/')
- m_currentToken.selfClosingTag = true;
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(ch);
- src.advance(m_lineNumber);
- }
- if (src.isEmpty())
- break;
-
- searchCount = 0; // Stop looking for '<!--' sequence
- state.setTagState(NoTag);
- tquote = NoQuote;
-
- if (*src != '<')
- src.advance(m_lineNumber);
-
- if (m_currentToken.tagName == nullAtom) { //stop if tag is unknown
- m_cBufferPos = cBufferPos;
- return state;
- }
-
- AtomicString tagName = m_currentToken.tagName;
-
- // Handle <script src="foo"/> like Mozilla/Opera. We have to do this now for Dashboard
- // compatibility.
- bool isSelfClosingScript = m_currentToken.selfClosingTag && m_currentToken.beginTag && m_currentToken.tagName == scriptTag;
- bool beginTag = !m_currentToken.selfClosingTag && m_currentToken.beginTag;
- if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeBuilder->skipMode()) {
- Attribute* a = 0;
- m_scriptTagSrcAttrValue = String();
- m_scriptTagCharsetAttrValue = String();
- if (m_currentToken.attrs && !m_fragment) {
- if (document()->frame() && document()->frame()->script()->canExecuteScripts(NotAboutToExecuteScript)) {
- if ((a = m_currentToken.attrs->getAttributeItem(srcAttr)))
- m_scriptTagSrcAttrValue = document()->completeURL(deprecatedParseURL(a->value())).string();
- }
- }
- }
-
- RefPtr<Node> n = processToken();
- m_cBufferPos = cBufferPos;
- if (n || inViewSourceMode()) {
- State savedState = state;
- SegmentedString savedSrc = src;
- long savedLineno = m_lineNumber;
- if ((tagName == preTag || tagName == listingTag) && !inViewSourceMode()) {
- if (beginTag)
- state.setDiscardLF(true); // Discard the first LF after we open a pre.
- } else if (tagName == scriptTag) {
- ASSERT(!m_scriptNode);
- m_scriptNode = static_pointer_cast<HTMLScriptElement>(n);
- if (m_scriptNode)
- m_scriptTagCharsetAttrValue = m_scriptNode->scriptCharset();
- if (beginTag) {
- m_searchStopper = scriptEnd;
- m_searchStopperLength = 8;
- state.setInScript(true);
- state = parseNonHTMLText(src, state);
- } else if (isSelfClosingScript) { // Handle <script src="foo"/>
- state.setInScript(true);
- state = scriptHandler(state);
- }
- } else if (tagName == styleTag) {
- if (beginTag) {
- m_searchStopper = styleEnd;
- m_searchStopperLength = 7;
- state.setInStyle(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == textareaTag) {
- if (beginTag) {
- m_searchStopper = textareaEnd;
- m_searchStopperLength = 10;
- state.setInTextArea(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == titleTag) {
- if (beginTag) {
- m_searchStopper = titleEnd;
- m_searchStopperLength = 7;
- state.setInTitle(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == xmpTag) {
- if (beginTag) {
- m_searchStopper = xmpEnd;
- m_searchStopperLength = 5;
- state.setInXmp(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == iframeTag) {
- if (beginTag) {
- m_searchStopper = iframeEnd;
- m_searchStopperLength = 8;
- state.setInIFrame(true);
- state = parseNonHTMLText(src, state);
- }
- }
- if (src.isEmpty() && (state.inTitle() || inViewSourceMode()) && !state.inComment() && !(state.inScript() && m_currentScriptTagStartLineNumber)) {
- // We just ate the rest of the document as the #text node under the special tag!
- // Reset the state then retokenize without special handling.
- // Let the parser clean up the missing close tag.
- // FIXME: This is incorrect, because src.isEmpty() doesn't mean we're
- // at the end of the document unless m_noMoreData is also true. We need
- // to detect this case elsewhere, and save the state somewhere other
- // than a local variable.
- state = savedState;
- src = savedSrc;
- m_lineNumber = savedLineno;
- m_scriptCodeSize = 0;
- }
- }
- if (tagName == plaintextTag)
- state.setInPlainText(beginTag);
- return state; // Finished parsing tag!
- }
- } // end switch
- }
- m_cBufferPos = cBufferPos;
- return state;
-}
-
-inline bool LegacyHTMLDocumentParser::continueProcessing(int& processedCount, double startTime, State &state)
-{
- // We don't want to be checking elapsed time with every character, so we only check after we've
- // processed a certain number of characters.
- bool allowedYield = state.allowYield();
- state.setAllowYield(false);
- if (!state.loadingExtScript() && !state.forceSynchronous() && !m_executingScript && (processedCount > m_tokenizerChunkSize || allowedYield)) {
- processedCount = 0;
- if (currentTime() - startTime > m_tokenizerTimeDelay) {
- /* FIXME: We'd like to yield aggressively to give stylesheets the opportunity to
- load, but this hurts overall performance on slower machines. For now turn this
- off.
- || (!document()->haveStylesheetsLoaded() &&
- (document()->documentElement()->id() != ID_HTML || document()->body()))) {*/
- // Schedule the timer to keep processing as soon as possible.
- m_timer.startOneShot(0);
- return false;
- }
- }
-
- processedCount++;
- return true;
-}
-
-// Turns the statemachine one crank using the passed in State object.
-// This does not modify m_state directly in order to be reentrant.
-ALWAYS_INLINE void LegacyHTMLDocumentParser::advance(State& state)
-{
- // do we need to enlarge the buffer?
- checkBuffer();
-
- UChar cc = *m_src;
-
- bool wasSkipLF = state.skipLF();
- if (wasSkipLF)
- state.setSkipLF(false);
-
- if (wasSkipLF && (cc == '\n'))
- m_src.advance();
- else if (state.needsSpecialWriteHandling()) {
- // it's important to keep needsSpecialWriteHandling with the flags this block tests
- if (state.hasEntityState())
- state = parseEntity(m_src, m_dest, state, m_cBufferPos, false, state.hasTagState());
- else if (state.inPlainText())
- state = parseText(m_src, state);
- else if (state.inAnyNonHTMLText())
- state = parseNonHTMLText(m_src, state);
- else if (state.inComment())
- state = parseComment(m_src, state);
- else if (state.inDoctype())
- state = parseDoctype(m_src, state);
- else if (state.inServer())
- state = parseServer(m_src, state);
- else if (state.inProcessingInstruction())
- state = parseProcessingInstruction(m_src, state);
- else if (state.hasTagState())
- state = parseTag(m_src, state);
- else if (state.startTag()) {
- state.setStartTag(false);
-
- switch (cc) {
- case '/':
- break;
- case '!': {
- // <!-- comment --> or <!DOCTYPE ...>
- searchCount = 1; // Look for '<!--' sequence to start comment or '<!DOCTYPE' sequence to start doctype
- m_doctypeSearchCount = 1;
- break;
- }
- case '?': {
- // xml processing instruction
- state.setInProcessingInstruction(true);
- tquote = NoQuote;
- state = parseProcessingInstruction(m_src, state);
- return;
- }
- case '%':
- if (!m_brokenServer) {
- // <% server stuff, handle as comment %>
- state.setInServer(true);
- tquote = NoQuote;
- state = parseServer(m_src, state);
- return;
- }
- // else fall through
- default: {
- if (((cc >= 'a') && (cc <= 'z')) || ((cc >= 'A') && (cc <= 'Z'))) {
- // Start of a Start-Tag
- } else {
- // Invalid tag
- // Add as is
- *m_dest = '<';
- m_dest++;
- return;
- }
- }
- }; // end case
-
- processToken();
-
- m_cBufferPos = 0;
- state.setTagState(TagName);
- state = parseTag(m_src, state);
- }
- } else if (cc == '&' && !m_src.escaped()) {
- m_src.advancePastNonNewline();
- state = parseEntity(m_src, m_dest, state, m_cBufferPos, true, state.hasTagState());
- } else if (cc == '<' && !m_src.escaped()) {
- m_currentTagStartLineNumber = m_lineNumber;
- m_src.advancePastNonNewline();
- state.setStartTag(true);
- state.setDiscardLF(false);
- } else if (cc == '\n' || cc == '\r') {
- if (state.discardLF())
- // Ignore this LF
- state.setDiscardLF(false); // We have discarded 1 LF
- else {
- // Process this LF
- *m_dest++ = '\n';
- if (cc == '\r' && !m_src.excludeLineNumbers())
- m_lineNumber++;
- }
-
- /* Check for MS-DOS CRLF sequence */
- if (cc == '\r')
- state.setSkipLF(true);
- m_src.advance(m_lineNumber);
- } else {
- state.setDiscardLF(false);
- *m_dest++ = cc;
- m_src.advancePastNonNewline();
- }
-}
-
-void LegacyHTMLDocumentParser::willWriteHTML(const SegmentedString& source)
-{
- #if ENABLE(INSPECTOR)
- if (InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent())
- timelineAgent->willWriteHTML(source.length(), m_lineNumber);
- #endif
-}
-
-void LegacyHTMLDocumentParser::didWriteHTML()
-{
- #if ENABLE(INSPECTOR)
- if (InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent())
- timelineAgent->didWriteHTML(m_lineNumber);
- #endif
-}
-
-void LegacyHTMLDocumentParser::write(const SegmentedString& str, bool appendData)
-{
- if (!m_buffer)
- return;
-
- if (m_parserStopped)
- return;
-
- SegmentedString source(str);
- if (m_executingScript)
- source.setExcludeLineNumbers();
-
- if ((m_executingScript && appendData) || !m_pendingScripts.isEmpty()) {
- // don't parse; we will do this later
- if (m_currentPrependingSrc)
- m_currentPrependingSrc->append(source);
- else {
- m_pendingSrc.append(source);
-#if PRELOAD_SCANNER_ENABLED
- if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
- m_preloadScanner->write(source);
-#endif
- }
- return;
- }
-
-#if PRELOAD_SCANNER_ENABLED
- if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
- m_preloadScanner->end();
-#endif
-
- if (!m_src.isEmpty())
- m_src.append(source);
- else
- setSrc(source);
-
- // Once a timer is set, it has control of when the parser continues.
- if (m_timer.isActive())
- return;
-
- bool wasInWrite = m_inWrite;
- m_inWrite = true;
-
- willWriteHTML(source);
-
- Frame* frame = document()->frame();
- State state = m_state;
- int processedCount = 0;
- double startTime = currentTime();
-
- while (!m_src.isEmpty() && (!frame || !frame->redirectScheduler()->locationChangePending())) {
- if (!continueProcessing(processedCount, startTime, state))
- break;
- advance(state);
- }
-
- didWriteHTML();
-
- m_inWrite = wasInWrite;
- m_state = state;
-
- if (m_noMoreData && !m_inWrite && !state.loadingExtScript() && !m_executingScript && !m_timer.isActive())
- end(); // this actually causes us to be deleted
-
- // After parsing, go ahead and dispatch image beforeload events, but only if we're doing
- // document parsing. For document fragments we wait, since they'll likely end up in the document by the time
- // the beforeload events fire.
- if (!m_fragment)
- ImageLoader::dispatchPendingBeforeLoadEvents();
-}
-
-void LegacyHTMLDocumentParser::insert(const SegmentedString& source)
-{
- // FIXME: forceSynchronous should always be the same as the bool passed to
- // write(). However LegacyHTMLDocumentParser uses write("", false) to pump
- // the parser (after running external scripts, etc.) thus necessitating a
- // separate state for forceSynchronous.
- bool wasForcedSynchronous = forceSynchronous();
- setForceSynchronous(true);
- write(source, false);
- setForceSynchronous(wasForcedSynchronous);
-}
-
-void LegacyHTMLDocumentParser::append(const SegmentedString& source)
-{
- write(source, true);
-}
-
-void LegacyHTMLDocumentParser::stopParsing()
-{
- DocumentParser::stopParsing();
- m_timer.stop();
-
- // FIXME: Why is LegacyHTMLDocumentParser the only DocumentParser which calls checkCompleted?
- // The FrameLoader needs to know that the parser has finished with its data,
- // regardless of whether it happened naturally or due to manual intervention.
- if (!m_fragment && document()->frame())
- document()->frame()->loader()->checkCompleted();
-}
-
-bool LegacyHTMLDocumentParser::processingData() const
-{
- return m_timer.isActive() || m_inWrite;
-}
-
-void LegacyHTMLDocumentParser::timerFired(Timer<LegacyHTMLDocumentParser>*)
-{
- if (document()->view() && document()->view()->layoutPending() && !document()->minimumLayoutDelay()) {
- // Restart the timer and let layout win. This is basically a way of ensuring that the layout
- // timer has higher priority than our timer.
- m_timer.startOneShot(0);
- return;
- }
-
- // Invoke write() as though more data came in. This might cause us to get deleted.
- write(SegmentedString(), true);
-}
-
-void LegacyHTMLDocumentParser::end()
-{
- ASSERT(!m_timer.isActive());
- m_timer.stop(); // Only helps if assertion above fires, but do it anyway.
-
- if (m_buffer) {
- // parseTag is using the buffer for different matters
- if (!m_state.hasTagState())
- processToken();
-
- fastFree(m_scriptCode);
- m_scriptCode = 0;
- m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
-
- fastFree(m_buffer);
- m_buffer = 0;
- }
-
- if (!inViewSourceMode())
- m_treeBuilder->finished();
- else
- document()->finishedParsing();
-}
-
-void LegacyHTMLDocumentParser::finish()
-{
- // do this as long as we don't find matching comment ends
- while ((m_state.inComment() || m_state.inServer()) && m_scriptCode && m_scriptCodeSize) {
- // we've found an unmatched comment start
- if (m_state.inComment())
- m_brokenComments = true;
- else
- m_brokenServer = true;
- checkScriptBuffer();
- m_scriptCode[m_scriptCodeSize] = 0;
- m_scriptCode[m_scriptCodeSize + 1] = 0;
- int pos;
- String food;
- if (m_state.inScript() || m_state.inStyle() || m_state.inTextArea())
- food = String(m_scriptCode, m_scriptCodeSize);
- else if (m_state.inServer()) {
- food = "<";
- food.append(m_scriptCode, m_scriptCodeSize);
- } else {
- pos = find(m_scriptCode, m_scriptCodeSize, '>');
- food = String(m_scriptCode + pos + 1, m_scriptCodeSize - pos - 1);
- }
- fastFree(m_scriptCode);
- m_scriptCode = 0;
- m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
- m_state.setInComment(false);
- m_state.setInServer(false);
- if (!food.isEmpty())
- write(food, true);
- }
- // this indicates we will not receive any more data... but if we are waiting on
- // an external script to load, we can't finish parsing until that is done
- m_noMoreData = true;
- if (!m_inWrite && !m_state.loadingExtScript() && !m_executingScript && !m_timer.isActive())
- end(); // this actually causes us to be deleted
-}
-
-bool LegacyHTMLDocumentParser::finishWasCalled()
-{
- return m_noMoreData;
-}
-
-PassRefPtr<Node> LegacyHTMLDocumentParser::processToken()
-{
- if (m_dest > m_buffer) {
- m_currentToken.text = StringImpl::createStrippingNullCharacters(m_buffer, m_dest - m_buffer);
- if (m_currentToken.tagName != commentAtom)
- m_currentToken.tagName = textAtom;
- } else if (m_currentToken.tagName == nullAtom) {
- m_currentToken.reset();
- return 0;
- }
-
- m_dest = m_buffer;
-
- RefPtr<Node> n;
-
- if (!m_parserStopped) {
- if (NamedNodeMap* map = m_currentToken.attrs.get())
- map->shrinkToLength();
- if (inViewSourceMode())
- static_cast<HTMLViewSourceDocument*>(document())->addViewSourceToken(&m_currentToken);
- else
- // pass the token over to the parser, the parser DOES NOT delete the token
- n = m_treeBuilder->parseToken(&m_currentToken);
- }
- m_currentToken.reset();
-
- return n.release();
-}
-
-void LegacyHTMLDocumentParser::processDoctypeToken()
-{
- if (inViewSourceMode())
- static_cast<HTMLViewSourceDocument*>(document())->addViewSourceDoctypeToken(&m_doctypeToken);
- else
- m_treeBuilder->parseDoctypeToken(&m_doctypeToken);
-}
-
-LegacyHTMLDocumentParser::~LegacyHTMLDocumentParser()
-{
- ASSERT(!m_inWrite);
- reset();
-}
-
-
-void LegacyHTMLDocumentParser::enlargeBuffer(int len)
-{
- // Resize policy: Always at least double the size of the buffer each time.
- int delta = max(len, m_bufferSize);
-
- // Check for overflow.
- // For now, handle overflow the same way we handle fastRealloc failure, with CRASH.
- static const int maxSize = INT_MAX / sizeof(UChar);
- if (delta > maxSize - m_bufferSize)
- CRASH();
-
- int newSize = m_bufferSize + delta;
- int oldOffset = m_dest - m_buffer;
- m_buffer = static_cast<UChar*>(fastRealloc(m_buffer, newSize * sizeof(UChar)));
- m_dest = m_buffer + oldOffset;
- m_bufferSize = newSize;
-}
-
-void LegacyHTMLDocumentParser::enlargeScriptBuffer(int len)
-{
- // Resize policy: Always at least double the size of the buffer each time.
- int delta = max(len, m_scriptCodeCapacity);
-
- // Check for overflow.
- // For now, handle overflow the same way we handle fastRealloc failure, with CRASH.
- static const int maxSize = INT_MAX / sizeof(UChar);
- if (delta > maxSize - m_scriptCodeCapacity)
- CRASH();
-
- int newSize = m_scriptCodeCapacity + delta;
- // If we allow fastRealloc(ptr, 0), it will call CRASH(). We run into this
- // case if the HTML being parsed begins with "<!--" and there's more data
- // coming.
- if (!newSize) {
- ASSERT(!m_scriptCode);
- return;
- }
-
- m_scriptCode = static_cast<UChar*>(fastRealloc(m_scriptCode, newSize * sizeof(UChar)));
- m_scriptCodeCapacity = newSize;
-}
-
-void LegacyHTMLDocumentParser::executeScriptsWaitingForStylesheets()
-{
- ASSERT(document()->haveStylesheetsLoaded());
-
- if (m_hasScriptsWaitingForStylesheets)
- notifyFinished(0);
-}
-
-void LegacyHTMLDocumentParser::notifyFinished(CachedResource*)
-{
- executeExternalScriptsIfReady();
-}
-
-void LegacyHTMLDocumentParser::executeExternalScriptsIfReady()
-{
- ASSERT(!m_pendingScripts.isEmpty());
-
- // Make external scripts wait for external stylesheets.
- // FIXME: This needs to be done for inline scripts too.
- m_hasScriptsWaitingForStylesheets = !document()->haveStylesheetsLoaded();
- if (m_hasScriptsWaitingForStylesheets)
- return;
-
- bool finished = false;
-
- double startTime = currentTime();
- while (!finished && m_pendingScripts.first()->isLoaded()) {
- if (!continueExecutingExternalScripts(startTime))
- break;
-
- CachedResourceHandle<CachedScript> cs = m_pendingScripts.takeFirst();
- ASSERT(cache()->disabled() || cs->accessCount() > 0);
-
- setSrc(SegmentedString());
-
- // make sure we forget about the script before we execute the new one
- // infinite recursion might happen otherwise
- ScriptSourceCode sourceCode(cs.get());
- bool errorOccurred = cs->errorOccurred();
- cs->removeClient(this);
-
- RefPtr<Node> n = m_scriptNode.release();
-
- if (errorOccurred)
- n->dispatchEvent(Event::create(eventNames().errorEvent, true, false));
- else {
- if (static_cast<HTMLScriptElement*>(n.get())->shouldExecuteAsJavaScript())
- m_state = scriptExecution(sourceCode, m_state);
-#if ENABLE(XHTMLMP)
- else
- document()->setShouldProcessNoscriptElement(true);
-#endif
- n->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
- }
-
- // The state of m_pendingScripts.isEmpty() can change inside the scriptExecution()
- // call above, so test afterwards.
- finished = m_pendingScripts.isEmpty();
- if (finished) {
- ASSERT(!m_hasScriptsWaitingForStylesheets);
- m_state.setLoadingExtScript(false);
- } else if (m_hasScriptsWaitingForStylesheets) {
- // m_hasScriptsWaitingForStylesheets flag might have changed during the script execution.
- // If it did we are now blocked waiting for stylesheets and should not execute more scripts until they arrive.
- finished = true;
- }
-
- // 'm_requestingScript' is true when we are called synchronously from
- // scriptHandler(). In that case scriptHandler() will take care
- // of m_pendingSrc.
- if (!m_requestingScript) {
- SegmentedString rest = m_pendingSrc;
- m_pendingSrc.clear();
- write(rest, false);
- // we might be deleted at this point, do not access any members.
- }
- }
-}
-
-void LegacyHTMLDocumentParser::executeExternalScriptsTimerFired(Timer<LegacyHTMLDocumentParser>*)
-{
- if (document()->view() && document()->view()->layoutPending() && !document()->minimumLayoutDelay()) {
- // Restart the timer and do layout first.
- m_externalScriptsTimer.startOneShot(0);
- return;
- }
-
- // Continue executing external scripts.
- executeExternalScriptsIfReady();
-}
-
-bool LegacyHTMLDocumentParser::continueExecutingExternalScripts(double startTime)
-{
- if (m_externalScriptsTimer.isActive())
- return false;
-
- if (currentTime() - startTime > m_tokenizerTimeDelay) {
- // Schedule the timer to keep processing as soon as possible.
- m_externalScriptsTimer.startOneShot(0);
- return false;
- }
- return true;
-}
-
-bool LegacyHTMLDocumentParser::isWaitingForScripts() const
-{
- return m_state.loadingExtScript();
-}
-
-void LegacyHTMLDocumentParser::setSrc(const SegmentedString& source)
-{
- m_src = source;
-}
-
-void LegacyHTMLDocumentParser::parseDocumentFragment(const String& source, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
-{
- LegacyHTMLDocumentParser parser(fragment, scriptingPermission);
- parser.setForceSynchronous(true);
- parser.write(source, true);
- parser.finish();
- ASSERT(!parser.processingData()); // make sure we're done (see 3963151)
-}
-
-UChar decodeNamedEntity(const char* name)
-{
- const Entity* e = findEntity(name, strlen(name));
- return e ? e->code : 0;
-}
-
-}
diff --git a/WebCore/html/LegacyHTMLDocumentParser.h b/WebCore/html/LegacyHTMLDocumentParser.h
deleted file mode 100644
index 49e6976..0000000
--- a/WebCore/html/LegacyHTMLDocumentParser.h
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- Copyright (C) 1997 Martin Jones (mjones@kde.org)
- (C) 1997 Torben Weis (weis@kde.org)
- (C) 1998 Waldo Bastian (bastian@kde.org)
- (C) 2001 Dirk Mueller (mueller@kde.org)
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- 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 LegacyHTMLDocumentParser_h
-#define LegacyHTMLDocumentParser_h
-
-#include "CachedResourceClient.h"
-#include "CachedResourceHandle.h"
-#include "FragmentScriptingPermission.h"
-#include "NamedNodeMap.h"
-#include "ScriptableDocumentParser.h"
-#include "SegmentedString.h"
-#include "Timer.h"
-#include <wtf/Deque.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class CachedScript;
-class DocumentFragment;
-class Document;
-class HTMLDocument;
-class HTMLScriptElement;
-class HTMLViewSourceDocument;
-class FrameView;
-class LegacyHTMLTreeBuilder;
-class Node;
-class LegacyPreloadScanner;
-class ScriptSourceCode;
-
-/**
- * @internal
- * represents one HTML tag. Consists of a numerical id, and the list
- * of attributes. Can also represent text. In this case the id = 0 and
- * text contains the text.
- */
-struct Token {
- Token()
- : beginTag(true)
- , selfClosingTag(false)
- , brokenXMLStyle(false)
- , m_sourceInfo(0)
- { }
- ~Token() { }
-
- void addAttribute(AtomicString& attrName, const AtomicString& v, bool viewSourceMode);
-
- bool isOpenTag(const QualifiedName& fullName) const { return beginTag && fullName.localName() == tagName; }
- bool isCloseTag(const QualifiedName& fullName) const { return !beginTag && fullName.localName() == tagName; }
-
- void reset()
- {
- attrs = 0;
- text = 0;
- tagName = nullAtom;
- beginTag = true;
- selfClosingTag = false;
- brokenXMLStyle = false;
- if (m_sourceInfo)
- m_sourceInfo->clear();
- }
-
- void addViewSourceChar(UChar c) { if (!m_sourceInfo.get()) m_sourceInfo.set(new Vector<UChar>); m_sourceInfo->append(c); }
-
- RefPtr<NamedNodeMap> attrs;
- RefPtr<StringImpl> text;
- AtomicString tagName;
- bool beginTag;
- bool selfClosingTag;
- bool brokenXMLStyle;
- OwnPtr<Vector<UChar> > m_sourceInfo;
-};
-
-enum DoctypeState {
- DoctypeBegin,
- DoctypeBeforeName,
- DoctypeName,
- DoctypeAfterName,
- DoctypeBeforePublicID,
- DoctypePublicID,
- DoctypeAfterPublicID,
- DoctypeBeforeSystemID,
- DoctypeSystemID,
- DoctypeAfterSystemID,
- DoctypeBogus
-};
-
-class DoctypeToken {
-public:
- DoctypeToken() {}
-
- void reset()
- {
- m_name.clear();
- m_publicID.clear();
- m_systemID.clear();
- m_state = DoctypeBegin;
- m_source.clear();
- m_forceQuirks = false;
- }
-
- DoctypeState state() { return m_state; }
- void setState(DoctypeState s) { m_state = s; }
-
- Vector<UChar> m_name;
- Vector<UChar> m_publicID;
- Vector<UChar> m_systemID;
- DoctypeState m_state;
-
- Vector<UChar> m_source;
-
- bool m_forceQuirks; // Used by the HTML5 parser.
-};
-
-//-----------------------------------------------------------------------------
-
-// FIXME: This class does too much. Right now it is both an HTML tokenizer as well
-// as handling all of the non-tokenizer-specific junk related to tokenizing HTML
-// (like dealing with <script> tags). The HTML tokenizer bits should be pushed
-// down into a separate HTML tokenizer class.
-
-class LegacyHTMLDocumentParser : public ScriptableDocumentParser, public CachedResourceClient {
-public:
- LegacyHTMLDocumentParser(HTMLDocument*, bool reportErrors);
- LegacyHTMLDocumentParser(HTMLViewSourceDocument*);
- LegacyHTMLDocumentParser(DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
- virtual ~LegacyHTMLDocumentParser();
-
- bool forceSynchronous() const { return m_state.forceSynchronous(); }
- void setForceSynchronous(bool force);
-
- static void parseDocumentFragment(const String&, DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
-
-protected:
- // Exposed for FTPDirectoryDocumentParser
- virtual void insert(const SegmentedString&);
- virtual void finish();
-
-private:
- // ScriptableDocumentParser
- virtual void append(const SegmentedString&);
- virtual bool finishWasCalled();
- virtual bool isWaitingForScripts() const;
- virtual void stopParsing();
- virtual bool processingData() const;
- virtual bool isExecutingScript() const { return !!m_executingScript; }
-
- virtual int lineNumber() const { return m_lineNumber; }
- virtual int columnNumber() const { return 1; }
-
- virtual bool processingContentWrittenByScript() const { return m_src.excludeLineNumbers(); }
-
- virtual void executeScriptsWaitingForStylesheets();
-
- virtual LegacyHTMLTreeBuilder* htmlTreeBuilder() const { return m_treeBuilder.get(); }
-
- class State;
-
- void begin();
- void end();
- void reset();
-
- void willWriteHTML(const SegmentedString&);
- void write(const SegmentedString&, bool appendData);
- ALWAYS_INLINE void advance(State&);
- void didWriteHTML();
-
- PassRefPtr<Node> processToken();
- void processDoctypeToken();
-
- State processListing(SegmentedString, State);
- State parseComment(SegmentedString&, State);
- State parseDoctype(SegmentedString&, State);
- State parseServer(SegmentedString&, State);
- State parseText(SegmentedString&, State);
- State parseNonHTMLText(SegmentedString&, State);
- State parseTag(SegmentedString&, State);
- State parseEntity(SegmentedString&, UChar*& dest, State, unsigned& cBufferPos, bool start, bool parsingTag);
- State parseProcessingInstruction(SegmentedString&, State);
- State scriptHandler(State);
- State scriptExecution(const ScriptSourceCode&, State);
- void setSrc(const SegmentedString&);
-
- // check if we have enough space in the buffer.
- // if not enlarge it
- inline void checkBuffer(int len = 10)
- {
- if ((m_dest - m_buffer) > m_bufferSize - len)
- enlargeBuffer(len);
- }
-
- inline void checkScriptBuffer(int len = 10)
- {
- if (m_scriptCodeSize + len >= m_scriptCodeCapacity)
- enlargeScriptBuffer(len);
- }
-
- void enlargeBuffer(int len);
- void enlargeScriptBuffer(int len);
-
- bool continueProcessing(int& processedCount, double startTime, State&);
- void timerFired(Timer<LegacyHTMLDocumentParser>*);
- void allDataProcessed();
-
- // from CachedResourceClient
- void notifyFinished(CachedResource*);
-
- void executeExternalScriptsIfReady();
- void executeExternalScriptsTimerFired(Timer<LegacyHTMLDocumentParser>*);
- bool continueExecutingExternalScripts(double startTime);
-
- // Internal buffers
- ///////////////////
- UChar* m_buffer;
- int m_bufferSize;
- UChar* m_dest;
-
- Token m_currentToken;
-
- // This buffer holds the raw characters we've seen between the beginning of
- // the attribute name and the first character of the attribute value.
- Vector<UChar, 32> m_rawAttributeBeforeValue;
-
- // DocumentParser flags
- //////////////////
- // are we in quotes within a html tag
- enum { NoQuote, SingleQuote, DoubleQuote } tquote;
-
- // Are we in a &... character entity description?
- enum EntityState {
- NoEntity = 0,
- SearchEntity = 1,
- NumericSearch = 2,
- Hexadecimal = 3,
- Decimal = 4,
- EntityName = 5,
- SearchSemicolon = 6
- };
- unsigned EntityUnicodeValue;
-
- enum TagState {
- NoTag = 0,
- TagName = 1,
- SearchAttribute = 2,
- AttributeName = 3,
- SearchEqual = 4,
- SearchValue = 5,
- QuotedValue = 6,
- Value = 7,
- SearchEnd = 8
- };
-
- class State {
- public:
- State() : m_bits(0) { }
-
- TagState tagState() const { return static_cast<TagState>(m_bits & TagMask); }
- void setTagState(TagState t) { m_bits = (m_bits & ~TagMask) | t; }
- EntityState entityState() const { return static_cast<EntityState>((m_bits & EntityMask) >> EntityShift); }
- void setEntityState(EntityState e) { m_bits = (m_bits & ~EntityMask) | (e << EntityShift); }
-
- bool inScript() const { return testBit(InScript); }
- void setInScript(bool v) { setBit(InScript, v); }
- bool inStyle() const { return testBit(InStyle); }
- void setInStyle(bool v) { setBit(InStyle, v); }
- bool inXmp() const { return testBit(InXmp); }
- void setInXmp(bool v) { setBit(InXmp, v); }
- bool inTitle() const { return testBit(InTitle); }
- void setInTitle(bool v) { setBit(InTitle, v); }
- bool inIFrame() const { return testBit(InIFrame); }
- void setInIFrame(bool v) { setBit(InIFrame, v); }
- bool inPlainText() const { return testBit(InPlainText); }
- void setInPlainText(bool v) { setBit(InPlainText, v); }
- bool inProcessingInstruction() const { return testBit(InProcessingInstruction); }
- void setInProcessingInstruction(bool v) { return setBit(InProcessingInstruction, v); }
- bool inComment() const { return testBit(InComment); }
- void setInComment(bool v) { setBit(InComment, v); }
- bool inDoctype() const { return testBit(InDoctype); }
- void setInDoctype(bool v) { setBit(InDoctype, v); }
- bool inTextArea() const { return testBit(InTextArea); }
- void setInTextArea(bool v) { setBit(InTextArea, v); }
- bool escaped() const { return testBit(Escaped); }
- void setEscaped(bool v) { setBit(Escaped, v); }
- bool inServer() const { return testBit(InServer); }
- void setInServer(bool v) { setBit(InServer, v); }
- bool skipLF() const { return testBit(SkipLF); }
- void setSkipLF(bool v) { setBit(SkipLF, v); }
- bool startTag() const { return testBit(StartTag); }
- void setStartTag(bool v) { setBit(StartTag, v); }
- bool discardLF() const { return testBit(DiscardLF); }
- void setDiscardLF(bool v) { setBit(DiscardLF, v); }
- bool allowYield() const { return testBit(AllowYield); }
- void setAllowYield(bool v) { setBit(AllowYield, v); }
- bool loadingExtScript() const { return testBit(LoadingExtScript); }
- void setLoadingExtScript(bool v) { setBit(LoadingExtScript, v); }
- bool forceSynchronous() const { return testBit(ForceSynchronous); }
- void setForceSynchronous(bool v) { setBit(ForceSynchronous, v); }
-
- bool inAnyNonHTMLText() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame); }
- bool hasTagState() const { return m_bits & TagMask; }
- bool hasEntityState() const { return m_bits & EntityMask; }
-
- bool needsSpecialWriteHandling() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame | TagMask | EntityMask | InPlainText | InComment | InDoctype | InServer | InProcessingInstruction | StartTag); }
-
- private:
- static const int EntityShift = 4;
- enum StateBits {
- TagMask = (1 << 4) - 1,
- EntityMask = (1 << 7) - (1 << 4),
- InScript = 1 << 7,
- InStyle = 1 << 8,
- // Bit 9 unused
- InXmp = 1 << 10,
- InTitle = 1 << 11,
- InPlainText = 1 << 12,
- InProcessingInstruction = 1 << 13,
- InComment = 1 << 14,
- InTextArea = 1 << 15,
- Escaped = 1 << 16,
- InServer = 1 << 17,
- SkipLF = 1 << 18,
- StartTag = 1 << 19,
- DiscardLF = 1 << 20, // FIXME: should clarify difference between skip and discard
- AllowYield = 1 << 21,
- LoadingExtScript = 1 << 22,
- ForceSynchronous = 1 << 23,
- InIFrame = 1 << 24,
- InDoctype = 1 << 25
- };
-
- void setBit(StateBits bit, bool value)
- {
- if (value)
- m_bits |= bit;
- else
- m_bits &= ~bit;
- }
- bool testBit(StateBits bit) const { return m_bits & bit; }
-
- unsigned m_bits;
- };
-
- State m_state;
-
- DoctypeToken m_doctypeToken;
- int m_doctypeSearchCount;
- int m_doctypeSecondarySearchCount;
-
- bool m_brokenServer;
-
- // Name of an attribute that we just scanned.
- AtomicString m_attrName;
-
- // Used to store the code of a scripting sequence
- UChar* m_scriptCode;
- // Size of the script sequenze stored in @ref #scriptCode
- int m_scriptCodeSize;
- // Maximal size that can be stored in @ref #scriptCode
- int m_scriptCodeCapacity;
- // resync point of script code size
- int m_scriptCodeResync;
-
- // Stores characters if we are scanning for a string like "</script>"
- UChar searchBuffer[10];
-
- // Counts where we are in the string we are scanning for
- int searchCount;
- // the stopper string
- const char* m_searchStopper;
- int m_searchStopperLength;
-
- // if no more data is coming, just parse what we have (including ext scripts that
- // may be still downloading) and finish
- bool m_noMoreData;
- // URL to get source code of script from
- String m_scriptTagSrcAttrValue;
- String m_scriptTagCharsetAttrValue;
- // the HTML code we will parse after the external script we are waiting for has loaded
- SegmentedString m_pendingSrc;
-
- // the HTML code we will parse after this particular script has
- // loaded, but before all pending HTML
- SegmentedString* m_currentPrependingSrc;
-
- // true if we are executing a script while parsing a document. This causes the parsing of
- // the output of the script to be postponed until after the script has finished executing
- int m_executingScript;
- Deque<CachedResourceHandle<CachedScript> > m_pendingScripts;
- RefPtr<HTMLScriptElement> m_scriptNode;
-
- bool m_requestingScript;
- bool m_hasScriptsWaitingForStylesheets;
-
- // if we found one broken comment, there are most likely others as well
- // store a flag to get rid of the O(n^2) behaviour in such a case.
- bool m_brokenComments;
- // current line number
- int m_lineNumber;
- int m_currentScriptTagStartLineNumber;
- int m_currentTagStartLineNumber;
-
- double m_tokenizerTimeDelay;
- int m_tokenizerChunkSize;
-
- // The timer for continued processing.
- Timer<LegacyHTMLDocumentParser> m_timer;
-
- // The timer for continued executing external scripts.
- Timer<LegacyHTMLDocumentParser> m_externalScriptsTimer;
-
-// This buffer can hold arbitrarily long user-defined attribute names, such as in EMBED tags.
-// So any fixed number might be too small, but rather than rewriting all usage of this buffer
-// we'll just make it large enough to handle all imaginable cases.
-#define CBUFLEN 1024
- UChar m_cBuffer[CBUFLEN + 2];
- unsigned int m_cBufferPos;
-
- SegmentedString m_src;
- OwnPtr<LegacyHTMLTreeBuilder> m_treeBuilder;
- bool m_inWrite;
- bool m_fragment;
- FragmentScriptingPermission m_scriptingPermission;
-
- OwnPtr<LegacyPreloadScanner> m_preloadScanner;
-};
-
-UChar decodeNamedEntity(const char*);
-
-} // namespace WebCore
-
-#endif // LegacyHTMLDocumentParser_h
diff --git a/WebCore/html/LegacyHTMLTreeBuilder.cpp b/WebCore/html/LegacyHTMLTreeBuilder.cpp
index ee0bcfc..f39579c 100644
--- a/WebCore/html/LegacyHTMLTreeBuilder.cpp
+++ b/WebCore/html/LegacyHTMLTreeBuilder.cpp
@@ -52,9 +52,9 @@
#include "HTMLTableCellElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLTableSectionElement.h"
-#include "LegacyHTMLDocumentParser.h"
#include "LocalizedStrings.h"
#include "Page.h"
+#include "ScriptableDocumentParser.h"
#include "Settings.h"
#include "Text.h"
#include "TreeDepthLimit.h"
diff --git a/WebCore/html/LegacyHTMLTreeBuilder.h b/WebCore/html/LegacyHTMLTreeBuilder.h
index 4ac8413..ed2b857 100644
--- a/WebCore/html/LegacyHTMLTreeBuilder.h
+++ b/WebCore/html/LegacyHTMLTreeBuilder.h
@@ -26,6 +26,7 @@
#include "FragmentScriptingPermission.h"
#include "HTMLParserErrorCodes.h"
+#include "NamedNodeMap.h"
#include "QualifiedName.h"
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
@@ -44,7 +45,97 @@ class HTMLParserQuirks;
class Node;
struct HTMLStackElem;
-struct Token;
+
+/**
+ * @internal
+ * represents one HTML tag. Consists of a numerical id, and the list
+ * of attributes. Can also represent text. In this case the id = 0 and
+ * text contains the text.
+ */
+struct Token {
+ Token()
+ : beginTag(true)
+ , selfClosingTag(false)
+ , brokenXMLStyle(false)
+ , m_sourceInfo(0)
+ { }
+ ~Token() { }
+
+ void addAttribute(AtomicString& attrName, const AtomicString& v, bool viewSourceMode);
+
+ bool isOpenTag(const QualifiedName& fullName) const { return beginTag && fullName.localName() == tagName; }
+ bool isCloseTag(const QualifiedName& fullName) const { return !beginTag && fullName.localName() == tagName; }
+
+ void reset()
+ {
+ attrs = 0;
+ text = 0;
+ tagName = nullAtom;
+ beginTag = true;
+ selfClosingTag = false;
+ brokenXMLStyle = false;
+ if (m_sourceInfo)
+ m_sourceInfo->clear();
+ }
+
+ void addViewSourceChar(UChar c)
+ {
+ if (!m_sourceInfo.get())
+ m_sourceInfo.set(new Vector<UChar>);
+ m_sourceInfo->append(c);
+ }
+
+ RefPtr<NamedNodeMap> attrs;
+ RefPtr<StringImpl> text;
+ AtomicString tagName;
+ bool beginTag;
+ bool selfClosingTag;
+ bool brokenXMLStyle;
+ OwnPtr<Vector<UChar> > m_sourceInfo;
+};
+
+enum DoctypeState {
+ DoctypeBegin,
+ DoctypeBeforeName,
+ DoctypeName,
+ DoctypeAfterName,
+ DoctypeBeforePublicID,
+ DoctypePublicID,
+ DoctypeAfterPublicID,
+ DoctypeBeforeSystemID,
+ DoctypeSystemID,
+ DoctypeAfterSystemID,
+ DoctypeBogus
+};
+
+class DoctypeToken {
+public:
+ DoctypeToken() {}
+
+ void reset()
+ {
+ m_name.clear();
+ m_publicID.clear();
+ m_systemID.clear();
+ m_state = DoctypeBegin;
+ m_source.clear();
+ m_forceQuirks = false;
+ }
+
+ DoctypeState state() { return m_state; }
+ void setState(DoctypeState s) { m_state = s; }
+
+ Vector<UChar> m_name;
+ Vector<UChar> m_publicID;
+ Vector<UChar> m_systemID;
+ DoctypeState m_state;
+
+ Vector<UChar> m_source;
+
+ bool m_forceQuirks; // Used by the HTML5 parser.
+};
+
+//-----------------------------------------------------------------------------
/**
* The parser for HTML. It receives a stream of tokens from the LegacyHTMLDocumentParser, and
diff --git a/WebCore/html/LegacyPreloadScanner.cpp b/WebCore/html/LegacyPreloadScanner.cpp
deleted file mode 100644
index c9fda4f..0000000
--- a/WebCore/html/LegacyPreloadScanner.cpp
+++ /dev/null
@@ -1,856 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.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 INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyPreloadScanner.h"
-
-#include "AtomicString.h"
-#include "CachedCSSStyleSheet.h"
-#include "CachedImage.h"
-#include "CachedResource.h"
-#include "CachedResourceClient.h"
-#include "CachedScript.h"
-#include "CSSHelper.h"
-#include "DocLoader.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "HTMLLinkElement.h"
-#include "HTMLNames.h"
-#include <wtf/text/CString.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/unicode/Unicode.h>
-
-// Use __GNUC__ instead of PLATFORM(GCC) to stay consistent with the gperf generated c file
-#ifdef __GNUC__
-// The main tokenizer includes this too so we are getting two copies of the data. However, this way the code gets inlined.
-#include "HTMLEntityNames.cpp"
-#else
-// Not inlined for non-GCC compilers
-struct Entity {
- const char* name;
- int code;
-};
-const struct Entity* findEntity(register const char* str, register unsigned int len);
-#endif
-
-#define PRELOAD_DEBUG 0
-
-using namespace WTF;
-
-namespace WebCore {
-
-using namespace HTMLNames;
-
-LegacyPreloadScanner::LegacyPreloadScanner(Document* doc)
- : m_inProgress(false)
- , m_timeUsed(0)
- , m_bodySeen(false)
- , m_document(doc)
-{
-#if PRELOAD_DEBUG
- printf("CREATING PRELOAD SCANNER FOR %s\n", m_document->url().string().latin1().data());
-#endif
-}
-
-LegacyPreloadScanner::~LegacyPreloadScanner()
-{
-#if PRELOAD_DEBUG
- printf("DELETING PRELOAD SCANNER FOR %s\n", m_document->url().string().latin1().data());
- printf("TOTAL TIME USED %.4fs\n", m_timeUsed);
-#endif
-}
-
-void LegacyPreloadScanner::begin()
-{
- ASSERT(!m_inProgress);
- reset();
- m_inProgress = true;
-}
-
-void LegacyPreloadScanner::end()
-{
- ASSERT(m_inProgress);
- m_inProgress = false;
-}
-
-void LegacyPreloadScanner::reset()
-{
- m_source.clear();
-
- m_state = Data;
- m_escape = false;
- m_contentModel = PCDATA;
- m_commentPos = 0;
-
- m_closeTag = false;
- m_tagName.clear();
- m_attributeName.clear();
- m_attributeValue.clear();
- m_lastStartTag = AtomicString();
-
- m_urlToLoad = String();
- m_charset = String();
- m_linkIsStyleSheet = false;
- m_lastCharacterIndex = 0;
- clearLastCharacters();
-
- m_cssState = CSSInitial;
- m_cssRule.clear();
- m_cssRuleValue.clear();
-}
-
-bool LegacyPreloadScanner::scanningBody() const
-{
- return m_document->body() || m_bodySeen;
-}
-
-void LegacyPreloadScanner::write(const SegmentedString& source)
-{
-#if PRELOAD_DEBUG
- double startTime = currentTime();
-#endif
- tokenize(source);
-#if PRELOAD_DEBUG
- m_timeUsed += currentTime() - startTime;
-#endif
-}
-
-static inline bool isWhitespace(UChar c)
-{
- return c == ' ' || c == '\n' || c == '\r' || c == '\t';
-}
-
-inline void LegacyPreloadScanner::clearLastCharacters()
-{
- memset(m_lastCharacters, 0, lastCharactersBufferSize * sizeof(UChar));
-}
-
-inline void LegacyPreloadScanner::rememberCharacter(UChar c)
-{
- m_lastCharacterIndex = (m_lastCharacterIndex + 1) % lastCharactersBufferSize;
- m_lastCharacters[m_lastCharacterIndex] = c;
-}
-
-inline bool LegacyPreloadScanner::lastCharactersMatch(const char* chars, unsigned count) const
-{
- unsigned pos = m_lastCharacterIndex;
- while (count) {
- if (chars[count - 1] != m_lastCharacters[pos])
- return false;
- --count;
- if (!pos)
- pos = lastCharactersBufferSize;
- --pos;
- }
- return true;
-}
-
-static inline unsigned legalEntityFor(unsigned value)
-{
- // FIXME There is a table for more exceptions in the HTML5 specification.
- if (value == 0 || value > 0x10FFFF || (value >= 0xD800 && value <= 0xDFFF))
- return 0xFFFD;
- return value;
-}
-
-unsigned LegacyPreloadScanner::consumeEntity(SegmentedString& source, bool& notEnoughCharacters)
-{
- enum EntityState {
- Initial,
- NumberType,
- MaybeHex,
- Hex,
- Decimal,
- Named
- };
- EntityState entityState = Initial;
- unsigned result = 0;
- Vector<UChar, 10> seenChars;
- Vector<char, 10> entityName;
-
- while (!source.isEmpty()) {
- UChar cc = *source;
- seenChars.append(cc);
- switch (entityState) {
- case Initial:
- if (isWhitespace(cc) || cc == '<' || cc == '&')
- return 0;
- else if (cc == '#')
- entityState = NumberType;
- else if ((cc >= 'a' && cc <= 'z') || (cc >= 'A' && cc <= 'Z')) {
- entityName.append(cc);
- entityState = Named;
- } else
- return 0;
- break;
- case NumberType:
- if (cc == 'x' || cc == 'X')
- entityState = MaybeHex;
- else if (cc >= '0' && cc <= '9') {
- entityState = Decimal;
- result = cc - '0';
- } else {
- source.push('#');
- return 0;
- }
- break;
- case MaybeHex:
- if (cc >= '0' && cc <= '9')
- result = cc - '0';
- else if (cc >= 'a' && cc <= 'f')
- result = 10 + cc - 'a';
- else if (cc >= 'A' && cc <= 'F')
- result = 10 + cc - 'A';
- else {
- source.push('#');
- source.push(seenChars[1]);
- return 0;
- }
- entityState = Hex;
- break;
- case Hex:
- if (cc >= '0' && cc <= '9')
- result = result * 16 + cc - '0';
- else if (cc >= 'a' && cc <= 'f')
- result = result * 16 + 10 + cc - 'a';
- else if (cc >= 'A' && cc <= 'F')
- result = result * 16 + 10 + cc - 'A';
- else if (cc == ';') {
- source.advance();
- return legalEntityFor(result);
- } else
- return legalEntityFor(result);
- break;
- case Decimal:
- if (cc >= '0' && cc <= '9')
- result = result * 10 + cc - '0';
- else if (cc == ';') {
- source.advance();
- return legalEntityFor(result);
- } else
- return legalEntityFor(result);
- break;
- case Named:
- // This is the attribute only version, generic version matches somewhat differently
- while (entityName.size() <= 8) {
- if (cc == ';') {
- const Entity* entity = findEntity(entityName.data(), entityName.size());
- if (entity) {
- source.advance();
- return entity->code;
- }
- break;
- }
- if (!(cc >= 'a' && cc <= 'z') && !(cc >= 'A' && cc <= 'Z') && !(cc >= '0' && cc <= '9')) {
- const Entity* entity = findEntity(entityName.data(), entityName.size());
- if (entity)
- return entity->code;
- break;
- }
- entityName.append(cc);
- source.advance();
- if (source.isEmpty())
- goto outOfCharacters;
- cc = *source;
- seenChars.append(cc);
- }
- if (seenChars.size() == 2)
- source.push(seenChars[0]);
- else if (seenChars.size() == 3) {
- source.push(seenChars[0]);
- source.push(seenChars[1]);
- } else
- source.prepend(SegmentedString(String(seenChars.data(), seenChars.size() - 1)));
- return 0;
- }
- source.advance();
- }
-outOfCharacters:
- notEnoughCharacters = true;
- source.prepend(SegmentedString(String(seenChars.data(), seenChars.size())));
- return 0;
-}
-
-void LegacyPreloadScanner::tokenize(const SegmentedString& source)
-{
- ASSERT(m_inProgress);
-
- m_source.append(source);
-
- // This is a simplified HTML5 Tokenizer
- // http://www.whatwg.org/specs/web-apps/current-work/#tokenisation0
- while (!m_source.isEmpty()) {
- UChar cc = *m_source;
- switch (m_state) {
- case Data:
- while (1) {
- rememberCharacter(cc);
- if (cc == '&') {
- if (m_contentModel == PCDATA || m_contentModel == RCDATA) {
- m_state = EntityData;
- break;
- }
- } else if (cc == '-') {
- if ((m_contentModel == RCDATA || m_contentModel == CDATA) && !m_escape) {
- if (lastCharactersMatch("<!--", 4))
- m_escape = true;
- }
- } else if (cc == '<') {
- if (m_contentModel == PCDATA || ((m_contentModel == RCDATA || m_contentModel == CDATA) && !m_escape)) {
- m_state = TagOpen;
- break;
- }
- } else if (cc == '>') {
- if ((m_contentModel == RCDATA || m_contentModel == CDATA) && m_escape) {
- if (lastCharactersMatch("-->", 3))
- m_escape = false;
- }
- }
- emitCharacter(cc);
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case EntityData:
- // should try to consume the entity but we only care about entities in attributes
- m_state = Data;
- break;
- case TagOpen:
- if (m_contentModel == RCDATA || m_contentModel == CDATA) {
- if (cc == '/')
- m_state = CloseTagOpen;
- else {
- m_state = Data;
- continue;
- }
- } else if (m_contentModel == PCDATA) {
- if (cc == '!')
- m_state = MarkupDeclarationOpen;
- else if (cc == '/')
- m_state = CloseTagOpen;
- else if (cc >= 'A' && cc <= 'Z') {
- m_tagName.clear();
- m_charset = String();
- m_tagName.append(cc + 0x20);
- m_closeTag = false;
- m_state = TagName;
- } else if (cc >= 'a' && cc <= 'z') {
- m_tagName.clear();
- m_charset = String();
- m_tagName.append(cc);
- m_closeTag = false;
- m_state = TagName;
- } else if (cc == '>') {
- m_state = Data;
- } else if (cc == '?') {
- m_state = BogusComment;
- } else {
- m_state = Data;
- continue;
- }
- }
- break;
- case CloseTagOpen:
- if (m_contentModel == RCDATA || m_contentModel == CDATA) {
- if (!m_lastStartTag.length()) {
- m_state = Data;
- continue;
- }
- if (m_source.length() < m_lastStartTag.length() + 1)
- return;
- Vector<UChar> tmpString;
- UChar tmpChar = 0;
- bool match = true;
- for (unsigned n = 0; n < m_lastStartTag.length() + 1; n++) {
- tmpChar = Unicode::toLower(*m_source);
- if (n < m_lastStartTag.length() && tmpChar != m_lastStartTag[n])
- match = false;
- tmpString.append(tmpChar);
- m_source.advance();
- }
- m_source.prepend(SegmentedString(String(tmpString.data(), tmpString.size())));
- if (!match || (!isWhitespace(tmpChar) && tmpChar != '>' && tmpChar != '/')) {
- m_state = Data;
- continue;
- }
- }
- if (cc >= 'A' && cc <= 'Z') {
- m_tagName.clear();
- m_charset = String();
- m_tagName.append(cc + 0x20);
- m_closeTag = true;
- m_state = TagName;
- } else if (cc >= 'a' && cc <= 'z') {
- m_tagName.clear();
- m_charset = String();
- m_tagName.append(cc);
- m_closeTag = true;
- m_state = TagName;
- } else if (cc == '>') {
- m_state = Data;
- } else
- m_state = BogusComment;
- break;
- case TagName:
- while (1) {
- if (isWhitespace(cc)) {
- m_state = BeforeAttributeName;
- break;
- }
- if (cc == '>') {
- emitTag();
- m_state = Data;
- break;
- }
- if (cc == '/') {
- m_state = BeforeAttributeName;
- break;
- }
- if (cc >= 'A' && cc <= 'Z')
- m_tagName.append(cc + 0x20);
- else
- m_tagName.append(cc);
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case BeforeAttributeName:
- if (isWhitespace(cc))
- ;
- else if (cc == '>') {
- emitTag();
- m_state = Data;
- } else if (cc >= 'A' && cc <= 'Z') {
- m_attributeName.clear();
- m_attributeValue.clear();
- m_attributeName.append(cc + 0x20);
- m_state = AttributeName;
- } else if (cc == '/')
- ;
- else {
- m_attributeName.clear();
- m_attributeValue.clear();
- m_attributeName.append(cc);
- m_state = AttributeName;
- }
- break;
- case AttributeName:
- while (1) {
- if (isWhitespace(cc)) {
- m_state = AfterAttributeName;
- break;
- }
- if (cc == '=') {
- m_state = BeforeAttributeValue;
- break;
- }
- if (cc == '>') {
- emitTag();
- m_state = Data;
- break;
- }
- if (cc == '/') {
- m_state = BeforeAttributeName;
- break;
- }
- if (cc >= 'A' && cc <= 'Z')
- m_attributeName.append(cc + 0x20);
- else
- m_attributeName.append(cc);
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case AfterAttributeName:
- if (isWhitespace(cc))
- ;
- else if (cc == '=')
- m_state = BeforeAttributeValue;
- else if (cc == '>') {
- emitTag();
- m_state = Data;
- } else if (cc >= 'A' && cc <= 'Z') {
- m_attributeName.clear();
- m_attributeValue.clear();
- m_attributeName.append(cc + 0x20);
- m_state = AttributeName;
- } else if (cc == '/')
- m_state = BeforeAttributeName;
- else {
- m_attributeName.clear();
- m_attributeValue.clear();
- m_attributeName.append(cc);
- m_state = AttributeName;
- }
- break;
- case BeforeAttributeValue:
- if (isWhitespace(cc))
- ;
- else if (cc == '"')
- m_state = AttributeValueDoubleQuoted;
- else if (cc == '&') {
- m_state = AttributeValueUnquoted;
- continue;
- } else if (cc == '\'')
- m_state = AttributeValueSingleQuoted;
- else if (cc == '>') {
- emitTag();
- m_state = Data;
- } else {
- m_attributeValue.append(cc);
- m_state = AttributeValueUnquoted;
- }
- break;
- case AttributeValueDoubleQuoted:
- while (1) {
- if (cc == '"') {
- processAttribute();
- m_state = BeforeAttributeName;
- break;
- }
- if (cc == '&') {
- m_stateBeforeEntityInAttributeValue = m_state;
- m_state = EntityInAttributeValue;
- break;
- }
- m_attributeValue.append(cc);
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case AttributeValueSingleQuoted:
- while (1) {
- if (cc == '\'') {
- processAttribute();
- m_state = BeforeAttributeName;
- break;
- }
- if (cc == '&') {
- m_stateBeforeEntityInAttributeValue = m_state;
- m_state = EntityInAttributeValue;
- break;
- }
- m_attributeValue.append(cc);
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case AttributeValueUnquoted:
- while (1) {
- if (isWhitespace(cc)) {
- processAttribute();
- m_state = BeforeAttributeName;
- break;
- }
- if (cc == '&') {
- m_stateBeforeEntityInAttributeValue = m_state;
- m_state = EntityInAttributeValue;
- break;
- }
- if (cc == '>') {
- processAttribute();
- emitTag();
- m_state = Data;
- break;
- }
- m_attributeValue.append(cc);
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case EntityInAttributeValue:
- {
- bool notEnoughCharacters = false;
- unsigned entity = consumeEntity(m_source, notEnoughCharacters);
- if (notEnoughCharacters)
- return;
- if (entity > 0xFFFF) {
- m_attributeValue.append(U16_LEAD(entity));
- m_attributeValue.append(U16_TRAIL(entity));
- } else if (entity)
- m_attributeValue.append(entity);
- else
- m_attributeValue.append('&');
- }
- m_state = m_stateBeforeEntityInAttributeValue;
- continue;
- case BogusComment:
- while (1) {
- if (cc == '>') {
- m_state = Data;
- break;
- }
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case MarkupDeclarationOpen: {
- if (cc == '-') {
- if (m_source.length() < 2)
- return;
- m_source.advance();
- cc = *m_source;
- if (cc == '-')
- m_state = CommentStart;
- else {
- m_state = BogusComment;
- continue;
- }
- // If we cared about the DOCTYPE we would test to enter those states here
- } else {
- m_state = BogusComment;
- continue;
- }
- break;
- }
- case CommentStart:
- if (cc == '-')
- m_state = CommentStartDash;
- else if (cc == '>')
- m_state = Data;
- else
- m_state = Comment;
- break;
- case CommentStartDash:
- if (cc == '-')
- m_state = CommentEnd;
- else if (cc == '>')
- m_state = Data;
- else
- m_state = Comment;
- break;
- case Comment:
- while (1) {
- if (cc == '-') {
- m_state = CommentEndDash;
- break;
- }
- m_source.advance();
- if (m_source.isEmpty())
- return;
- cc = *m_source;
- }
- break;
- case CommentEndDash:
- if (cc == '-')
- m_state = CommentEnd;
- else
- m_state = Comment;
- break;
- case CommentEnd:
- if (cc == '>')
- m_state = Data;
- else if (cc == '-')
- ;
- else
- m_state = Comment;
- break;
- }
- m_source.advance();
- }
-}
-
-void LegacyPreloadScanner::processAttribute()
-{
- AtomicString tag = AtomicString(m_tagName.data(), m_tagName.size());
- AtomicString attribute = AtomicString(m_attributeName.data(), m_attributeName.size());
-
- String value(m_attributeValue.data(), m_attributeValue.size());
- if (tag == scriptTag || tag == imgTag) {
- if (attribute == srcAttr && m_urlToLoad.isEmpty())
- m_urlToLoad = deprecatedParseURL(value);
- else if (attribute == charsetAttr)
- m_charset = value;
- } else if (tag == linkTag) {
- if (attribute == hrefAttr && m_urlToLoad.isEmpty())
- m_urlToLoad = deprecatedParseURL(value);
- else if (attribute == relAttr) {
- HTMLLinkElement::RelAttribute rel;
- HTMLLinkElement::tokenizeRelAttribute(value, rel);
- m_linkIsStyleSheet = rel.m_isStyleSheet && !rel.m_isAlternate && !rel.m_isIcon && !rel.m_isDNSPrefetch;
- } else if (attribute == charsetAttr)
- m_charset = value;
- }
-}
-
-inline void LegacyPreloadScanner::emitCharacter(UChar c)
-{
- if (m_contentModel == CDATA && m_lastStartTag == styleTag)
- tokenizeCSS(c);
-}
-
-inline void LegacyPreloadScanner::tokenizeCSS(UChar c)
-{
- // We are just interested in @import rules, no need for real tokenization here
- // Searching for other types of resources is probably low payoff
- switch (m_cssState) {
- case CSSInitial:
- if (c == '@')
- m_cssState = CSSRuleStart;
- else if (c == '/')
- m_cssState = CSSMaybeComment;
- break;
- case CSSMaybeComment:
- if (c == '*')
- m_cssState = CSSComment;
- else
- m_cssState = CSSInitial;
- break;
- case CSSComment:
- if (c == '*')
- m_cssState = CSSMaybeCommentEnd;
- break;
- case CSSMaybeCommentEnd:
- if (c == '/')
- m_cssState = CSSInitial;
- else if (c == '*')
- ;
- else
- m_cssState = CSSComment;
- break;
- case CSSRuleStart:
- if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
- m_cssRule.clear();
- m_cssRuleValue.clear();
- m_cssRule.append(c);
- m_cssState = CSSRule;
- } else
- m_cssState = CSSInitial;
- break;
- case CSSRule:
- if (isWhitespace(c))
- m_cssState = CSSAfterRule;
- else if (c == ';')
- m_cssState = CSSInitial;
- else
- m_cssRule.append(c);
- break;
- case CSSAfterRule:
- if (isWhitespace(c))
- ;
- else if (c == ';')
- m_cssState = CSSInitial;
- else {
- m_cssState = CSSRuleValue;
- m_cssRuleValue.append(c);
- }
- break;
- case CSSRuleValue:
- if (isWhitespace(c))
- m_cssState = CSSAfterRuleValue;
- else if (c == ';') {
- emitCSSRule();
- m_cssState = CSSInitial;
- } else
- m_cssRuleValue.append(c);
- break;
- case CSSAfterRuleValue:
- if (isWhitespace(c))
- ;
- else if (c == ';') {
- emitCSSRule();
- m_cssState = CSSInitial;
- } else {
- // FIXME media rules
- m_cssState = CSSInitial;
- }
- break;
- }
-}
-
-void LegacyPreloadScanner::emitTag()
-{
- if (m_closeTag) {
- m_contentModel = PCDATA;
- m_cssState = CSSInitial;
- clearLastCharacters();
- return;
- }
-
- AtomicString tag(m_tagName.data(), m_tagName.size());
- m_lastStartTag = tag;
-
- if (tag == textareaTag || tag == titleTag)
- m_contentModel = RCDATA;
- else if (tag == styleTag || tag == xmpTag || tag == scriptTag || tag == iframeTag || tag == noembedTag || tag == noframesTag)
- m_contentModel = CDATA;
- else if (tag == noscriptTag)
- // we wouldn't be here if scripts were disabled
- m_contentModel = CDATA;
- else if (tag == plaintextTag)
- m_contentModel = PLAINTEXT;
- else
- m_contentModel = PCDATA;
-
- if (tag == bodyTag)
- m_bodySeen = true;
-
- if (m_urlToLoad.isEmpty()) {
- m_linkIsStyleSheet = false;
- return;
- }
-
- if (tag == scriptTag)
- m_document->docLoader()->preload(CachedResource::Script, m_urlToLoad, m_charset, scanningBody());
- else if (tag == imgTag)
- m_document->docLoader()->preload(CachedResource::ImageResource, m_urlToLoad, String(), scanningBody());
- else if (tag == linkTag && m_linkIsStyleSheet)
- m_document->docLoader()->preload(CachedResource::CSSStyleSheet, m_urlToLoad, m_charset, scanningBody());
-
- m_urlToLoad = String();
- m_charset = String();
- m_linkIsStyleSheet = false;
-}
-
-void LegacyPreloadScanner::emitCSSRule()
-{
- String rule(m_cssRule.data(), m_cssRule.size());
- if (equalIgnoringCase(rule, "import") && !m_cssRuleValue.isEmpty()) {
- String value(m_cssRuleValue.data(), m_cssRuleValue.size());
- String url = deprecatedParseURL(value);
- if (!url.isEmpty())
- m_document->docLoader()->preload(CachedResource::CSSStyleSheet, url, String(), scanningBody());
- }
- m_cssRule.clear();
- m_cssRuleValue.clear();
-}
-
-}
diff --git a/WebCore/html/LegacyPreloadScanner.h b/WebCore/html/LegacyPreloadScanner.h
deleted file mode 100644
index 95710ab..0000000
--- a/WebCore/html/LegacyPreloadScanner.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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 INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyPreloadScanner_h
-#define LegacyPreloadScanner_h
-
-#include "AtomicString.h"
-#include "SegmentedString.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
- class CachedResource;
- class CachedResourceClient;
- class Document;
-
- class LegacyPreloadScanner : public Noncopyable {
- public:
- LegacyPreloadScanner(Document*);
- ~LegacyPreloadScanner();
- void begin();
- void write(const SegmentedString&);
- void end();
- bool inProgress() const { return m_inProgress; }
-
- bool scanningBody() const;
-
- static unsigned consumeEntity(SegmentedString&, bool& notEnoughCharacters);
-
- private:
- void tokenize(const SegmentedString&);
- void reset();
-
- void emitTag();
- void emitCharacter(UChar);
-
- void tokenizeCSS(UChar);
- void emitCSSRule();
-
- void processAttribute();
-
-
- void clearLastCharacters();
- void rememberCharacter(UChar);
- bool lastCharactersMatch(const char*, unsigned count) const;
-
- bool m_inProgress;
- SegmentedString m_source;
-
- enum State {
- Data,
- EntityData,
- TagOpen,
- CloseTagOpen,
- TagName,
- BeforeAttributeName,
- AttributeName,
- AfterAttributeName,
- BeforeAttributeValue,
- AttributeValueDoubleQuoted,
- AttributeValueSingleQuoted,
- AttributeValueUnquoted,
- EntityInAttributeValue,
- BogusComment,
- MarkupDeclarationOpen,
- CommentStart,
- CommentStartDash,
- Comment,
- CommentEndDash,
- CommentEnd
- };
- State m_state;
- bool m_escape;
- enum ContentModel {
- PCDATA,
- RCDATA,
- CDATA,
- PLAINTEXT
- };
- ContentModel m_contentModel;
- unsigned m_commentPos;
- State m_stateBeforeEntityInAttributeValue;
-
- static const unsigned lastCharactersBufferSize = 8;
- UChar m_lastCharacters[lastCharactersBufferSize];
- unsigned m_lastCharacterIndex;
-
- bool m_closeTag;
- Vector<UChar, 32> m_tagName;
- Vector<UChar, 32> m_attributeName;
- Vector<UChar> m_attributeValue;
- AtomicString m_lastStartTag;
-
- String m_urlToLoad;
- String m_charset;
- bool m_linkIsStyleSheet;
-
- enum CSSState {
- CSSInitial,
- CSSMaybeComment,
- CSSComment,
- CSSMaybeCommentEnd,
- CSSRuleStart,
- CSSRule,
- CSSAfterRule,
- CSSRuleValue,
- CSSAfterRuleValue
- };
- CSSState m_cssState;
- Vector<UChar, 16> m_cssRule;
- Vector<UChar> m_cssRuleValue;
-
- double m_timeUsed;
-
- bool m_bodySeen;
- Document* m_document;
- };
-
-}
-
-#endif
diff --git a/WebCore/html/ThreadableBlobRegistry.cpp b/WebCore/html/ThreadableBlobRegistry.cpp
new file mode 100644
index 0000000..1df290d
--- /dev/null
+++ b/WebCore/html/ThreadableBlobRegistry.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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 "ThreadableBlobRegistry.h"
+
+#include "BlobData.h"
+#include "BlobRegistry.h"
+#include "CrossThreadTask.h"
+#include "NotImplemented.h"
+#include "ScriptExecutionContext.h"
+#include "WorkerContext.h"
+#include "WorkerLoaderProxy.h"
+#include "WorkerThread.h"
+
+namespace WebCore {
+
+static void postTaskToMainThread(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<ScriptExecutionContext::Task> task)
+{
+#if ENABLE(WORKERS)
+ ASSERT(scriptExecutionContext->isWorkerContext());
+ WorkerLoaderProxy& proxy = static_cast<WorkerContext*>(scriptExecutionContext)->thread()->workerLoaderProxy();
+ proxy.postTaskToLoader(task);
+#else
+ notImplemented();
+#endif
+}
+
+static void registerBlobURLTask(ScriptExecutionContext*, const KURL& url, PassOwnPtr<BlobData> blobData)
+{
+ BlobRegistry::instance().registerBlobURL(url, blobData);
+}
+
+void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url, PassOwnPtr<BlobData> blobData)
+{
+ if (scriptExecutionContext->isWorkerContext())
+ postTaskToMainThread(scriptExecutionContext, createCallbackTask(&registerBlobURLTask, url, blobData));
+ else
+ registerBlobURLTask(scriptExecutionContext, url, blobData);
+}
+
+static void registerBlobURLFromTask(ScriptExecutionContext*, const KURL& url, const KURL& srcURL)
+{
+ BlobRegistry::instance().registerBlobURL(url, srcURL);
+}
+
+void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url, const KURL& srcURL)
+{
+ if (scriptExecutionContext->isWorkerContext())
+ postTaskToMainThread(scriptExecutionContext, createCallbackTask(&registerBlobURLFromTask, url, srcURL));
+ else
+ registerBlobURLFromTask(scriptExecutionContext, url, srcURL);
+}
+
+static void unregisterBlobURLTask(ScriptExecutionContext*, const KURL& url)
+{
+ BlobRegistry::instance().unregisterBlobURL(url);
+}
+
+void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url)
+{
+ if (scriptExecutionContext->isWorkerContext())
+ postTaskToMainThread(scriptExecutionContext, createCallbackTask(&unregisterBlobURLTask, url));
+ else
+ unregisterBlobURLTask(scriptExecutionContext, url);
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/ThreadableBlobRegistry.h b/WebCore/html/ThreadableBlobRegistry.h
new file mode 100644
index 0000000..7dce6bb
--- /dev/null
+++ b/WebCore/html/ThreadableBlobRegistry.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 ThreadableBlobRegistry_h
+#define ThreadableBlobRegistry_h
+
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class BlobData;
+class KURL;
+class ScriptExecutionContext;
+
+class ThreadableBlobRegistry {
+public:
+ static void registerBlobURL(ScriptExecutionContext*, const KURL&, PassOwnPtr<BlobData>);
+ static void registerBlobURL(ScriptExecutionContext*, const KURL&, const KURL& srcURL);
+ static void unregisterBlobURL(ScriptExecutionContext*, const KURL&);
+};
+
+} // namespace WebCore
+
+#endif // ThreadableBlobRegistry_h
diff --git a/WebCore/html/canvas/CanvasPattern.cpp b/WebCore/html/canvas/CanvasPattern.cpp
index 62a4620..818d7d3 100644
--- a/WebCore/html/canvas/CanvasPattern.cpp
+++ b/WebCore/html/canvas/CanvasPattern.cpp
@@ -57,7 +57,7 @@ void CanvasPattern::parseRepetitionType(const String& type, bool& repeatX, bool&
ec = SYNTAX_ERR;
}
-CanvasPattern::CanvasPattern(Image* image, bool repeatX, bool repeatY, bool originClean)
+CanvasPattern::CanvasPattern(PassRefPtr<Image> image, bool repeatX, bool repeatY, bool originClean)
: m_pattern(Pattern::create(image, repeatX, repeatY))
, m_originClean(originClean)
{
diff --git a/WebCore/html/canvas/CanvasPattern.h b/WebCore/html/canvas/CanvasPattern.h
index 91e0794..58848a9 100644
--- a/WebCore/html/canvas/CanvasPattern.h
+++ b/WebCore/html/canvas/CanvasPattern.h
@@ -41,7 +41,7 @@ namespace WebCore {
public:
static void parseRepetitionType(const String&, bool& repeatX, bool& repeatY, ExceptionCode&);
- static PassRefPtr<CanvasPattern> create(Image* image, bool repeatX, bool repeatY, bool originClean)
+ static PassRefPtr<CanvasPattern> create(PassRefPtr<Image> image, bool repeatX, bool repeatY, bool originClean)
{
return adoptRef(new CanvasPattern(image, repeatX, repeatY, originClean));
}
@@ -51,7 +51,7 @@ namespace WebCore {
bool originClean() const { return m_originClean; }
private:
- CanvasPattern(Image*, bool repeatX, bool repeatY, bool originClean);
+ CanvasPattern(PassRefPtr<Image>, bool repeatX, bool repeatY, bool originClean);
RefPtr<Pattern> m_pattern;
bool m_originClean;
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 559ddda..58ec1d0 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -126,7 +126,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, bo
return;
if (FrameView* view = canvas->document()->view()) {
if (ScrollView* rootView = view->root()) {
- if (HostWindow* hostWindow = view->root()->hostWindow()) {
+ if (HostWindow* hostWindow = rootView->hostWindow()) {
// Set up our context
GraphicsContext3D::Attributes attr;
attr.stencil = true;
@@ -167,8 +167,8 @@ void CanvasRenderingContext2D::reset()
}
CanvasRenderingContext2D::State::State()
- : m_strokeStyle(CanvasStyle::create(Color::black))
- , m_fillStyle(CanvasStyle::create(Color::black))
+ : m_strokeStyle(CanvasStyle::createFromRGBA(Color::black))
+ , m_fillStyle(CanvasStyle::createFromRGBA(Color::black))
, m_lineWidth(1)
, m_lineCap(ButtCap)
, m_lineJoin(MiterJoin)
@@ -550,82 +550,82 @@ void CanvasRenderingContext2D::setStrokeColor(const String& color)
{
if (color == state().m_unparsedStrokeColor)
return;
- setStrokeStyle(CanvasStyle::create(color));
+ setStrokeStyle(CanvasStyle::createFromString(color));
state().m_unparsedStrokeColor = color;
}
void CanvasRenderingContext2D::setStrokeColor(float grayLevel)
{
- if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(grayLevel, grayLevel, grayLevel, 1.0f))
+ if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentRGBA(grayLevel, grayLevel, grayLevel, 1.0f))
return;
- setStrokeStyle(CanvasStyle::create(grayLevel, 1));
+ setStrokeStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, 1.0f));
}
void CanvasRenderingContext2D::setStrokeColor(const String& color, float alpha)
{
- setStrokeStyle(CanvasStyle::create(color, alpha));
+ setStrokeStyle(CanvasStyle::createFromStringWithOverrideAlpha(color, alpha));
}
void CanvasRenderingContext2D::setStrokeColor(float grayLevel, float alpha)
{
- if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(grayLevel, grayLevel, grayLevel, alpha))
+ if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentRGBA(grayLevel, grayLevel, grayLevel, alpha))
return;
- setStrokeStyle(CanvasStyle::create(grayLevel, alpha));
+ setStrokeStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, alpha));
}
void CanvasRenderingContext2D::setStrokeColor(float r, float g, float b, float a)
{
- if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(r, g, b, a))
+ if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentRGBA(r, g, b, a))
return;
- setStrokeStyle(CanvasStyle::create(r, g, b, a));
+ setStrokeStyle(CanvasStyle::createFromRGBAChannels(r, g, b, a));
}
void CanvasRenderingContext2D::setStrokeColor(float c, float m, float y, float k, float a)
{
- if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(c, m, y, k, a))
+ if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentCMYKA(c, m, y, k, a))
return;
- setStrokeStyle(CanvasStyle::create(c, m, y, k, a));
+ setStrokeStyle(CanvasStyle::createFromCMYKAChannels(c, m, y, k, a));
}
void CanvasRenderingContext2D::setFillColor(const String& color)
{
if (color == state().m_unparsedFillColor)
return;
- setFillStyle(CanvasStyle::create(color));
+ setFillStyle(CanvasStyle::createFromString(color));
state().m_unparsedFillColor = color;
}
void CanvasRenderingContext2D::setFillColor(float grayLevel)
{
- if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(grayLevel, grayLevel, grayLevel, 1.0f))
+ if (state().m_fillStyle && state().m_fillStyle->isEquivalentRGBA(grayLevel, grayLevel, grayLevel, 1.0f))
return;
- setFillStyle(CanvasStyle::create(grayLevel, 1));
+ setFillStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, 1.0f));
}
void CanvasRenderingContext2D::setFillColor(const String& color, float alpha)
{
- setFillStyle(CanvasStyle::create(color, alpha));
+ setFillStyle(CanvasStyle::createFromStringWithOverrideAlpha(color, alpha));
}
void CanvasRenderingContext2D::setFillColor(float grayLevel, float alpha)
{
- if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(grayLevel, grayLevel, grayLevel, alpha))
+ if (state().m_fillStyle && state().m_fillStyle->isEquivalentRGBA(grayLevel, grayLevel, grayLevel, alpha))
return;
- setFillStyle(CanvasStyle::create(grayLevel, alpha));
+ setFillStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, alpha));
}
void CanvasRenderingContext2D::setFillColor(float r, float g, float b, float a)
{
- if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(r, g, b, a))
+ if (state().m_fillStyle && state().m_fillStyle->isEquivalentRGBA(r, g, b, a))
return;
- setFillStyle(CanvasStyle::create(r, g, b, a));
+ setFillStyle(CanvasStyle::createFromRGBAChannels(r, g, b, a));
}
void CanvasRenderingContext2D::setFillColor(float c, float m, float y, float k, float a)
{
- if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(c, m, y, k, a))
+ if (state().m_fillStyle && state().m_fillStyle->isEquivalentCMYKA(c, m, y, k, a))
return;
- setFillStyle(CanvasStyle::create(c, m, y, k, a));
+ setFillStyle(CanvasStyle::createFromCMYKAChannels(c, m, y, k, a));
}
void CanvasRenderingContext2D::beginPath()
@@ -825,8 +825,16 @@ void CanvasRenderingContext2D::stroke()
c->beginPath();
c->addPath(m_path);
+#if PLATFORM(QT)
+ // Fast approximation of the stroke's bounding rect.
+ // This yields a slightly oversized rect but is very fast
+ // compared to Path::strokeBoundingRect().
+ FloatRect boundingRect = m_path.platformPath().controlPointRect();
+ boundingRect.inflate(state().m_miterLimit + state().m_lineWidth);
+#else
CanvasStrokeStyleApplier strokeApplier(this);
FloatRect boundingRect = m_path.strokeBoundingRect(&strokeApplier);
+#endif
willDraw(boundingRect);
c->strokePath();
@@ -1264,7 +1272,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
sourceCanvas->makeRenderingResultsAvailable();
- c->drawImage(buffer->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
+ c->drawImageBuffer(buffer, DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
willDraw(destRect); // This call comes after drawImage, since the buffer we draw into may be our own, and we need to make sure it is dirty.
// FIXME: Arguably willDraw should become didDraw and occur after drawing calls and not before them to avoid problems like this.
}
@@ -1464,7 +1472,7 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem
CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
if (ec)
return 0;
- return CanvasPattern::create(canvas->buffer()->image(), repeatX, repeatY, canvas->originClean());
+ return CanvasPattern::create(canvas->copiedImage(), repeatX, repeatY, canvas->originClean());
}
void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
@@ -1820,7 +1828,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
maskImageContext->drawBidiText(font, textRun, location);
c->save();
- c->clipToImageBuffer(maskRect, maskImage.get());
+ c->clipToImageBuffer(maskImage.get(), maskRect);
drawStyle->applyFillColor(c);
c->fillRect(maskRect);
c->restore();
diff --git a/WebCore/html/canvas/CanvasStyle.cpp b/WebCore/html/canvas/CanvasStyle.cpp
index 52b31c8..fd3c6e5 100644
--- a/WebCore/html/canvas/CanvasStyle.cpp
+++ b/WebCore/html/canvas/CanvasStyle.cpp
@@ -55,12 +55,6 @@ CanvasStyle::CanvasStyle(RGBA32 rgba)
{
}
-CanvasStyle::CanvasStyle(float grayLevel)
- : m_type(RGBA)
- , m_rgba(makeRGBA32FromFloats(grayLevel, grayLevel, grayLevel, 1.0f))
-{
-}
-
CanvasStyle::CanvasStyle(float grayLevel, float alpha)
: m_type(RGBA)
, m_rgba(makeRGBA32FromFloats(grayLevel, grayLevel, grayLevel, alpha))
@@ -92,7 +86,7 @@ CanvasStyle::CanvasStyle(PassRefPtr<CanvasPattern> pattern)
{
}
-PassRefPtr<CanvasStyle> CanvasStyle::create(const String& color)
+PassRefPtr<CanvasStyle> CanvasStyle::createFromString(const String& color)
{
RGBA32 rgba;
if (!CSSParser::parseColor(rgba, color))
@@ -100,7 +94,7 @@ PassRefPtr<CanvasStyle> CanvasStyle::create(const String& color)
return adoptRef(new CanvasStyle(rgba));
}
-PassRefPtr<CanvasStyle> CanvasStyle::create(const String& color, float alpha)
+PassRefPtr<CanvasStyle> CanvasStyle::createFromStringWithOverrideAlpha(const String& color, float alpha)
{
RGBA32 rgba;
if (!CSSParser::parseColor(rgba, color))
@@ -108,13 +102,13 @@ PassRefPtr<CanvasStyle> CanvasStyle::create(const String& color, float alpha)
return adoptRef(new CanvasStyle(colorWithOverrideAlpha(rgba, alpha)));
}
-PassRefPtr<CanvasStyle> CanvasStyle::create(PassRefPtr<CanvasGradient> gradient)
+PassRefPtr<CanvasStyle> CanvasStyle::createFromGradient(PassRefPtr<CanvasGradient> gradient)
{
if (!gradient)
return 0;
return adoptRef(new CanvasStyle(gradient));
}
-PassRefPtr<CanvasStyle> CanvasStyle::create(PassRefPtr<CanvasPattern> pattern)
+PassRefPtr<CanvasStyle> CanvasStyle::createFromPattern(PassRefPtr<CanvasPattern> pattern)
{
if (!pattern)
return 0;
@@ -144,7 +138,7 @@ bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const
return false;
}
-bool CanvasStyle::isEquivalentColor(float r, float g, float b, float a) const
+bool CanvasStyle::isEquivalentRGBA(float r, float g, float b, float a) const
{
if (m_type != RGBA)
return false;
@@ -152,7 +146,7 @@ bool CanvasStyle::isEquivalentColor(float r, float g, float b, float a) const
return m_rgba == makeRGBA32FromFloats(r, g, b, a);
}
-bool CanvasStyle::isEquivalentColor(float c, float m, float y, float k, float a) const
+bool CanvasStyle::isEquivalentCMYKA(float c, float m, float y, float k, float a) const
{
if (m_type != CMYKA)
return false;
diff --git a/WebCore/html/canvas/CanvasStyle.h b/WebCore/html/canvas/CanvasStyle.h
index 8e47e63..3ca760a 100644
--- a/WebCore/html/canvas/CanvasStyle.h
+++ b/WebCore/html/canvas/CanvasStyle.h
@@ -38,15 +38,14 @@ namespace WebCore {
class CanvasStyle : public RefCounted<CanvasStyle> {
public:
- static PassRefPtr<CanvasStyle> create(RGBA32 rgba) { return adoptRef(new CanvasStyle(rgba)); }
- static PassRefPtr<CanvasStyle> create(const String& color);
- static PassRefPtr<CanvasStyle> create(const String& color, float alpha);
- static PassRefPtr<CanvasStyle> create(float grayLevel) { return adoptRef(new CanvasStyle(grayLevel)); }
- static PassRefPtr<CanvasStyle> create(float grayLevel, float alpha) { return adoptRef(new CanvasStyle(grayLevel, alpha)); }
- static PassRefPtr<CanvasStyle> create(float r, float g, float b, float a) { return adoptRef(new CanvasStyle(r, g, b, a)); }
- static PassRefPtr<CanvasStyle> create(float c, float m, float y, float k, float a) { return adoptRef(new CanvasStyle(c, m, y, k, a)); }
- static PassRefPtr<CanvasStyle> create(PassRefPtr<CanvasGradient> gradient);
- static PassRefPtr<CanvasStyle> create(PassRefPtr<CanvasPattern> pattern);
+ static PassRefPtr<CanvasStyle> createFromRGBA(RGBA32 rgba) { return adoptRef(new CanvasStyle(rgba)); }
+ static PassRefPtr<CanvasStyle> createFromString(const String& color);
+ static PassRefPtr<CanvasStyle> createFromStringWithOverrideAlpha(const String& color, float alpha);
+ static PassRefPtr<CanvasStyle> createFromGrayLevelWithAlpha(float grayLevel, float alpha) { return adoptRef(new CanvasStyle(grayLevel, alpha)); }
+ static PassRefPtr<CanvasStyle> createFromRGBAChannels(float r, float g, float b, float a) { return adoptRef(new CanvasStyle(r, g, b, a)); }
+ static PassRefPtr<CanvasStyle> createFromCMYKAChannels(float c, float m, float y, float k, float a) { return adoptRef(new CanvasStyle(c, m, y, k, a)); }
+ static PassRefPtr<CanvasStyle> createFromGradient(PassRefPtr<CanvasGradient>);
+ static PassRefPtr<CanvasStyle> createFromPattern(PassRefPtr<CanvasPattern>);
String color() const { return Color(m_rgba).serialized(); }
CanvasGradient* canvasGradient() const { return m_gradient.get(); }
@@ -56,12 +55,11 @@ namespace WebCore {
void applyStrokeColor(GraphicsContext*);
bool isEquivalentColor(const CanvasStyle&) const;
- bool isEquivalentColor(float r, float g, float b, float a) const;
- bool isEquivalentColor(float c, float m, float y, float k, float a) const;
+ bool isEquivalentRGBA(float r, float g, float b, float a) const;
+ bool isEquivalentCMYKA(float c, float m, float y, float k, float a) const;
private:
CanvasStyle(RGBA32 rgba);
- CanvasStyle(float grayLevel);
CanvasStyle(float grayLevel, float alpha);
CanvasStyle(float r, float g, float b, float a);
CanvasStyle(float c, float m, float y, float k, float a);
diff --git a/WebCore/html/canvas/WebGLObject.cpp b/WebCore/html/canvas/WebGLObject.cpp
index 6a34269..5fd5534 100644
--- a/WebCore/html/canvas/WebGLObject.cpp
+++ b/WebCore/html/canvas/WebGLObject.cpp
@@ -35,8 +35,9 @@ namespace WebCore {
WebGLObject::WebGLObject(WebGLRenderingContext* context)
: m_object(0)
- , m_shouldDeleteObject(true)
, m_context(context)
+ , m_attachmentCount(0)
+ , m_deleted(false)
{
}
@@ -46,27 +47,26 @@ WebGLObject::~WebGLObject()
m_context->removeObject(this);
}
-void WebGLObject::setObject(Platform3DObject object, bool shouldDeleteObject)
+void WebGLObject::setObject(Platform3DObject object)
{
if (object == m_object)
return;
deleteObject();
m_object = object;
- m_shouldDeleteObject = shouldDeleteObject;
}
void WebGLObject::deleteObject()
{
if (m_object) {
- if (m_shouldDeleteObject)
- if (m_context) {
- m_context->graphicsContext3D()->makeContextCurrent();
- deleteObjectImpl(m_object);
- }
- m_object = 0;
+ if (m_context) {
+ m_context->graphicsContext3D()->makeContextCurrent();
+ deleteObjectImpl(m_object);
+ }
+ if (!m_attachmentCount)
+ m_object = 0;
+ m_deleted = true;
}
- m_shouldDeleteObject = true;
}
}
diff --git a/WebCore/html/canvas/WebGLObject.h b/WebCore/html/canvas/WebGLObject.h
index b66311f..18d4cf9 100644
--- a/WebCore/html/canvas/WebGLObject.h
+++ b/WebCore/html/canvas/WebGLObject.h
@@ -40,7 +40,7 @@ public:
virtual ~WebGLObject();
Platform3DObject object() const { return m_object; }
- void setObject(Platform3DObject, bool shouldDeleteObject = true);
+ void setObject(Platform3DObject);
void deleteObject();
void detachContext()
@@ -58,20 +58,25 @@ public:
virtual bool isShader() const { return false; }
virtual bool isTexture() const { return false; }
+ void onAttached() { ++m_attachmentCount; }
+ void onDetached()
+ {
+ if (m_attachmentCount)
+ --m_attachmentCount;
+ if (!m_attachmentCount && m_deleted)
+ m_object = 0;
+ }
+ unsigned getAttachmentCount() { return m_attachmentCount; }
+
protected:
WebGLObject(WebGLRenderingContext*);
virtual void deleteObjectImpl(Platform3DObject) = 0;
private:
Platform3DObject m_object;
- // The shouldDeleteObject flag indicates whether this wrapper
- // owns the underlying resource and should delete it when the
- // wrapper is unreferenced for the last time and deleted. It
- // is only set to false for certain objects returned from get
- // queries. FIXME: should consider canonicalizing all of these
- // objects in the future.
- bool m_shouldDeleteObject;
WebGLRenderingContext* m_context;
+ unsigned m_attachmentCount;
+ bool m_deleted;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLProgram.cpp b/WebCore/html/canvas/WebGLProgram.cpp
index 846b171..8cf3c42 100644
--- a/WebCore/html/canvas/WebGLProgram.cpp
+++ b/WebCore/html/canvas/WebGLProgram.cpp
@@ -45,9 +45,15 @@ WebGLProgram::WebGLProgram(WebGLRenderingContext* ctx)
setObject(context()->graphicsContext3D()->createProgram());
}
-void WebGLProgram::deleteObjectImpl(Platform3DObject object)
+void WebGLProgram::deleteObjectImpl(Platform3DObject obj)
{
- context()->graphicsContext3D()->deleteProgram(object);
+ context()->graphicsContext3D()->deleteProgram(obj);
+ if (!object()) {
+ if (m_vertexShader)
+ m_vertexShader->onDetached();
+ if (m_fragmentShader)
+ m_fragmentShader->onDetached();
+ }
}
bool WebGLProgram::cacheActiveAttribLocations()
@@ -94,6 +100,58 @@ bool WebGLProgram::isUsingVertexAttrib0() const
return false;
}
+WebGLShader* WebGLProgram::getAttachedShader(GraphicsContext3D::WebGLEnumType type)
+{
+ switch (type) {
+ case GraphicsContext3D::VERTEX_SHADER:
+ return m_vertexShader.get();
+ case GraphicsContext3D::FRAGMENT_SHADER:
+ return m_fragmentShader.get();
+ default:
+ return 0;
+ }
+}
+
+bool WebGLProgram::attachShader(WebGLShader* shader)
+{
+ if (!shader || !shader->object())
+ return false;
+ switch (shader->getType()) {
+ case GraphicsContext3D::VERTEX_SHADER:
+ if (m_vertexShader)
+ return false;
+ m_vertexShader = shader;
+ return true;
+ case GraphicsContext3D::FRAGMENT_SHADER:
+ if (m_fragmentShader)
+ return false;
+ m_fragmentShader = shader;
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool WebGLProgram::detachShader(WebGLShader* shader)
+{
+ if (!shader || !shader->object())
+ return false;
+ switch (shader->getType()) {
+ case GraphicsContext3D::VERTEX_SHADER:
+ if (m_vertexShader != shader)
+ return false;
+ m_vertexShader = 0;
+ return true;
+ case GraphicsContext3D::FRAGMENT_SHADER:
+ if (m_fragmentShader != shader)
+ return false;
+ m_fragmentShader = 0;
+ return true;
+ default:
+ return false;
+ }
+}
+
}
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/WebGLProgram.h b/WebCore/html/canvas/WebGLProgram.h
index 0156938..e5548eb 100644
--- a/WebCore/html/canvas/WebGLProgram.h
+++ b/WebCore/html/canvas/WebGLProgram.h
@@ -28,6 +28,8 @@
#include "WebGLObject.h"
+#include "WebGLShader.h"
+
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
@@ -54,6 +56,10 @@ public:
bool isLinkFailureFlagSet() const { return m_linkFailure; }
void setLinkFailureFlag(bool failed) { m_linkFailure = failed; }
+ WebGLShader* getAttachedShader(GraphicsContext3D::WebGLEnumType);
+ bool attachShader(WebGLShader*);
+ bool detachShader(WebGLShader*);
+
protected:
WebGLProgram(WebGLRenderingContext*);
@@ -65,6 +71,9 @@ private:
Vector<int> m_activeAttribLocations;
bool m_linkFailure;
+
+ RefPtr<WebGLShader> m_vertexShader;
+ RefPtr<WebGLShader> m_fragmentShader;
};
} // namespace WebCore
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 0284ec6..4465833 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -158,27 +158,11 @@ void WebGLRenderingContext::markContextChanged()
void WebGLRenderingContext::paintRenderingResultsToCanvas()
{
- if (m_markedCanvasDirty) {
- // FIXME: It should not be necessary to clear the image before doing a readback.
- // Investigate why this is needed and remove if possible.
- canvas()->buffer()->clearImage();
- m_markedCanvasDirty = false;
- m_context->paintRenderingResultsToCanvas(this);
- }
-}
-
-void WebGLRenderingContext::beginPaint()
-{
- if (m_markedCanvasDirty)
- m_context->beginPaint(this);
-}
-
-void WebGLRenderingContext::endPaint()
-{
- if (m_markedCanvasDirty) {
- m_markedCanvasDirty = false;
- m_context->endPaint();
- }
+ if (!m_markedCanvasDirty)
+ return;
+ canvas()->clearCopiedImage();
+ m_markedCanvasDirty = false;
+ m_context->paintRenderingResultsToCanvas(this);
}
void WebGLRenderingContext::reshape(int width, int height)
@@ -191,7 +175,9 @@ void WebGLRenderingContext::reshape(int width, int height)
#endif
m_needsUpdate = false;
}
-
+
+ // We don't have to mark the canvas as dirty, since the newly created image buffer will also start off
+ // clear (and this matches what reshape will do).
m_context->reshape(width, height);
}
@@ -217,7 +203,12 @@ void WebGLRenderingContext::attachShader(WebGLProgram* program, WebGLShader* sha
UNUSED_PARAM(ec);
if (!validateWebGLObject(program) || !validateWebGLObject(shader))
return;
+ if (!program->attachShader(shader)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
m_context->attachShader(objectOrZero(program), objectOrZero(shader));
+ shader->onAttached();
cleanupAfterGraphicsCall(false);
}
@@ -521,6 +512,9 @@ void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, uns
{
if (!validateTexFuncParameters(target, level, internalformat, width, height, border, internalformat, GraphicsContext3D::UNSIGNED_BYTE))
return;
+ WebGLTexture* tex = validateTextureBinding(target, true);
+ if (!tex)
+ return;
if (!isGLES2Compliant()) {
if (m_framebufferBinding && m_framebufferBinding->object()
&& !isTexInternalFormatColorBufferCombinationValid(internalformat,
@@ -535,21 +529,20 @@ void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, uns
}
m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border);
// FIXME: if the framebuffer is not complete, none of the below should be executed.
- WebGLTexture* tex = getTextureBinding(target);
- if (!isGLES2Compliant()) {
- if (tex)
- tex->setLevelInfo(target, level, internalformat, width, height, GraphicsContext3D::UNSIGNED_BYTE);
- }
- if (m_framebufferBinding && tex)
+ if (!isGLES2Compliant())
+ tex->setLevelInfo(target, level, internalformat, width, height, GraphicsContext3D::UNSIGNED_BYTE);
+ if (m_framebufferBinding)
m_framebufferBinding->onAttachedObjectChange(tex);
cleanupAfterGraphicsCall(false);
}
void WebGLRenderingContext::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height)
{
+ WebGLTexture* tex = validateTextureBinding(target, true);
+ if (!tex)
+ return;
if (!isGLES2Compliant()) {
- WebGLTexture* tex = getTextureBinding(target);
- if (m_framebufferBinding && m_framebufferBinding->object() && tex
+ if (m_framebufferBinding && m_framebufferBinding->object()
&& !isTexInternalFormatColorBufferCombinationValid(tex->getInternalFormat(),
m_framebufferBinding->getColorBufferFormat())) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
@@ -648,7 +641,12 @@ void WebGLRenderingContext::deleteProgram(WebGLProgram* program)
{
if (!program)
return;
-
+ if (program->context() != this) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
+ if (!program->object())
+ return;
program->deleteObject();
}
@@ -703,7 +701,12 @@ void WebGLRenderingContext::detachShader(WebGLProgram* program, WebGLShader* sha
UNUSED_PARAM(ec);
if (!validateWebGLObject(program) || !validateWebGLObject(shader))
return;
+ if (!program->detachShader(shader)) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return;
+ }
m_context->detachShader(objectOrZero(program), objectOrZero(shader));
+ shader->onDetached();
cleanupAfterGraphicsCall(false);
}
@@ -890,7 +893,7 @@ bool WebGLRenderingContext::validateRenderingState(long numElementsRequired)
bool WebGLRenderingContext::validateWebGLObject(WebGLObject* object)
{
- if (!object) {
+ if (!object || !object->object()) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return false;
}
@@ -1110,22 +1113,18 @@ void WebGLRenderingContext::frontFace(unsigned long mode)
void WebGLRenderingContext::generateMipmap(unsigned long target)
{
- RefPtr<WebGLTexture> tex;
+ WebGLTexture* tex = validateTextureBinding(target, false);
+ if (!tex)
+ return;
if (!isGLES2Compliant()) {
- if (target == GraphicsContext3D::TEXTURE_2D)
- tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding;
- else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP)
- tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding;
- if (tex && !tex->canGenerateMipmaps()) {
+ if (!tex->canGenerateMipmaps()) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
}
m_context->generateMipmap(target);
- if (!isGLES2Compliant()) {
- if (tex)
- tex->generateMipmapLevelInfo();
- }
+ if (!isGLES2Compliant())
+ tex->generateMipmapLevelInfo();
cleanupAfterGraphicsCall(false);
}
@@ -1574,11 +1573,9 @@ String WebGLRenderingContext::getString(unsigned long name)
WebGLGetInfo WebGLRenderingContext::getTexParameter(unsigned long target, unsigned long pname, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
- if (target != GraphicsContext3D::TEXTURE_2D
- && target != GraphicsContext3D::TEXTURE_CUBE_MAP) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ WebGLTexture* tex = validateTextureBinding(target, false);
+ if (!tex)
return WebGLGetInfo();
- }
WebGLStateRestorer(this, false);
int value = 0;
switch (pname) {
@@ -1886,21 +1883,7 @@ void WebGLRenderingContext::linkProgram(WebGLProgram* program, ExceptionCode& ec
if (!validateWebGLObject(program))
return;
if (!isGLES2Compliant()) {
- Vector<WebGLShader*> shaders;
- bool succeed = getAttachedShaders(program, shaders, ec);
- if (succeed) {
- bool vShader = false;
- bool fShader = false;
- for (size_t ii = 0; ii < shaders.size() && (!vShader || !fShader); ++ii) {
- if (shaders[ii]->getType() == GraphicsContext3D::VERTEX_SHADER)
- vShader = true;
- else if (shaders[ii]->getType() == GraphicsContext3D::FRAGMENT_SHADER)
- fShader = true;
- }
- if (!vShader || !fShader)
- succeed = false;
- }
- if (!succeed) {
+ if (!program->getAttachedShader(GraphicsContext3D::VERTEX_SHADER) || !program->getAttachedShader(GraphicsContext3D::FRAGMENT_SHADER)) {
program->setLinkFailureFlag(true);
return;
}
@@ -2100,6 +2083,9 @@ void WebGLRenderingContext::texImage2DBase(unsigned target, unsigned level, unsi
ec = 0;
if (!validateTexFuncParameters(target, level, internalformat, width, height, border, format, type))
return;
+ WebGLTexture* tex = validateTextureBinding(target, true);
+ if (!tex)
+ return;
if (!isGLES2Compliant()) {
if (level && WebGLTexture::isNPOT(width, height)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
@@ -2108,12 +2094,9 @@ void WebGLRenderingContext::texImage2DBase(unsigned target, unsigned level, unsi
}
m_context->texImage2D(target, level, internalformat, width, height,
border, format, type, pixels);
- WebGLTexture* tex = getTextureBinding(target);
- if (!isGLES2Compliant()) {
- if (tex)
- tex->setLevelInfo(target, level, internalformat, width, height, type);
- }
- if (m_framebufferBinding && tex)
+ if (!isGLES2Compliant())
+ tex->setLevelInfo(target, level, internalformat, width, height, type);
+ if (m_framebufferBinding)
m_framebufferBinding->onAttachedObjectChange(tex);
cleanupAfterGraphicsCall(false);
}
@@ -2200,7 +2183,8 @@ void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
- texImage2DImpl(target, level, internalformat, format, type, canvas->buffer()->image(),
+
+ texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(),
m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
}
@@ -2219,130 +2203,12 @@ void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned
cleanupAfterGraphicsCall(false);
}
-// Obsolete texImage2D entry points -- to be removed shortly. (FIXME)
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageData* pixels,
- ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, ImageData pixels)");
- texImage2D(target, level, pixels, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageData* pixels,
- bool flipY, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, ImageData pixels, GLboolean flipY)");
- texImage2D(target, level, pixels, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageData* pixels,
- bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, ImageData pixels, GLboolean flipY, GLboolean premultiplyAlpha)");
- ec = 0;
- Vector<uint8_t> data;
- if (!m_context->extractImageData(pixels, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, flipY, premultiplyAlpha, data)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- texImage2DBase(target, level, GraphicsContext3D::RGBA, pixels->width(), pixels->height(), 0,
- GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, data.data(), ec);
-}
-
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
- ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, HTMLImageElement image)");
- texImage2D(target, level, image, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
- bool flipY, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, HTMLImageElement image, GLboolean flipY)");
- texImage2D(target, level, image, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLImageElement* image,
- bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, HTMLImageElement image, GLboolean flipY, GLboolean premultiplyAlpha)");
- ec = 0;
- if (!image || !image->cachedImage()) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- texImage2DImpl(target, level, GraphicsContext3D::RGBA, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, image->cachedImage()->image(), flipY, premultiplyAlpha, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
- ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, HTMLCanvasElement canvas)");
- texImage2D(target, level, canvas, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
- bool flipY, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, HTMLCanvasElement canvas, GLboolean flipY)");
- texImage2D(target, level, canvas, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas,
- bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, HTMLCanvasElement canvas, GLboolean flipY, GLboolean premultiplyAlpha)");
- ec = 0;
- if (!canvas || !canvas->buffer()) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- texImage2DImpl(target, level, GraphicsContext3D::RGBA, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, canvas->buffer()->image(), flipY, premultiplyAlpha, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
- ExceptionCode& ec)
-{
- texImage2D(target, level, video, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
- bool flipY, ExceptionCode& ec)
-{
- texImage2D(target, level, video, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, HTMLVideoElement* video,
- bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- // FIXME: Need implement this call
- UNUSED_PARAM(target);
- UNUSED_PARAM(level);
- UNUSED_PARAM(video);
- UNUSED_PARAM(flipY);
- UNUSED_PARAM(premultiplyAlpha);
-
- ec = 0;
- cleanupAfterGraphicsCall(false);
-}
-
void WebGLRenderingContext::texParameter(unsigned long target, unsigned long pname, float paramf, int parami, bool isFloat)
{
+ WebGLTexture* tex = validateTextureBinding(target, false);
+ if (!tex)
+ return;
if (!isGLES2Compliant()) {
- RefPtr<WebGLTexture> tex = 0;
- switch (target) {
- case GraphicsContext3D::TEXTURE_2D:
- tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding;
- break;
- case GraphicsContext3D::TEXTURE_CUBE_MAP:
- tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding;
- break;
- default:
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
- return;
- }
switch (pname) {
case GraphicsContext3D::TEXTURE_MIN_FILTER:
case GraphicsContext3D::TEXTURE_MAG_FILTER:
@@ -2359,12 +2225,10 @@ void WebGLRenderingContext::texParameter(unsigned long target, unsigned long pna
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return;
}
- if (tex) {
- if (isFloat)
- tex->setParameterf(pname, paramf);
- else
- tex->setParameteri(pname, parami);
- }
+ if (isFloat)
+ tex->setParameterf(pname, paramf);
+ else
+ tex->setParameteri(pname, parami);
}
if (isFloat)
m_context->texParameterf(target, pname, paramf);
@@ -2391,7 +2255,8 @@ void WebGLRenderingContext::texSubImage2DBase(unsigned target, unsigned level, u
ec = 0;
if (!validateTexFuncFormatAndType(format, type))
return;
-
+ if (!validateTextureBinding(target, true))
+ return;
m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
cleanupAfterGraphicsCall(false);
}
@@ -2469,7 +2334,8 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
- texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->buffer()->image(),
+
+ texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(),
m_unpackFlipY, m_unpackPremultiplyAlpha, ec);
}
@@ -2488,117 +2354,6 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
cleanupAfterGraphicsCall(false);
}
-// Obsolete texSubImage2D entry points -- to be removed shortly. (FIXME)
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- ImageData* pixels, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, ImageData pixels)");
- texSubImage2D(target, level, xoffset, yoffset, pixels, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- ImageData* pixels, bool flipY, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, ImageData pixels, GLboolean flipY)");
- texSubImage2D(target, level, xoffset, yoffset, pixels, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, ImageData pixels, GLboolean flipY, GLboolean premultiplyAlpha)");
- ec = 0;
- Vector<uint8_t> data;
- if (!m_context->extractImageData(pixels, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, flipY, premultiplyAlpha, data)) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- texSubImage2DBase(target, level, xoffset, yoffset, pixels->width(), pixels->height(),
- GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, data.data(), ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLImageElement* image, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, HTMLImageElement image)");
- texSubImage2D(target, level, xoffset, yoffset, image, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLImageElement* image, bool flipY, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, HTMLImageElement image, GLboolean flipY)");
- texSubImage2D(target, level, xoffset, yoffset, image, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, HTMLImageElement image, GLboolean flipY, GLboolean premultiplyAlpha)");
- ec = 0;
- if (!image || !image->cachedImage()) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- texSubImage2DImpl(target, level, xoffset, yoffset, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, image->cachedImage()->image(),
- flipY, premultiplyAlpha, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLCanvasElement* canvas, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, HTMLCanvasElement canvas)");
- texSubImage2D(target, level, xoffset, yoffset, canvas, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLCanvasElement* canvas, bool flipY, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, HTMLCanvasElement canvas, GLboolean flipY)");
- texSubImage2D(target, level, xoffset, yoffset, canvas, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, HTMLCanvasElement canvas, GLboolean flipY, GLboolean premultiplyAlpha)");
- ec = 0;
- if (!canvas || !canvas->buffer()) {
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
- return;
- }
- texSubImage2DImpl(target, level, xoffset, yoffset, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, canvas->buffer()->image(),
- flipY, premultiplyAlpha, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLVideoElement* video, ExceptionCode& ec)
-{
- texSubImage2D(target, level, xoffset, yoffset, video, 0, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLVideoElement* video, bool flipY, ExceptionCode& ec)
-{
- texSubImage2D(target, level, xoffset, yoffset, video, flipY, 0, ec);
-}
-
-void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
- HTMLVideoElement* video, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
-{
- // FIXME: Need to implement this call
- UNUSED_PARAM(target);
- UNUSED_PARAM(level);
- UNUSED_PARAM(xoffset);
- UNUSED_PARAM(yoffset);
- UNUSED_PARAM(video);
- UNUSED_PARAM(flipY);
- UNUSED_PARAM(premultiplyAlpha);
- ec = 0;
- cleanupAfterGraphicsCall(false);
-}
-
void WebGLRenderingContext::uniform1f(const WebGLUniformLocation* location, float x, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
@@ -2935,13 +2690,23 @@ void WebGLRenderingContext::uniformMatrix4fv(const WebGLUniformLocation* locatio
void WebGLRenderingContext::useProgram(WebGLProgram* program, ExceptionCode& ec)
{
- UNUSED_PARAM(ec);
if (program && program->context() != this) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
- m_currentProgram = program;
- m_context->useProgram(objectOrZero(program));
+ if (program && program->object() && !getProgramParameter(program, GraphicsContext3D::LINK_STATUS, ec).getBool()) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ cleanupAfterGraphicsCall(false);
+ return;
+ }
+ if (m_currentProgram != program) {
+ if (m_currentProgram)
+ m_currentProgram->onDetached();
+ m_currentProgram = program;
+ m_context->useProgram(objectOrZero(program));
+ if (program)
+ program->onAttached();
+ }
cleanupAfterGraphicsCall(false);
}
@@ -3185,7 +2950,8 @@ WebGLGetInfo WebGLRenderingContext::getUnsignedLongParameter(unsigned long pname
{
int value;
m_context->getIntegerv(pname, &value);
- return WebGLGetInfo(static_cast<unsigned long>(value));
+ unsigned int uValue = static_cast<unsigned int>(value);
+ return WebGLGetInfo(static_cast<unsigned long>(uValue));
}
WebGLGetInfo WebGLRenderingContext::getWebGLFloatArrayParameter(unsigned long pname)
@@ -3309,12 +3075,12 @@ bool WebGLRenderingContext::isTexInternalFormatColorBufferCombinationValid(unsig
return false;
}
-WebGLTexture* WebGLRenderingContext::getTextureBinding(unsigned long target)
+WebGLTexture* WebGLRenderingContext::validateTextureBinding(unsigned long target, bool useSixEnumsForCubeMap)
{
- RefPtr<WebGLTexture> tex = 0;
+ WebGLTexture* tex = 0;
switch (target) {
case GraphicsContext3D::TEXTURE_2D:
- tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding;
+ tex = m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get();
break;
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_X:
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_X:
@@ -3322,12 +3088,26 @@ WebGLTexture* WebGLRenderingContext::getTextureBinding(unsigned long target)
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:
- tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding;
+ if (!useSixEnumsForCubeMap) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return 0;
+ }
+ tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding.get();
+ break;
+ case GraphicsContext3D::TEXTURE_CUBE_MAP:
+ if (useSixEnumsForCubeMap) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return 0;
+ }
+ tex = m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding.get();
break;
+ default:
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return 0;
}
- if (tex && tex->object())
- return tex.get();
- return 0;
+ if (!tex)
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return tex;
}
bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, unsigned long type)
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index 608797f..48fa7c8 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -206,19 +206,6 @@ public:
unsigned format, unsigned type, HTMLCanvasElement* canvas, ExceptionCode&);
void texImage2D(unsigned target, unsigned level, unsigned internalformat,
unsigned format, unsigned type, HTMLVideoElement* video, ExceptionCode&);
- // Obsolete entry points -- to be removed shortly. (FIXME)
- void texImage2D(unsigned target, unsigned level, ImageData* pixels, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, ImageData* pixels, bool flipY, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLImageElement* image, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLImageElement* image, bool flipY, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas, bool flipY, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video, bool flipY, ExceptionCode&);
- void texImage2D(unsigned target, unsigned level, HTMLVideoElement* video, bool flipY, bool premultiplyAlpha, ExceptionCode&);
void texParameterf(unsigned target, unsigned pname, float param);
void texParameteri(unsigned target, unsigned pname, int param);
@@ -234,19 +221,6 @@ public:
unsigned format, unsigned type, HTMLCanvasElement* canvas, ExceptionCode&);
void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
unsigned format, unsigned type, HTMLVideoElement* video, ExceptionCode&);
- // Obsolete entry points -- to be removed shortly. (FIXME)
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, ImageData* pixels, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, ImageData* pixels, bool flipY, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, ImageData* pixels, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLImageElement* image, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLImageElement* image, bool flipY, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLImageElement* image, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLCanvasElement* canvas, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLCanvasElement* canvas, bool flipY, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLCanvasElement* canvas, bool flipY, bool premultiplyAlpha, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLVideoElement* video, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLVideoElement* video, bool flipY, ExceptionCode&);
- void texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, HTMLVideoElement* video, bool flipY, bool premultiplyAlpha, ExceptionCode&);
void uniform1f(const WebGLUniformLocation* location, float x, ExceptionCode&);
void uniform1fv(const WebGLUniformLocation* location, Float32Array* v, ExceptionCode&);
@@ -305,12 +279,10 @@ public:
virtual void paintRenderingResultsToCanvas();
- // Helpers for notification about paint events.
- void beginPaint();
- void endPaint();
-
void removeObject(WebGLObject*);
+ bool paintsIntoCanvasBuffer() const { return m_context->paintsIntoCanvasBuffer(); }
+
private:
friend class WebGLObject;
@@ -460,8 +432,10 @@ public:
bool isTexInternalFormatColorBufferCombinationValid(unsigned long texInternalFormat,
unsigned long colorBufferFormat);
- // Helper function to get the current bound texture.
- WebGLTexture* getTextureBinding(unsigned long target);
+ // Helper function to check target and texture bound to the target.
+ // Generate GL errors and return 0 if target is invalid or texture bound is
+ // null. Otherwise, return the texture bound to the target.
+ WebGLTexture* validateTextureBinding(unsigned long target, bool useSixEnumsForCubeMap);
// Helper function to check input format/type for functions {copy}Tex{Sub}Image.
// Generates GL error and returns false if parameters are invalid.
diff --git a/WebCore/html/canvas/WebGLRenderingContext.idl b/WebCore/html/canvas/WebGLRenderingContext.idl
index 711aa42..960dd0b 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.idl
+++ b/WebCore/html/canvas/WebGLRenderingContext.idl
@@ -622,15 +622,6 @@ module html {
in unsigned long format, in unsigned long type, in HTMLCanvasElement canvas) raises (DOMException);
void texImage2D(in unsigned long target, in long level, in unsigned long internalformat,
in unsigned long format, in unsigned long type, in HTMLVideoElement video) raises (DOMException);
- // Obsolete entry points -- to be removed shortly. (FIXME)
- void texImage2D(in unsigned long target, in long level, in ImageData pixels,
- in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
- void texImage2D(in unsigned long target, in long level, in HTMLImageElement image,
- in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
- void texImage2D(in unsigned long target, in long level, in HTMLCanvasElement canvas,
- in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
- void texImage2D(in unsigned long target, in long level, in HTMLVideoElement video,
- in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
in long width, in long height,
@@ -643,15 +634,6 @@ module html {
in unsigned long format, in unsigned long type, in HTMLCanvasElement canvas) raises (DOMException);
void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
in unsigned long format, in unsigned long type, in HTMLVideoElement video) raises (DOMException);
- // Obsolete entry points -- to be removed shortly. (FIXME)
- void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in ImageData pixels, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
- void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in HTMLImageElement image, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
- void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in HTMLCanvasElement canvas, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
- void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset,
- in HTMLVideoElement video, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException);
void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException);
[Custom] void uniform1fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
diff --git a/WebCore/html/canvas/WebGLTexture.cpp b/WebCore/html/canvas/WebGLTexture.cpp
index 2c50bf8..e6dfd0a 100644
--- a/WebCore/html/canvas/WebGLTexture.cpp
+++ b/WebCore/html/canvas/WebGLTexture.cpp
@@ -151,21 +151,22 @@ void WebGLTexture::generateMipmapLevelInfo()
return;
if (!canGenerateMipmaps())
return;
- if (m_isComplete)
- return;
- for (size_t ii = 0; ii < m_info.size(); ++ii) {
- const LevelInfo& info0 = m_info[ii][0];
- int width = info0.width;
- int height = info0.height;
- int levelCount = computeLevelCount(width, height);
- for (int level = 1; level < levelCount; ++level) {
- width = std::max(1, width >> 1);
- height = std::max(1, height >> 1);
- LevelInfo& info = m_info[ii][level];
- info.setInfo(info0.internalFormat, width, height, info0.type);
+ if (!m_isComplete) {
+ for (size_t ii = 0; ii < m_info.size(); ++ii) {
+ const LevelInfo& info0 = m_info[ii][0];
+ int width = info0.width;
+ int height = info0.height;
+ int levelCount = computeLevelCount(width, height);
+ for (int level = 1; level < levelCount; ++level) {
+ width = std::max(1, width >> 1);
+ height = std::max(1, height >> 1);
+ LevelInfo& info = m_info[ii][level];
+ info.setInfo(info0.internalFormat, width, height, info0.type);
+ }
}
+ m_isComplete = true;
}
- m_isComplete = true;
+ m_needToUseBlackTexture = false;
}
unsigned long WebGLTexture::getInternalFormat() const
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm
index 9d0af53..cd9052a 100644
--- a/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/WebCore/inspector/CodeGeneratorInspector.pm
@@ -47,30 +47,27 @@ $typeTransform{"PassRefPtr"} = {
};
$typeTransform{"Object"} = {
"param" => "PassRefPtr<InspectorObject>",
- "retVal" => "PassRefPtr<InspectorObject>",
"variable" => "RefPtr<InspectorObject>",
"defaultValue" => "InspectorObject::create()",
"forward" => "InspectorObject",
"header" => "InspectorValues.h",
- "accessorSuffix" => ""
+ "accessorSuffix" => "Object"
};
$typeTransform{"Array"} = {
"param" => "PassRefPtr<InspectorArray>",
- "retVal" => "PassRefPtr<InspectorArray>",
"variable" => "RefPtr<InspectorArray>",
"defaultValue" => "InspectorArray::create()",
"forward" => "InspectorArray",
"header" => "InspectorValues.h",
- "accessorSuffix" => ""
+ "accessorSuffix" => "Array"
};
$typeTransform{"Value"} = {
"param" => "PassRefPtr<InspectorValue>",
- "retVal" => "PassRefPtr<InspectorValue>",
"variable" => "RefPtr<InspectorValue>",
"defaultValue" => "InspectorValue::null()",
"forward" => "InspectorValue",
"header" => "InspectorValues.h",
- "accessorSuffix" => ""
+ "accessorSuffix" => "Value"
};
$typeTransform{"String"} = {
"param" => "const String&",
@@ -120,7 +117,6 @@ $typeTransform{"boolean"} = {
"accessorSuffix" => "Bool"
};
$typeTransform{"void"} = {
- "retVal" => "void",
"forward" => "",
"header" => ""
};
@@ -142,17 +138,23 @@ my $verbose;
my $namespace;
my $backendClassName;
+my $backendJSStubName;
my %backendTypes;
my %backendMethods;
my @backendMethodsImpl;
my $backendConstructor;
+my @backendConstantDeclarations;
+my @backendConstantDefinitions;
my $backendFooter;
+my @backendStubJS;
my $frontendClassName;
my %frontendTypes;
my %frontendMethods;
my @frontendMethodsImpl;
my $frontendConstructor;
+my @frontendConstantDeclarations;
+my @frontendConstantDefinitions;
my $frontendFooter;
my $callId = new domSignature(); # it is just structure for describing parameters from IDLStructure.pm.
@@ -204,11 +206,12 @@ sub GenerateInterface
$frontendTypes{"PassRefPtr"} = 1;
$backendClassName = $className . "BackendDispatcher";
+ $backendJSStubName = $className . "BackendStub";
my @backendHead;
push(@backendHead, " ${backendClassName}(InspectorController* inspectorController) : m_inspectorController(inspectorController) { }");
push(@backendHead, " void reportProtocolError(const long callId, const String& method, const String& errorText) const;");
push(@backendHead, " void dispatch(const String& message);");
- push(@backendHead, "private:");
+ push(@backendHead, " static bool getCommandName(const String& message, String* result);");
$backendConstructor = join("\n", @backendHead);
$backendFooter = " InspectorController* m_inspectorController;";
$backendTypes{"Controller"} = 1;
@@ -216,8 +219,13 @@ sub GenerateInterface
$backendTypes{"PassRefPtr"} = 1;
$backendTypes{"Array"} = 1;
- generateBackendPrivateFunctions();
+ push(@backendMethodsImpl, generateBackendPrivateFunctions());
+ push(@backendMethodsImpl, generateBackendMessageParser());
generateFunctions($interface);
+
+ # Make dispatcher methods private on the backend.
+ push(@backendConstantDeclarations, "");
+ push(@backendConstantDeclarations, "private:");
}
sub generateFunctions
@@ -225,23 +233,25 @@ sub generateFunctions
my $interface = shift;
foreach my $function (@{$interface->functions}) {
- generateFrontendFunction($function);
- generateBackendFunction($function);
+ if ($function->signature->extendedAttributes->{"notify"}) {
+ generateFrontendFunction($function);
+ } else {
+ generateBackendFunction($function);
+ }
}
push(@backendMethodsImpl, generateBackendDispatcher());
push(@backendMethodsImpl, generateBackendReportProtocolError());
+
+ @backendStubJS = generateBackendStubJS($interface);
}
sub generateFrontendFunction
{
my $function = shift;
- my $notify = $function->signature->extendedAttributes->{"notify"};
- return if !$notify;
- my $functionName = $notify ? $function->signature->name : "did" . ucfirst($function->signature->name);
+ my $functionName = $function->signature->name;
my @argsFiltered = grep($_->direction eq "out", @{$function->parameters}); # just keep only out parameters for frontend interface.
- unshift(@argsFiltered, $callId) if !$notify; # Add callId as the first argument for all frontend did* methods.
map($frontendTypes{$_->type} = 1, @argsFiltered); # register required types.
my $arguments = join(", ", map($typeTransform{$_->type}->{"param"} . " " . $_->name, @argsFiltered)); # prepare arguments for function signature.
my @pushArguments = map(" arguments->push" . $typeTransform{$_->type}->{"accessorSuffix"} . "(" . $_->name . ");", @argsFiltered);
@@ -254,7 +264,7 @@ sub generateFrontendFunction
push(@function, "void ${frontendClassName}::${functionName}(${arguments})");
push(@function, "{");
push(@function, " RefPtr<InspectorArray> arguments = InspectorArray::create();");
- push(@function, " arguments->pushString(\"" . ($notify ? $functionName : "processResponse") . "\");");
+ push(@function, " arguments->pushString(\"$functionName\");");
push(@function, @pushArguments);
push(@function, " m_inspectorClient->sendMessageToFrontend(arguments->toJSONString());");
@@ -277,16 +287,18 @@ static String formatWrongArgumentTypeMessage(unsigned position, const char* name
return String::format("Failed to convert parameter %d (%s) to %s", position, name, expectedType);
}
EOF
- push(@backendMethodsImpl, $privateFunctions);
+ return split("\n", $privateFunctions);
}
sub generateBackendFunction
{
my $function = shift;
- return if $function->signature->extendedAttributes->{"notify"};
my $functionName = $function->signature->name;
+ push(@backendConstantDeclarations, " static const char* ${functionName}Cmd;");
+ push(@backendConstantDefinitions, "const char* ${backendClassName}::${functionName}Cmd = \"${functionName}\";");
+
map($backendTypes{$_->type} = 1, @{$function->parameters}); # register required types
my @inArgs = grep($_->direction eq "in", @{$function->parameters});
my @outArgs = grep($_->direction eq "out", @{$function->parameters});
@@ -298,7 +310,6 @@ sub generateBackendFunction
my @function;
push(@function, "void ${backendClassName}::${functionName}(PassRefPtr<InspectorArray> args)");
push(@function, "{");
- push(@function, " DEFINE_STATIC_LOCAL(String, backendFunctionName, (\"$functionName\"));");
push(@function, " long callId = 0;");
push(@function, "");
@@ -306,7 +317,7 @@ sub generateBackendFunction
my $expectedParametersCountWithMethodName = scalar(@inArgs) + 1;
push(@function, " if (args->length() != $expectedParametersCountWithMethodName) {");
push(@function, " ASSERT_NOT_REACHED();");
- push(@function, " reportProtocolError(callId, backendFunctionName, formatWrongArgumentsCountMessage(args->length() - 1, $expectedParametersCount));");
+ push(@function, " reportProtocolError(callId, ${functionName}Cmd, formatWrongArgumentsCountMessage(args->length() - 1, $expectedParametersCount));");
push(@function, " return;");
push(@function, " }");
push(@function, "");
@@ -314,11 +325,11 @@ sub generateBackendFunction
my $i = 1; # zero element is the method name.
foreach my $parameter (@inArgs) {
my $type = $parameter->type;
- my $argumentType = $typeTransform{$type}->{$typeTransform{$type}->{"retVal"} ? "retVal" : "variable"};
+ my $argumentType = $typeTransform{$type}->{"variable"};
push(@function, " $argumentType " . $parameter->name . ";") if !($parameter->name eq "callId");
push(@function, " if (!args->get($i)->as" . $typeTransform{$type}->{"accessorSuffix"} . "(&" . $parameter->name . ")) {");
push(@function, " ASSERT_NOT_REACHED();");
- push(@function, " reportProtocolError(callId, backendFunctionName, formatWrongArgumentTypeMessage($i, \"" . $parameter->name . "\", \"$type\"));");
+ push(@function, " reportProtocolError(callId, ${functionName}Cmd, formatWrongArgumentTypeMessage($i, \"" . $parameter->name . "\", \"$type\"));");
push(@function, " return;");
push(@function, " }");
push(@function, "");
@@ -329,7 +340,7 @@ sub generateBackendFunction
my $handlerAccessor = $typeTransform{$handler}->{"handlerAccessor"};
$backendTypes{$handler} = 1;
push(@function, " if (!$handlerAccessor) {");
- push(@function, " reportProtocolError(callId, backendFunctionName, \"Error: $handler handler is not available.\");");
+ push(@function, " reportProtocolError(callId, ${functionName}Cmd, \"Error: $handler handler is not available.\");");
push(@function, " return;");
push(@function, " }");
push(@function, "");
@@ -383,7 +394,7 @@ sub generateBackendDispatcher
{
my @body;
my @methods = map($backendMethods{$_}, keys %backendMethods);
- my @mapEntries = map(" dispatchMap.add(\"$_\", &${backendClassName}::$_);", @methods);
+ my @mapEntries = map(" dispatchMap.add(${_}Cmd, &${backendClassName}::$_);", @methods);
my $mapEntries = join("\n", @mapEntries);
my $backendDispatcherBody = << "EOF";
@@ -436,16 +447,72 @@ EOF
return split("\n", $backendDispatcherBody);
}
+sub generateBackendMessageParser
+{
+ my $messageParserBody = << "EOF";
+bool ${backendClassName}::getCommandName(const String& message, String* result)
+{
+ RefPtr<InspectorValue> value = InspectorValue::parseJSON(message);
+ if (!value)
+ return false;
+ RefPtr<InspectorArray> array = value->asArray();
+ if (!array)
+ return false;
+
+ if (!array->length())
+ return false;
+ return array->get(0)->asString(result);
+}
+EOF
+ return split("\n", $messageParserBody);
+}
+
+sub generateBackendStubJS
+{
+ my $interface = shift;
+ my @backendFunctions = grep(!$_->signature->extendedAttributes->{"notify"}, @{$interface->functions});
+ my @JSStubs = map(" this._registerDelegate(\"" . $_->signature->name . "\");", @backendFunctions);
+
+ my $JSStubs = join("\n", @JSStubs);
+ my $inspectorBackendStubJS = << "EOF";
+$licenseTemplate
+
+WebInspector.InspectorBackendStub = function()
+{
+$JSStubs
+}
+
+WebInspector.InspectorBackendStub.prototype = {
+ _registerDelegate: function(methodName)
+ {
+ this[methodName] = this.sendMessageToBackend.bind(this, methodName);
+ },
+
+ sendMessageToBackend: function()
+ {
+ var message = JSON.stringify(Array.prototype.slice.call(arguments));
+ InspectorFrontendHost.sendMessageToBackend(message);
+ }
+}
+
+InspectorBackend = new WebInspector.InspectorBackendStub();
+
+EOF
+ return split("\n", $inspectorBackendStubJS);
+}
+
sub generateHeader
{
my $className = shift;
my $types = shift;
my $constructor = shift;
+ my $constants = shift;
my $methods = shift;
my $footer = shift;
my $forwardHeaders = join("\n", sort(map("#include <" . $typeTransform{$_}->{"forwardHeader"} . ">", grep($typeTransform{$_}->{"forwardHeader"}, keys %{$types}))));
my $forwardDeclarations = join("\n", sort(map("class " . $typeTransform{$_}->{"forward"} . ";", grep($typeTransform{$_}->{"forward"}, keys %{$types}))));
+ my $constantDeclarations = join("\n", @{$constants});
my $methodsDeclarations = join("\n", keys %{$methods});
my $headerBody = << "EOF";
@@ -465,6 +532,7 @@ class $className {
public:
$constructor
+$constantDeclarations
$methodsDeclarations
private:
@@ -482,6 +550,7 @@ sub generateSource
{
my $className = shift;
my $types = shift;
+ my $constants = shift;
my $methods = shift;
my @sourceContent = split("\r", $licenseTemplate);
@@ -499,6 +568,8 @@ sub generateSource
push(@sourceContent, "");
push(@sourceContent, "namespace $namespace {");
push(@sourceContent, "");
+ push (@sourceContent, join("\n", @{$constants}));
+ push(@sourceContent, "");
push(@sourceContent, @{$methods});
push(@sourceContent, "");
push(@sourceContent, "} // namespace $namespace");
@@ -513,24 +584,29 @@ sub finish
my $object = shift;
open(my $SOURCE, ">$outputDir/$frontendClassName.cpp") || die "Couldn't open file $outputDir/$frontendClassName.cpp";
- print $SOURCE join("\n", generateSource($frontendClassName, \%frontendTypes, \@frontendMethodsImpl));
+ print $SOURCE join("\n", generateSource($frontendClassName, \%frontendTypes, \@frontendConstantDefinitions, \@frontendMethodsImpl));
close($SOURCE);
undef($SOURCE);
open(my $HEADER, ">$outputHeadersDir/$frontendClassName.h") || die "Couldn't open file $outputHeadersDir/$frontendClassName.h";
- print $HEADER generateHeader($frontendClassName, \%frontendTypes, $frontendConstructor, \%frontendMethods, $frontendFooter);
+ print $HEADER generateHeader($frontendClassName, \%frontendTypes, $frontendConstructor, \@frontendConstantDeclarations, \%frontendMethods, $frontendFooter);
close($HEADER);
undef($HEADER);
open($SOURCE, ">$outputDir/$backendClassName.cpp") || die "Couldn't open file $outputDir/$backendClassName.cpp";
- print $SOURCE join("\n", generateSource($backendClassName, \%backendTypes, \@backendMethodsImpl));
+ print $SOURCE join("\n", generateSource($backendClassName, \%backendTypes, \@backendConstantDefinitions, \@backendMethodsImpl));
close($SOURCE);
undef($SOURCE);
open($HEADER, ">$outputHeadersDir/$backendClassName.h") || die "Couldn't open file $outputHeadersDir/$backendClassName.h";
- print $HEADER join("\n", generateHeader($backendClassName, \%backendTypes, $backendConstructor, \%backendMethods, $backendFooter));
+ print $HEADER join("\n", generateHeader($backendClassName, \%backendTypes, $backendConstructor, \@backendConstantDeclarations, \%backendMethods, $backendFooter));
close($HEADER);
undef($HEADER);
+
+ open(my $JS_STUB, ">$outputDir/$backendJSStubName.js") || die "Couldn't open file $outputDir/$backendJSStubName.js";
+ print $JS_STUB join("\n", @backendStubJS);
+ close($JS_STUB);
+ undef($JS_STUB);
}
1;
diff --git a/WebCore/inspector/ConsoleMessage.cpp b/WebCore/inspector/ConsoleMessage.cpp
index 059dea4..6f19d2a 100644
--- a/WebCore/inspector/ConsoleMessage.cpp
+++ b/WebCore/inspector/ConsoleMessage.cpp
@@ -126,23 +126,25 @@ void ConsoleMessage::addToFrontend(RemoteInspectorFrontend* frontend, InjectedSc
jsonObj->setNumber("repeatCount", static_cast<int>(m_repeatCount));
jsonObj->setString("message", m_message);
if (!m_arguments.isEmpty()) {
- RefPtr<InspectorArray> jsonArgs = InspectorArray::create();
InjectedScript injectedScript = injectedScriptHost->injectedScriptFor(m_scriptState.get());
- for (unsigned i = 0; i < m_arguments.size(); ++i) {
- RefPtr<InspectorValue> inspectorValue = injectedScript.wrapForConsole(m_arguments[i]);
- if (!inspectorValue) {
- ASSERT_NOT_REACHED();
- return;
+ if (!injectedScript.hasNoValue()) {
+ RefPtr<InspectorArray> jsonArgs = InspectorArray::create();
+ for (unsigned i = 0; i < m_arguments.size(); ++i) {
+ RefPtr<InspectorValue> inspectorValue = injectedScript.wrapForConsole(m_arguments[i]);
+ if (!inspectorValue) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+ jsonArgs->pushValue(inspectorValue);
}
- jsonArgs->push(inspectorValue);
+ jsonObj->setArray("parameters", jsonArgs);
}
- jsonObj->set("parameters", jsonArgs);
}
if (!m_frames.isEmpty()) {
RefPtr<InspectorArray> frames = InspectorArray::create();
for (unsigned i = 0; i < m_frames.size(); i++)
- frames->push(m_frames.at(i).buildInspectorObject());
- jsonObj->set("stackTrace", frames);
+ frames->pushObject(m_frames.at(i).buildInspectorObject());
+ jsonObj->setArray("stackTrace", frames);
}
frontend->addConsoleMessage(jsonObj);
}
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 9d3d102..1c66b59 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -67,6 +67,7 @@ module core {
[notify] void updateConsoleMessageRepeatCount(out unsigned long count);
[notify] void updateFocusedNode(out long nodeId);
[notify] void updateResource(out Value resource);
+ [notify] void consoleMessagesCleared();
#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
[notify] void addProfileHeader(out Object header);
@@ -176,10 +177,10 @@ module core {
[handler=DOM] void searchCanceled();
[handler=DOM] void pushNodeByPathToFrontend(in long callId, in String path, out long nodeId);
- [handler=Backend] void clearConsoleMessages(in long callId);
-
+ [handler=Controller] void clearConsoleMessages();
[handler=Controller] void highlightDOMNode(in long nodeId);
[handler=Controller] void hideDOMNodeHighlight();
+ [handler=Controller] void openInInspectedWindow(in String url);
[handler=DOM] void getStyles(in long callId, in long nodeId, in boolean authOnly, out Value styles);
[handler=DOM] void getAllStyles(in long callId, out Array styles);
@@ -216,6 +217,5 @@ module core {
[handler=Controller] void setDOMStorageItem(in long callId, in long storageId, in String key, in String value, out boolean success);
[handler=Controller] void removeDOMStorageItem(in long callId, in long storageId, in String key, out boolean success);
#endif
-
};
}
diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.cpp b/WebCore/inspector/InspectorApplicationCacheAgent.cpp
index b95c0e1..1206184 100644
--- a/WebCore/inspector/InspectorApplicationCacheAgent.cpp
+++ b/WebCore/inspector/InspectorApplicationCacheAgent.cpp
@@ -82,7 +82,7 @@ PassRefPtr<InspectorObject> InspectorApplicationCacheAgent::buildObjectForApplic
value->setString("lastPathComponent", applicationCacheInfo.m_manifest.lastPathComponent());
value->setNumber("creationTime", applicationCacheInfo.m_creationTime);
value->setNumber("updateTime", applicationCacheInfo.m_updateTime);
- value->set("resources", buildArrayForApplicationCacheResources(applicationCacheResources));
+ value->setArray("resources", buildArrayForApplicationCacheResources(applicationCacheResources));
return value;
}
@@ -93,7 +93,7 @@ PassRefPtr<InspectorArray> InspectorApplicationCacheAgent::buildArrayForApplicat
ApplicationCacheHost::ResourceInfoList::const_iterator end = applicationCacheResources.end();
ApplicationCacheHost::ResourceInfoList::const_iterator it = applicationCacheResources.begin();
for (int i = 0; it != end; ++it, i++)
- resources->push(buildObjectForApplicationCacheResource(*it));
+ resources->pushObject(buildObjectForApplicationCacheResource(*it));
return resources;
}
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 0a18e1c..f0ed94b 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -106,11 +106,6 @@ void InspectorBackend::dispatchOnInjectedScript(long injectedScriptId, const Str
injectedScript.dispatch(methodName, arguments, result, hadException);
}
-void InspectorBackend::clearConsoleMessages()
-{
- m_inspectorController->clearConsoleMessages();
-}
-
void InspectorBackend::releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup)
{
m_inspectorController->injectedScriptHost()->releaseWrapperObjectGroup(injectedScriptId, objectGroup);
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 63c4a09..27a93eb 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -67,7 +67,6 @@ public:
void setInjectedScriptSource(const String& source);
void dispatchOnInjectedScript(long injectedScriptId, const String& methodName, const String& arguments, RefPtr<InspectorValue>* result, bool* hadException);
- void clearConsoleMessages();
// Generic code called from custom implementations.
void releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup);
diff --git a/WebCore/inspector/InspectorCSSStore.h b/WebCore/inspector/InspectorCSSStore.h
index 2a05d71..ee435e5 100644
--- a/WebCore/inspector/InspectorCSSStore.h
+++ b/WebCore/inspector/InspectorCSSStore.h
@@ -29,10 +29,10 @@
#ifndef InspectorCSSStore_h
#define InspectorCSSStore_h
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 0b59617..ac670cb 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"
@@ -46,6 +46,7 @@
#include "FloatQuad.h"
#include "FloatRect.h"
#include "Frame.h"
+#include "FrameLoadRequest.h"
#include "FrameLoader.h"
#include "FrameTree.h"
#include "FrameView.h"
@@ -86,6 +87,7 @@
#include "SharedBuffer.h"
#include "TextEncoding.h"
#include "TextIterator.h"
+#include "WindowFeatures.h"
#include <wtf/text/CString.h>
#include <wtf/CurrentTime.h>
#include <wtf/ListHashSet.h>
@@ -359,6 +361,8 @@ void InspectorController::clearConsoleMessages()
m_injectedScriptHost->releaseWrapperObjectGroup(0 /* release the group in all scripts */, "console");
if (m_domAgent)
m_domAgent->releaseDanglingNodes();
+ if (m_remoteFrontend)
+ m_remoteFrontend->consoleMessagesCleared();
}
void InspectorController::startGroup(MessageSource source, ScriptCallStack* callStack, bool collapsed)
@@ -604,9 +608,12 @@ void InspectorController::releaseFrontendLifetimeAgents()
if (m_domAgent)
m_domAgent->reset();
m_domAgent.clear();
+
+#if ENABLE(DATABASE)
if (m_storageAgent)
m_storageAgent->clearFrontend();
m_storageAgent.clear();
+#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
m_applicationCacheAgent.clear();
@@ -1329,7 +1336,7 @@ PassRefPtr<InspectorArray> InspectorController::buildArrayForCookies(ListHashSet
ListHashSet<Cookie>::iterator end = cookiesList.end();
ListHashSet<Cookie>::iterator it = cookiesList.begin();
for (int i = 0; it != end; ++it, i++)
- cookies->push(buildObjectForCookie(*it));
+ cookies->pushObject(buildObjectForCookie(*it));
return cookies;
}
@@ -1413,7 +1420,7 @@ void InspectorController::getDOMStorageEntries(long storageId, RefPtr<InspectorA
RefPtr<InspectorArray> entry = InspectorArray::create();
entry->pushString(name);
entry->pushString(value);
- (*entries)->push(entry);
+ (*entries)->pushArray(entry);
}
}
}
@@ -1500,7 +1507,7 @@ void InspectorController::getProfileHeaders(RefPtr<InspectorArray>* headers)
{
ProfilesMap::iterator profilesEnd = m_profiles.end();
for (ProfilesMap::iterator it = m_profiles.begin(); it != profilesEnd; ++it)
- (*headers)->push(createProfileHeader(*it->second));
+ (*headers)->pushObject(createProfileHeader(*it->second));
}
void InspectorController::getProfile(unsigned uid, RefPtr<InspectorObject>* profileObject)
@@ -1508,7 +1515,7 @@ void InspectorController::getProfile(unsigned uid, RefPtr<InspectorObject>* prof
ProfilesMap::iterator it = m_profiles.find(uid);
if (it != m_profiles.end()) {
*profileObject = createProfileHeader(*it->second);
- (*profileObject)->set("head", it->second->buildInspectorObjectForHead());
+ (*profileObject)->setObject("head", it->second->buildInspectorObjectForHead());
}
}
@@ -1865,6 +1872,22 @@ void InspectorController::drawNodeHighlight(GraphicsContext& context) const
}
}
+void InspectorController::openInInspectedWindow(const String& url)
+{
+ ResourceRequest request;
+ FrameLoadRequest frameRequest(request, "_blank");
+ bool created;
+ Frame* mainFrame = m_inspectedPage->mainFrame();
+ WindowFeatures windowFeatures;
+ Frame* newFrame = WebCore::createWindow(mainFrame, mainFrame, frameRequest, windowFeatures, created);
+ if (!newFrame)
+ return;
+
+ newFrame->loader()->setOpener(mainFrame);
+ newFrame->page()->setOpenedByDOM();
+ newFrame->loader()->changeLocation(newFrame->loader()->completeURL(url), "", false, false, true);
+}
+
void InspectorController::count(const String& title, unsigned lineNumber, const String& sourceID)
{
String identifier = title + String::format("@%s:%d", sourceID.utf8().data(), lineNumber);
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index faddedb..8d96005 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -35,13 +35,13 @@
#include "PlatformString.h"
#include "ScriptProfile.h"
#include "ScriptState.h"
-#include "StringHash.h"
#include "Timer.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/ListHashSet.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
@@ -136,7 +136,7 @@ public:
void connectFrontend();
void disconnectFrontend();
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message = String());
+ void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message);
void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
void clearConsoleMessages();
const Vector<OwnPtr<ConsoleMessage> >& consoleMessages() const { return m_consoleMessages; }
@@ -212,6 +212,7 @@ public:
bool hasFrontend() const { return m_remoteFrontend; }
void drawNodeHighlight(GraphicsContext&) const;
+ void openInInspectedWindow(const String& url);
void count(const String& title, unsigned lineNumber, const String& sourceID);
@@ -252,6 +253,7 @@ public:
void evaluateForTestInFrontend(long testCallId, const String& script);
InjectedScript injectedScriptForNodeId(long id);
+
void addScriptToEvaluateOnLoad(const String& source);
void removeAllScriptsToEvaluateOnLoad();
void setInspectorExtensionAPI(const String& source);
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 7cf0a82..6243299 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -33,7 +33,6 @@
#if ENABLE(INSPECTOR)
-#include "AtomicString.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSRule.h"
@@ -78,6 +77,7 @@
#include <wtf/ListHashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -600,7 +600,7 @@ void InspectorDOMAgent::getEventListenersForNode(long nodeId, long* outNodeId, R
for (size_t j = 0; j < vector.size(); ++j) {
const RegisteredEventListener& listener = vector[j];
if (listener.useCapture)
- (*listenersArray)->push(buildObjectForEventListener(listener, info.eventType, info.node));
+ (*listenersArray)->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
}
}
@@ -611,7 +611,7 @@ void InspectorDOMAgent::getEventListenersForNode(long nodeId, long* outNodeId, R
for (size_t j = 0; j < vector.size(); ++j) {
const RegisteredEventListener& listener = vector[j];
if (!listener.useCapture)
- (*listenersArray)->push(buildObjectForEventListener(listener, info.eventType, info.node));
+ (*listenersArray)->pushObject(buildObjectForEventListener(listener, info.eventType, info.node));
}
}
}
@@ -630,7 +630,7 @@ void InspectorDOMAgent::performSearch(const String& whitespaceTrimmedQuery, bool
// 2) There is no need to push all search results to the front-end at a time, pushing next / previous result
// is sufficient.
- int queryLength = whitespaceTrimmedQuery.length();
+ unsigned queryLength = whitespaceTrimmedQuery.length();
bool startTagFound = !whitespaceTrimmedQuery.find('<');
bool endTagFound = whitespaceTrimmedQuery.reverseFind('>') + 1 == queryLength;
@@ -766,11 +766,11 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForNode(Node* node, in
value->setNumber("childNodeCount", nodeCount);
RefPtr<InspectorArray> children = buildArrayForContainerChildren(node, depth, nodesMap);
if (children->length() > 0)
- value->set("children", children.release());
+ value->setArray("children", children.release());
if (node->nodeType() == Node::ELEMENT_NODE) {
Element* element = static_cast<Element*>(node);
- value->set("attributes", buildArrayForElementAttributes(element));
+ value->setArray("attributes", buildArrayForElementAttributes(element));
if (node->isFrameOwnerElement()) {
HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(node);
value->setString("documentURL", documentURLString(frameOwner->contentDocument()));
@@ -813,7 +813,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForContainerChildren(Nod
if (innerChildNodeCount(container) == 1) {
Node *child = innerFirstChild(container);
if (child->nodeType() == Node::TEXT_NODE)
- children->push(buildObjectForNode(child, 0, nodesMap));
+ children->pushObject(buildObjectForNode(child, 0, nodesMap));
}
return children.release();
} else if (depth > 0) {
@@ -821,7 +821,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForContainerChildren(Nod
}
for (Node *child = innerFirstChild(container); child; child = innerNextSibling(child))
- children->push(buildObjectForNode(child, depth, nodesMap));
+ children->pushObject(buildObjectForNode(child, depth, nodesMap));
return children.release();
}
@@ -986,27 +986,27 @@ void InspectorDOMAgent::getStyles(long nodeId, bool authorOnly, RefPtr<Inspector
RefPtr<InspectorObject> result = InspectorObject::create();
if (element->style())
- result->set("inlineStyle", buildObjectForStyle(element->style(), true));
- result->set("computedStyle", buildObjectForStyle(computedStyleInfo.get(), false));
+ result->setObject("inlineStyle", buildObjectForStyle(element->style(), true));
+ result->setObject("computedStyle", buildObjectForStyle(computedStyleInfo.get(), false));
CSSStyleSelector* selector = element->ownerDocument()->styleSelector();
RefPtr<CSSRuleList> matchedRules = selector->styleRulesForElement(element, authorOnly);
- result->set("matchedCSSRules", buildArrayForCSSRules(node->ownerDocument(), matchedRules.get()));
+ result->setArray("matchedCSSRules", buildArrayForCSSRules(node->ownerDocument(), matchedRules.get()));
- result->set("styleAttributes", buildObjectForAttributeStyles(element));
- result->set("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
+ result->setObject("styleAttributes", buildObjectForAttributeStyles(element));
+ result->setArray("pseudoElements", buildArrayForPseudoElements(element, authorOnly));
RefPtr<InspectorObject> currentStyle = result;
Element* parentElement = element->parentElement();
while (parentElement) {
RefPtr<InspectorObject> parentStyle = InspectorObject::create();
- currentStyle->set("parent", parentStyle);
+ currentStyle->setObject("parent", parentStyle);
if (parentElement->style() && parentElement->style()->length())
- parentStyle->set("inlineStyle", buildObjectForStyle(parentElement->style(), true));
+ parentStyle->setObject("inlineStyle", buildObjectForStyle(parentElement->style(), true));
CSSStyleSelector* parentSelector = parentElement->ownerDocument()->styleSelector();
RefPtr<CSSRuleList> parentMatchedRules = parentSelector->styleRulesForElement(parentElement, authorOnly);
- parentStyle->set("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
+ parentStyle->setArray("matchedCSSRules", buildArrayForCSSRules(parentElement->ownerDocument(), parentMatchedRules.get()));
parentElement = parentElement->parentElement();
currentStyle = parentStyle;
@@ -1021,7 +1021,7 @@ void InspectorDOMAgent::getAllStyles(RefPtr<InspectorArray>* styles)
for (unsigned i = 0; i < list->length(); ++i) {
StyleSheet* styleSheet = list->item(i);
if (styleSheet->isCSSStyleSheet())
- (*styles)->push(buildObjectForStyleSheet((*it).get(), static_cast<CSSStyleSheet*>(styleSheet)));
+ (*styles)->pushObject(buildObjectForStyleSheet((*it).get(), static_cast<CSSStyleSheet*>(styleSheet)));
}
}
}
@@ -1044,9 +1044,9 @@ void InspectorDOMAgent::getRuleRanges(long styleSheetId, RefPtr<InspectorValue>*
for (HashMap<long, SourceRange>::iterator it = ruleRanges.begin(); it != ruleRanges.end(); ++it) {
if (it->second.second) {
RefPtr<InspectorObject> ruleRange = InspectorObject::create();
- result->set(String::number(it->first).utf8().data(), ruleRange);
+ result->setObject(String::number(it->first).utf8().data(), ruleRange);
RefPtr<InspectorObject> bodyRange = InspectorObject::create();
- ruleRange->set("bodyRange", bodyRange);
+ ruleRange->setObject("bodyRange", bodyRange);
bodyRange->setNumber("start", it->second.first);
bodyRange->setNumber("end", it->second.second);
}
@@ -1085,7 +1085,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForAttributeStyles(Ele
Attribute* attribute = attributes->attributeItem(i);
if (attribute->style()) {
String attributeName = attribute->localName();
- styleAttributes->set(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), true));
+ styleAttributes->setObject(attributeName.utf8().data(), buildObjectForStyle(attribute->style(), true));
}
}
return styleAttributes;
@@ -1097,7 +1097,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForCSSRules(Document* ow
for (unsigned i = 0; matchedRules && i < matchedRules->length(); ++i) {
CSSRule* rule = matchedRules->item(i);
if (rule->type() == CSSRule::STYLE_RULE)
- matchedCSSRules->push(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
+ matchedCSSRules->pushObject(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
}
return matchedCSSRules.release();
}
@@ -1113,8 +1113,8 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForPseudoElements(Elemen
if (matchedRules && matchedRules->length()) {
RefPtr<InspectorObject> pseudoStyles = InspectorObject::create();
pseudoStyles->setNumber("pseudoId", static_cast<int>(pseudoId));
- pseudoStyles->set("rules", buildArrayForCSSRules(element->ownerDocument(), matchedRules.get()));
- result->push(pseudoStyles.release());
+ pseudoStyles->setArray("rules", buildArrayForCSSRules(element->ownerDocument(), matchedRules.get()));
+ result->pushObject(pseudoStyles.release());
}
}
return result.release();
@@ -1309,7 +1309,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyle(CSSStyleDecla
DisabledStyleDeclaration* disabledStyle = cssStore()->disabledStyleForId(styleId, false);
if (disabledStyle)
- result->set("disabled", buildArrayForDisabledStyleProperties(disabledStyle));
+ result->setArray("disabled", buildArrayForDisabledStyleProperties(disabledStyle));
}
result->setString("width", style->getPropertyValue("width"));
result->setString("height", style->getPropertyValue("height"));
@@ -1336,10 +1336,10 @@ void InspectorDOMAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* s
shorthandValues->setString(shorthand, shorthandValue(style, shorthand));
}
property->setString("value", style->getPropertyValue(name));
- properties->push(property.release());
+ properties->pushObject(property.release());
}
- result->set("properties", properties);
- result->set("shorthandValues", shorthandValues);
+ result->setArray("properties", properties);
+ result->setObject("shorthandValues", shorthandValues);
}
PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForDisabledStyleProperties(DisabledStyleDeclaration* declaration)
@@ -1350,7 +1350,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForDisabledStyleProperti
property->setString("name", it->first);
property->setString("value", it->second.first);
property->setString("priority", it->second.second);
- properties->push(property.release());
+ properties->pushObject(property.release());
}
return properties.release();
}
@@ -1370,10 +1370,10 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document
for (unsigned i = 0; i < cssRuleList->length(); ++i) {
CSSRule* rule = cssRuleList->item(i);
if (rule->isStyleRule())
- cssRules->push(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
+ cssRules->pushObject(buildObjectForRule(ownerDocument, static_cast<CSSStyleRule*>(rule)));
}
}
- result->set("cssRules", cssRules.release());
+ result->setArray("cssRules", cssRules.release());
return result.release();
}
@@ -1390,7 +1390,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne
RefPtr<InspectorObject> parentStyleSheetValue = InspectorObject::create();
parentStyleSheetValue->setString("href", parentStyleSheet->href());
parentStyleSheetValue->setNumber("id", cssStore()->bindStyleSheet(parentStyleSheet));
- result->set("parentStyleSheet", parentStyleSheetValue.release());
+ result->setObject("parentStyleSheet", parentStyleSheetValue.release());
}
bool isUserAgent = parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty();
bool isUser = parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document";
@@ -1400,7 +1400,7 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne
// Bind editable scripts only.
bool bind = !isUserAgent && !isUser;
- result->set("style", buildObjectForStyle(rule->style(), bind));
+ result->setObject("style", buildObjectForStyle(rule->style(), bind));
if (bind)
result->setNumber("id", cssStore()->bindRule(rule));
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index bae65f5..5317a22 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -30,7 +30,6 @@
#ifndef InspectorDOMAgent_h
#define InspectorDOMAgent_h
-#include "AtomicString.h"
#include "Document.h"
#include "EventListener.h"
#include "EventTarget.h"
@@ -46,6 +45,7 @@
#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
class ContainerNode;
diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp
index b70ddbf..e1c0dc0 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -236,7 +236,7 @@ void InspectorDebuggerAgent::saveBreakpoints()
if (it->second.isEmpty())
continue;
RefPtr<InspectorObject> breakpointsForURL = ScriptBreakpoint::inspectorObjectFromSourceBreakpoints(it->second);
- breakpoints->set(it->first, breakpointsForURL);
+ breakpoints->setObject(it->first, breakpointsForURL);
}
m_inspectorController->saveBreakpoints(breakpoints);
}
diff --git a/WebCore/inspector/InspectorDebuggerAgent.h b/WebCore/inspector/InspectorDebuggerAgent.h
index 5428eb2..2cfbf55 100644
--- a/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/WebCore/inspector/InspectorDebuggerAgent.h
@@ -34,10 +34,10 @@
#include "ScriptBreakpoint.h"
#include "ScriptDebugListener.h"
#include "ScriptState.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
class InjectedScriptHost;
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 9259d79..a2b55b0 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -189,7 +189,7 @@ void InspectorResource::updateScriptObject(RemoteInspectorFrontend* frontend)
jsonObject->setString("path", m_requestURL.path());
jsonObject->setString("lastPathComponent", m_requestURL.lastPathComponent());
RefPtr<InspectorObject> requestHeaders = buildHeadersObject(m_requestHeaderFields);
- jsonObject->set("requestHeaders", requestHeaders);
+ jsonObject->setObject("requestHeaders", requestHeaders);
jsonObject->setBool("mainResource", m_isMainResource);
jsonObject->setString("requestMethod", m_requestMethod);
jsonObject->setString("requestFormData", m_requestFormData);
@@ -203,12 +203,12 @@ void InspectorResource::updateScriptObject(RemoteInspectorFrontend* frontend)
jsonObject->setNumber("statusCode", m_responseStatusCode);
jsonObject->setString("statusText", m_responseStatusText);
RefPtr<InspectorObject> responseHeaders = buildHeadersObject(m_responseHeaderFields);
- jsonObject->set("responseHeaders", responseHeaders);
+ jsonObject->setObject("responseHeaders", responseHeaders);
jsonObject->setNumber("connectionID", m_connectionID);
jsonObject->setBool("connectionReused", m_connectionReused);
jsonObject->setBool("cached", m_cached);
if (m_loadTiming && !m_cached)
- jsonObject->set("timing", buildObjectForTiming(m_loadTiming.get()));
+ jsonObject->setObject("timing", buildObjectForTiming(m_loadTiming.get()));
jsonObject->setBool("didResponseChange", true);
}
diff --git a/WebCore/inspector/InspectorStorageAgent.cpp b/WebCore/inspector/InspectorStorageAgent.cpp
index f95b392..66d3372 100644
--- a/WebCore/inspector/InspectorStorageAgent.cpp
+++ b/WebCore/inspector/InspectorStorageAgent.cpp
@@ -92,7 +92,7 @@ public:
switch (value.type()) {
case SQLValue::StringValue: values->pushString(value.string()); break;
case SQLValue::NumberValue: values->pushNumber(value.number()); break;
- case SQLValue::NullValue: values->push(InspectorValue::null()); break;
+ case SQLValue::NullValue: values->pushValue(InspectorValue::null()); break;
}
}
m_agent->frontend()->sqlTransactionSucceeded(m_transactionId, columnNames, values);
diff --git a/WebCore/inspector/InspectorTimelineAgent.cpp b/WebCore/inspector/InspectorTimelineAgent.cpp
index b5cff68..aa42a54 100644
--- a/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -63,7 +63,7 @@ void InspectorTimelineAgent::pushGCEventRecords()
m_gcEvents.clear();
for (GCEvents::iterator i = events.begin(); i != events.end(); ++i) {
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(i->startTime);
- record->set("data", TimelineRecordFactory::createGCEventData(i->collectedBytes));
+ record->setObject("data", TimelineRecordFactory::createGCEventData(i->collectedBytes));
record->setNumber("endTime", i->endTime);
addRecordToTimeline(record.release(), GCEventTimelineRecordType);
}
@@ -150,7 +150,7 @@ void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool sing
{
pushGCEventRecords();
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
- record->set("data", TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot));
+ record->setObject("data", TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot));
addRecordToTimeline(record.release(), TimerInstallTimelineRecordType);
}
@@ -158,7 +158,7 @@ void InspectorTimelineAgent::didRemoveTimer(int timerId)
{
pushGCEventRecords();
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
- record->set("data", TimelineRecordFactory::createGenericTimerData(timerId));
+ record->setObject("data", TimelineRecordFactory::createGenericTimerData(timerId));
addRecordToTimeline(record.release(), TimerRemoveTimelineRecordType);
}
@@ -206,7 +206,7 @@ void InspectorTimelineAgent::didScheduleResourceRequest(const String& url)
{
pushGCEventRecords();
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
- record->set("data", TimelineRecordFactory::createScheduleResourceRequestData(url));
+ record->setObject("data", TimelineRecordFactory::createScheduleResourceRequestData(url));
record->setNumber("type", ScheduleResourceRequestTimelineRecordType);
addRecordToTimeline(record.release(), ScheduleResourceRequestTimelineRecordType);
}
@@ -216,7 +216,7 @@ void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, b
{
pushGCEventRecords();
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
- record->set("data", TimelineRecordFactory::createResourceSendRequestData(identifier, isMainResource, request));
+ record->setObject("data", TimelineRecordFactory::createResourceSendRequestData(identifier, isMainResource, request));
record->setNumber("type", ResourceSendRequestTimelineRecordType);
setHeapSizeStatistic(record.get());
m_frontend->addRecordToTimeline(record.release());
@@ -246,7 +246,7 @@ void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier,
{
pushGCEventRecords();
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
- record->set("data", TimelineRecordFactory::createResourceFinishData(identifier, didFail));
+ record->setObject("data", TimelineRecordFactory::createResourceFinishData(identifier, didFail));
record->setNumber("type", ResourceFinishTimelineRecordType);
setHeapSizeStatistic(record.get());
m_frontend->addRecordToTimeline(record.release());
@@ -256,7 +256,7 @@ void InspectorTimelineAgent::didMarkTimeline(const String& message)
{
pushGCEventRecords();
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
- record->set("data", TimelineRecordFactory::createMarkTimelineData(message));
+ record->setObject("data", TimelineRecordFactory::createMarkTimelineData(message));
addRecordToTimeline(record.release(), MarkTimelineRecordType);
}
@@ -295,7 +295,7 @@ void InspectorTimelineAgent::addRecordToTimeline(PassRefPtr<InspectorObject> prp
m_frontend->addRecordToTimeline(record.release());
else {
TimelineRecordEntry parent = m_recordStack.last();
- parent.children->push(record.release());
+ parent.children->pushObject(record.release());
}
}
@@ -317,8 +317,8 @@ void InspectorTimelineAgent::didCompleteCurrentRecord(TimelineRecordType type)
TimelineRecordEntry entry = m_recordStack.last();
m_recordStack.removeLast();
ASSERT(entry.type == type);
- entry.record->set("data", entry.data);
- entry.record->set("children", entry.children);
+ entry.record->setObject("data", entry.data);
+ entry.record->setArray("children", entry.children);
entry.record->setNumber("endTime", WTF::currentTimeMS());
addRecordToTimeline(entry.record, type);
}
diff --git a/WebCore/inspector/InspectorValues.cpp b/WebCore/inspector/InspectorValues.cpp
index dad84ac..a7c43a5 100644
--- a/WebCore/inspector/InspectorValues.cpp
+++ b/WebCore/inspector/InspectorValues.cpp
@@ -366,7 +366,7 @@ PassRefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, cons
RefPtr<InspectorValue> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
if (!arrayNode)
return 0;
- array->push(arrayNode);
+ array->pushValue(arrayNode);
// After a list value, we expect a comma or the end of the list.
start = tokenEnd;
@@ -406,7 +406,7 @@ PassRefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, cons
RefPtr<InspectorValue> value = buildValue(start, end, &tokenEnd, depth + 1);
if (!value)
return 0;
- object->set(key, value);
+ object->setValue(key, value);
start = tokenEnd;
// After a key/value pair, we expect a comma or the end of the
@@ -504,6 +504,22 @@ bool InspectorValue::asString(String*) const
return false;
}
+bool InspectorValue::asValue(RefPtr<InspectorValue>* output)
+{
+ *output = this;
+ return true;
+}
+
+bool InspectorValue::asObject(RefPtr<InspectorObject>*)
+{
+ return false;
+}
+
+bool InspectorValue::asArray(RefPtr<InspectorArray>*)
+{
+ return false;
+}
+
PassRefPtr<InspectorObject> InspectorValue::asObject()
{
return 0;
@@ -606,6 +622,12 @@ void InspectorString::writeJSON(Vector<UChar>* output) const
doubleQuoteString(m_stringValue, output);
}
+bool InspectorObject::asObject(RefPtr<InspectorObject>* output)
+{
+ *output = this;
+ return true;
+}
+
PassRefPtr<InspectorObject> InspectorObject::asObject()
{
return this;
@@ -674,6 +696,12 @@ void InspectorObject::writeJSON(Vector<UChar>* output) const
output->append('}');
}
+bool InspectorArray::asArray(RefPtr<InspectorArray>* output)
+{
+ *output = this;
+ return true;
+}
+
PassRefPtr<InspectorArray> InspectorArray::asArray()
{
return this;
diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h
index f6556d7..4bc36f2 100644
--- a/WebCore/inspector/InspectorValues.h
+++ b/WebCore/inspector/InspectorValues.h
@@ -34,12 +34,12 @@
#if ENABLE(INSPECTOR)
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
@@ -73,6 +73,9 @@ public:
virtual bool asNumber(unsigned long* output) const;
virtual bool asNumber(unsigned int* output) const;
virtual bool asString(String* output) const;
+ virtual bool asValue(RefPtr<InspectorValue>* output);
+ virtual bool asObject(RefPtr<InspectorObject>* output);
+ virtual bool asArray(RefPtr<InspectorArray>* output);
virtual PassRefPtr<InspectorObject> asObject();
virtual PassRefPtr<InspectorArray> asArray();
@@ -163,12 +166,15 @@ public:
}
~InspectorObject() { }
+ virtual bool asObject(RefPtr<InspectorObject>* output);
virtual PassRefPtr<InspectorObject> asObject();
void setBool(const String& name, bool);
void setNumber(const String& name, double);
void setString(const String& name, const String&);
- void set(const String& name, PassRefPtr<InspectorValue>);
+ void setValue(const String& name, PassRefPtr<InspectorValue>);
+ void setObject(const String& name, PassRefPtr<InspectorObject>);
+ void setArray(const String& name, PassRefPtr<InspectorArray>);
bool getBool(const String& name, bool* output) const;
bool getNumber(const String& name, double* output) const;
@@ -198,12 +204,15 @@ public:
}
~InspectorArray() { }
+ virtual bool asArray(RefPtr<InspectorArray>* output);
virtual PassRefPtr<InspectorArray> asArray();
void pushBool(bool);
void pushNumber(double);
void pushString(const String&);
- void push(PassRefPtr<InspectorValue>);
+ void pushValue(PassRefPtr<InspectorValue>);
+ void pushObject(PassRefPtr<InspectorObject>);
+ void pushArray(PassRefPtr<InspectorArray>);
unsigned length() const { return m_data.size(); }
PassRefPtr<InspectorValue> get(size_t index);
@@ -217,20 +226,32 @@ private:
inline void InspectorObject::setBool(const String& name, bool value)
{
- set(name, InspectorBasicValue::create(value));
+ setValue(name, InspectorBasicValue::create(value));
}
inline void InspectorObject::setNumber(const String& name, double value)
{
- set(name, InspectorBasicValue::create(value));
+ setValue(name, InspectorBasicValue::create(value));
}
inline void InspectorObject::setString(const String& name, const String& value)
{
- set(name, InspectorString::create(value));
+ setValue(name, InspectorString::create(value));
}
-inline void InspectorObject::set(const String& name, PassRefPtr<InspectorValue> value)
+inline void InspectorObject::setValue(const String& name, PassRefPtr<InspectorValue> value)
+{
+ if (m_data.set(name, value).second)
+ m_order.append(name);
+}
+
+inline void InspectorObject::setObject(const String& name, PassRefPtr<InspectorObject> value)
+{
+ if (m_data.set(name, value).second)
+ m_order.append(name);
+}
+
+inline void InspectorObject::setArray(const String& name, PassRefPtr<InspectorArray> value)
{
if (m_data.set(name, value).second)
m_order.append(name);
@@ -251,7 +272,17 @@ inline void InspectorArray::pushString(const String& value)
m_data.append(InspectorString::create(value));
}
-inline void InspectorArray::push(PassRefPtr<InspectorValue> value)
+inline void InspectorArray::pushValue(PassRefPtr<InspectorValue> value)
+{
+ m_data.append(value);
+}
+
+inline void InspectorArray::pushObject(PassRefPtr<InspectorObject> value)
+{
+ m_data.append(value);
+}
+
+inline void InspectorArray::pushArray(PassRefPtr<InspectorArray> value)
{
m_data.append(value);
}
diff --git a/WebCore/inspector/ScriptBreakpoint.cpp b/WebCore/inspector/ScriptBreakpoint.cpp
index ce0d18a..24401f1 100644
--- a/WebCore/inspector/ScriptBreakpoint.cpp
+++ b/WebCore/inspector/ScriptBreakpoint.cpp
@@ -64,7 +64,7 @@ PassRefPtr<InspectorObject> ScriptBreakpoint::inspectorObjectFromSourceBreakpoin
RefPtr<InspectorObject> breakpoint = InspectorObject::create();
breakpoint->setBool("enabled", it->second.enabled);
breakpoint->setString("condition", it->second.condition);
- breakpoints->set(String::number(it->first), breakpoint);
+ breakpoints->setObject(String::number(it->first), breakpoint);
}
return breakpoints.release();
}
diff --git a/WebCore/inspector/TimelineRecordFactory.cpp b/WebCore/inspector/TimelineRecordFactory.cpp
index ad9fdec..e1c2bbb 100644
--- a/WebCore/inspector/TimelineRecordFactory.cpp
+++ b/WebCore/inspector/TimelineRecordFactory.cpp
@@ -49,7 +49,7 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createGenericRecord(double st
RefPtr<InspectorArray> stackTrace = InspectorArray::create();
if (ScriptCallStack::stackTrace(5, stackTrace))
- record->set("stackTrace", stackTrace);
+ record->setArray("stackTrace", stackTrace);
return record.release();
}
diff --git a/WebCore/inspector/front-end/AuditRules.js b/WebCore/inspector/front-end/AuditRules.js
index 8519cf2..e28a364 100644
--- a/WebCore/inspector/front-end/AuditRules.js
+++ b/WebCore/inspector/front-end/AuditRules.js
@@ -724,9 +724,9 @@ WebInspector.AuditRules.CssInHeadRule = function()
WebInspector.AuditRules.CssInHeadRule.prototype = {
doRun: function(resources, result, callback)
{
- function evalCallback(evalResult, isException)
+ function evalCallback(evalResult)
{
- if (isException || !evalResult)
+ if (!evalResult)
return callback(null);
var summary = result.addChild("");
@@ -800,9 +800,9 @@ WebInspector.AuditRules.StylesScriptsOrderRule = function()
WebInspector.AuditRules.StylesScriptsOrderRule.prototype = {
doRun: function(resources, result, callback)
{
- function evalCallback(resultValue, isException)
+ function evalCallback(resultValue)
{
- if (isException || !resultValue)
+ if (!resultValue)
return callback(null);
var lateCssUrls = resultValue[0];
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 6a4e0d3..474c362 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -296,7 +296,7 @@ WebInspector.ConsoleView.prototype = {
requestClearMessages: function()
{
- InspectorBackend.clearConsoleMessages(WebInspector.Callback.wrap(this.clearMessages.bind(this)));
+ InspectorBackend.clearConsoleMessages();
},
clearMessages: function()
@@ -342,7 +342,7 @@ WebInspector.ConsoleView.prototype = {
var injectedScriptAccess;
if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {
var selectedCallFrame = WebInspector.panels.scripts.sidebarPanes.callstack.selectedCallFrame;
- injectedScriptAccess = InjectedScriptAccess.get(selectedCallFrame.injectedScriptId);
+ injectedScriptAccess = InjectedScriptAccess.get(selectedCallFrame.worldId);
} else
injectedScriptAccess = InjectedScriptAccess.getDefault();
injectedScriptAccess.getCompletions(expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions);
@@ -511,7 +511,7 @@ WebInspector.ConsoleView.prototype = {
function evalCallback(result)
{
- callback(result.value, result.isException);
+ callback(WebInspector.RemoteObject.fromPayload(result));
};
InjectedScriptAccess.getDefault().evaluate(expression, objectGroup, evalCallback);
},
@@ -534,7 +534,7 @@ WebInspector.ConsoleView.prototype = {
this.addMessage(commandMessage);
var self = this;
- function printResult(result, exception)
+ function printResult(result)
{
self.prompt.history.push(str);
self.prompt.historyOffset = 0;
@@ -542,7 +542,7 @@ WebInspector.ConsoleView.prototype = {
WebInspector.applicationSettings.consoleHistory = self.prompt.history.slice(-30);
- self.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage));
+ self.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));
}
this.evalInInspectedWindow(str, "console", printResult);
},
@@ -550,7 +550,7 @@ WebInspector.ConsoleView.prototype = {
_format: function(output, forceObjectFormat)
{
var isProxy = (output != null && typeof output === "object");
- var type = (forceObjectFormat ? "object" : Object.proxyType(output));
+ var type = (forceObjectFormat ? "object" : WebInspector.RemoteObject.type(output));
var formatter = this._customFormatters[type];
if (!formatter || !isProxy) {
@@ -589,12 +589,12 @@ WebInspector.ConsoleView.prototype = {
elem.appendChild(treeOutline.element);
}
- InjectedScriptAccess.get(object.injectedScriptId).pushNodeToFrontend(object, printNode);
+ object.pushNodeToFrontend(printNode);
},
_formatarray: function(arr, elem)
{
- InjectedScriptAccess.get(arr.injectedScriptId).getProperties(arr, false, false, this._printArray.bind(this, elem));
+ arr.getOwnProperties(false, this._printArray.bind(this, elem));
},
_formatstring: function(output, elem)
@@ -637,9 +637,8 @@ WebInspector.ConsoleView.prototype = {
_formatAsArrayEntry: function(output)
{
- var type = Object.proxyType(output);
// Prevent infinite expansion of cross-referencing arrays.
- return this._format(output, type === "array");
+ return this._format(output, WebInspector.RemoteObject.type(output) === "array");
}
}
@@ -728,12 +727,15 @@ WebInspector.ConsoleMessage.prototype = {
// Formatting code below assumes that parameters are all wrappers whereas frontend console
// API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here.
- for (var i = 0; i < parameters.length; ++i)
- if (typeof parameters[i] !== "object" && typeof parameters[i] !== "function")
- parameters[i] = WebInspector.ObjectProxy.wrapPrimitiveValue(parameters[i]);
+ for (var i = 0; i < parameters.length; ++i) {
+ if (typeof parameters[i] === "object")
+ parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);
+ else
+ parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);
+ }
// There can be string log and string eval result. We distinguish between them based on message type.
- var shouldFormatMessage = Object.proxyType(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
+ var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
// Multiple parameters with the first being a format string. Save unused substitutions.
if (shouldFormatMessage) {
@@ -1048,21 +1050,11 @@ WebInspector.ConsoleCommand.prototype = {
}
}
-WebInspector.ConsoleCommandResult = function(result, exception, originatingCommand)
+WebInspector.ConsoleCommandResult = function(result, originatingCommand)
{
- var level = (exception ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
- var message = result;
- if (exception) {
- // Distinguish between strings and errors (no need to quote latter).
- message = WebInspector.ObjectProxy.wrapPrimitiveValue(result);
- message.type = "error";
- }
- var line = (exception ? result.line : -1);
- var url = (exception ? result.sourceURL : null);
-
+ var level = (result.isError() ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
this.originatingCommand = originatingCommand;
-
- WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, line, url, null, 1, null, [message]);
+ WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, null, 1, null, [result]);
}
WebInspector.ConsoleCommandResult.prototype = {
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index c41d038..57422f6 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -33,10 +33,6 @@ WebInspector.DOMNode = function(doc, payload) {
this.ownerDocument = doc;
this.id = payload.id;
- // injectedScriptId is a node is for DOM nodes which should be converted
- // to corresponding InjectedScript by the inspector backend. We indicate
- // this by making injectedScriptId negative.
- this.injectedScriptId = -payload.id;
this.nodeType = payload.nodeType;
this.nodeName = payload.nodeName;
this.localName = payload.localName;
diff --git a/WebCore/inspector/front-end/DatabaseTableView.js b/WebCore/inspector/front-end/DatabaseTableView.js
index 9e6d374..5440763 100644
--- a/WebCore/inspector/front-end/DatabaseTableView.js
+++ b/WebCore/inspector/front-end/DatabaseTableView.js
@@ -46,7 +46,7 @@ WebInspector.DatabaseTableView.prototype = {
get statusBarItems()
{
- return [this.refreshButton];
+ return [this.refreshButton.element];
},
update: function()
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 6713ddc..0296737 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -255,7 +255,7 @@ WebInspector.ElementsPanel.prototype = {
this._matchesCountUpdateTimeout = null;
this._searchQuery = query;
- InspectorBackend.performSearch(whitespaceTrimmedQuery);
+ InspectorBackend.performSearch(whitespaceTrimmedQuery, false);
},
searchingForNodeWasEnabled: function()
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 87d85c1..c7d39f1 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -413,8 +413,8 @@ WebInspector.ElementsTreeElement.prototype = {
else
this.tooltip = WebInspector.UIString("%d × %d pixels (Natural: %d × %d pixels)", properties.offsetWidth, properties.offsetHeight, properties.naturalWidth, properties.naturalHeight);
}
- var objectProxy = new WebInspector.ObjectProxy(node.injectedScriptId, node.id);
- WebInspector.ObjectProxy.getPropertiesAsync(objectProxy, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
+
+ InjectedScriptAccess.getForNode(node).getNodeProperties(node.id, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
},
updateSelection: function()
diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js
index 6798845..2800d6e 100644
--- a/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -189,17 +189,21 @@ WebInspector.EventListenerBar = function(eventListener, nodeId)
WebInspector.EventListenerBar.prototype = {
update: function()
{
- var properties = [];
- for (var propertyName in this.eventListener) {
- // Just build properties in place - no need to reach out for injected script.
- var value = this.eventListener[propertyName];
- if (value instanceof WebInspector.DOMNode)
- value = new WebInspector.ObjectProxy(value.injectedScriptId, value.id, [], appropriateSelectorForNode(value), true);
- else
- value = WebInspector.ObjectProxy.wrapPrimitiveValue(value);
- properties.push(new WebInspector.ObjectPropertyProxy(propertyName, value));
+ function updateWithNodeObject(nodeObject)
+ {
+ var properties = [];
+ if (nodeObject)
+ properties.push(new WebInspector.RemoteObjectProperty("node", nodeObject));
+
+ for (var propertyName in this.eventListener) {
+ var value = WebInspector.RemoteObject.fromPrimitiveValue(value);
+ properties.push(new WebInspector.RemoteObjectProperty(propertyName, value));
+ }
+ this.updateProperties(properties);
}
- this.updateProperties(properties);
+ var node = this.eventListener.node;
+ delete this.eventListener.node;
+ WebInspector.RemoteObject.resolveNode(node, updateWithNodeObject.bind(this));
},
_setNodeTitle: function()
diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js
index 2abe1db..95f373f 100644
--- a/WebCore/inspector/front-end/ExtensionServer.js
+++ b/WebCore/inspector/front-end/ExtensionServer.js
@@ -139,7 +139,8 @@ WebInspector.ExtensionServer.prototype = {
var lastToolbarItem = WebInspector.panelOrder[WebInspector.panelOrder.length - 1].toolbarItem;
WebInspector.addPanelToolbarIcon(toolbarElement, panel, lastToolbarItem);
WebInspector.panels[id] = panel;
- this._createClientIframe(panel.element, message.url);
+ var iframe = this._createClientIframe(panel.element, message.url);
+ iframe.style.height = "100%";
return this._status.OK();
},
@@ -165,6 +166,7 @@ WebInspector.ExtensionServer.prototype = {
iframe.src = url;
iframe.style.width = "100%";
parent.appendChild(iframe);
+ return iframe;
},
_onSetSidebarHeight: function(message)
@@ -193,7 +195,17 @@ WebInspector.ExtensionServer.prototype = {
_onEvaluateOnInspectedPage: function(message, port)
{
- InjectedScriptAccess.getDefault().evaluateAndStringify(message.expression, this._dispatchCallback.bind(this, message.requestId, port));
+ var escapedMessage = escape(message.expression);
+ function callback(resultPayload)
+ {
+ var resultObject = WebInspector.RemoteObject.fromPayload(resultPayload);
+ var result = {};
+ if (resultObject.isError())
+ result.isException = true;
+ result.value = resultObject.description;
+ this._dispatchCallback(message.requestId, port, result);
+ }
+ InjectedScriptAccess.getDefault().evaluate("(function() { var a = window.eval(unescape(\"" + escapedMessage + "\")); return JSON.stringify(a); })();", "", callback.bind(this));
},
_onRevealAndSelect: function(message)
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index b8bf9f2..d4e3d80 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -28,392 +28,517 @@
var injectedScriptConstructor = (function (InjectedScriptHost, inspectedWindow, injectedScriptId, jsEngine) {
-var InjectedScript = {};
-
-InjectedScript.lastBoundObjectId = 1;
-InjectedScript.idToWrappedObject = {};
-InjectedScript.objectGroups = {};
-
-InjectedScript.wrapObjectForConsole = function(object, canAccessInspectedWindow)
+var InjectedScript = function()
{
- if (canAccessInspectedWindow)
- return InjectedScript.wrapObject(object, "console");
- var result = {};
- result.type = typeof object;
- result.description = InjectedScript._toString(object);
- return result;
+ this._lastBoundObjectId = 1;
+ this._idToWrappedObject = {};
+ this._objectGroups = {};
}
-InjectedScript.wrapObject = function(object, objectGroupName)
-{
- try {
- var objectId;
- if (typeof object === "object" || typeof object === "function" || InjectedScript._isHTMLAllCollection(object)) {
- var id = InjectedScript.lastBoundObjectId++;
- objectId = "object#" + id;
- InjectedScript.idToWrappedObject[objectId] = object;
-
- var group = InjectedScript.objectGroups[objectGroupName];
- if (!group) {
- group = [];
- InjectedScript.objectGroups[objectGroupName] = group;
+InjectedScript.prototype = {
+ wrapObjectForConsole: function(object, canAccessInspectedWindow)
+ {
+ if (canAccessInspectedWindow)
+ return this._wrapObject(object, "console");
+ var result = {};
+ result.type = typeof object;
+ result.description = this._toString(object);
+ return result;
+ },
+
+ _wrapObject: function(object, objectGroupName, abbreviate)
+ {
+ try {
+ var objectId;
+ if (typeof object === "object" || typeof object === "function" || this._isHTMLAllCollection(object)) {
+ var id = this._lastBoundObjectId++;
+ objectId = id;
+ this._idToWrappedObject[id] = object;
+
+ var group = this._objectGroups[objectGroupName];
+ if (!group) {
+ group = [];
+ this._objectGroups[objectGroupName] = group;
+ }
+ group.push(id);
+ objectId = this._serializeObjectId(id, objectGroupName);
}
- group.push(objectId);
+ return InjectedScript.RemoteObject.fromObject(object, objectId, abbreviate);
+ } catch (e) {
+ return InjectedScript.RemoteObject.fromObject("[ Exception: " + e.toString() + " ]");
}
- return InjectedScript.createProxyObject(object, objectId);
- } catch (e) {
- return InjectedScript.createProxyObject("[ Exception: " + e.toString() + " ]");
- }
- return InjectedScript.createProxyObject(object, objectId);
-};
-
-InjectedScript.unwrapObject = function(objectId) {
- return InjectedScript.idToWrappedObject[objectId];
-};
-
-InjectedScript.releaseWrapperObjectGroup = function(objectGroupName) {
- var group = InjectedScript.objectGroups[objectGroupName];
- if (!group)
- return;
- for (var i = 0; i < group.length; i++)
- delete InjectedScript.idToWrappedObject[group[i]];
- delete InjectedScript.objectGroups[objectGroupName];
-};
-
-InjectedScript.dispatch = function(methodName, args, callId)
-{
- var argsArray = eval("(" + args + ")");
- if (callId)
- argsArray.splice(0, 0, callId); // Methods that run asynchronously have a call back id parameter.
- var result = InjectedScript[methodName].apply(InjectedScript, argsArray);
- if (typeof result === "undefined") {
- inspectedWindow.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName);
- result = null;
- }
- return result;
-}
+ },
-InjectedScript.getPrototypes = function(nodeId)
-{
- var node = InjectedScript._nodeForId(nodeId);
- if (!node)
- return false;
-
- var result = [];
- for (var prototype = node; prototype; prototype = prototype.__proto__) {
- var title = InjectedScript._describe(prototype, true);
- if (title.match(/Prototype$/)) {
- title = title.replace(/Prototype$/, "");
+ _serializeObjectId: function(id, groupName)
+ {
+ return injectedScriptId + ":" + id + ":" + groupName;
+ },
+
+ _parseObjectId: function(objectId)
+ {
+ var tokens = objectId.split(":");
+ var parsedObjectId = {};
+ parsedObjectId.id = parseInt(tokens[1]);
+ parsedObjectId.groupName = tokens[2];
+ return parsedObjectId;
+ },
+
+ releaseWrapperObjectGroup: function(objectGroupName)
+ {
+ var group = this._objectGroups[objectGroupName];
+ if (!group)
+ return;
+ for (var i = 0; i < group.length; i++)
+ delete this._idToWrappedObject[group[i]];
+ delete this._objectGroups[objectGroupName];
+ },
+
+ dispatch: function(methodName, args)
+ {
+ var argsArray = eval("(" + args + ")");
+ var result = this[methodName].apply(this, argsArray);
+ if (typeof result === "undefined") {
+ inspectedWindow.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName);
+ result = null;
}
- result.push(title);
- }
- return result;
-}
+ return result;
+ },
-InjectedScript.getProperties = function(objectProxy, ignoreHasOwnProperty, abbreviate)
-{
- var object = InjectedScript._resolveObject(objectProxy);
- if (!InjectedScript._isDefined(object))
- return false;
- var properties = [];
+ getPrototypes: function(nodeId)
+ {
+ this.releaseWrapperObjectGroup("prototypes");
+ var node = this._nodeForId(nodeId);
+ if (!node)
+ return false;
+
+ var result = [];
+ var prototype = node;
+ do {
+ result.push(this._wrapObject(prototype, "prototypes"));
+ prototype = prototype.__proto__;
+ } while (prototype)
+ return result;
+ },
+
+ getProperties: function(objectId, ignoreHasOwnProperty, abbreviate)
+ {
+ var parsedObjectId = this._parseObjectId(objectId);
+ var object = this._objectForId(parsedObjectId);
+ if (!this._isDefined(object))
+ return false;
+ var properties = [];
+
+ var propertyNames = ignoreHasOwnProperty ? this._getPropertyNames(object) : Object.getOwnPropertyNames(object);
+ if (!ignoreHasOwnProperty && object.__proto__)
+ propertyNames.push("__proto__");
- var propertyNames = ignoreHasOwnProperty ? InjectedScript._getPropertyNames(object) : Object.getOwnPropertyNames(object);
- if (!ignoreHasOwnProperty && object.__proto__)
- propertyNames.push("__proto__");
-
- // Go over properties, prepare results.
- for (var i = 0; i < propertyNames.length; ++i) {
- var propertyName = propertyNames[i];
-
- var property = {};
- property.name = propertyName + "";
- property.parentObjectProxy = objectProxy;
- var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName);
- if (!isGetter) {
- try {
- var childObject = object[propertyName];
- var childObjectProxy = new InjectedScript.createProxyObject(childObject, objectProxy.objectId, abbreviate);
- childObjectProxy.path = objectProxy.path ? objectProxy.path.slice() : [];
- childObjectProxy.path.push(propertyName);
- property.value = childObjectProxy;
- } catch(e) {
- property.value = { description: e.toString() };
- property.isError = true;
+ // Go over properties, prepare results.
+ for (var i = 0; i < propertyNames.length; ++i) {
+ var propertyName = propertyNames[i];
+
+ var property = {};
+ property.name = propertyName + "";
+ var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName);
+ if (!isGetter) {
+ try {
+ property.value = this._wrapObject(object[propertyName], parsedObjectId.groupName, abbreviate);
+ } catch(e) {
+ property.value = new InjectedScript.RemoteObject.fromException(e);
+ }
+ } else {
+ // FIXME: this should show something like "getter" (bug 16734).
+ property.value = new InjectedScript.RemoteObject.fromObject("\u2014"); // em dash
+ property.isGetter = true;
}
- } else {
- // FIXME: this should show something like "getter" (bug 16734).
- property.value = { description: "\u2014" }; // em dash
- property.isGetter = true;
+ properties.push(property);
}
- properties.push(property);
- }
- return properties;
-}
-
-InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression)
-{
- var object = InjectedScript._resolveObject(objectProxy);
- if (!InjectedScript._isDefined(object))
- return false;
-
- var expressionLength = expression.length;
- if (!expressionLength) {
- delete object[propertyName];
- return !(propertyName in object);
- }
+ return properties;
+ },
- try {
- // Surround the expression in parenthesis so the result of the eval is the result
- // of the whole expression not the last potential sub-expression.
-
- // There is a regression introduced here: eval is now happening against global object,
- // not call frame while on a breakpoint.
- // TODO: bring evaluation against call frame back.
- var result = inspectedWindow.eval("(" + expression + ")");
- // Store the result in the property.
- object[propertyName] = result;
- return true;
- } catch(e) {
+ setPropertyValue: function(objectId, propertyName, expression)
+ {
+ var parsedObjectId = this._parseObjectId(objectId);
+ var object = this._objectForId(parsedObjectId);
+ if (!this._isDefined(object))
+ return false;
+
+ var expressionLength = expression.length;
+ if (!expressionLength) {
+ delete object[propertyName];
+ return !(propertyName in object);
+ }
+
try {
- var result = inspectedWindow.eval("\"" + expression.replace(/"/g, "\\\"") + "\"");
+ // Surround the expression in parenthesis so the result of the eval is the result
+ // of the whole expression not the last potential sub-expression.
+
+ // There is a regression introduced here: eval is now happening against global object,
+ // not call frame while on a breakpoint.
+ // TODO: bring evaluation against call frame back.
+ var result = inspectedWindow.eval("(" + expression + ")");
+ // Store the result in the property.
object[propertyName] = result;
return true;
} catch(e) {
- return false;
+ try {
+ var result = inspectedWindow.eval("\"" + expression.replace(/"/g, "\\\"") + "\"");
+ object[propertyName] = result;
+ return true;
+ } catch(e) {
+ return false;
+ }
}
- }
-}
+ },
-InjectedScript._populatePropertyNames = function(object, resultSet)
-{
- for (var o = object; o; o = o.__proto__) {
- try {
- var names = Object.getOwnPropertyNames(o);
- for (var i = 0; i < names.length; ++i)
- resultSet[names[i]] = true;
- } catch (e) {
+ _populatePropertyNames: function(object, resultSet)
+ {
+ for (var o = object; o; o = o.__proto__) {
+ try {
+ var names = Object.getOwnPropertyNames(o);
+ for (var i = 0; i < names.length; ++i)
+ resultSet[names[i]] = true;
+ } catch (e) {
+ }
}
- }
-}
+ },
-InjectedScript._getPropertyNames = function(object, resultSet)
-{
- var propertyNameSet = {};
- InjectedScript._populatePropertyNames(object, propertyNameSet);
- return Object.keys(propertyNameSet);
-}
+ _getPropertyNames: function(object, resultSet)
+ {
+ var propertyNameSet = {};
+ this._populatePropertyNames(object, propertyNameSet);
+ return Object.keys(propertyNameSet);
+ },
-InjectedScript.getCompletions = function(expression, includeInspectorCommandLineAPI, callFrameId)
-{
- var props = {};
- try {
- var expressionResult;
- // Evaluate on call frame if call frame id is available.
- if (typeof callFrameId === "number") {
- var callFrame = InjectedScript._callFrameForId(callFrameId);
- if (!callFrame)
- return props;
- if (expression)
- expressionResult = InjectedScript._evaluateOn(callFrame.evaluate, callFrame, expression, true);
- else {
- // Evaluate into properties in scope of the selected call frame.
- var scopeChain = callFrame.scopeChain;
- for (var i = 0; i < scopeChain.length; ++i)
- InjectedScript._populatePropertyNames(scopeChain[i], props);
+ getCompletions: function(expression, includeInspectorCommandLineAPI, callFrameId)
+ {
+ var props = {};
+ try {
+ var expressionResult;
+ // Evaluate on call frame if call frame id is available.
+ if (typeof callFrameId === "number") {
+ var callFrame = this._callFrameForId(callFrameId);
+ if (!callFrame)
+ return props;
+ if (expression)
+ expressionResult = this._evaluateOn(callFrame.evaluate, callFrame, expression);
+ else {
+ // Evaluate into properties in scope of the selected call frame.
+ var scopeChain = callFrame.scopeChain;
+ for (var i = 0; i < scopeChain.length; ++i)
+ this._populatePropertyNames(scopeChain[i], props);
+ }
+ } else {
+ if (!expression)
+ expression = "this";
+ expressionResult = this._evaluateOn(inspectedWindow.eval, inspectedWindow, expression);
}
- } else {
- if (!expression)
- expression = "this";
- expressionResult = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
+ if (typeof expressionResult === "object")
+ this._populatePropertyNames(expressionResult, props);
+
+ if (includeInspectorCommandLineAPI) {
+ for (var prop in this._commandLineAPI)
+ props[prop] = true;
+ }
+ } catch(e) {
}
- if (typeof expressionResult === "object")
- InjectedScript._populatePropertyNames(expressionResult, props);
+ return props;
+ },
- if (includeInspectorCommandLineAPI) {
- for (var prop in InjectedScript._commandLineAPI)
- props[prop] = true;
+ evaluate: function(expression, objectGroup)
+ {
+ return this._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup);
+ },
+
+ _evaluateAndWrap: function(evalFunction, object, expression, objectGroup)
+ {
+ try {
+ return this._wrapObject(this._evaluateOn(evalFunction, object, expression), objectGroup);
+ } catch (e) {
+ return InjectedScript.RemoteObject.fromException(e);
}
- } catch(e) {
- }
- return props;
-}
+ },
-InjectedScript.evaluateAndStringify = function(expression)
-{
- var result = {};
- try {
- var value = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
- result.value = JSON.stringify(value);
- } catch (e) {
- result.value = e.toString();
- result.isException = true;
- }
- return result;
-}
+ _evaluateOn: function(evalFunction, object, expression)
+ {
+ // Only install command line api object for the time of evaluation.
+ // Surround the expression in with statements to inject our command line API so that
+ // the window object properties still take more precedent than our API functions.
+ inspectedWindow.console._commandLineAPI = this._commandLineAPI;
+
+ expression = "with (window.console._commandLineAPI) { with (window) {\n" + expression + "\n} }";
+ var value = evalFunction.call(object, expression);
+
+ delete inspectedWindow.console._commandLineAPI;
+
+ // When evaluating on call frame error is not thrown, but returned as a value.
+ if (this._type(value) === "error")
+ throw value.toString();
+
+ return value;
+ },
-InjectedScript.evaluate = function(expression, objectGroup)
-{
- return InjectedScript._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup);
-}
+ getNodeId: function(node)
+ {
+ return InjectedScriptHost.pushNodePathToFrontend(node, false, false);
+ },
-InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup, dontUseCommandLineAPI)
-{
- var result = {};
- try {
- result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup);
+ callFrames: function()
+ {
+ var callFrame = InjectedScriptHost.currentCallFrame();
+ if (!callFrame)
+ return false;
+
+ injectedScript.releaseWrapperObjectGroup("backtrace");
+ var result = [];
+ var depth = 0;
+ do {
+ result.push(new InjectedScript.CallFrameProxy(depth++, callFrame));
+ callFrame = callFrame.caller;
+ } while (callFrame);
+ return result;
+ },
- // Handle error that might have happened while describing result.
- if (result.value.errorText) {
- result.value = result.value.errorText;
- result.isException = true;
- }
- } catch (e) {
- result.value = e.toString();
- result.isException = true;
- }
- return result;
-}
+ evaluateInCallFrame: function(callFrameId, code, objectGroup)
+ {
+ var callFrame = this._callFrameForId(callFrameId);
+ if (!callFrame)
+ return false;
+ return this._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup);
+ },
-InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseCommandLineAPI)
-{
- if (!dontUseCommandLineAPI) {
- // Only install command line api object for the time of evaluation.
+ _callFrameForId: function(id)
+ {
+ var callFrame = InjectedScriptHost.currentCallFrame();
+ while (--id >= 0 && callFrame)
+ callFrame = callFrame.caller;
+ return callFrame;
+ },
- // Surround the expression in with statements to inject our command line API so that
- // the window object properties still take more precedent than our API functions.
- inspectedWindow.console._commandLineAPI = InjectedScript._commandLineAPI;
+ _nodeForId: function(nodeId)
+ {
+ if (!nodeId)
+ return null;
+ return InjectedScriptHost.nodeForId(nodeId);
+ },
- expression = "with (window.console._commandLineAPI) { with (window) {\n" + expression + "\n} }";
- }
+ _objectForId: function(parsedObjectId)
+ {
+ return this._idToWrappedObject[parsedObjectId.id];
+ },
- var value = evalFunction.call(object, expression);
+ resolveNode: function(nodeId)
+ {
+ var node = this._nodeForId(nodeId);
+ if (!node)
+ return false;
+ // FIXME: receive the object group from client.
+ return this._wrapObject(node, "prototype");
+ },
- if (!dontUseCommandLineAPI)
- delete inspectedWindow.console._commandLineAPI;
+ getNodeProperties: function(nodeId, properties)
+ {
+ var node = this._nodeForId(nodeId);
+ if (!node)
+ return false;
+ var result = {};
+ for (var i = 0; i < properties.length; ++i)
+ result[properties[i]] = node[properties[i]];
+ return result;
+ },
- // When evaluating on call frame error is not thrown, but returned as a value.
- if (InjectedScript._type(value) === "error")
- throw value.toString();
+ pushNodeToFrontend: function(objectId)
+ {
+ var parsedObjectId = this._parseObjectId(objectId);
+ var object = this._objectForId(parsedObjectId);
+ if (!object || this._type(object) !== "node")
+ return false;
+ return InjectedScriptHost.pushNodePathToFrontend(object, false, false);
+ },
- return value;
-}
+ evaluateOnSelf: function(funcBody, args)
+ {
+ var func = window.eval("(" + funcBody + ")");
+ return func.apply(this, args || []);
+ },
-InjectedScript.getNodeId = function(node)
-{
- return InjectedScriptHost.pushNodePathToFrontend(node, false, false);
-}
+ _isDefined: function(object)
+ {
+ return object || this._isHTMLAllCollection(object);
+ },
-InjectedScript.openInInspectedWindow = function(url)
-{
- // Don't call window.open on wrapper - popup blocker mutes it.
- // URIs should have no double quotes.
- inspectedWindow.eval("window.open(\"" + url + "\")");
- return true;
-}
+ _isHTMLAllCollection: function(object)
+ {
+ // document.all is reported as undefined, but we still want to process it.
+ return (typeof object === "undefined") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;
+ },
-InjectedScript.callFrames = function()
-{
- var callFrame = InjectedScriptHost.currentCallFrame();
- if (!callFrame)
- return false;
-
- var result = [];
- var depth = 0;
- do {
- result.push(new InjectedScript.CallFrameProxy(depth++, callFrame));
- callFrame = callFrame.caller;
- } while (callFrame);
- return result;
-}
+ _type: function(obj)
+ {
+ if (obj === null)
+ return "null";
+
+ var type = typeof obj;
+ if (type !== "object" && type !== "function") {
+ // FIXME(33716): typeof document.all is always 'undefined'.
+ if (this._isHTMLAllCollection(obj))
+ return "array";
+ return type;
+ }
-InjectedScript.evaluateInCallFrame = function(callFrameId, code, objectGroup)
-{
- var callFrame = InjectedScript._callFrameForId(callFrameId);
- if (!callFrame)
- return false;
- return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup, true);
-}
+ // If owning frame has navigated to somewhere else window properties will be undefined.
+ // In this case just return result of the typeof.
+ if (!inspectedWindow.document)
+ return type;
-InjectedScript._callFrameForId = function(id)
-{
- var callFrame = InjectedScriptHost.currentCallFrame();
- while (--id >= 0 && callFrame)
- callFrame = callFrame.caller;
- return callFrame;
-}
+ if (obj instanceof inspectedWindow.Node)
+ return (obj.nodeType === undefined ? type : "node");
+ if (obj instanceof inspectedWindow.String)
+ return "string";
+ if (obj instanceof inspectedWindow.Array)
+ return "array";
+ if (obj instanceof inspectedWindow.Boolean)
+ return "boolean";
+ if (obj instanceof inspectedWindow.Number)
+ return "number";
+ if (obj instanceof inspectedWindow.Date)
+ return "date";
+ if (obj instanceof inspectedWindow.RegExp)
+ return "regexp";
+ // FireBug's array detection.
+ if (isFinite(obj.length) && typeof obj.splice === "function")
+ return "array";
+ if (isFinite(obj.length) && typeof obj.callee === "function") // arguments.
+ return "array";
+ if (obj instanceof inspectedWindow.NodeList)
+ return "array";
+ if (obj instanceof inspectedWindow.HTMLCollection)
+ return "array";
+ if (obj instanceof inspectedWindow.Error)
+ return "error";
+ return type;
+ },
-InjectedScript._resolveObject = function(objectProxy)
-{
- var object = InjectedScript._objectForId(objectProxy.objectId);
- var path = objectProxy.path;
+ _describe: function(obj, abbreviated)
+ {
+ var type = this._type(obj);
+
+ switch (type) {
+ case "object":
+ case "node":
+ return this._className(obj);
+ case "array":
+ var className = this._className(obj);
+ if (typeof obj.length === "number")
+ className += "[" + obj.length + "]";
+ return className;
+ case "string":
+ if (!abbreviated)
+ return obj;
+ if (obj.length > 100)
+ return "\"" + obj.substring(0, 100) + "\u2026\"";
+ return "\"" + obj + "\"";
+ case "function":
+ var objectText = this._toString(obj);
+ if (abbreviated)
+ objectText = /.*/.exec(objectText)[0].replace(/ +$/g, "");
+ return objectText;
+ default:
+ return this._toString(obj);
+ }
+ },
- // Follow the property path.
- for (var i = 0; InjectedScript._isDefined(object) && path && i < path.length; ++i)
- object = object[path[i]];
+ _toString: function(obj)
+ {
+ // We don't use String(obj) because inspectedWindow.String is undefined if owning frame navigated to another page.
+ return "" + obj;
+ },
- return object;
-}
+ _className: function(obj)
+ {
+ // We can't use the same code for fetching class names of the dom bindings prototype chain.
+ // Both of the methods below result in "Object" names on the foreign engine bindings.
+ // I gave up and am using a check below to distinguish between the egine bingings.
-InjectedScript._nodeForId = function(nodeId)
-{
- if (!nodeId)
- return null;
- return InjectedScriptHost.nodeForId(nodeId);
+ if (jsEngine == "JSC") {
+ var str = inspectedWindow.Object ? inspectedWindow.Object.prototype.toString.call(obj) : this._toString(obj);
+ return str.replace(/^\[object (.*)\]$/i, "$1");
+ } else {
+ // V8
+ return obj.constructor && obj.constructor.name || "Object";
+ }
+ },
+
+ _logEvent: function(event)
+ {
+ console.log(event.type, event);
+ },
+
+ _normalizeEventTypes: function(types)
+ {
+ if (typeof types === "undefined")
+ types = [ "mouse", "key", "load", "unload", "abort", "error", "select", "change", "submit", "reset", "focus", "blur", "resize", "scroll" ];
+ else if (typeof types === "string")
+ types = [ types ];
+
+ var result = [];
+ for (var i = 0; i < types.length; i++) {
+ if (types[i] === "mouse")
+ result.splice(0, 0, "mousedown", "mouseup", "click", "dblclick", "mousemove", "mouseover", "mouseout");
+ else if (types[i] === "key")
+ result.splice(0, 0, "keydown", "keyup", "keypress");
+ else
+ result.push(types[i]);
+ }
+ return result;
+ },
+
+ _inspectedNode: function(num)
+ {
+ var nodeId = InjectedScriptHost.inspectedNode(num);
+ return this._nodeForId(nodeId);
+ },
+
+ _bindToScript: function(func)
+ {
+ var args = Array.prototype.slice.call(arguments, 1);
+ function bound()
+ {
+ return func.apply(injectedScript, args.concat(Array.prototype.slice.call(arguments)));
+ }
+ bound.toString = function() {
+ return "bound: " + func;
+ };
+ return bound;
+ }
}
-InjectedScript._objectForId = function(objectId)
+var injectedScript = new InjectedScript();
+
+InjectedScript.RemoteObject = function(objectId, type, description, hasChildren)
{
- // There are three types of object ids used:
- // - numbers point to DOM Node via the InspectorDOMAgent mapping
- // - strings point to console objects cached in InspectorController for lazy evaluation upon them
- // - objects contain complex ids and are currently used for scoped objects
- if (typeof objectId === "number")
- return InjectedScript._nodeForId(objectId);
- else if (typeof objectId === "string")
- return InjectedScript.unwrapObject(objectId);
- else if (typeof objectId === "object") {
- var callFrame = InjectedScript._callFrameForId(objectId.callFrame);
- if (objectId.thisObject)
- return callFrame.thisObject;
- else
- return callFrame.scopeChain[objectId.chainIndex];
- }
- return objectId;
+ this.objectId = objectId;
+ this.type = type;
+ this.description = description;
+ this.hasChildren = hasChildren;
}
-InjectedScript.pushNodeToFrontend = function(objectProxy)
+InjectedScript.RemoteObject.fromException = function(e)
{
- var object = InjectedScript._resolveObject(objectProxy);
- if (!object || InjectedScript._type(object) !== "node")
- return false;
- return InjectedScriptHost.pushNodePathToFrontend(object, false, false);
+ return new InjectedScript.RemoteObject(null, "error", e.toString());
}
-// Called from within InspectorController on the 'inspected page' side.
-InjectedScript.createProxyObject = function(object, objectId, abbreviate)
+InjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate)
{
- var result = {};
- result.injectedScriptId = injectedScriptId;
- result.objectId = objectId;
- result.type = InjectedScript._type(object);
- if (result.type === "array")
- result.propertyLength = object.length;
-
- var type = typeof object;
-
- result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || type === "function";
+ var type = injectedScript._type(object);
+ var rawType = typeof object;
+ var hasChildren = (rawType === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || rawType === "function";
+ var description = "";
try {
- result.description = InjectedScript._describe(object, abbreviate);
+ var description = injectedScript._describe(object, abbreviate);
+ return new InjectedScript.RemoteObject(objectId, type, description, hasChildren);
} catch (e) {
- result.errorText = e.toString();
+ return InjectedScript.RemoteObject.fromException(e);
}
- return result;
-}
-
-InjectedScript.evaluateOnSelf = function(funcBody, args)
-{
- var func = window.eval("(" + funcBody + ")");
- return func.apply(this, args || []);
}
InjectedScript.CallFrameProxy = function(id, callFrame)
@@ -424,7 +549,7 @@ InjectedScript.CallFrameProxy = function(id, callFrame)
this.sourceID = callFrame.sourceID;
this.line = callFrame.line;
this.scopeChain = this._wrapScopeChain(callFrame);
- this.injectedScriptId = injectedScriptId;
+ this.worldId = injectedScriptId;
}
InjectedScript.CallFrameProxy.prototype = {
@@ -442,13 +567,13 @@ InjectedScript.CallFrameProxy.prototype = {
for (var i = 0; i < scopeChain.length; i++) {
var scopeType = callFrame.scopeType(i);
var scopeObject = scopeChain[i];
- var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
+ var scopeObjectProxy = injectedScript._wrapObject(scopeObject, "backtrace", true);
switch(scopeType) {
case LOCAL_SCOPE: {
foundLocalScope = true;
scopeObjectProxy.isLocal = true;
- scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
+ scopeObjectProxy.thisObject = injectedScript._wrapObject(callFrame.thisObject, "backtrace", true);
break;
}
case CLOSURE_SCOPE: {
@@ -472,138 +597,10 @@ InjectedScript.CallFrameProxy.prototype = {
}
}
-InjectedScript._isDefined = function(object)
-{
- return object || InjectedScript._isHTMLAllCollection(object);
-}
-
-InjectedScript._isHTMLAllCollection = function(object)
-{
- // document.all is reported as undefined, but we still want to process it.
- return (typeof object === "undefined") && inspectedWindow.HTMLAllCollection && object instanceof inspectedWindow.HTMLAllCollection;
-}
-
-InjectedScript._type = function(obj)
-{
- if (obj === null)
- return "null";
-
- var type = typeof obj;
- if (type !== "object" && type !== "function") {
- // FIXME(33716): typeof document.all is always 'undefined'.
- if (InjectedScript._isHTMLAllCollection(obj))
- return "array";
- return type;
- }
-
- // If owning frame has navigated to somewhere else window properties will be undefined.
- // In this case just return result of the typeof.
- if (!inspectedWindow.document)
- return type;
-
- if (obj instanceof inspectedWindow.Node)
- return (obj.nodeType === undefined ? type : "node");
- if (obj instanceof inspectedWindow.String)
- return "string";
- if (obj instanceof inspectedWindow.Array)
- return "array";
- if (obj instanceof inspectedWindow.Boolean)
- return "boolean";
- if (obj instanceof inspectedWindow.Number)
- return "number";
- if (obj instanceof inspectedWindow.Date)
- return "date";
- if (obj instanceof inspectedWindow.RegExp)
- return "regexp";
- if (obj instanceof inspectedWindow.NodeList)
- return "array";
- if (obj instanceof inspectedWindow.HTMLCollection)
- return "array";
- if (typeof inspectedWindow.jQuery === "function" && obj instanceof inspectedWindow.jQuery)
- return "array";
- if (obj instanceof inspectedWindow.Error)
- return "error";
- return type;
-}
-
-InjectedScript._describe = function(obj, abbreviated)
-{
- var type = InjectedScript._type(obj);
-
- switch (type) {
- case "object":
- case "node":
- case "array":
- return InjectedScript._className(obj);
- case "string":
- if (!abbreviated)
- return obj;
- if (obj.length > 100)
- return "\"" + obj.substring(0, 100) + "\u2026\"";
- return "\"" + obj + "\"";
- case "function":
- var objectText = InjectedScript._toString(obj);
- if (abbreviated)
- objectText = /.*/.exec(objectText)[0].replace(/ +$/g, "");
- return objectText;
- default:
- return InjectedScript._toString(obj);
- }
-}
-
-InjectedScript._toString = function(obj)
-{
- // We don't use String(obj) because inspectedWindow.String is undefined if owning frame navigated to another page.
- return "" + obj;
-}
-
-InjectedScript._className = function(obj)
-{
- // We can't use the same code for fetching class names of the dom bindings prototype chain.
- // Both of the methods below result in "Object" names on the foreign engine bindings.
- // I gave up and am using a check below to distinguish between the egine bingings.
-
- if (jsEngine == "JSC") {
- var str = inspectedWindow.Object ? inspectedWindow.Object.prototype.toString.call(obj) : InjectedScript._toString(obj);
- return str.replace(/^\[object (.*)\]$/i, "$1");
- } else {
- // V8
- return obj.constructor && obj.constructor.name || "Object";
- }
-}
-
-InjectedScript._logEvent = function(event)
-{
- console.log(event.type, event);
-}
-
-InjectedScript._normalizeEventTypes = function(types)
-{
- if (typeof types === "undefined")
- types = [ "mouse", "key", "load", "unload", "abort", "error", "select", "change", "submit", "reset", "focus", "blur", "resize", "scroll" ];
- else if (typeof types === "string")
- types = [ types ];
-
- var result = [];
- for (var i = 0; i < types.length; i++) {
- if (types[i] === "mouse")
- result.splice(0, 0, "mousedown", "mouseup", "click", "dblclick", "mousemove", "mouseover", "mouseout");
- else if (types[i] === "key")
- result.splice(0, 0, "keydown", "keyup", "keypress");
- else
- result.push(types[i]);
- }
- return result;
-}
-
-InjectedScript._inspectedNode = function(num)
-{
- var nodeId = InjectedScriptHost.inspectedNode(num);
- return InjectedScript._nodeForId(nodeId);
-}
-
function CommandLineAPI()
{
+ for (var i = 0; i < 5; ++i)
+ this.__defineGetter__("$" + i, injectedScript._bindToScript(injectedScript._inspectedNode, i));
}
CommandLineAPI.prototype = {
@@ -670,10 +667,10 @@ CommandLineAPI.prototype = {
{
if (!object || !object.addEventListener || !object.removeEventListener)
return;
- types = InjectedScript._normalizeEventTypes(types);
+ types = injectedScript._normalizeEventTypes(types);
for (var i = 0; i < types.length; ++i) {
- object.removeEventListener(types[i], InjectedScript._logEvent, false);
- object.addEventListener(types[i], InjectedScript._logEvent, false);
+ object.removeEventListener(types[i], injectedScript._logEvent, false);
+ object.addEventListener(types[i], injectedScript._logEvent, false);
}
},
@@ -681,9 +678,9 @@ CommandLineAPI.prototype = {
{
if (!object || !object.addEventListener || !object.removeEventListener)
return;
- types = InjectedScript._normalizeEventTypes(types);
+ types = injectedScript._normalizeEventTypes(types);
for (var i = 0; i < types.length; ++i)
- object.removeEventListener(types[i], InjectedScript._logEvent, false);
+ object.removeEventListener(types[i], injectedScript._logEvent, false);
},
inspect: function(object)
@@ -692,10 +689,10 @@ CommandLineAPI.prototype = {
return;
inspectedWindow.console.log(object);
- if (InjectedScript._type(object) === "node")
+ if (injectedScript._type(object) === "node")
InjectedScriptHost.pushNodePathToFrontend(object, false, true);
else {
- switch (InjectedScript._describe(object)) {
+ switch (injectedScript._describe(object)) {
case "Database":
InjectedScriptHost.selectDatabase(object);
break;
@@ -708,7 +705,7 @@ CommandLineAPI.prototype = {
copy: function(object)
{
- if (InjectedScript._type(object) === "node") {
+ if (injectedScript._type(object) === "node") {
var nodeId = InjectedScriptHost.pushNodePathToFrontend(object, false, false);
InjectedScriptHost.copyNode(nodeId);
} else
@@ -718,35 +715,9 @@ CommandLineAPI.prototype = {
clear: function()
{
InjectedScriptHost.clearConsoleMessages();
- },
-
- get $0()
- {
- return InjectedScript._inspectedNode(0);
- },
-
- get $1()
- {
- return InjectedScript._inspectedNode(1);
- },
-
- get $2()
- {
- return InjectedScript._inspectedNode(2);
- },
-
- get $3()
- {
- return InjectedScript._inspectedNode(3);
- },
-
- get $4()
- {
- return InjectedScript._inspectedNode(4);
}
}
-InjectedScript._commandLineAPI = new CommandLineAPI();
-
-return InjectedScript;
+injectedScript._commandLineAPI = new CommandLineAPI();
+return injectedScript;
});
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index b5aa9c7..ce264dd 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -29,17 +29,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-function InjectedScriptAccess(injectedScriptId) {
- this._injectedScriptId = injectedScriptId;
+function InjectedScriptAccess(worldId) {
+ this._worldId = worldId;
}
-InjectedScriptAccess.get = function(injectedScriptId)
+InjectedScriptAccess.get = function(worldId)
{
- if (typeof injectedScriptId === "number")
- return new InjectedScriptAccess(injectedScriptId);
+ if (typeof worldId === "number")
+ return new InjectedScriptAccess(worldId);
- console.error("Access to injected script with no id");
- console.trace();
+ console.assert(false, "Access to injected script with no id");
+}
+
+InjectedScriptAccess.getForNode = function(node)
+{
+ // FIXME: do something.
+ return InjectedScriptAccess.get(-node.id);
+}
+
+InjectedScriptAccess.getForObjectId = function(objectId)
+{
+ // FIXME: move to native layer.
+ var tokens = objectId.split(":");
+ return InjectedScriptAccess.get(parseInt(tokens[0]));
}
InjectedScriptAccess.getDefault = function()
@@ -66,7 +78,7 @@ InjectedScriptAccess._installHandler = function(methodName, async)
}
var callId = WebInspector.Callback.wrap(myCallback);
- InspectorBackend.dispatchOnInjectedScript(callId, this._injectedScriptId, methodName, argsString);
+ InspectorBackend.dispatchOnInjectedScript(callId, this._worldId, methodName, argsString);
};
}
@@ -75,12 +87,12 @@ InjectedScriptAccess._installHandler = function(methodName, async)
// - Make sure last parameter of all the InjectedSriptAccess.* calls is a callback function.
// We keep these sorted.
InjectedScriptAccess._installHandler("evaluate");
-InjectedScriptAccess._installHandler("evaluateAndStringify");
InjectedScriptAccess._installHandler("evaluateInCallFrame");
InjectedScriptAccess._installHandler("evaluateOnSelf");
InjectedScriptAccess._installHandler("getCompletions");
InjectedScriptAccess._installHandler("getProperties");
InjectedScriptAccess._installHandler("getPrototypes");
-InjectedScriptAccess._installHandler("openInInspectedWindow");
InjectedScriptAccess._installHandler("pushNodeToFrontend");
+InjectedScriptAccess._installHandler("resolveNode");
+InjectedScriptAccess._installHandler("getNodeProperties");
InjectedScriptAccess._installHandler("setPropertyValue");
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
deleted file mode 100644
index c87cb81..0000000
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.InspectorBackendStub = function()
-{
- this._registerDelegate("addInspectedNode");
- this._registerDelegate("addScriptToEvaluateOnLoad");
- this._registerDelegate("changeTagName");
- this._registerDelegate("clearConsoleMessages");
- this._registerDelegate("copyNode");
- this._registerDelegate("deleteCookie");
- this._registerDelegate("didEvaluateForTestInFrontend");
- this._registerDelegate("disableMonitoringXHR");
- this._registerDelegate("disableResourceTracking");
- this._registerDelegate("disableSearchingForNode");
- this._registerDelegate("disableTimeline");
- this._registerDelegate("dispatchOnInjectedScript");
- this._registerDelegate("enableMonitoringXHR");
- this._registerDelegate("enableResourceTracking");
- this._registerDelegate("enableSearchingForNode");
- this._registerDelegate("enableTimeline");
- this._registerDelegate("getApplicationCaches");
- this._registerDelegate("getChildNodes");
- this._registerDelegate("getCookies");
- this._registerDelegate("getDatabaseTableNames");
- this._registerDelegate("getDOMStorageEntries");
- this._registerDelegate("getEventListenersForNode");
- this._registerDelegate("getOuterHTML");
- this._registerDelegate("getProfile");
- this._registerDelegate("getProfileHeaders");
- this._registerDelegate("removeProfile");
- this._registerDelegate("clearProfiles");
- this._registerDelegate("getResourceContent");
- this._registerDelegate("highlightDOMNode");
- this._registerDelegate("hideDOMNodeHighlight");
- this._registerDelegate("performSearch");
- this._registerDelegate("pushNodeByPathToFrontend");
- this._registerDelegate("releaseWrapperObjectGroup");
- this._registerDelegate("removeAllScriptsToEvaluateOnLoad");
- this._registerDelegate("reloadPage");
- this._registerDelegate("removeAttribute");
- this._registerDelegate("removeDOMStorageItem");
- this._registerDelegate("removeNode");
- this._registerDelegate("saveApplicationSettings");
- this._registerDelegate("saveSessionSettings");
- this._registerDelegate("searchCanceled");
- this._registerDelegate("setAttribute");
- this._registerDelegate("setDOMStorageItem");
- this._registerDelegate("setInjectedScriptSource");
- this._registerDelegate("setOuterHTML");
- this._registerDelegate("setTextNodeValue");
- this._registerDelegate("startProfiling");
- this._registerDelegate("startTimelineProfiler");
- this._registerDelegate("stopProfiling");
- this._registerDelegate("stopTimelineProfiler");
- this._registerDelegate("storeLastActivePanel");
- this._registerDelegate("takeHeapSnapshot");
- this._registerDelegate("getProfilerLogLines");
-
- this._registerDelegate("getAllStyles");
- this._registerDelegate("getStyles");
- this._registerDelegate("getComputedStyle");
- this._registerDelegate("getInlineStyle");
- this._registerDelegate("getStyleSheet");
- this._registerDelegate("getRuleRanges");
- this._registerDelegate("applyStyleText");
- this._registerDelegate("setStyleText");
- this._registerDelegate("setStyleProperty");
- this._registerDelegate("toggleStyleEnabled");
- this._registerDelegate("setRuleSelector");
- this._registerDelegate("addRule");
-
- this._registerDelegate("disableDebugger");
- this._registerDelegate("editScriptSource");
- this._registerDelegate("getScriptSource");
- this._registerDelegate("enableDebugger");
- this._registerDelegate("setBreakpoint");
- this._registerDelegate("removeBreakpoint");
- this._registerDelegate("activateBreakpoints");
- this._registerDelegate("deactivateBreakpoints");
- this._registerDelegate("pause");
- this._registerDelegate("resume");
- this._registerDelegate("stepIntoStatement");
- this._registerDelegate("stepOutOfFunction");
- this._registerDelegate("stepOverStatement");
- this._registerDelegate("setPauseOnExceptionsState");
-}
-
-WebInspector.InspectorBackendStub.prototype = {
- _registerDelegate: function(methodName)
- {
- this[methodName] = this.sendMessageToBackend.bind(this, methodName);
- },
-
- sendMessageToBackend: function()
- {
- var message = JSON.stringify(Array.prototype.slice.call(arguments));
- InspectorFrontendHost.sendMessageToBackend(message);
- }
-}
-
-InspectorBackend = new WebInspector.InspectorBackendStub();
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.qrc b/WebCore/inspector/front-end/InspectorBackendStub.qrc
new file mode 100644
index 0000000..30f6d75
--- /dev/null
+++ b/WebCore/inspector/front-end/InspectorBackendStub.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/webkit/inspector">
+ <file>InspectorBackendStub.js</file>
+</qresource>
+</RCC>
+
diff --git a/WebCore/inspector/front-end/ObjectPropertiesSection.js b/WebCore/inspector/front-end/ObjectPropertiesSection.js
index a32e799..aab9546 100644
--- a/WebCore/inspector/front-end/ObjectPropertiesSection.js
+++ b/WebCore/inspector/front-end/ObjectPropertiesSection.js
@@ -50,7 +50,7 @@ WebInspector.ObjectPropertiesSection.prototype = {
return;
self.updateProperties(properties);
};
- InjectedScriptAccess.get(this.object.injectedScriptId).getProperties(this.object, this.ignoreHasOwnProperty, true, callback);
+ this.object.getProperties(this.ignoreHasOwnProperty, true, callback);
},
updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
@@ -69,8 +69,10 @@ WebInspector.ObjectPropertiesSection.prototype = {
this.propertiesTreeOutline.removeChildren();
- for (var i = 0; i < properties.length; ++i)
+ for (var i = 0; i < properties.length; ++i) {
+ properties[i].parentObject = this.object;
this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i]));
+ }
if (!this.propertiesTreeOutline.children.length) {
var title = "<div class=\"info\">" + this.emptyPlaceholder + "</div>";
@@ -152,7 +154,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
}
};
- InjectedScriptAccess.get(this.property.value.injectedScriptId).getProperties(this.property.value, false, true, callback.bind(this));
+ this.property.value.getOwnProperties(true, callback.bind(this));
},
ondblclick: function(event)
@@ -178,11 +180,9 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.valueElement = document.createElement("span");
this.valueElement.className = "value";
this.valueElement.textContent = this.property.value.description;
- if (typeof this.property.value.propertyLength !== "undefined")
- this.valueElement.textContent += " (" + this.property.value.propertyLength + ")";
if (this.property.isGetter)
this.valueElement.addStyleClass("dimmed");
- if (this.property.isError)
+ if (this.property.value.isError())
this.valueElement.addStyleClass("error");
this.listItemElement.removeChildren();
@@ -260,7 +260,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
self.updateSiblings();
}
};
- InjectedScriptAccess.get(this.property.parentObjectProxy.injectedScriptId).setPropertyValue(this.property.parentObjectProxy, this.property.name, expression.trim(), callback);
+ this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback);
}
}
diff --git a/WebCore/inspector/front-end/PropertiesSidebarPane.js b/WebCore/inspector/front-end/PropertiesSidebarPane.js
index 9df6448..75d6a48 100644
--- a/WebCore/inspector/front-end/PropertiesSidebarPane.js
+++ b/WebCore/inspector/front-end/PropertiesSidebarPane.js
@@ -48,17 +48,18 @@ WebInspector.PropertiesSidebarPane.prototype = {
body.removeChildren();
self.sections = [];
- var path = [];
// Get array of prototype user-friendly names.
for (var i = 0; i < prototypes.length; ++i) {
- var prototype = new WebInspector.ObjectProxy(node.injectedScriptId, node.id, path.slice());
- var section = new WebInspector.ObjectPropertiesSection(prototype, prototypes[i], WebInspector.UIString("Prototype"));
+ var prototype = WebInspector.RemoteObject.fromPayload(prototypes[i]);
+ var title = prototype.description;
+ if (title.match(/Prototype$/))
+ title = title.replace(/Prototype$/, "");
+ var section = new WebInspector.ObjectPropertiesSection(prototype, title, WebInspector.UIString("Prototype"));
self.sections.push(section);
body.appendChild(section.element);
- path.push("__proto__");
}
};
- InjectedScriptAccess.get(node.injectedScriptId).getPrototypes(node.id, callback);
+ InjectedScriptAccess.getForNode(node).getPrototypes(node.id, callback);
}
}
diff --git a/WebCore/inspector/front-end/RemoteObject.js b/WebCore/inspector/front-end/RemoteObject.js
new file mode 100644
index 0000000..003d483
--- /dev/null
+++ b/WebCore/inspector/front-end/RemoteObject.js
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+WebInspector.RemoteObject = function(objectId, type, description, hasChildren)
+{
+ this._objectId = objectId;
+ this._type = type;
+ this._description = description;
+ this._hasChildren = hasChildren;
+}
+
+WebInspector.RemoteObject.fromPrimitiveValue = function(value)
+{
+ return new WebInspector.RemoteObject(null, typeof value, value);
+}
+
+WebInspector.RemoteObject.resolveNode = function(node, callback)
+{
+ function mycallback(object)
+ {
+ callback(object ? WebInspector.RemoteObject.fromPayload(object) : null);
+ }
+ InjectedScriptAccess.getForNode(node).resolveNode(node.id, mycallback);
+}
+
+WebInspector.RemoteObject.fromPayload = function(payload)
+{
+ if (typeof payload === "object")
+ return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.description, payload.hasChildren);
+ // FIXME: make sure we only get here with real payloads in the new DebuggerAgent.js.
+ return payload;
+}
+
+WebInspector.RemoteObject.type = function(remoteObject)
+{
+ if (remoteObject === null)
+ return "null";
+
+ var type = typeof remoteObject;
+ if (type !== "object" && type !== "function")
+ return type;
+
+ return remoteObject.type;
+}
+
+WebInspector.RemoteObject.prototype = {
+ get objectId()
+ {
+ return this._objectId;
+ },
+
+ get type()
+ {
+ return this._type;
+ },
+
+ get description()
+ {
+ return this._description;
+ },
+
+ get hasChildren()
+ {
+ return this._hasChildren;
+ },
+
+ isError: function()
+ {
+ return this._type === "error";
+ },
+
+ getOwnProperties: function(abbreviate, callback)
+ {
+ this.getProperties(false, abbreviate, callback);
+ },
+
+ getProperties: function(ignoreHasOwnProperty, abbreviate, callback)
+ {
+ if (!this._objectId) {
+ callback([]);
+ return;
+ }
+ function remoteObjectBinder(properties)
+ {
+ for (var i = 0; properties && i < properties.length; ++i)
+ properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value);
+ callback(properties);
+ }
+ InjectedScriptAccess.getForObjectId(this._objectId).getProperties(this._objectId, ignoreHasOwnProperty, abbreviate, remoteObjectBinder);
+ },
+
+ setPropertyValue: function(name, value, callback)
+ {
+ if (!this._objectId) {
+ callback(false);
+ return;
+ }
+ InjectedScriptAccess.getForObjectId(this._objectId).setPropertyValue(this._objectId, name, value, callback);
+ },
+
+ pushNodeToFrontend: function(callback)
+ {
+ InjectedScriptAccess.getForObjectId(this._objectId).pushNodeToFrontend(this._objectId, callback);
+ }
+}
+
+WebInspector.RemoteObjectProperty = function(name, value)
+{
+ this.name = name;
+ this.value = value;
+}
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 9785644..01eefc7 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -1186,7 +1186,7 @@ WebInspector.ResourceSidebarTreeElement.prototype = {
ondblclick: function(event)
{
- InjectedScriptAccess.getDefault().openInInspectedWindow(this.resource.url, function() {});
+ InspectorBackend.openInInspectedWindow(this.resource.url);
},
ondragstart: function(event) {
diff --git a/WebCore/inspector/front-end/ScopeChainSidebarPane.js b/WebCore/inspector/front-end/ScopeChainSidebarPane.js
index fdfcd38..d3190a9 100644
--- a/WebCore/inspector/front-end/ScopeChainSidebarPane.js
+++ b/WebCore/inspector/front-end/ScopeChainSidebarPane.js
@@ -60,7 +60,7 @@ WebInspector.ScopeChainSidebarPane.prototype = {
emptyPlaceholder = WebInspector.UIString("No Variables");
subtitle = null;
if (scopeObjectProxy.thisObject)
- extraProperties = [ new WebInspector.ObjectPropertyProxy("this", scopeObjectProxy.thisObject) ];
+ extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(scopeObjectProxy.thisObject)) ];
} else if (scopeObjectProxy.isClosure) {
title = WebInspector.UIString("Closure");
emptyPlaceholder = WebInspector.UIString("No Variables");
@@ -77,7 +77,7 @@ WebInspector.ScopeChainSidebarPane.prototype = {
if (!title || title === subtitle)
subtitle = null;
- var section = new WebInspector.ObjectPropertiesSection(scopeObjectProxy, title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);
+ var section = new WebInspector.ObjectPropertiesSection(WebInspector.RemoteObject.fromPayload(scopeObjectProxy), title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);
section.editInSelectedCallFrameWhenPaused = true;
section.pane = this;
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 44c1dba..8675f79 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -387,9 +387,9 @@ WebInspector.ScriptsPanel.prototype = {
updateInterface = true;
var self = this;
- function updatingCallbackWrapper(result, exception)
+ function updatingCallbackWrapper(result)
{
- callback(result, exception);
+ callback(result);
if (updateInterface)
self.sidebarPanes.scopechain.update(selectedCallFrame);
}
@@ -401,9 +401,9 @@ WebInspector.ScriptsPanel.prototype = {
function evalCallback(result)
{
if (result)
- callback(result.value, result.isException);
+ callback(WebInspector.RemoteObject.fromPayload(result));
}
- InjectedScriptAccess.get(callFrame.injectedScriptId).evaluateInCallFrame(callFrame.id, code, objectGroup, evalCallback);
+ InjectedScriptAccess.get(callFrame.worldId).evaluateInCallFrame(callFrame.id, code, objectGroup, evalCallback);
},
debuggerPaused: function(callFrames)
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index 73c3e2a..01a8ec2 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -625,9 +625,9 @@ WebInspector.SourceFrame.prototype = {
popupContentElement.addEventListener("mousemove", killHidePopupTimer.bind(this), true);
}
- function evaluateCallback(result, exception)
+ function evaluateCallback(result)
{
- if (exception)
+ if (result.isError())
return;
if (!WebInspector.panels.scripts.paused)
return;
@@ -699,11 +699,11 @@ WebInspector.SourceFrame.prototype = {
return;
var expression = selection.getRangeAt(0).toString().trim();
- WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result, exception) {
+ WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result) {
WebInspector.showConsole();
var commandMessage = new WebInspector.ConsoleCommand(expression);
WebInspector.console.addMessage(commandMessage);
- WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage));
+ WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));
});
},
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index b530ab6..28dad23 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -90,24 +90,10 @@ WebInspector.WatchExpressionsSection.NewWatchExpression = "\xA0";
WebInspector.WatchExpressionsSection.prototype = {
update: function()
{
- function appendResult(expression, watchIndex, result, exception)
+ function appendResult(expression, watchIndex, result)
{
- if (exception) {
- // Exception results are not wrappers, but text messages.
- result = WebInspector.ObjectProxy.wrapPrimitiveValue(result);
- } else if (result.type === "string") {
- // Evaluation result is intentionally not abbreviated. However, we'd like to distinguish between null and "null"
- result.description = "\"" + result.description + "\"";
- }
-
- var property = new WebInspector.ObjectPropertyProxy(expression, result);
+ var property = new WebInspector.RemoteObjectProperty(expression, result);
property.watchIndex = watchIndex;
- property.isException = exception;
-
- // For newly added, empty expressions, set description to "",
- // since otherwise you get DOMWindow
- if (property.name === WebInspector.WatchExpressionsSection.NewWatchExpression)
- property.value.description = "";
// To clarify what's going on here:
// In the outer function, we calculate the number of properties
@@ -222,7 +208,7 @@ WebInspector.WatchExpressionTreeElement.prototype = {
{
WebInspector.ObjectPropertyTreeElement.prototype.update.call(this);
- if (this.property.isException)
+ if (this.property.value.isError())
this.valueElement.addStyleClass("watch-expressions-error-level");
var deleteButton = document.createElement("input");
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index a54936c..4901857 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -46,13 +46,11 @@
<file>InjectedScript.js</file>
<file>InjectedScriptAccess.js</file>
<file>inspector.js</file>
- <file>InspectorBackendStub.js</file>
<file>InspectorFrontendHostStub.js</file>
<file>KeyboardShortcut.js</file>
<file>MetricsSidebarPane.js</file>
<file>Object.js</file>
<file>ObjectPropertiesSection.js</file>
- <file>ObjectProxy.js</file>
<file>Panel.js</file>
<file>PanelEnablerView.js</file>
<file>Placard.js</file>
@@ -62,6 +60,7 @@
<file>ProfileView.js</file>
<file>PropertiesSection.js</file>
<file>PropertiesSidebarPane.js</file>
+ <file>RemoteObject.js</file>
<file>Resource.js</file>
<file>ResourceCategory.js</file>
<file>ResourcesPanel.js</file>
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 48e95bb..14e2cdc 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -73,7 +73,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="SidebarTreeElement.js"></script>
<script type="text/javascript" src="Section.js"></script>
<script type="text/javascript" src="PropertiesSection.js"></script>
- <script type="text/javascript" src="ObjectProxy.js"></script>
+ <script type="text/javascript" src="RemoteObject.js"></script>
<script type="text/javascript" src="ObjectPropertiesSection.js"></script>
<script type="text/javascript" src="BreakpointsSidebarPane.js"></script>
<script type="text/javascript" src="CallStackSidebarPane.js"></script>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 4e8e633..fa57916 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -28,7 +28,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-function preloadImages()
+// Keep this ; so that concatenated version of the script worked.
+;(function preloadImages()
{
(new Image()).src = "Images/clearConsoleButtonGlyph.png";
(new Image()).src = "Images/consoleButtonGlyph.png";
@@ -45,9 +46,7 @@ function preloadImages()
(new Image()).src = "Images/recordToggledButtonGlyph.png";
(new Image()).src = "Images/reloadButtonGlyph.png";
(new Image()).src = "Images/undockButtonGlyph.png";
-}
-
-preloadImages();
+})();
var WebInspector = {
resources: {},
@@ -427,10 +426,39 @@ WebInspector.PlatformFlavor = {
MacTiger: "mac-tiger",
MacLeopard: "mac-leopard",
MacSnowLeopard: "mac-snowleopard"
-}
+};
+
+(function parseQueryParameters()
+{
+ WebInspector.queryParamsObject = {};
+ var queryParams = window.location.search;
+ if (!queryParams)
+ return;
+ var params = queryParams.substring(1).split("&");
+ for (var i = 0; i < params.length; ++i) {
+ var pair = params[i].split("=");
+ WebInspector.queryParamsObject[pair[0]] = pair[1];
+ }
+})();
WebInspector.loaded = function()
{
+ if ("page" in WebInspector.queryParamsObject) {
+ WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector.queryParamsObject.page);
+ WebInspector.socket.onmessage = function(message) { WebInspector_syncDispatch(message.data); }
+ WebInspector.socket.onerror = function(error) { console.error(error); }
+ WebInspector.socket.onopen = function() {
+ InspectorFrontendHost.sendMessageToBackend = WebInspector.socket.send.bind(WebInspector.socket);
+ InspectorFrontendHost.loaded = WebInspector.socket.send.bind(WebInspector.socket, "loaded");
+ WebInspector.doLoadedDone();
+ }
+ return;
+ }
+ WebInspector.doLoadedDone();
+}
+
+WebInspector.doLoadedDone = function()
+{
InspectorBackend.setInjectedScriptSource("(" + injectedScriptConstructor + ");");
var platform = WebInspector.platform;
@@ -581,6 +609,15 @@ WebInspector.dispatch = function() {
setTimeout(delayDispatch, 0);
}
+// This function is purposely put into the global scope for easy access.
+WebInspector_syncDispatch = function(message)
+{
+ var args = JSON.parse(message);
+ var methodName = args[0];
+ var parameters = args.slice(1);
+ WebInspector[methodName].apply(WebInspector, parameters);
+}
+
WebInspector.dispatchMessageFromBackend = function(arguments)
{
WebInspector.dispatch.apply(this, arguments);
@@ -1109,6 +1146,11 @@ WebInspector.selectDatabase = function(o)
WebInspector.panels.storage.selectDatabase(o);
}
+WebInspector.consoleMessagesCleared = function()
+{
+ WebInspector.console.clearMessages();
+}
+
WebInspector.selectDOMStorage = function(o)
{
WebInspector.showPanel("storage");
@@ -1470,7 +1512,7 @@ WebInspector.log = function(message, messageLevel)
// return indication if we can actually log a message
function isLogAvailable()
{
- return WebInspector.ConsoleMessage && WebInspector.ObjectProxy && self.console;
+ return WebInspector.ConsoleMessage && WebInspector.RemoteObject && self.console;
}
// flush the queue of pending messages
@@ -1510,7 +1552,7 @@ WebInspector.log = function(message, messageLevel)
WebInspector.log.repeatCount = repeatCount;
// ConsoleMessage expects a proxy object
- message = new WebInspector.ObjectProxy(null, null, [], message, false);
+ message = new WebInspector.RemoteObject.fromPrimitiveValue(message);
// post the message
var msg = new WebInspector.ConsoleMessage(
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index dd3e761..66cf284 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -26,18 +26,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-Object.proxyType = function(objectProxy)
-{
- if (objectProxy === null)
- return "null";
-
- var type = typeof objectProxy;
- if (type !== "object" && type !== "function")
- return type;
-
- return objectProxy.type;
-}
-
Object.properties = function(obj)
{
var properties = [];
@@ -847,7 +835,7 @@ String.tokenizeFormatString = function(format)
String.standardFormatters = {
d: function(substitution)
{
- if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
+ if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")
substitution = substitution.description;
substitution = parseInt(substitution);
return !isNaN(substitution) ? substitution : 0;
@@ -855,7 +843,7 @@ String.standardFormatters = {
f: function(substitution, token)
{
- if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
+ if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")
substitution = substitution.description;
substitution = parseFloat(substitution);
if (substitution && token.precision > -1)
@@ -865,7 +853,7 @@ String.standardFormatters = {
s: function(substitution)
{
- if (typeof substitution == "object" && Object.proxyType(substitution) !== "null")
+ if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) !== "null")
substitution = substitution.description;
return substitution;
},
diff --git a/WebCore/loader/Cache.h b/WebCore/loader/Cache.h
index 0a5b74d..23aad1e 100644
--- a/WebCore/loader/Cache.h
+++ b/WebCore/loader/Cache.h
@@ -28,12 +28,12 @@
#include "CachePolicy.h"
#include "CachedResource.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include "loader.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/CrossOriginAccessControl.cpp b/WebCore/loader/CrossOriginAccessControl.cpp
index f019f28..630f2b7 100644
--- a/WebCore/loader/CrossOriginAccessControl.cpp
+++ b/WebCore/loader/CrossOriginAccessControl.cpp
@@ -27,11 +27,11 @@
#include "config.h"
#include "CrossOriginAccessControl.h"
-#include "AtomicString.h"
#include "HTTPParsers.h"
#include "ResourceResponse.h"
#include "SecurityOrigin.h"
#include <wtf/Threading.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/loader/CrossOriginPreflightResultCache.cpp b/WebCore/loader/CrossOriginPreflightResultCache.cpp
index 51874d1..18e4be2 100644
--- a/WebCore/loader/CrossOriginPreflightResultCache.cpp
+++ b/WebCore/loader/CrossOriginPreflightResultCache.cpp
@@ -74,16 +74,16 @@ static void addToAccessControlAllowList(const String& string, unsigned start, un
template<class HashType>
static bool parseAccessControlAllowList(const String& string, HashSet<String, HashType>& set)
{
- int start = 0;
- int end;
- while ((end = string.find(',', start)) != -1) {
+ unsigned start = 0;
+ size_t end;
+ while ((end = string.find(',', start)) != notFound) {
if (start == end)
return false;
addToAccessControlAllowList(string, start, end - 1, set);
start = end + 1;
}
- if (start != static_cast<int>(string.length()))
+ if (start != string.length())
addToAccessControlAllowList(string, start, string.length() - 1, set);
return true;
diff --git a/WebCore/loader/CrossOriginPreflightResultCache.h b/WebCore/loader/CrossOriginPreflightResultCache.h
index 0f3e356..1016aed 100644
--- a/WebCore/loader/CrossOriginPreflightResultCache.h
+++ b/WebCore/loader/CrossOriginPreflightResultCache.h
@@ -28,10 +28,10 @@
#define CrossOriginPreflightResultCache_h
#include "KURLHash.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/DocLoader.h b/WebCore/loader/DocLoader.h
index 2b43bb3..06b02c9 100644
--- a/WebCore/loader/DocLoader.h
+++ b/WebCore/loader/DocLoader.h
@@ -29,10 +29,10 @@
#include "CachedResource.h"
#include "CachedResourceHandle.h"
#include "CachePolicy.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/ListHashSet.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index fcc1826..26d66e8 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -86,6 +86,7 @@ DocumentLoader::DocumentLoader(const ResourceRequest& req, const SubstituteData&
, m_gotFirstByte(false)
, m_primaryLoadComplete(false)
, m_isClientRedirect(false)
+ , m_wasOnloadHandled(false)
, m_stopRecordingResponses(false)
, m_substituteResourceDeliveryTimer(this, &DocumentLoader::substituteResourceDeliveryTimerFired)
, m_didCreateGlobalHistoryEntry(false)
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index d9e7581..bc81350 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -109,6 +109,8 @@ namespace WebCore {
void prepareForLoadStart();
bool isClientRedirect() const { return m_isClientRedirect; }
void setIsClientRedirect(bool isClientRedirect) { m_isClientRedirect = isClientRedirect; }
+ void handledOnloadEvents() { m_wasOnloadHandled = true; }
+ bool wasOnloadHandled() { return m_wasOnloadHandled; }
bool isLoadingInAPISense() const;
void setPrimaryLoadComplete(bool);
void setTitle(const String&);
@@ -269,6 +271,7 @@ namespace WebCore {
bool m_gotFirstByte;
bool m_primaryLoadComplete;
bool m_isClientRedirect;
+ bool m_wasOnloadHandled;
String m_pageTitle;
String m_pageIconURL;
diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp
index 9315e45..5c7102c 100644
--- a/WebCore/loader/FTPDirectoryDocument.cpp
+++ b/WebCore/loader/FTPDirectoryDocument.cpp
@@ -27,9 +27,9 @@
#include "FTPDirectoryDocument.h"
#include "CharacterNames.h"
+#include "HTMLDocumentParser.h"
#include "HTMLNames.h"
#include "HTMLTableElement.h"
-#include "LegacyHTMLDocumentParser.h"
#include "LocalizedStrings.h"
#include "Logging.h"
#include "FTPDirectoryParser.h"
@@ -48,13 +48,13 @@ namespace WebCore {
using namespace HTMLNames;
-class FTPDirectoryDocumentParser : public LegacyHTMLDocumentParser {
+class FTPDirectoryDocumentParser : public HTMLDocumentParser {
public:
FTPDirectoryDocumentParser(HTMLDocument*);
virtual void append(const SegmentedString&);
virtual void finish();
-
+
virtual bool isWaitingForScripts() const { return false; }
inline void checkBuffer(int len = 10)
@@ -79,7 +79,7 @@ private:
void parseAndAppendOneLine(const String&);
void appendEntry(const String& name, const String& size, const String& date, bool isDirectory);
PassRefPtr<Element> createTDForFilename(const String&);
-
+
RefPtr<HTMLTableElement> m_tableElement;
bool m_skipLF;
@@ -94,14 +94,14 @@ private:
};
FTPDirectoryDocumentParser::FTPDirectoryDocumentParser(HTMLDocument* document)
- : LegacyHTMLDocumentParser(document, false)
+ : HTMLDocumentParser(document, false)
, m_skipLF(false)
, m_parsedTemplate(false)
, m_size(254)
, m_buffer(static_cast<UChar*>(fastMalloc(sizeof(UChar) * m_size)))
, m_dest(m_buffer)
{
-}
+}
void FTPDirectoryDocumentParser::appendEntry(const String& filename, const String& size, const String& date, bool isDirectory)
{
@@ -109,7 +109,7 @@ void FTPDirectoryDocumentParser::appendEntry(const String& filename, const Strin
RefPtr<Element> rowElement = m_tableElement->insertRow(-1, ec);
rowElement->setAttribute("class", "ftpDirectoryEntryRow", ec);
-
+
RefPtr<Element> element = document()->createElement(tdTag, false);
element->appendChild(Text::create(document(), String(&noBreakSpace, 1)), ec);
if (isDirectory)
@@ -117,16 +117,16 @@ void FTPDirectoryDocumentParser::appendEntry(const String& filename, const Strin
else
element->setAttribute("class", "ftpDirectoryIcon ftpDirectoryTypeFile", ec);
rowElement->appendChild(element, ec);
-
+
element = createTDForFilename(filename);
element->setAttribute("class", "ftpDirectoryFileName", ec);
rowElement->appendChild(element, ec);
-
+
element = document()->createElement(tdTag, false);
element->appendChild(Text::create(document(), date), ec);
element->setAttribute("class", "ftpDirectoryFileDate", ec);
rowElement->appendChild(element, ec);
-
+
element = document()->createElement(tdTag, false);
element->appendChild(Text::create(document(), size), ec);
element->setAttribute("class", "ftpDirectoryFileSize", ec);
@@ -136,7 +136,7 @@ void FTPDirectoryDocumentParser::appendEntry(const String& filename, const Strin
PassRefPtr<Element> FTPDirectoryDocumentParser::createTDForFilename(const String& filename)
{
ExceptionCode ec;
-
+
String fullURL = document()->baseURL().string();
if (fullURL[fullURL.length() - 1] == '/')
fullURL.append(filename);
@@ -146,10 +146,10 @@ PassRefPtr<Element> FTPDirectoryDocumentParser::createTDForFilename(const String
RefPtr<Element> anchorElement = document()->createElement(aTag, false);
anchorElement->setAttribute("href", fullURL, ec);
anchorElement->appendChild(Text::create(document(), filename), ec);
-
+
RefPtr<Element> tdElement = document()->createElement(tdTag, false);
tdElement->appendChild(anchorElement, ec);
-
+
return tdElement.release();
}
@@ -157,18 +157,18 @@ static String processFilesizeString(const String& size, bool isDirectory)
{
if (isDirectory)
return "--";
-
+
bool valid;
int64_t bytes = size.toUInt64(&valid);
if (!valid)
return unknownFileSizeText();
-
+
if (bytes < 1000000)
return String::format("%.2f KB", static_cast<float>(bytes)/1000);
if (bytes < 1000000000)
return String::format("%.2f MB", static_cast<float>(bytes)/1000000);
-
+
return String::format("%.2f GB", static_cast<float>(bytes)/1000000000);
}
@@ -177,19 +177,19 @@ static bool wasLastDayOfMonth(int year, int month, int day)
static int lastDays[] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
if (month < 0 || month > 11)
return false;
-
+
if (month == 2) {
if (year % 4 == 0 && (year % 100 || year % 400 == 0)) {
if (day == 29)
return true;
return false;
}
-
+
if (day == 28)
return true;
return false;
}
-
+
return lastDays[month] == day;
}
@@ -198,11 +198,11 @@ static String processFileDateString(const FTPTime& fileTime)
// FIXME: Need to localize this string?
String timeOfDay;
-
+
if (!(fileTime.tm_hour == 0 && fileTime.tm_min == 0 && fileTime.tm_sec == 0)) {
int hour = fileTime.tm_hour;
ASSERT(hour >= 0 && hour < 24);
-
+
if (hour < 12) {
if (hour == 0)
hour = 12;
@@ -214,15 +214,15 @@ static String processFileDateString(const FTPTime& fileTime)
timeOfDay = String::format(", %i:%02i PM", hour, fileTime.tm_min);
}
}
-
+
// If it was today or yesterday, lets just do that - but we have to compare to the current time
struct tm now;
time_t now_t = time(NULL);
getLocalTime(&now_t, &now);
-
+
// localtime does "year = current year - 1900", compensate for that for readability and comparison purposes
now.tm_year += 1900;
-
+
if (fileTime.tm_year == now.tm_year) {
if (fileTime.tm_mon == now.tm_mon) {
if (fileTime.tm_mday == now.tm_mday)
@@ -235,23 +235,23 @@ static String processFileDateString(const FTPTime& fileTime)
wasLastDayOfMonth(fileTime.tm_year, fileTime.tm_mon, fileTime.tm_mday))
return "Yesterday" + timeOfDay;
}
-
+
if (fileTime.tm_year == now.tm_year - 1 && fileTime.tm_mon == 12 && fileTime.tm_mday == 31 && now.tm_mon == 1 && now.tm_mday == 1)
return "Yesterday" + timeOfDay;
static const char* months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "???" };
-
+
int month = fileTime.tm_mon;
if (month < 0 || month > 11)
month = 12;
-
+
String dateString;
-
+
if (fileTime.tm_year > -1)
dateString = String::format("%s %i, %i", months[month], fileTime.tm_mday, fileTime.tm_year);
else
dateString = String::format("%s %i, %i", months[month], fileTime.tm_mday, now.tm_year);
-
+
return dateString + timeOfDay;
}
@@ -261,22 +261,22 @@ void FTPDirectoryDocumentParser::parseAndAppendOneLine(const String& inputLine)
CString latin1Input = inputLine.latin1();
FTPEntryType typeResult = parseOneFTPLine(latin1Input.data(), m_listState, result);
-
+
// FTPMiscEntry is a comment or usage statistic which we don't care about, and junk is invalid data - bail in these 2 cases
if (typeResult == FTPMiscEntry || typeResult == FTPJunkEntry)
return;
-
+
String filename(result.filename, result.filenameLength);
if (result.type == FTPDirectoryEntry) {
filename.append("/");
-
+
// We have no interest in linking to "current directory"
if (filename == "./")
return;
}
LOG(FTP, "Appending entry - %s, %s", filename.ascii().data(), result.fileSize.ascii().data());
-
+
appendEntry(filename, processFilesizeString(result.fileSize, result.type == FTPDirectoryEntry), processFileDateString(result.modifiedTime), result.type == FTPDirectoryEntry);
}
@@ -302,8 +302,8 @@ bool FTPDirectoryDocumentParser::loadDocumentTemplate()
return false;
}
- LegacyHTMLDocumentParser::insert(String(templateDocumentData->data(), templateDocumentData->size()));
-
+ HTMLDocumentParser::insert(String(templateDocumentData->data(), templateDocumentData->size()));
+
RefPtr<Element> tableElement = document()->getElementById("ftpDirectoryTable");
if (!tableElement)
LOG_ERROR("Unable to find element by id \"ftpDirectoryTable\" in the template document.");
@@ -329,7 +329,7 @@ bool FTPDirectoryDocumentParser::loadDocumentTemplate()
body->appendChild(m_tableElement, ec);
else
document()->appendChild(m_tableElement, ec);
-
+
return true;
}
@@ -340,10 +340,10 @@ void FTPDirectoryDocumentParser::createBasicDocument()
// FIXME: Make this "basic document" more acceptable
RefPtr<Element> bodyElement = document()->createElement(bodyTag, false);
-
+
ExceptionCode ec;
document()->appendChild(bodyElement, ec);
-
+
RefPtr<Element> tableElement = document()->createElement(tableTag, false);
m_tableElement = static_cast<HTMLTableElement*>(tableElement.get());
m_tableElement->setAttribute("id", "ftpDirectoryTable", ec);
@@ -360,14 +360,14 @@ void FTPDirectoryDocumentParser::append(const SegmentedString& source)
createBasicDocument();
ASSERT(m_tableElement);
}
-
+
bool foundNewLine = false;
-
+
m_dest = m_buffer;
SegmentedString str = source;
while (!str.isEmpty()) {
UChar c = *str;
-
+
if (c == '\r') {
*m_dest++ = '\n';
foundNewLine = true;
@@ -382,13 +382,13 @@ void FTPDirectoryDocumentParser::append(const SegmentedString& source)
*m_dest++ = c;
m_skipLF = false;
}
-
+
str.advance();
-
+
// Maybe enlarge the buffer
checkBuffer();
}
-
+
if (!foundNewLine) {
m_dest = m_buffer;
return;
@@ -396,7 +396,7 @@ void FTPDirectoryDocumentParser::append(const SegmentedString& source)
UChar* start = m_buffer;
UChar* cursor = start;
-
+
while (cursor < m_dest) {
if (*cursor == '\n') {
m_carryOver.append(String(start, cursor - start));
@@ -408,7 +408,7 @@ void FTPDirectoryDocumentParser::append(const SegmentedString& source)
} else
cursor++;
}
-
+
// Copy the partial line we have left to the carryover buffer
if (cursor - start > 1)
m_carryOver.append(String(start, cursor - start - 1));
@@ -421,11 +421,11 @@ void FTPDirectoryDocumentParser::finish()
parseAndAppendOneLine(m_carryOver);
m_carryOver = String();
}
-
+
m_tableElement = 0;
fastFree(m_buffer);
-
- LegacyHTMLDocumentParser::finish();
+
+ HTMLDocumentParser::finish();
}
FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame, const KURL& url)
diff --git a/WebCore/loader/FTPDirectoryParser.cpp b/WebCore/loader/FTPDirectoryParser.cpp
index 142f2a3..f6a74de 100644
--- a/WebCore/loader/FTPDirectoryParser.cpp
+++ b/WebCore/loader/FTPDirectoryParser.cpp
@@ -188,9 +188,13 @@ FTPEntryType parseOneFTPLine(const char* line, ListState& state, ListResult& res
if (pos < linelen && line[pos] == ',')
{
unsigned long long seconds = 0;
+#if OS(WINDOWS)
+ sscanf(p + 1, "%I64u", &seconds);
+#else
sscanf(p + 1, "%llu", &seconds);
+#endif
time_t t = static_cast<time_t>(seconds);
-
+
// FIXME: This code has the year 2038 bug
gmtime_r(&t, &result.modifiedTime);
result.modifiedTime.tm_year += 1900;
diff --git a/WebCore/loader/FormSubmission.cpp b/WebCore/loader/FormSubmission.cpp
index f661273..22e89d7 100644
--- a/WebCore/loader/FormSubmission.cpp
+++ b/WebCore/loader/FormSubmission.cpp
@@ -179,6 +179,16 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A
return adoptRef(new FormSubmission(attributes.method(), actionURL, targetOrBaseTarget, encodingType, formState.release(), formData.release(), boundary, lockHistory, event));
}
+KURL FormSubmission::requestURL() const
+{
+ if (m_method == FormSubmission::PostMethod)
+ return m_action;
+
+ KURL requestURL(m_action);
+ requestURL.setQuery(m_formData->flattenToString());
+ return requestURL;
+}
+
void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
{
if (!m_target.isEmpty())
@@ -187,9 +197,7 @@ void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
if (!m_referrer.isEmpty())
frameRequest.resourceRequest().setHTTPReferrer(m_referrer);
- if (m_method == FormSubmission::GetMethod)
- m_action.setQuery(m_formData->flattenToString());
- else {
+ if (m_method == FormSubmission::PostMethod) {
frameRequest.resourceRequest().setHTTPMethod("POST");
frameRequest.resourceRequest().setHTTPBody(m_formData);
@@ -200,7 +208,7 @@ void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
}
- frameRequest.resourceRequest().setURL(m_action);
+ frameRequest.resourceRequest().setURL(requestURL());
FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin);
}
diff --git a/WebCore/loader/FormSubmission.h b/WebCore/loader/FormSubmission.h
index bee4e71..b935882 100644
--- a/WebCore/loader/FormSubmission.h
+++ b/WebCore/loader/FormSubmission.h
@@ -85,6 +85,8 @@ public:
static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&, PassRefPtr<Event> event, bool lockHistory, FormSubmissionTrigger);
void populateFrameLoadRequest(FrameLoadRequest&);
+
+ KURL requestURL() const;
Method method() const { return m_method; }
const KURL& action() const { return m_action; }
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 8307c15..a4bc865 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -271,71 +271,6 @@ void FrameLoader::setDefersLoading(bool defers)
}
}
-Frame* FrameLoader::createWindow(FrameLoader* frameLoaderForFrameLookup, const FrameLoadRequest& request, const WindowFeatures& features, bool& created)
-{
- ASSERT(!features.dialog || request.frameName().isEmpty());
-
- if (!request.frameName().isEmpty() && request.frameName() != "_blank") {
- Frame* frame = frameLoaderForFrameLookup->frame()->tree()->find(request.frameName());
- if (frame && shouldAllowNavigation(frame)) {
- if (!request.resourceRequest().url().isEmpty())
- frame->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer);
- if (Page* page = frame->page())
- page->chrome()->focus();
- created = false;
- return frame;
- }
- }
-
- // Sandboxed frames cannot open new auxiliary browsing contexts.
- if (isDocumentSandboxed(m_frame, SandboxNavigation))
- return 0;
-
- // FIXME: Setting the referrer should be the caller's responsibility.
- FrameLoadRequest requestWithReferrer = request;
- requestWithReferrer.resourceRequest().setHTTPReferrer(m_outgoingReferrer);
- addHTTPOriginIfNeeded(requestWithReferrer.resourceRequest(), outgoingOrigin());
-
- Page* oldPage = m_frame->page();
- if (!oldPage)
- return 0;
-
- Page* page = oldPage->chrome()->createWindow(m_frame, requestWithReferrer, features);
- if (!page)
- return 0;
-
- Frame* frame = page->mainFrame();
- if (request.frameName() != "_blank")
- frame->tree()->setName(request.frameName());
-
- page->chrome()->setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
- page->chrome()->setStatusbarVisible(features.statusBarVisible);
- page->chrome()->setScrollbarsVisible(features.scrollbarsVisible);
- page->chrome()->setMenubarVisible(features.menuBarVisible);
- page->chrome()->setResizable(features.resizable);
-
- // 'x' and 'y' specify the location of the window, while 'width' and 'height'
- // specify the size of the page. We can only resize the window, so
- // adjust for the difference between the window size and the page size.
-
- FloatRect windowRect = page->chrome()->windowRect();
- FloatSize pageSize = page->chrome()->pageRect().size();
- if (features.xSet)
- windowRect.setX(features.x);
- if (features.ySet)
- windowRect.setY(features.y);
- if (features.widthSet)
- windowRect.setWidth(features.width + (windowRect.width() - pageSize.width()));
- if (features.heightSet)
- windowRect.setHeight(features.height + (windowRect.height() - pageSize.height()));
- page->chrome()->setWindowRect(windowRect);
-
- page->chrome()->show();
-
- created = true;
- return frame;
-}
-
bool FrameLoader::canHandleRequest(const ResourceRequest& request)
{
return m_client->canHandleRequest(request);
@@ -1160,7 +1095,7 @@ bool FrameLoader::isProcessingUserGesture()
Frame* frame = m_frame->tree()->top();
if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
return true; // If JavaScript is disabled, a user gesture must have initiated the navigation.
- return frame->script()->processingUserGesture(mainThreadNormalWorld()); // FIXME: Use pageIsProcessingUserGesture.
+ return ScriptController::processingUserGesture(); // FIXME: Use pageIsProcessingUserGesture.
}
void FrameLoader::resetMultipleFormSubmissionProtection()
@@ -2660,10 +2595,12 @@ void FrameLoader::handledOnloadEvents()
{
m_client->dispatchDidHandleOnloadEvents();
+ if (documentLoader()) {
+ documentLoader()->handledOnloadEvents();
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
- if (documentLoader())
documentLoader()->applicationCacheHost()->stopDeferringEvents();
#endif
+ }
}
void FrameLoader::frameDetached()
@@ -3553,4 +3490,69 @@ bool FrameLoaderClient::hasHTMLView() const
return true;
}
+Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadRequest& request, const WindowFeatures& features, bool& created)
+{
+ ASSERT(!features.dialog || request.frameName().isEmpty());
+
+ if (!request.frameName().isEmpty() && request.frameName() != "_blank") {
+ Frame* frame = lookupFrame->tree()->find(request.frameName());
+ if (frame && openerFrame->loader()->shouldAllowNavigation(frame)) {
+ if (!request.resourceRequest().url().isEmpty())
+ frame->loader()->loadFrameRequest(request, false, false, 0, 0, SendReferrer);
+ if (Page* page = frame->page())
+ page->chrome()->focus();
+ created = false;
+ return frame;
+ }
+ }
+
+ // Sandboxed frames cannot open new auxiliary browsing contexts.
+ if (isDocumentSandboxed(openerFrame, SandboxNavigation))
+ return 0;
+
+ // FIXME: Setting the referrer should be the caller's responsibility.
+ FrameLoadRequest requestWithReferrer = request;
+ requestWithReferrer.resourceRequest().setHTTPReferrer(openerFrame->loader()->outgoingReferrer());
+ FrameLoader::addHTTPOriginIfNeeded(requestWithReferrer.resourceRequest(), openerFrame->loader()->outgoingOrigin());
+
+ Page* oldPage = openerFrame->page();
+ if (!oldPage)
+ return 0;
+
+ Page* page = oldPage->chrome()->createWindow(openerFrame, requestWithReferrer, features);
+ if (!page)
+ return 0;
+
+ Frame* frame = page->mainFrame();
+ if (request.frameName() != "_blank")
+ frame->tree()->setName(request.frameName());
+
+ page->chrome()->setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
+ page->chrome()->setStatusbarVisible(features.statusBarVisible);
+ page->chrome()->setScrollbarsVisible(features.scrollbarsVisible);
+ page->chrome()->setMenubarVisible(features.menuBarVisible);
+ page->chrome()->setResizable(features.resizable);
+
+ // 'x' and 'y' specify the location of the window, while 'width' and 'height'
+ // specify the size of the page. We can only resize the window, so
+ // adjust for the difference between the window size and the page size.
+
+ FloatRect windowRect = page->chrome()->windowRect();
+ FloatSize pageSize = page->chrome()->pageRect().size();
+ if (features.xSet)
+ windowRect.setX(features.x);
+ if (features.ySet)
+ windowRect.setY(features.y);
+ if (features.widthSet)
+ windowRect.setWidth(features.width + (windowRect.width() - pageSize.width()));
+ if (features.heightSet)
+ windowRect.setHeight(features.height + (windowRect.height() - pageSize.height()));
+ page->chrome()->setWindowRect(windowRect);
+
+ page->chrome()->show();
+
+ created = true;
+ return frame;
+}
+
} // namespace WebCore
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index de043d2..639b6cc 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -124,10 +124,6 @@ public:
static void reportLocalLoadFailed(Frame*, const String& url);
- // Called by createWindow in JSDOMWindowBase.cpp, e.g. to fulfill a modal dialog creation
- // FIXME: Move this method outside of the FrameLoader class.
- Frame* createWindow(FrameLoader* frameLoaderForFrameLookup, const FrameLoadRequest&, const WindowFeatures&, bool& created);
-
unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data);
bool canHandleRequest(const ResourceRequest&);
@@ -505,6 +501,15 @@ private:
#endif
};
+// This function is called by createWindow() in JSDOMWindowBase.cpp, for example, for
+// modal dialog creation. The lookupFrame is for looking up the frame name in case
+// the frame name references a frame different from the openerFrame, e.g. when it is
+// "_self" or "_parent".
+//
+// FIXME: Consider making this function part of an appropriate class (not FrameLoader)
+// and moving it to a more appropriate location.
+Frame* createWindow(Frame* openerFrame, Frame* lookupFrame, const FrameLoadRequest&, const WindowFeatures&, bool& created);
+
} // namespace WebCore
#endif // FrameLoader_h
diff --git a/WebCore/loader/FrameNetworkingContext.h b/WebCore/loader/FrameNetworkingContext.h
new file mode 100644
index 0000000..dff1144
--- /dev/null
+++ b/WebCore/loader/FrameNetworkingContext.h
@@ -0,0 +1,51 @@
+/*
+ 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 FrameNetworkingContext_h
+#define FrameNetworkingContext_h
+
+#include "Frame.h"
+#include "NetworkingContext.h"
+
+namespace WebCore {
+
+class FrameNetworkingContext : public NetworkingContext {
+public:
+ void invalidate()
+ {
+ m_frame = 0;
+ }
+
+protected:
+ FrameNetworkingContext(Frame* frame)
+ : m_frame(frame)
+ {
+ }
+
+ Frame* frame() const { return m_frame; }
+
+private:
+ virtual bool isValid() const { return m_frame; }
+
+ Frame* m_frame;
+};
+
+}
+
+#endif // FrameNetworkingContext_h
diff --git a/WebCore/loader/ImageLoader.h b/WebCore/loader/ImageLoader.h
index a585354..02ddce8 100644
--- a/WebCore/loader/ImageLoader.h
+++ b/WebCore/loader/ImageLoader.h
@@ -23,9 +23,9 @@
#ifndef ImageLoader_h
#define ImageLoader_h
-#include "AtomicString.h"
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index c03f9ca..a7a5968 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -305,8 +305,8 @@ void MainResourceLoader::substituteMIMETypeFromPluginDatabase(const ResourceResp
if (filename.endsWith("/"))
return;
- int extensionPos = filename.reverseFind('.');
- if (extensionPos == -1)
+ size_t extensionPos = filename.reverseFind('.');
+ if (extensionPos == notFound)
return;
String extension = filename.substring(extensionPos + 1);
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index 3cfe61a..d969f30 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -175,15 +175,13 @@ public:
ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad)
: ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true)
, m_submission(submission)
- , m_wasProcessingUserGesture(UserGestureIndicator::processingUserGesture())
+ , m_haveToldClient(false)
{
ASSERT(m_submission->state());
}
virtual void fire(Frame* frame)
{
- UserGestureIndicator gestureIndicator(m_wasProcessingUserGesture ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
-
// The submitForm function will find a target frame before using the redirection timer.
// Now that the timer has fired, we need to repeat the security check which normally is done when
// selecting a target, in case conditions have changed. Other code paths avoid this by targeting
@@ -194,15 +192,25 @@ public:
m_submission->populateFrameLoadRequest(frameRequest);
frame->loader()->loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), SendReferrer);
}
+
+ virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
+ {
+ if (m_haveToldClient)
+ return;
+ m_haveToldClient = true;
+ frame->loader()->clientRedirected(m_submission->requestURL(), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
+ }
- // FIXME: Implement didStartTimer? It would make sense to report form
- // submissions as client redirects too. But we didn't do that in the past
- // when form submission used a separate delay mechanism, so doing it will
- // be a behavior change.
+ virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
+ {
+ if (!m_haveToldClient)
+ return;
+ frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
+ }
private:
RefPtr<FormSubmission> m_submission;
- bool m_wasProcessingUserGesture;
+ bool m_haveToldClient;
};
RedirectScheduler::RedirectScheduler(Frame* frame)
@@ -240,17 +248,21 @@ void RedirectScheduler::scheduleRedirect(double delay, const String& url)
if (url.isEmpty())
return;
- // We want a new history item if the refresh timeout is > 1 second.
+ // We want a new back/forward list item if the refresh timeout is > 1 second.
if (!m_redirect || delay <= m_redirect->delay())
schedule(new ScheduledRedirect(delay, url, true, delay <= 1, false));
}
-bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame)
+bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame, bool wasUserGesture)
{
+ // Non-user navigation before the page has finished firing onload should not create a new back/forward item.
+ // See https://webkit.org/b/42861 for the original motivation for this.
+ if (!wasUserGesture && targetFrame->loader()->documentLoader() && !targetFrame->loader()->documentLoader()->wasOnloadHandled())
+ return true;
+
// Navigation of a subframe during loading of an ancestor frame does not create a new back/forward item.
// The definition of "during load" is any time before all handlers for the load event have been run.
// See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motivation for this.
-
for (Frame* ancestor = targetFrame->tree()->parent(); ancestor; ancestor = ancestor->tree()->parent()) {
Document* document = ancestor->document();
if (!ancestor->loader()->isComplete() || (document && document->processingLoadEvent()))
@@ -266,7 +278,7 @@ void RedirectScheduler::scheduleLocationChange(const String& url, const String&
if (url.isEmpty())
return;
- lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame);
+ lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame, wasUserGesture);
FrameLoader* loader = m_frame->loader();
@@ -300,7 +312,7 @@ void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submis
// to match IE and Opera.
// See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
- bool lockBackForwardList = mustLockBackForwardList(m_frame) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
+ bool lockBackForwardList = mustLockBackForwardList(m_frame, UserGestureIndicator::processingUserGesture()) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
schedule(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad));
}
diff --git a/WebCore/loader/RedirectScheduler.h b/WebCore/loader/RedirectScheduler.h
index 0203e08..70b0202 100644
--- a/WebCore/loader/RedirectScheduler.h
+++ b/WebCore/loader/RedirectScheduler.h
@@ -70,7 +70,7 @@ private:
void timerFired(Timer<RedirectScheduler>*);
void schedule(PassOwnPtr<ScheduledNavigation>);
- static bool mustLockBackForwardList(Frame* targetFrame);
+ static bool mustLockBackForwardList(Frame* targetFrame, bool mustLockIfDuringLoad);
Frame* m_frame;
Timer<RedirectScheduler> m_timer;
@@ -79,4 +79,4 @@ private:
} // namespace WebCore
-#endif // FrameLoader_h
+#endif // RedirectScheduler_h
diff --git a/WebCore/loader/appcache/ApplicationCache.cpp b/WebCore/loader/appcache/ApplicationCache.cpp
index 2ad4a4b..2a93765 100644
--- a/WebCore/loader/appcache/ApplicationCache.cpp
+++ b/WebCore/loader/appcache/ApplicationCache.cpp
@@ -32,6 +32,7 @@
#include "ApplicationCacheResource.h"
#include "ApplicationCacheStorage.h"
#include "ResourceRequest.h"
+#include <wtf/text/CString.h>
#include <stdio.h>
namespace WebCore {
diff --git a/WebCore/loader/appcache/ApplicationCache.h b/WebCore/loader/appcache/ApplicationCache.h
index d6e15ed..f073499 100644
--- a/WebCore/loader/appcache/ApplicationCache.h
+++ b/WebCore/loader/appcache/ApplicationCache.h
@@ -29,11 +29,11 @@
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/appcache/ApplicationCacheStorage.cpp b/WebCore/loader/appcache/ApplicationCacheStorage.cpp
index 5624809..5a82d6e 100644
--- a/WebCore/loader/appcache/ApplicationCacheStorage.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheStorage.cpp
@@ -968,8 +968,8 @@ bool ApplicationCacheStorage::storeNewestCache(ApplicationCacheGroup* group)
static inline void parseHeader(const UChar* header, size_t headerLength, ResourceResponse& response)
{
- int pos = find(header, headerLength, ':');
- ASSERT(pos != -1);
+ size_t pos = find(header, headerLength, ':');
+ ASSERT(pos != notFound);
AtomicString headerName = AtomicString(header, pos);
String headerValue = String(header + pos + 1, headerLength - pos - 1);
@@ -979,9 +979,9 @@ static inline void parseHeader(const UChar* header, size_t headerLength, Resourc
static inline void parseHeaders(const String& headers, ResourceResponse& response)
{
- int startPos = 0;
- int endPos;
- while ((endPos = headers.find('\n', startPos)) != -1) {
+ unsigned startPos = 0;
+ size_t endPos;
+ while ((endPos = headers.find('\n', startPos)) != notFound) {
ASSERT(startPos != endPos);
parseHeader(headers.characters() + startPos, endPos - startPos, response);
@@ -989,7 +989,7 @@ static inline void parseHeaders(const String& headers, ResourceResponse& respons
startPos = endPos + 1;
}
- if (startPos != static_cast<int>(headers.length()))
+ if (startPos != headers.length())
parseHeader(headers.characters(), headers.length(), response);
}
diff --git a/WebCore/loader/appcache/ApplicationCacheStorage.h b/WebCore/loader/appcache/ApplicationCacheStorage.h
index c990fa7..7db34e6 100644
--- a/WebCore/loader/appcache/ApplicationCacheStorage.h
+++ b/WebCore/loader/appcache/ApplicationCacheStorage.h
@@ -30,9 +30,8 @@
#include "PlatformString.h"
#include "SQLiteDatabase.h"
-#include "StringHash.h"
-
#include <wtf/HashCountedSet.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/appcache/DOMApplicationCache.h b/WebCore/loader/appcache/DOMApplicationCache.h
index de0614a..2a806fa 100644
--- a/WebCore/loader/appcache/DOMApplicationCache.h
+++ b/WebCore/loader/appcache/DOMApplicationCache.h
@@ -29,7 +29,6 @@
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "ApplicationCacheHost.h"
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -38,6 +37,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/icon/IconDatabase.cpp b/WebCore/loader/icon/IconDatabase.cpp
index b8149d2..63b9c64 100644
--- a/WebCore/loader/icon/IconDatabase.cpp
+++ b/WebCore/loader/icon/IconDatabase.cpp
@@ -1315,7 +1315,7 @@ void IconDatabase::performURLImport()
}
}
- LOG(IconDatabase, "Notifying %zu interested page URLs that their icon URL is known due to the import", urlsToNotify.size());
+ LOG(IconDatabase, "Notifying %lu interested page URLs that their icon URL is known due to the import", static_cast<unsigned long>(urlsToNotify.size()));
// Now that we don't hold any locks, perform the actual notifications
for (unsigned i = 0; i < urlsToNotify.size(); ++i) {
LOG(IconDatabase, "Notifying icon info known for pageURL %s", urlsToNotify[i].ascii().data());
@@ -1639,11 +1639,19 @@ void IconDatabase::pruneUnretainedIcons()
SQLiteStatement pageDeleteSQL(m_syncDB, "DELETE FROM PageURL WHERE rowid = (?);");
pageDeleteSQL.prepare();
for (size_t i = 0; i < numToDelete; ++i) {
+#if OS(WINDOWS)
+ LOG(IconDatabase, "Pruning page with rowid %I64i from disk", static_cast<long long>(pageIDsToDelete[i]));
+#else
LOG(IconDatabase, "Pruning page with rowid %lli from disk", static_cast<long long>(pageIDsToDelete[i]));
+#endif
pageDeleteSQL.bindInt64(1, pageIDsToDelete[i]);
int result = pageDeleteSQL.step();
if (result != SQLResultDone)
+#if OS(WINDOWS)
+ LOG_ERROR("Unabled to delete page with id %I64i from disk", static_cast<long long>(pageIDsToDelete[i]));
+#else
LOG_ERROR("Unabled to delete page with id %lli from disk", static_cast<long long>(pageIDsToDelete[i]));
+#endif
pageDeleteSQL.reset();
// If the thread was asked to terminate, we should commit what pruning we've done so far, figuring we can
diff --git a/WebCore/loader/icon/IconDatabase.h b/WebCore/loader/icon/IconDatabase.h
index 44ef22a..9793d21 100644
--- a/WebCore/loader/icon/IconDatabase.h
+++ b/WebCore/loader/icon/IconDatabase.h
@@ -27,12 +27,12 @@
#ifndef IconDatabase_h
#define IconDatabase_h
-#include "StringHash.h"
#include "Timer.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(ICONDATABASE)
#include "SQLiteDatabase.h"
diff --git a/WebCore/loader/icon/IconFetcher.cpp b/WebCore/loader/icon/IconFetcher.cpp
index 3d3df39..1107d7b 100644
--- a/WebCore/loader/icon/IconFetcher.cpp
+++ b/WebCore/loader/icon/IconFetcher.cpp
@@ -87,8 +87,8 @@ static void parseIconLink(HTMLLinkElement* link, Vector<IconLinkEntry>& entries)
// Try to determine the file type.
String path = url.path();
- int pos = path.reverseFind('.');
- if (pos >= 0) {
+ size_t pos = path.reverseFind('.');
+ if (pos != notFound) {
String extension = path.substring(pos + 1);
if (equalIgnoringCase(extension, "icns"))
type = IconLinkEntry::ICNS;
diff --git a/WebCore/loader/icon/IconRecord.cpp b/WebCore/loader/icon/IconRecord.cpp
index ffea318..7e90d8e 100644
--- a/WebCore/loader/icon/IconRecord.cpp
+++ b/WebCore/loader/icon/IconRecord.cpp
@@ -34,6 +34,7 @@
#include "Logging.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
+#include <wtf/text/CString.h>
#include <limits.h>
diff --git a/WebCore/loader/icon/IconRecord.h b/WebCore/loader/icon/IconRecord.h
index aaea787..f1fe12f 100644
--- a/WebCore/loader/icon/IconRecord.h
+++ b/WebCore/loader/icon/IconRecord.h
@@ -33,10 +33,10 @@
#include <wtf/RefCounted.h>
#include "SharedBuffer.h"
+#include "PlatformString.h"
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
-#include "PlatformString.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/loader/loader.h b/WebCore/loader/loader.h
index 1fdb9cf..52c61aa 100644
--- a/WebCore/loader/loader.h
+++ b/WebCore/loader/loader.h
@@ -22,8 +22,6 @@
#ifndef loader_h
#define loader_h
-#include "AtomicString.h"
-#include "AtomicStringImpl.h"
#include "FrameLoaderTypes.h"
#include "PlatformString.h"
#include "SubresourceLoaderClient.h"
@@ -31,6 +29,8 @@
#include <wtf/Deque.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/AtomicStringImpl.h>
namespace WebCore {
diff --git a/WebCore/make-hash-tools.pl b/WebCore/make-hash-tools.pl
index 42cb6fd..8cc9952 100644
--- a/WebCore/make-hash-tools.pl
+++ b/WebCore/make-hash-tools.pl
@@ -29,16 +29,6 @@ my $option = basename($ARGV[0],".gperf");
switch ($option) {
-case "HTMLEntityNames" {
-
- my $htmlEntityNamesGenerated = "$outdir/HTMLEntityNames.cpp";
- my $htmlEntityNamesGperf = $ARGV[0];
- shift;
-
- system("gperf --key-positions=\"*\" -D -s 2 $htmlEntityNamesGperf > $htmlEntityNamesGenerated") == 0 || die "calling gperf failed: $?";
-
-} # case "HTMLEntityNames"
-
case "DocTypeStrings" {
my $docTypeStringsGenerated = "$outdir/DocTypeStrings.cpp";
diff --git a/WebCore/manual-tests/back-forward-during-alert-1.html b/WebCore/manual-tests/back-forward-during-alert-1.html
new file mode 100644
index 0000000..41a6e6a
--- /dev/null
+++ b/WebCore/manual-tests/back-forward-during-alert-1.html
@@ -0,0 +1,3 @@
+<body>
+View this page, then click <a href="back-forward-during-alert-2.html">here.</a>
+</body>
diff --git a/WebCore/manual-tests/back-forward-during-alert-2.html b/WebCore/manual-tests/back-forward-during-alert-2.html
new file mode 100644
index 0000000..931af01
--- /dev/null
+++ b/WebCore/manual-tests/back-forward-during-alert-2.html
@@ -0,0 +1,10 @@
+<script>
+function loaded()
+{
+ alert("While this alert is showing, two-fingered swipe back using a MacBook trackpad, Magic Trackpad, or Magic Mouse. You should not be able to navigate back. If you can, dismissing this dialog will likely result in a crash.");
+}
+</script>
+
+<body onload="loaded();">
+Follow the instructions in the alert that shows up on page load.
+</body>
diff --git a/WebCore/manual-tests/indexed-database.html b/WebCore/manual-tests/indexed-database.html
new file mode 100644
index 0000000..d0fb381
--- /dev/null
+++ b/WebCore/manual-tests/indexed-database.html
@@ -0,0 +1,67 @@
+<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>This page opens up a database with the name "name" and a description of "description". Result of open: <span id=result>Pending...</span></p>
+
+<p>The first time you open this page up, the message should be a success. Now, lets make it fail. Find where the associated .indexeddb file is
+ for this page, replace it with something that's not a sqlite database, and make it read only to your user. Now close and re-open the browser.
+ When you re-open it, you should get an internal error from the page.</p>
+
+<p>Now delete all IndexedDB files (including the one you just made), restart the browser, and come back to this page. It should start up fine again.</p>
+
+<p>Now click <a href="javascript:updateDescription()">here</a>, close the browser, come back, and click <a href="javascript:readDescription()">here</a>. If everything worked well, this should be a success here: <span id=description>...</span></p>
+
+<p>That's it!</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>";
+
+ request = indexedDB.open("name");
+ request.onsuccess = function() {
+ document.getElementById("result").innerHTML = "<font color=green>Success!</font>";
+ window.nameDB = event.result;
+ };
+ request.onerror = function() {
+ document.getElementById("result").innerHTML = "<font color=red>Error: " + event.message + ".</font>";
+ };
+
+ request = indexedDB.open("another", "test of the description attribute");
+ request.onsuccess = function() {
+ window.anotherDB = event.result;
+ };
+ }
+
+ function updateDescription()
+ {
+ indexedDB.open("name", "test of the description attribute");
+ indexedDB.open("another", "xyz");
+ }
+
+ function readDescription()
+ {
+ if (window.nameDB.description != "test of the description attribute") {
+ // Since we passed in nothing, the description should not be reset.
+ document.getElementById("description").innerHTML = "<font color=red>Failure: (Database 'name' was this: " + window.nameDB.description + ").</font>";
+ } else if (window.anotherDB.description != "test of the description attribute") {
+ // But in this case we did pass something in, so it should have been reset.
+ document.getElementById("description").innerHTML = "<font color=red>Failure: (Database 'another' was this: " + window.anotherDB.description + ").</font>";
+ } else {
+ request = indexedDB.open("another", "123");
+ request.onsuccess = function() {
+ // And here it should have been reset again.
+ if (event.result.description != "123")
+ document.getElementById("description").innerHTML = "<font color=red>Failure: (Database 'another' was this: " + event.result.description + ").</font>";
+ else
+ document.getElementById("description").innerHTML = "<font color=green>Success!</font>";
+ };
+ }
+ }
+
+</script>
+</body>
+</html>
diff --git a/WebCore/notifications/Notification.h b/WebCore/notifications/Notification.h
index 20a319b..e8e29f4 100644
--- a/WebCore/notifications/Notification.h
+++ b/WebCore/notifications/Notification.h
@@ -33,7 +33,6 @@
#define Notification_h
#include "ActiveDOMObject.h"
-#include "AtomicStringHash.h"
#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
@@ -51,6 +50,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicStringHash.h>
#if ENABLE(NOTIFICATIONS)
namespace WebCore {
diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
index 3d8a7de..9cc8d5d 100644
--- a/WebCore/page/Console.cpp
+++ b/WebCore/page/Console.cpp
@@ -185,7 +185,7 @@ void Console::addMessage(MessageType type, MessageLevel level, ScriptCallStack*
page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL().prettyURL());
#if ENABLE(INSPECTOR)
- page->inspectorController()->addMessageToConsole(JSMessageSource, type, level, callStack);
+ page->inspectorController()->addMessageToConsole(JSMessageSource, type, level, callStack, message);
#endif
if (!Console::shouldPrintExceptions())
diff --git a/WebCore/page/DOMSelection.cpp b/WebCore/page/DOMSelection.cpp
index d62051e..106dd13 100644
--- a/WebCore/page/DOMSelection.cpp
+++ b/WebCore/page/DOMSelection.cpp
@@ -427,6 +427,8 @@ void DOMSelection::deleteFromDocument()
selection->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, CharacterGranularity);
RefPtr<Range> selectedRange = selection->selection().toNormalizedRange();
+ if (!selectedRange)
+ return;
ExceptionCode ec = 0;
selectedRange->deleteContents(ec);
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 71ad7cb..86708de 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -331,20 +331,20 @@ void DOMWindow::parseModalDialogFeatures(const String& featuresArg, HashMap<Stri
Vector<String>::const_iterator end = features.end();
for (Vector<String>::const_iterator it = features.begin(); it != end; ++it) {
String s = *it;
- int pos = s.find('=');
- int colonPos = s.find(':');
- if (pos >= 0 && colonPos >= 0)
+ size_t pos = s.find('=');
+ size_t colonPos = s.find(':');
+ if (pos != notFound && colonPos != notFound)
continue; // ignore any strings that have both = and :
- if (pos < 0)
+ if (pos == notFound)
pos = colonPos;
- if (pos < 0) {
+ if (pos == notFound) {
// null string for value means key without value
map.set(s.stripWhiteSpace().lower(), String());
} else {
String key = s.left(pos).stripWhiteSpace().lower();
String val = s.substring(pos + 1).stripWhiteSpace().lower();
- int spacePos = val.find(' ');
- if (spacePos != -1)
+ size_t spacePos = val.find(' ');
+ if (spacePos != notFound)
val = val.left(spacePos);
map.set(key, val);
}
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index a65739b..cabe68a 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -478,17 +478,6 @@ module window {
attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint32ArrayConstructor Uint32Array; // Usable with new operator
attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Float32ArrayConstructor Float32Array; // Usable with new operator
- // Temporary aliases to keep current WebGL content working during transition period to TypedArray spec.
- // To be removed before WebGL spec is finalized. (FIXME)
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] ArrayBufferConstructor WebGLArrayBuffer; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int8ArrayConstructor WebGLByteArray; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint8ArrayConstructor WebGLUnsignedByteArray; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int16ArrayConstructor WebGLShortArray; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint16ArrayConstructor WebGLUnsignedShortArray; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int32ArrayConstructor WebGLIntArray; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Uint32ArrayConstructor WebGLUnsignedIntArray; // Usable with new operator
- attribute [CustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Float32ArrayConstructor WebGLFloatArray; // Usable with new operator
-
attribute EventConstructor Event;
attribute BeforeLoadEventConstructor BeforeLoadEvent;
attribute KeyboardEventConstructor KeyboardEvent;
diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp
index d93a256..bbf4fed 100644
--- a/WebCore/page/DragController.cpp
+++ b/WebCore/page/DragController.cpp
@@ -63,6 +63,7 @@
#include "SelectionController.h"
#include "Settings.h"
#include "Text.h"
+#include "TextEvent.h"
#include "htmlediting.h"
#include "markup.h"
#include <wtf/CurrentTime.h>
@@ -363,6 +364,15 @@ static bool setSelectionToDragCaret(Frame* frame, VisibleSelection& dragCaret, R
return !frame->selection()->isNone() && frame->selection()->isContentEditable();
}
+bool DragController::dispatchTextInputEventFor(Frame* innerFrame, DragData* dragData)
+{
+ VisibleSelection dragCaret(m_page->dragCaretController()->selection());
+ String text = dragCaret.isContentRichlyEditable() ? "" : dragData->asPlainText();
+ Node* target = innerFrame->editor()->findEventTargetFrom(dragCaret);
+ ExceptionCode ec = 0;
+ return target->dispatchEvent(TextEvent::createForDrop(innerFrame->domWindow(), text), ec);
+}
+
bool DragController::concludeEditDrag(DragData* dragData)
{
ASSERT(dragData);
@@ -376,12 +386,13 @@ bool DragController::concludeEditDrag(DragData* dragData)
Frame* innerFrame = element->ownerDocument()->frame();
ASSERT(innerFrame);
+ if (!dispatchTextInputEventFor(innerFrame, dragData))
+ return true;
+
if (dragData->containsColor()) {
Color color = dragData->asColor();
if (!color.isValid())
return false;
- if (!innerFrame)
- return false;
RefPtr<Range> innerRange = innerFrame->selection()->toNormalizedRange();
RefPtr<CSSStyleDeclaration> style = m_documentUnderMouse->createCSSStyleDeclaration();
ExceptionCode ec;
diff --git a/WebCore/page/DragController.h b/WebCore/page/DragController.h
index 712f9ab..0e90a52 100644
--- a/WebCore/page/DragController.h
+++ b/WebCore/page/DragController.h
@@ -90,6 +90,7 @@ namespace WebCore {
static const float DragImageAlpha;
private:
+ bool dispatchTextInputEventFor(Frame*, DragData*);
bool canProcessDrag(DragData*);
bool concludeEditDrag(DragData*);
DragOperation dragEnteredOrUpdated(DragData*);
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index adcaadc..6263a4b 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -2656,6 +2656,7 @@ bool EventHandler::handleTextInputEvent(const String& text, Event* underlyingEve
// Platforms should differentiate real commands like selectAll from text input in disguise (like insertNewline),
// and avoid dispatching text input events from keydown default handlers.
ASSERT(!underlyingEvent || !underlyingEvent->isKeyboardEvent() || static_cast<KeyboardEvent*>(underlyingEvent)->type() == eventNames().keypressEvent);
+ ASSERT(!(isLineBreak && isBackTab));
if (!m_frame)
return false;
@@ -2671,10 +2672,9 @@ bool EventHandler::handleTextInputEvent(const String& text, Event* underlyingEve
if (FrameView* view = m_frame->view())
view->resetDeferredRepaintDelay();
- RefPtr<TextEvent> event = TextEvent::create(m_frame->domWindow(), text);
+ RefPtr<TextEvent> event = TextEvent::create(m_frame->domWindow(), text, TextEvent::selectInputType(isLineBreak, isBackTab));
event->setUnderlyingEvent(underlyingEvent);
- event->setIsLineBreak(isLineBreak);
- event->setIsBackTab(isBackTab);
+
ExceptionCode ec;
target->dispatchEvent(event, ec);
return event->defaultHandled();
diff --git a/WebCore/page/FrameTree.h b/WebCore/page/FrameTree.h
index 9ab999f..b97aab6 100644
--- a/WebCore/page/FrameTree.h
+++ b/WebCore/page/FrameTree.h
@@ -20,7 +20,7 @@
#ifndef FrameTree_h
#define FrameTree_h
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 04fef3b..441e543 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -1148,13 +1148,13 @@ void FrameView::setScrollPosition(const IntPoint& scrollPoint)
void FrameView::scrollPositionChangedViaPlatformWidget()
{
+ repaintFixedElementsAfterScrolling();
scrollPositionChanged();
}
void FrameView::scrollPositionChanged()
{
frame()->eventHandler()->sendScrollEvent();
- repaintFixedElementsAfterScrolling();
#if USE(ACCELERATED_COMPOSITING)
if (RenderView* root = m_frame->contentRenderer()) {
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 523c21d..0847769 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -50,6 +50,9 @@ namespace WebCore {
static const char permissionDeniedErrorMessage[] = "User denied Geolocation";
static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocation service";
+static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents";
+
+static const int firstAvailableWatchId = 1;
#if ENABLE(CLIENT_BASED_GEOLOCATION)
@@ -97,9 +100,15 @@ Geolocation::GeoNotifier::GeoNotifier(Geolocation* geolocation, PassRefPtr<Posit
void Geolocation::GeoNotifier::setFatalError(PassRefPtr<PositionError> error)
{
- // This method is called at most once on a given GeoNotifier object.
- ASSERT(!m_fatalError);
+ // If a fatal error has already been set, stick with it. This makes sure that
+ // when permission is denied, this is the error reported, as required by the
+ // spec.
+ if (m_fatalError)
+ return;
+
m_fatalError = error;
+ // An existing timer may not have a zero timeout.
+ m_timer.stop();
m_timer.startOneShot(0);
}
@@ -133,6 +142,8 @@ void Geolocation::GeoNotifier::timerFired(Timer<GeoNotifier>*)
// could be deleted by a call to clearWatch in a callback.
RefPtr<GeoNotifier> protect(this);
+ // Test for fatal error first. This is required for the case where the Frame is
+ // disconnected and requests are cancelled.
if (m_fatalError) {
if (m_errorCallback)
m_errorCallback->handleEvent(m_fatalError.get());
@@ -158,6 +169,7 @@ void Geolocation::GeoNotifier::timerFired(Timer<GeoNotifier>*)
void Geolocation::Watchers::set(int id, PassRefPtr<GeoNotifier> prpNotifier)
{
+ ASSERT(id > 0);
RefPtr<GeoNotifier> notifier = prpNotifier;
m_idToNotifierMap.set(id, notifier.get());
@@ -166,6 +178,7 @@ void Geolocation::Watchers::set(int id, PassRefPtr<GeoNotifier> prpNotifier)
void Geolocation::Watchers::remove(int id)
{
+ ASSERT(id > 0);
IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id);
if (iter == m_idToNotifierMap.end())
return;
@@ -234,10 +247,14 @@ void Geolocation::disconnectFrame()
{
if (m_frame && m_frame->page() && m_allowGeolocation == InProgress)
m_frame->page()->chrome()->cancelGeolocationPermissionRequestForFrame(m_frame, this);
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
// See Geolocation::stop()
#else
stopTimers();
+=======
+ cancelAllRequests();
+>>>>>>> WebKit at r65615
stopUpdating();
#endif // PLATFORM(ANDROID)
if (m_frame && m_frame->document())
@@ -265,6 +282,9 @@ Geoposition* Geolocation::lastPosition()
void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
{
+ if (!m_frame)
+ return;
+
RefPtr<GeoNotifier> notifier = startRequest(successCallback, errorCallback, options);
ASSERT(notifier);
@@ -273,10 +293,13 @@ void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallbac
int Geolocation::watchPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
{
+ if (!m_frame)
+ return 0;
+
RefPtr<GeoNotifier> notifier = startRequest(successCallback, errorCallback, options);
ASSERT(notifier);
- static int nextAvailableWatchId = 1;
+ static int nextAvailableWatchId = firstAvailableWatchId;
// In case of overflow, make sure the ID remains positive, but reuse the ID values.
if (nextAvailableWatchId < 1)
nextAvailableWatchId = 1;
@@ -294,13 +317,18 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi
notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
else if (haveSuitableCachedPosition(notifier->m_options.get()))
notifier->setUseCachedPosition();
- else if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) {
+ else if (notifier->hasZeroTimeout())
+ notifier->startTimerIfNeeded();
#if USE(PREEMPT_GEOLOCATION_PERMISSION)
- // Only start timer if we're not waiting for user permission.
- if (!m_startRequestPermissionNotifier)
-#endif
- notifier->startTimerIfNeeded();
- } else
+ else if (!isAllowed()) {
+ // if we don't yet have permission, request for permission before calling startUpdating()
+ m_pendingForPermissionNotifiers.add(notifier);
+ requestPermission();
+ }
+#endif
+ else if (startUpdating(notifier.get()))
+ notifier->startTimerIfNeeded();
+ else
notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
return notifier.release();
@@ -388,6 +416,9 @@ bool Geolocation::haveSuitableCachedPosition(PositionOptions* options)
void Geolocation::clearWatch(int watchId)
{
+ if (watchId < firstAvailableWatchId)
+ return;
+
m_watchers.remove(watchId);
if (!hasListeners())
@@ -417,28 +448,10 @@ void Geolocation::setIsAllowed(bool allowed)
m_allowGeolocation = allowed ? Yes : No;
#if USE(PREEMPT_GEOLOCATION_PERMISSION)
- if (m_startRequestPermissionNotifier) {
- if (isAllowed()) {
- // Permission request was made during the startUpdating process
- m_startRequestPermissionNotifier->startTimerIfNeeded();
- // The notifier is always ref'ed by m_oneShots or m_watchers.
- GeoNotifier* notifier = m_startRequestPermissionNotifier.get();
- m_startRequestPermissionNotifier = 0;
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
- if (!m_frame)
- return;
- Page* page = m_frame->page();
- if (!page)
- return;
- page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
-#else
- // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
-#endif
- } else {
- m_startRequestPermissionNotifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
- m_oneShots.add(m_startRequestPermissionNotifier);
- m_startRequestPermissionNotifier = 0;
- }
+ // Permission request was made during the startRequest process
+ if (!m_pendingForPermissionNotifiers.isEmpty()) {
+ handlePendingPermissionNotifiers();
+ m_pendingForPermissionNotifiers.clear();
return;
}
#endif
@@ -513,6 +526,22 @@ void Geolocation::stopTimers()
stopTimersForWatchers();
}
+void Geolocation::cancelRequests(Vector<RefPtr<GeoNotifier> >& notifiers)
+{
+ Vector<RefPtr<GeoNotifier> >::const_iterator end = notifiers.end();
+ for (Vector<RefPtr<GeoNotifier> >::const_iterator it = notifiers.begin(); it != end; ++it)
+ (*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, framelessDocumentErrorMessage));
+}
+
+void Geolocation::cancelAllRequests()
+{
+ Vector<RefPtr<GeoNotifier> > copy;
+ copyToVector(m_oneShots, copy);
+ cancelRequests(copy);
+ m_watchers.getNotifiersVector(copy);
+ cancelRequests(copy);
+}
+
void Geolocation::handleError(PositionError* error)
{
ASSERT(error);
@@ -634,14 +663,6 @@ void Geolocation::geolocationServiceErrorOccurred(GeolocationService* service)
bool Geolocation::startUpdating(GeoNotifier* notifier)
{
-#if USE(PREEMPT_GEOLOCATION_PERMISSION)
- if (!isAllowed()) {
- m_startRequestPermissionNotifier = notifier;
- requestPermission();
- return true;
- }
-#endif
-
#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (!m_frame)
return false;
@@ -686,6 +707,38 @@ void Geolocation::stopUpdating()
}
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
+void Geolocation::handlePendingPermissionNotifiers()
+{
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+ if (!m_frame)
+ return;
+ Page* page = m_frame->page();
+ if (!page)
+ return;
+#endif
+
+ // While we iterate through the list, we need not worry about list being modified as the permission
+ // is already set to Yes/No and no new listeners will be added to the pending list
+ GeoNotifierSet::const_iterator end = m_pendingForPermissionNotifiers.end();
+ for (GeoNotifierSet::const_iterator iter = m_pendingForPermissionNotifiers.begin(); iter != end; ++iter) {
+ GeoNotifier* notifier = iter->get();
+
+ if (isAllowed()) {
+ // start all pending notification requests as permission granted.
+ // The notifier is always ref'ed by m_oneShots or m_watchers.
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+ notifier->startTimerIfNeeded();
+ page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
+#else
+ // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
+#endif
+ } else
+ notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
+ }
+}
+#endif
+
} // namespace WebCore
#else
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index af10632..a4a0c5a 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -139,6 +139,9 @@ private:
void stopTimersForWatchers();
void stopTimers();
+ void cancelRequests(Vector<RefPtr<GeoNotifier> >&);
+ void cancelAllRequests();
+
void positionChangedInternal();
void makeSuccessCallbacks();
void handleError(PositionError*);
@@ -148,6 +151,10 @@ private:
bool startUpdating(GeoNotifier*);
void stopUpdating();
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
+ void handlePendingPermissionNotifiers();
+#endif
+
#if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION)
// GeolocationServiceClient
virtual void geolocationServicePositionChanged(GeolocationService*);
@@ -171,7 +178,7 @@ private:
OwnPtr<GeolocationService> m_service;
#endif
#if USE(PREEMPT_GEOLOCATION_PERMISSION)
- RefPtr<GeoNotifier> m_startRequestPermissionNotifier;
+ GeoNotifierSet m_pendingForPermissionNotifiers;
#endif
RefPtr<Geoposition> m_lastPosition;
diff --git a/WebCore/page/GroupSettings.cpp b/WebCore/page/GroupSettings.cpp
new file mode 100644
index 0000000..58ab74d
--- /dev/null
+++ b/WebCore/page/GroupSettings.cpp
@@ -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:
+ *
+ * 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 "GroupSettings.h"
+
+namespace WebCore {
+
+GroupSettings::GroupSettings()
+ : m_localStorageQuotaBytes(5 * 1024 * 1024) // Suggested by the HTML5 spec.
+{
+}
+
+void GroupSettings::setLocalStorageQuotaBytes(unsigned quota)
+{
+ m_localStorageQuotaBytes = quota;
+}
+
+void GroupSettings::setIndexedDBDatabasePath(const String& path)
+{
+ m_indexedDBDatabasePath = path;
+}
+
+} // namespace WebCore
diff --git a/WebCore/page/GroupSettings.h b/WebCore/page/GroupSettings.h
new file mode 100644
index 0000000..62a5dd2
--- /dev/null
+++ b/WebCore/page/GroupSettings.h
@@ -0,0 +1,58 @@
+/*
+ * 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 GroupSettings_h
+#define GroupSettings_h
+
+#include "PlatformString.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebCore {
+
+class PageGroup;
+
+class GroupSettings : public Noncopyable {
+public:
+ static PassOwnPtr<GroupSettings> create()
+ {
+ return adoptPtr(new GroupSettings());
+ }
+
+ void setLocalStorageQuotaBytes(unsigned);
+ unsigned localStorageQuotaBytes() const { return m_localStorageQuotaBytes; }
+
+ void setIndexedDBDatabasePath(const String&);
+ const String& indexedDBDatabasePath() const { return m_indexedDBDatabasePath; }
+
+private:
+ GroupSettings();
+
+ unsigned m_localStorageQuotaBytes;
+ String m_indexedDBDatabasePath;
+};
+
+} // namespace WebCore
+
+#endif // GroupSettings_h
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index f808928..63decd7 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -65,12 +65,12 @@
#include "SharedBuffer.h"
#include "SpeechInput.h"
#include "SpeechInputClient.h"
-#include "StringHash.h"
#include "TextResourceDecoder.h"
#include "Widget.h"
#include <wtf/HashMap.h>
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(DOM_STORAGE)
#include "StorageArea.h"
@@ -359,6 +359,9 @@ void Page::goBackOrForward(int distance)
void Page::goToItem(HistoryItem* item, FrameLoadType type)
{
+ if (defersLoading())
+ return;
+
// Abort any current load unless we're navigating the current document to a new state object
HistoryItem* currentItem = m_mainFrame->loader()->history()->currentItem();
if (!item->stateObject() || !currentItem || item->documentSequenceNumber() != currentItem->documentSequenceNumber() || item == currentItem) {
@@ -445,7 +448,10 @@ void Page::refreshPlugins(bool reload)
Page* page = *it;
// Clear out the page's plug-in data.
- page->m_pluginData = 0;
+ if (page->m_pluginData) {
+ page->m_pluginData->disconnectPage();
+ page->m_pluginData = 0;
+ }
if (!reload)
continue;
diff --git a/WebCore/page/PageGroup.cpp b/WebCore/page/PageGroup.cpp
index 12b1a41..aecd550 100644
--- a/WebCore/page/PageGroup.cpp
+++ b/WebCore/page/PageGroup.cpp
@@ -30,6 +30,7 @@
#include "ChromeClient.h"
#include "Document.h"
#include "Frame.h"
+#include "GroupSettings.h"
#include "IDBFactoryBackendInterface.h"
#include "Page.h"
#include "Settings.h"
@@ -55,12 +56,14 @@ PageGroup::PageGroup(const String& name)
: m_name(name)
, m_visitedLinksPopulated(false)
, m_identifier(getUniqueIdentifier())
+ , m_groupSettings(GroupSettings::create())
{
}
PageGroup::PageGroup(Page* page)
: m_visitedLinksPopulated(false)
, m_identifier(getUniqueIdentifier())
+ , m_groupSettings(GroupSettings::create())
{
ASSERT(page);
addPage(page);
@@ -200,7 +203,7 @@ StorageNamespace* PageGroup::localStorage()
// at this point we're stuck with it.
Page* page = *m_pages.begin();
const String& path = page->settings()->localStorageDatabasePath();
- unsigned quota = page->settings()->localStorageQuota();
+ unsigned quota = m_groupSettings->localStorageQuotaBytes();
m_localStorage = StorageNamespace::localStorageNamespace(path, quota);
}
@@ -236,11 +239,12 @@ void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& sourc
void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
- UserContentInjectedFrames injectedFrames)
+ UserContentInjectedFrames injectedFrames,
+ UserStyleSheet::Level level)
{
ASSERT_ARG(world, world);
- OwnPtr<UserStyleSheet> userStyleSheet(new UserStyleSheet(source, url, whitelist, blacklist, injectedFrames));
+ OwnPtr<UserStyleSheet> userStyleSheet(new UserStyleSheet(source, url, whitelist, blacklist, injectedFrames, level));
if (!m_userStyleSheets)
m_userStyleSheets.set(new UserStyleSheetMap);
UserStyleSheetVector*& styleSheetsInWorld = m_userStyleSheets->add(world, 0).first->second;
diff --git a/WebCore/page/PageGroup.h b/WebCore/page/PageGroup.h
index 08b03d7..6a3518e 100644
--- a/WebCore/page/PageGroup.h
+++ b/WebCore/page/PageGroup.h
@@ -29,13 +29,14 @@
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include "LinkHash.h"
-#include "StringHash.h"
#include "UserScript.h"
#include "UserStyleSheet.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
class KURL;
+ class GroupSettings;
class IDBFactoryBackendInterface;
class Page;
class StorageNamespace;
@@ -80,7 +81,8 @@ namespace WebCore {
UserScriptInjectionTime, UserContentInjectedFrames);
void addUserStyleSheetToWorld(DOMWrapperWorld*, const String& source, const KURL&,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
- UserContentInjectedFrames);
+ UserContentInjectedFrames,
+ UserStyleSheet::Level level = UserStyleSheet::UserLevel);
void removeUserScriptFromWorld(DOMWrapperWorld*, const KURL&);
void removeUserStyleSheetFromWorld(DOMWrapperWorld*, const KURL&);
@@ -93,6 +95,8 @@ namespace WebCore {
const UserScriptMap* userScripts() const { return m_userScripts.get(); }
const UserStyleSheetMap* userStyleSheets() const { return m_userStyleSheets.get(); }
+ GroupSettings* groupSettings() const { return m_groupSettings.get(); }
+
private:
void addVisitedLink(LinkHash stringHash);
void resetUserStyleCacheInAllFrames();
@@ -114,6 +118,8 @@ namespace WebCore {
OwnPtr<UserScriptMap> m_userScripts;
OwnPtr<UserStyleSheetMap> m_userStyleSheets;
+
+ OwnPtr<GroupSettings> m_groupSettings;
};
} // namespace WebCore
diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp
index 87b3ed2..f759402 100644
--- a/WebCore/page/SecurityOrigin.cpp
+++ b/WebCore/page/SecurityOrigin.cpp
@@ -30,6 +30,7 @@
#include "SecurityOrigin.h"
#include "Document.h"
+#include "FileSystem.h"
#include "KURL.h"
#include "OriginAccessEntry.h"
#include "SchemeRegistry.h"
@@ -367,13 +368,13 @@ static const char SeparatorCharacter = '_';
PassRefPtr<SecurityOrigin> SecurityOrigin::createFromDatabaseIdentifier(const String& databaseIdentifier)
{
// Make sure there's a first separator
- int separator1 = databaseIdentifier.find(SeparatorCharacter);
- if (separator1 == -1)
+ size_t separator1 = databaseIdentifier.find(SeparatorCharacter);
+ if (separator1 == notFound)
return create(KURL());
// Make sure there's a second separator
- int separator2 = databaseIdentifier.reverseFind(SeparatorCharacter);
- if (separator2 == -1)
+ size_t separator2 = databaseIdentifier.reverseFind(SeparatorCharacter);
+ if (separator2 == notFound)
return create(KURL());
// Ensure there were at least 2 separator characters. Some hostnames on intranets have
@@ -384,7 +385,7 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::createFromDatabaseIdentifier(const St
// Make sure the port section is a valid port number or doesn't exist
bool portOkay;
int port = databaseIdentifier.right(databaseIdentifier.length() - separator2 - 1).toInt(&portOkay);
- bool portAbsent = (separator2 == static_cast<int>(databaseIdentifier.length()) - 1);
+ bool portAbsent = (separator2 == databaseIdentifier.length() - 1);
if (!(portOkay || portAbsent))
return create(KURL());
@@ -399,85 +400,12 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::createFromDatabaseIdentifier(const St
return create(KURL(KURL(), protocol + "://" + host + ":" + String::number(port)));
}
-// The following lower-ASCII characters need escaping to be used in a filename
-// across all systems, including Windows:
-// - Unprintable ASCII (00-1F)
-// - Space (20)
-// - Double quote (22)
-// - Percent (25) (escaped because it is our escape character)
-// - Asterisk (2A)
-// - Slash (2F)
-// - Colon (3A)
-// - Less-than (3C)
-// - Greater-than (3E)
-// - Question Mark (3F)
-// - Backslash (5C)
-// - Pipe (7C)
-// - Delete (7F)
-
-static const bool needsEscaping[128] = {
- /* 00-07 */ true, true, true, true, true, true, true, true,
- /* 08-0F */ true, true, true, true, true, true, true, true,
-
- /* 10-17 */ true, true, true, true, true, true, true, true,
- /* 18-1F */ true, true, true, true, true, true, true, true,
-
- /* 20-27 */ true, false, true, false, false, true, false, false,
- /* 28-2F */ false, false, true, false, false, false, false, true,
-
- /* 30-37 */ false, false, false, false, false, false, false, false,
- /* 38-3F */ false, false, true, false, true, false, true, true,
-
- /* 40-47 */ false, false, false, false, false, false, false, false,
- /* 48-4F */ false, false, false, false, false, false, false, false,
-
- /* 50-57 */ false, false, false, false, false, false, false, false,
- /* 58-5F */ false, false, false, false, true, false, false, false,
-
- /* 60-67 */ false, false, false, false, false, false, false, false,
- /* 68-6F */ false, false, false, false, false, false, false, false,
-
- /* 70-77 */ false, false, false, false, false, false, false, false,
- /* 78-7F */ false, false, false, false, true, false, false, true,
-};
-
-static inline bool shouldEscapeUChar(UChar c)
-{
- return c > 127 ? false : needsEscaping[c];
-}
-
-static const char hexDigits[17] = "0123456789ABCDEF";
-
-static String encodedHost(const String& host)
-{
- unsigned length = host.length();
- Vector<UChar, 512> buffer(length * 3 + 1);
- UChar* p = buffer.data();
-
- const UChar* str = host.characters();
- const UChar* strEnd = str + length;
-
- while (str < strEnd) {
- UChar c = *str++;
- if (shouldEscapeUChar(c)) {
- *p++ = '%';
- *p++ = hexDigits[(c >> 4) & 0xF];
- *p++ = hexDigits[c & 0xF];
- } else
- *p++ = c;
- }
-
- ASSERT(p - buffer.data() <= static_cast<int>(buffer.size()));
-
- return String(buffer.data(), p - buffer.data());
-}
-
String SecurityOrigin::databaseIdentifier() const
{
String separatorString(&SeparatorCharacter, 1);
if (m_encodedHost.isEmpty())
- m_encodedHost = encodedHost(m_host);
+ m_encodedHost = encodeForFileName(m_host);
return m_protocol + separatorString + m_encodedHost + separatorString + String::number(m_port);
}
diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h
index fa5b1e4..266ade0 100644
--- a/WebCore/page/SecurityOrigin.h
+++ b/WebCore/page/SecurityOrigin.h
@@ -33,10 +33,10 @@
#include <wtf/RefCounted.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Threading.h>
+#include <wtf/text/StringHash.h>
#include "FrameLoaderTypes.h"
#include "PlatformString.h"
-#include "StringHash.h"
namespace WebCore {
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 6ec65c2..24563af 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -76,8 +76,7 @@ Settings::Settings(Page* page)
, m_blockNetworkImage(false)
#endif
, m_maximumDecodedImageSize(numeric_limits<size_t>::max())
-#if ENABLE(DOM_STORAGE)
- , m_localStorageQuota(5 * 1024 * 1024) // Suggested by the HTML5 spec.
+#if ENABLE(DOM_STORAGE)
, m_sessionStorageQuota(StorageMap::noQuota)
#endif
, m_pluginAllowedRunTime(numeric_limits<unsigned>::max())
@@ -315,12 +314,7 @@ void Settings::setLocalStorageEnabled(bool localStorageEnabled)
m_localStorageEnabled = localStorageEnabled;
}
-#if ENABLE(DOM_STORAGE)
-void Settings::setLocalStorageQuota(unsigned localStorageQuota)
-{
- m_localStorageQuota = localStorageQuota;
-}
-
+#if ENABLE(DOM_STORAGE)
void Settings::setSessionStorageQuota(unsigned sessionStorageQuota)
{
m_sessionStorageQuota = sessionStorageQuota;
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index c5a13b2..bca23b0 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -27,11 +27,11 @@
#ifndef Settings_h
#define Settings_h
-#include "AtomicString.h"
#include "EditingBehaviorTypes.h"
#include "FontRenderingMode.h"
#include "KURL.h"
#include "ZoomMode.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -157,10 +157,7 @@ namespace WebCore {
void setLocalStorageEnabled(bool);
bool localStorageEnabled() const { return m_localStorageEnabled; }
-#if ENABLE(DOM_STORAGE)
- void setLocalStorageQuota(unsigned);
- unsigned localStorageQuota() const { return m_localStorageQuota; }
-
+#if ENABLE(DOM_STORAGE)
// Allow clients concerned with memory consumption to set a quota on session storage
// since the memory used won't be released until the Page is destroyed.
// Default is noQuota.
@@ -457,8 +454,7 @@ namespace WebCore {
bool m_blockNetworkImage : 1;
#endif
size_t m_maximumDecodedImageSize;
-#if ENABLE(DOM_STORAGE)
- unsigned m_localStorageQuota;
+#if ENABLE(DOM_STORAGE)
unsigned m_sessionStorageQuota;
#endif
unsigned m_pluginAllowedRunTime;
diff --git a/WebCore/page/SpeechInput.cpp b/WebCore/page/SpeechInput.cpp
index 4f37988..24b52d2 100644
--- a/WebCore/page/SpeechInput.cpp
+++ b/WebCore/page/SpeechInput.cpp
@@ -41,46 +41,74 @@ namespace WebCore {
SpeechInput::SpeechInput(SpeechInputClient* client)
: m_client(client)
- , m_listener(0)
+ , m_nextListenerId(1)
{
+ m_client->setListener(this);
}
-void SpeechInput::didCompleteRecording()
+SpeechInput::~SpeechInput()
{
- ASSERT(m_listener);
- m_listener->didCompleteRecording();
+ m_client->setListener(0);
}
-void SpeechInput::didCompleteRecognition()
+int SpeechInput::registerListener(SpeechInputListener* listener)
{
- ASSERT(m_listener);
- m_listener->didCompleteRecognition();
- m_listener = 0;
+#if defined(DEBUG)
+ // Check if already present.
+ for (HashMap<int, SpeechInputListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
+ ASSERT(it->second != listener);
+#endif
+
+ m_listeners.add(m_nextListenerId, listener);
+ return m_nextListenerId++;
+}
+
+void SpeechInput::unregisterListener(int listenerId)
+{
+ if (m_listeners.contains(listenerId))
+ m_listeners.remove(listenerId);
+}
+
+void SpeechInput::didCompleteRecording(int listenerId)
+{
+ // Don't assert if not present as the element might have been removed by the page while
+ // this event was on the way.
+ if (m_listeners.contains(listenerId))
+ m_listeners.get(listenerId)->didCompleteRecording(listenerId);
+}
+
+void SpeechInput::didCompleteRecognition(int listenerId)
+{
+ // Don't assert if not present as the element might have been removed by the page while
+ // this event was on the way.
+ if (m_listeners.contains(listenerId))
+ m_listeners.get(listenerId)->didCompleteRecognition(listenerId);
+}
+
+void SpeechInput::setRecognitionResult(int listenerId, const String& result)
+{
+ // Don't assert if not present as the element might have been removed by the page while
+ // this event was on the way.
+ if (m_listeners.contains(listenerId))
+ m_listeners.get(listenerId)->setRecognitionResult(listenerId, result);
}
-void SpeechInput::setRecognitionResult(const String& result)
+bool SpeechInput::startRecognition(int listenerId)
{
- ASSERT(m_listener);
- m_listener->setRecognitionResult(result);
+ ASSERT(m_listeners.contains(listenerId));
+ return m_client->startRecognition(listenerId);
}
-bool SpeechInput::startRecognition(SpeechInputListener* listener)
+void SpeechInput::stopRecording(int listenerId)
{
- // Cancel any ongoing recognition first.
- if (m_listener) {
- m_listener->didCompleteRecognition();
- m_listener = 0;
- m_client->cancelRecognition();
- }
-
- m_listener = listener;
- return m_client->startRecognition(this);
+ ASSERT(m_listeners.contains(listenerId));
+ m_client->stopRecording(listenerId);
}
-void SpeechInput::stopRecording()
+void SpeechInput::cancelRecognition(int listenerId)
{
- ASSERT(m_listener);
- m_client->stopRecording();
+ ASSERT(m_listeners.contains(listenerId));
+ m_client->cancelRecognition(listenerId);
}
} // namespace WebCore
diff --git a/WebCore/page/SpeechInput.h b/WebCore/page/SpeechInput.h
index 58f4efe..f36194c 100644
--- a/WebCore/page/SpeechInput.h
+++ b/WebCore/page/SpeechInput.h
@@ -35,6 +35,7 @@
#include "SpeechInputListener.h"
#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
namespace WebCore {
@@ -48,20 +49,30 @@ class SpeechInputListener;
class SpeechInput : public Noncopyable, public SpeechInputListener {
public:
SpeechInput(SpeechInputClient*);
- virtual ~SpeechInput() { }
+ virtual ~SpeechInput();
+
+ // Generates a unique ID for the given listener to be used for speech requests.
+ // This should be the first call made by listeners before anything else.
+ int registerListener(SpeechInputListener*);
+
+ // Invoked when the listener is done with recording or getting destroyed.
+ // Failure to unregister may result in crashes if there were any pending speech events.
+ void unregisterListener(int);
// Methods invoked by the input elements.
- bool startRecognition(SpeechInputListener* listener);
- void stopRecording();
+ bool startRecognition(int);
+ void stopRecording(int);
+ void cancelRecognition(int);
// SpeechInputListener methods.
- virtual void didCompleteRecording();
- virtual void didCompleteRecognition();
- virtual void setRecognitionResult(const String&);
+ virtual void didCompleteRecording(int);
+ virtual void didCompleteRecognition(int);
+ virtual void setRecognitionResult(int, const String&);
private:
SpeechInputClient* m_client;
- SpeechInputListener* m_listener;
+ HashMap<int, SpeechInputListener*> m_listeners;
+ int m_nextListenerId;
};
} // namespace WebCore
diff --git a/WebCore/page/SpeechInputClient.h b/WebCore/page/SpeechInputClient.h
index f6c61cf..87ff7b9 100644
--- a/WebCore/page/SpeechInputClient.h
+++ b/WebCore/page/SpeechInputClient.h
@@ -40,15 +40,22 @@ class SpeechInputListener;
// Provides an interface for SpeechInput to call into the embedder.
class SpeechInputClient {
public:
- virtual bool startRecognition(SpeechInputListener* listener) = 0;
+ // This is the first call made by a listener, registering itself for future callbacks.
+ // When the listener no longer needs speech input (for e.g. when it gets destroyed),
+ // it should set a null listener to stop receiving callbacks.
+ // The client does not take ownership of the pointer.
+ virtual void setListener(SpeechInputListener*) = 0;
+
+ // Starts speech recognition and audio recording.
+ virtual bool startRecognition(int requestId) = 0;
// Stops audio recording and performs recognition with the audio recorded until now
// (does not discard audio).
- virtual void stopRecording() = 0;
+ virtual void stopRecording(int requestId) = 0;
// Cancels an ongoing recognition and discards any audio recorded so far. No partial
// recognition results are returned to the listener.
- virtual void cancelRecognition() = 0;
+ virtual void cancelRecognition(int requestId) = 0;
protected:
virtual ~SpeechInputClient() { }
diff --git a/WebCore/page/SpeechInputListener.h b/WebCore/page/SpeechInputListener.h
index 143984d..36060fc 100644
--- a/WebCore/page/SpeechInputListener.h
+++ b/WebCore/page/SpeechInputListener.h
@@ -41,19 +41,19 @@ namespace WebCore {
class SpeechInputListener {
public:
// Informs that audio recording has completed and recognition is underway.
- virtual void didCompleteRecording() = 0;
+ virtual void didCompleteRecording(int requestId) = 0;
// 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() = 0;
+ virtual void didCompleteRecognition(int requestId) = 0;
// 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(const String& result) = 0;
+ virtual void setRecognitionResult(int requestId, const String& result) = 0;
protected:
virtual ~SpeechInputListener() { }
diff --git a/WebCore/page/UserContentURLPattern.cpp b/WebCore/page/UserContentURLPattern.cpp
index 09eb678..272284a 100644
--- a/WebCore/page/UserContentURLPattern.cpp
+++ b/WebCore/page/UserContentURLPattern.cpp
@@ -63,14 +63,14 @@ bool UserContentURLPattern::parse(const String& pattern)
{
DEFINE_STATIC_LOCAL(const String, schemeSeparator, ("://"));
- int schemeEndPos = pattern.find(schemeSeparator);
- if (schemeEndPos == -1)
+ size_t schemeEndPos = pattern.find(schemeSeparator);
+ if (schemeEndPos == notFound)
return false;
m_scheme = pattern.left(schemeEndPos);
- int hostStartPos = schemeEndPos + schemeSeparator.length();
- if (hostStartPos >= static_cast<int>(pattern.length()))
+ unsigned hostStartPos = schemeEndPos + schemeSeparator.length();
+ if (hostStartPos >= pattern.length())
return false;
int pathStartPos = 0;
@@ -78,8 +78,8 @@ bool UserContentURLPattern::parse(const String& pattern)
if (equalIgnoringCase(m_scheme, "file"))
pathStartPos = hostStartPos;
else {
- int hostEndPos = pattern.find("/", hostStartPos);
- if (hostEndPos == -1)
+ size_t hostEndPos = pattern.find("/", hostStartPos);
+ if (hostEndPos == notFound)
return false;
m_host = pattern.substring(hostStartPos, hostEndPos - hostStartPos);
@@ -96,7 +96,7 @@ bool UserContentURLPattern::parse(const String& pattern)
}
// No other '*' can occur in the host.
- if (m_host.find("*") != -1)
+ if (m_host.find("*") != notFound)
return false;
pathStartPos = hostEndPos;
diff --git a/WebCore/page/UserStyleSheet.h b/WebCore/page/UserStyleSheet.h
index 4c6d708..1acd296 100644
--- a/WebCore/page/UserStyleSheet.h
+++ b/WebCore/page/UserStyleSheet.h
@@ -37,14 +37,20 @@ namespace WebCore {
class UserStyleSheet : public Noncopyable {
public:
+ enum Level {
+ UserLevel,
+ AuthorLevel
+ };
+
UserStyleSheet(const String& source, const KURL& url,
PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
- UserContentInjectedFrames injectedFrames)
+ UserContentInjectedFrames injectedFrames, Level level)
: m_source(source)
, m_url(url)
, m_whitelist(whitelist)
, m_blacklist(blacklist)
, m_injectedFrames(injectedFrames)
+ , m_level(level)
{
}
@@ -53,6 +59,7 @@ public:
const Vector<String>* whitelist() const { return m_whitelist.get(); }
const Vector<String>* blacklist() const { return m_blacklist.get(); }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
+ Level level() const { return m_level; }
private:
String m_source;
@@ -60,6 +67,7 @@ private:
OwnPtr<Vector<String> > m_whitelist;
OwnPtr<Vector<String> > m_blacklist;
UserContentInjectedFrames m_injectedFrames;
+ Level m_level;
};
} // namespace WebCore
diff --git a/WebCore/page/WindowFeatures.cpp b/WebCore/page/WindowFeatures.cpp
index 1654ff5..82e36b9 100644
--- a/WebCore/page/WindowFeatures.cpp
+++ b/WebCore/page/WindowFeatures.cpp
@@ -24,10 +24,10 @@
#include "WindowFeatures.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
#include <wtf/MathExtras.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp
index 22506b2..fb0e1c0 100644
--- a/WebCore/page/XSSAuditor.cpp
+++ b/WebCore/page/XSSAuditor.cpp
@@ -34,8 +34,8 @@
#include "DocumentLoader.h"
#include "DOMWindow.h"
#include "Frame.h"
+#include "HTMLEntityParser.h"
#include "KURL.h"
-#include "LegacyPreloadScanner.h"
#include "ResourceResponseBase.h"
#include "ScriptSourceCode.h"
#include "Settings.h"
@@ -277,7 +277,7 @@ String XSSAuditor::decodeHTMLEntities(const String& string, bool leaveUndecodabl
if (leaveUndecodableEntitiesUntouched)
sourceShadow = source;
bool notEnoughCharacters = false;
- unsigned entity = LegacyPreloadScanner::consumeEntity(source, notEnoughCharacters);
+ unsigned entity = consumeHTMLEntity(source, notEnoughCharacters);
// We ignore notEnoughCharacters because we might as well use this loop
// to copy the remaining characters into |result|.
@@ -405,10 +405,10 @@ bool XSSAuditor::findInRequest(Frame* frame, const FindTask& task) const
String decodedPageURL = m_pageURLCache.canonicalizeURL(pageURL, frame->document()->decoder()->encoding(), task.decodeEntities, task.decodeURLEscapeSequencesTwice);
- if (task.allowRequestIfNoIllegalURICharacters && !hasFormData && decodedPageURL.find(&isIllegalURICharacter, 0) == -1)
+ if (task.allowRequestIfNoIllegalURICharacters && !hasFormData && decodedPageURL.find(&isIllegalURICharacter, 0) == notFound)
return false; // Injection is impossible because the request does not contain any illegal URI characters.
- if (decodedPageURL.find(canonicalizedString, 0, false) != -1)
+ if (decodedPageURL.find(canonicalizedString, 0, false) != notFound)
return true; // We've found the string in the GET data.
if (hasFormData) {
@@ -423,7 +423,7 @@ bool XSSAuditor::findInRequest(Frame* frame, const FindTask& task) const
if (m_formDataSuffixTree && !m_formDataSuffixTree->mightContain(canonicalizedString))
return false;
- if (decodedFormData.find(canonicalizedString, 0, false) != -1)
+ if (decodedFormData.find(canonicalizedString, 0, false) != notFound)
return true; // We found the string in the POST data.
}
diff --git a/WebCore/page/XSSAuditor.h b/WebCore/page/XSSAuditor.h
index 20e0a53..2b781f1 100644
--- a/WebCore/page/XSSAuditor.h
+++ b/WebCore/page/XSSAuditor.h
@@ -66,7 +66,7 @@ namespace WebCore {
// * ScriptController::executeIfJavaScriptURL - used to evaluate JavaScript URLs.
// * ScriptEventListener::createAttributeEventListener - used to create JavaScript event handlers.
// * HTMLBaseElement::process - used to set the document base URL.
- // * LegacyHTMLDocumentParser::parseTag - used to load external JavaScript scripts.
+ // * HTMLDocumentParser::shouldLoadExternalScriptFromSrc - used to load external JavaScript scripts.
// * SubframeLoader::requestObject - used to load <object>/<embed> elements.
//
class XSSAuditor : public Noncopyable {
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index 33a0b1d..182cb3c 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -29,8 +29,8 @@
#ifndef AnimationBase_h
#define AnimationBase_h
-#include "AtomicString.h"
#include <wtf/HashMap.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/page/animation/AnimationControllerPrivate.h b/WebCore/page/animation/AnimationControllerPrivate.h
index 3ae15a5..3305e24 100644
--- a/WebCore/page/animation/AnimationControllerPrivate.h
+++ b/WebCore/page/animation/AnimationControllerPrivate.h
@@ -29,7 +29,6 @@
#ifndef AnimationControllerPrivate_h
#define AnimationControllerPrivate_h
-#include "AtomicString.h"
#include "CSSPropertyNames.h"
#include "PlatformString.h"
#include "Timer.h"
@@ -37,6 +36,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/page/animation/CompositeAnimation.h b/WebCore/page/animation/CompositeAnimation.h
index 51ba565..a0ac455 100644
--- a/WebCore/page/animation/CompositeAnimation.h
+++ b/WebCore/page/animation/CompositeAnimation.h
@@ -29,12 +29,11 @@
#ifndef CompositeAnimation_h
#define CompositeAnimation_h
-#include "AtomicString.h"
-
#include "ImplicitAnimation.h"
#include "KeyframeAnimation.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/platform/ContentType.cpp b/WebCore/platform/ContentType.cpp
index 3dce7b5..c094d54 100644
--- a/WebCore/platform/ContentType.cpp
+++ b/WebCore/platform/ContentType.cpp
@@ -41,14 +41,14 @@ String ContentType::parameter(const String& parameterName) const
String strippedType = m_type.stripWhiteSpace();
// a MIME type can have one or more "param=value" after a semi-colon, and separated from each other by semi-colons
- int semi = strippedType.find(';');
- if (semi != -1) {
- int start = strippedType.find(parameterName, semi + 1, false);
- if (start != -1) {
+ size_t semi = strippedType.find(';');
+ if (semi != notFound) {
+ size_t start = strippedType.find(parameterName, semi + 1, false);
+ if (start != notFound) {
start = strippedType.find('=', start + 6);
- if (start != -1) {
- int end = strippedType.find(';', start + 6);
- if (end == -1)
+ if (start != notFound) {
+ size_t end = strippedType.find(';', start + 6);
+ if (end == notFound)
end = strippedType.length();
parameterValue = strippedType.substring(start + 1, end - (start + 1)).stripWhiteSpace();
}
@@ -63,8 +63,8 @@ String ContentType::type() const
String strippedType = m_type.stripWhiteSpace();
// "type" can have parameters after a semi-colon, strip them
- int semi = strippedType.find(';');
- if (semi != -1)
+ size_t semi = strippedType.find(';');
+ if (semi != notFound)
strippedType = strippedType.left(semi).stripWhiteSpace();
return strippedType;
diff --git a/WebCore/platform/Cookie.h b/WebCore/platform/Cookie.h
index 0fe3851..4eea7d2 100644
--- a/WebCore/platform/Cookie.h
+++ b/WebCore/platform/Cookie.h
@@ -27,7 +27,7 @@
#define Cookie_h
#include "PlatformString.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/FileSystem.cpp b/WebCore/platform/FileSystem.cpp
new file mode 100644
index 0000000..511f8aa
--- /dev/null
+++ b/WebCore/platform/FileSystem.cpp
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "FileSystem.h"
+
+namespace WebCore {
+
+// The following lower-ASCII characters need escaping to be used in a filename
+// across all systems, including Windows:
+// - Unprintable ASCII (00-1F)
+// - Space (20)
+// - Double quote (22)
+// - Percent (25) (escaped because it is our escape character)
+// - Asterisk (2A)
+// - Slash (2F)
+// - Colon (3A)
+// - Less-than (3C)
+// - Greater-than (3E)
+// - Question Mark (3F)
+// - Backslash (5C)
+// - Pipe (7C)
+// - Delete (7F)
+
+static const bool needsEscaping[128] = {
+ /* 00-07 */ true, true, true, true, true, true, true, true,
+ /* 08-0F */ true, true, true, true, true, true, true, true,
+
+ /* 10-17 */ true, true, true, true, true, true, true, true,
+ /* 18-1F */ true, true, true, true, true, true, true, true,
+
+ /* 20-27 */ true, false, true, false, false, true, false, false,
+ /* 28-2F */ false, false, true, false, false, false, false, true,
+
+ /* 30-37 */ false, false, false, false, false, false, false, false,
+ /* 38-3F */ false, false, true, false, true, false, true, true,
+
+ /* 40-47 */ false, false, false, false, false, false, false, false,
+ /* 48-4F */ false, false, false, false, false, false, false, false,
+
+ /* 50-57 */ false, false, false, false, false, false, false, false,
+ /* 58-5F */ false, false, false, false, true, false, false, false,
+
+ /* 60-67 */ false, false, false, false, false, false, false, false,
+ /* 68-6F */ false, false, false, false, false, false, false, false,
+
+ /* 70-77 */ false, false, false, false, false, false, false, false,
+ /* 78-7F */ false, false, false, false, true, false, false, true,
+};
+
+static inline bool shouldEscapeUChar(UChar c)
+{
+ return c > 127 ? false : needsEscaping[c];
+}
+
+static const char hexDigits[17] = "0123456789ABCDEF";
+
+String encodeForFileName(const String& inputStr)
+{
+ unsigned length = inputStr.length();
+ Vector<UChar, 512> buffer(length * 3 + 1);
+ UChar* p = buffer.data();
+
+ const UChar* str = inputStr.characters();
+ const UChar* strEnd = str + length;
+
+ while (str < strEnd) {
+ UChar c = *str++;
+ if (shouldEscapeUChar(c)) {
+ *p++ = '%';
+ *p++ = hexDigits[(c >> 4) & 0xF];
+ *p++ = hexDigits[c & 0xF];
+ } else
+ *p++ = c;
+ }
+
+ ASSERT(p - buffer.data() <= static_cast<int>(buffer.size()));
+
+ return String(buffer.data(), p - buffer.data());
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h
index 617470b..ec75a21 100644
--- a/WebCore/platform/FileSystem.h
+++ b/WebCore/platform/FileSystem.h
@@ -170,6 +170,9 @@ int readFromFile(PlatformFileHandle, char* data, int length);
// Methods for dealing with loadable modules
bool unloadModule(PlatformModule);
+// Encode a string for use within a file name.
+String encodeForFileName(const String&);
+
#if PLATFORM(WIN)
String localUserSpecificStorageDirectory();
String roamingUserSpecificStorageDirectory();
diff --git a/WebCore/platform/KURL.cpp b/WebCore/platform/KURL.cpp
index 9ed900f..16b84b5 100644
--- a/WebCore/platform/KURL.cpp
+++ b/WebCore/platform/KURL.cpp
@@ -29,11 +29,11 @@
#include "KURL.h"
-#include "StringHash.h"
#include "TextEncoding.h"
#include <wtf/text/CString.h>
#include <wtf/HashMap.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if USE(ICU_UNICODE)
#include <unicode/uidna.h>
@@ -551,12 +551,12 @@ String KURL::lastPathComponent() const
if (!hasPath())
return String();
- int end = m_pathEnd - 1;
+ unsigned end = m_pathEnd - 1;
if (m_string[end] == '/')
--end;
- int start = m_string.reverseFind('/', end);
- if (start < m_portEnd)
+ size_t start = m_string.reverseFind('/', end);
+ if (start < static_cast<unsigned>(m_portEnd))
return String();
++start;
@@ -675,7 +675,7 @@ String KURL::path() const
bool KURL::setProtocol(const String& s)
{
// Firefox and IE remove everything after the first ':'.
- int separatorPosition = s.find(':');
+ size_t separatorPosition = s.find(':');
String newProtocol = s.substring(0, separatorPosition);
if (!isValidProtocol(newProtocol))
@@ -882,13 +882,13 @@ String decodeURLEscapeSequences(const String& str, const TextEncoding& encoding)
CharBuffer buffer;
- int length = str.length();
- int decodedPosition = 0;
- int searchPosition = 0;
- int encodedRunPosition;
- while ((encodedRunPosition = str.find('%', searchPosition)) >= 0) {
+ unsigned length = str.length();
+ unsigned decodedPosition = 0;
+ unsigned searchPosition = 0;
+ size_t encodedRunPosition;
+ while ((encodedRunPosition = str.find('%', searchPosition)) != notFound) {
// Find the sequence of %-escape codes.
- int encodedRunEnd = encodedRunPosition;
+ unsigned encodedRunEnd = encodedRunPosition;
while (length - encodedRunEnd >= 3
&& str[encodedRunEnd] == '%'
&& isASCIIHexDigit(str[encodedRunEnd + 1])
@@ -1614,13 +1614,13 @@ static void encodeRelativeString(const String& rel, const TextEncoding& encoding
static String substituteBackslashes(const String& string)
{
- int questionPos = string.find('?');
- int hashPos = string.find('#');
- int pathEnd;
+ size_t questionPos = string.find('?');
+ size_t hashPos = string.find('#');
+ unsigned pathEnd;
- if (hashPos >= 0 && (questionPos < 0 || questionPos > hashPos))
+ if (hashPos != notFound && (questionPos == notFound || questionPos > hashPos))
pathEnd = hashPos;
- else if (questionPos >= 0)
+ else if (questionPos != notFound)
pathEnd = questionPos;
else
pathEnd = string.length();
@@ -1799,13 +1799,12 @@ bool portAllowed(const KURL& url)
String mimeTypeFromDataURL(const String& url)
{
ASSERT(protocolIs(url, "data"));
- int index = url.find(';');
- if (index == -1)
+ size_t index = url.find(';');
+ if (index == notFound)
index = url.find(',');
- if (index != -1) {
- int len = index - 5;
- if (len > 0)
- return url.substring(5, len);
+ if (index != notFound) {
+ if (index > 5)
+ return url.substring(5, index - 5);
return "text/plain"; // Data URLs with no MIME type are considered text/plain.
}
return "";
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp
index ac02630..3d23fcf 100644
--- a/WebCore/platform/KURLGoogle.cpp
+++ b/WebCore/platform/KURLGoogle.cpp
@@ -40,13 +40,13 @@
#include <algorithm>
-#include "StringHash.h"
#include "NotImplemented.h"
#include "TextEncoding.h"
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
#include <googleurl/src/url_util.h>
diff --git a/WebCore/platform/KURLHash.h b/WebCore/platform/KURLHash.h
index 283170b..44a4624 100644
--- a/WebCore/platform/KURLHash.h
+++ b/WebCore/platform/KURLHash.h
@@ -28,7 +28,7 @@
#include "KURL.h"
#include "PlatformString.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/Length.cpp b/WebCore/platform/Length.cpp
index 3757d92..e2fd9b8 100644
--- a/WebCore/platform/Length.cpp
+++ b/WebCore/platform/Length.cpp
@@ -26,9 +26,9 @@
#include "Length.h"
#include "PlatformString.h"
-#include "StringBuffer.h"
#include <wtf/ASCIICType.h>
#include <wtf/Assertions.h>
+#include <wtf/text/StringBuffer.h>
using namespace WTF;
@@ -103,10 +103,10 @@ Length* newCoordsArray(const String& string, int& len)
Length* r = new Length[len];
int i = 0;
- int pos = 0;
- int pos2;
+ unsigned pos = 0;
+ size_t pos2;
- while ((pos2 = str->find(' ', pos)) != -1) {
+ while ((pos2 = str->find(' ', pos)) != notFound) {
r[i++] = parseLength(str->characters() + pos, pos2 - pos);
pos = pos2+1;
}
@@ -129,10 +129,10 @@ Length* newLengthArray(const String& string, int& len)
Length* r = new Length[len];
int i = 0;
- int pos = 0;
- int pos2;
+ unsigned pos = 0;
+ size_t pos2;
- while ((pos2 = str->find(',', pos)) != -1) {
+ while ((pos2 = str->find(',', pos)) != notFound) {
r[i++] = parseLength(str->characters() + pos, pos2 - pos);
pos = pos2+1;
}
diff --git a/WebCore/platform/LinkHash.cpp b/WebCore/platform/LinkHash.cpp
index 12437ab..86b4c8a 100644
--- a/WebCore/platform/LinkHash.cpp
+++ b/WebCore/platform/LinkHash.cpp
@@ -22,49 +22,49 @@
*/
#include "config.h"
-#include "AtomicString.h"
#include "KURL.h"
#include "LinkHash.h"
#include "PlatformString.h"
-#include "StringHash.h"
-#include "StringImpl.h"
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/StringImpl.h>
namespace WebCore {
-static inline int findSlashDotDotSlash(const UChar* characters, size_t length)
+static inline size_t findSlashDotDotSlash(const UChar* characters, size_t length)
{
if (length < 4)
- return -1;
+ return notFound;
unsigned loopLimit = length - 3;
for (unsigned i = 0; i < loopLimit; ++i) {
if (characters[i] == '/' && characters[i + 1] == '.' && characters[i + 2] == '.' && characters[i + 3] == '/')
return i;
}
- return -1;
+ return notFound;
}
-static inline int findSlashSlash(const UChar* characters, size_t length, int position)
+static inline size_t findSlashSlash(const UChar* characters, size_t length, int position)
{
if (length < 2)
- return -1;
+ return notFound;
unsigned loopLimit = length - 1;
for (unsigned i = position; i < loopLimit; ++i) {
if (characters[i] == '/' && characters[i + 1] == '/')
return i;
}
- return -1;
+ return notFound;
}
-static inline int findSlashDotSlash(const UChar* characters, size_t length)
+static inline size_t findSlashDotSlash(const UChar* characters, size_t length)
{
if (length < 3)
- return -1;
+ return notFound;
unsigned loopLimit = length - 2;
for (unsigned i = 0; i < loopLimit; ++i) {
if (characters[i] == '/' && characters[i + 1] == '.' && characters[i + 2] == '/')
return i;
}
- return -1;
+ return notFound;
}
static inline bool containsColonSlashSlash(const UChar* characters, unsigned length)
@@ -82,36 +82,32 @@ static inline bool containsColonSlashSlash(const UChar* characters, unsigned len
static inline void cleanPath(Vector<UChar, 512>& path)
{
// FIXME: Should not do this in the query or anchor part.
- int pos;
- while ((pos = findSlashDotDotSlash(path.data(), path.size())) != -1) {
- int prev = reverseFind(path.data(), path.size(), '/', pos - 1);
+ size_t pos;
+ while ((pos = findSlashDotDotSlash(path.data(), path.size())) != notFound) {
+ size_t prev = reverseFind(path.data(), path.size(), '/', pos - 1);
// don't remove the host, i.e. http://foo.org/../foo.html
- if (prev < 0 || (prev > 3 && path[prev - 2] == ':' && path[prev - 1] == '/'))
+ if (prev == notFound || (prev > 3 && path[prev - 2] == ':' && path[prev - 1] == '/'))
path.remove(pos, 3);
else
path.remove(prev, pos - prev + 3);
}
// FIXME: Should not do this in the query part.
- // Set refPos to -2 to mean "I haven't looked for the anchor yet".
- // We don't want to waste a function call on the search for the the anchor
- // in the vast majority of cases where there is no "//" in the path.
pos = 0;
- int refPos = -2;
- while ((pos = findSlashSlash(path.data(), path.size(), pos)) != -1) {
- if (refPos == -2)
- refPos = find(path.data(), path.size(), '#');
- if (refPos > 0 && pos >= refPos)
- break;
-
- if (pos == 0 || path[pos - 1] != ':')
- path.remove(pos);
- else
- pos += 2;
+ if ((pos = findSlashSlash(path.data(), path.size(), pos)) != notFound) {
+ size_t refPos = find(path.data(), path.size(), '#');
+ while (refPos == 0 || refPos == notFound || pos < refPos) {
+ if (pos == 0 || path[pos - 1] != ':')
+ path.remove(pos);
+ else
+ pos += 2;
+ if ((pos = findSlashSlash(path.data(), path.size(), pos)) == notFound)
+ break;
+ }
}
// FIXME: Should not do this in the query or anchor part.
- while ((pos = findSlashDotSlash(path.data(), path.size())) != -1)
+ while ((pos = findSlashDotSlash(path.data(), path.size())) != notFound)
path.remove(pos, 2);
}
diff --git a/WebCore/platform/LinkHash.h b/WebCore/platform/LinkHash.h
index a499a8e..dc494d2 100644
--- a/WebCore/platform/LinkHash.h
+++ b/WebCore/platform/LinkHash.h
@@ -26,8 +26,8 @@
#ifndef LinkHash_h
#define LinkHash_h
-#include "StringHash.h"
#include <wtf/Forward.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index e9e5dd3..b489d3b 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -31,10 +31,10 @@
#include "ArchiveFactory.h"
#endif
#include "MediaPlayer.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if PLATFORM(CG)
#include "ImageSourceCG.h"
@@ -403,8 +403,8 @@ static void initializeMIMETypeRegistry()
String MIMETypeRegistry::getMIMETypeForPath(const String& path)
{
- int pos = path.reverseFind('.');
- if (pos >= 0) {
+ size_t pos = path.reverseFind('.');
+ if (pos != notFound) {
String extension = path.substring(pos + 1);
String result = getMIMETypeForExtension(extension);
if (result.length())
diff --git a/WebCore/platform/MIMETypeRegistry.h b/WebCore/platform/MIMETypeRegistry.h
index f71b478..64abea8 100644
--- a/WebCore/platform/MIMETypeRegistry.h
+++ b/WebCore/platform/MIMETypeRegistry.h
@@ -27,9 +27,9 @@
#define MIMETypeRegistry_h
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/SchemeRegistry.cpp b/WebCore/platform/SchemeRegistry.cpp
index 0423236..58df51a 100644
--- a/WebCore/platform/SchemeRegistry.cpp
+++ b/WebCore/platform/SchemeRegistry.cpp
@@ -113,8 +113,8 @@ bool SchemeRegistry::shouldTreatURLAsLocal(const String& url)
return true;
}
- int loc = url.find(':');
- if (loc == -1)
+ size_t loc = url.find(':');
+ if (loc == notFound)
return false;
String scheme = url.left(loc);
diff --git a/WebCore/platform/SchemeRegistry.h b/WebCore/platform/SchemeRegistry.h
index d92ec4e..56e3b33 100644
--- a/WebCore/platform/SchemeRegistry.h
+++ b/WebCore/platform/SchemeRegistry.h
@@ -27,8 +27,8 @@
#define SchemeRegistry_h
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index ddecf1e..615ae5d 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -322,6 +322,7 @@ void ScrollView::valueChanged(Scrollbar* scrollbar)
if (scrollbarsSuppressed())
return;
+ repaintFixedElementsAfterScrolling();
scrollContents(scrollDelta);
}
diff --git a/WebCore/platform/ThreadGlobalData.cpp b/WebCore/platform/ThreadGlobalData.cpp
index 99cd44a..6d7eb51 100644
--- a/WebCore/platform/ThreadGlobalData.cpp
+++ b/WebCore/platform/ThreadGlobalData.cpp
@@ -28,10 +28,10 @@
#include "ThreadGlobalData.h"
#include "EventNames.h"
-#include "StringImpl.h"
#include "ThreadTimers.h"
#include <wtf/UnusedParam.h>
#include <wtf/WTFThreadData.h>
+#include <wtf/text/StringImpl.h>
#if USE(ICU_UNICODE)
#include "TextCodecICU.h"
diff --git a/WebCore/platform/ThreadGlobalData.h b/WebCore/platform/ThreadGlobalData.h
index c17fbeb..9f57f00 100644
--- a/WebCore/platform/ThreadGlobalData.h
+++ b/WebCore/platform/ThreadGlobalData.h
@@ -27,10 +27,10 @@
#ifndef ThreadGlobalData_h
#define ThreadGlobalData_h
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(WORKERS)
#include <wtf/ThreadSpecific.h>
diff --git a/WebCore/platform/android/PopupMenuAndroid.cpp b/WebCore/platform/android/PopupMenuAndroid.cpp
new file mode 100644
index 0000000..8a1ed07
--- /dev/null
+++ b/WebCore/platform/android/PopupMenuAndroid.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is part of the popup menu implementation for <select> elements in WebCore.
+ *
+ * Copyright 2009, The Android Open Source Project
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ *
+ * 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 "PopupMenu.h"
+
+namespace WebCore {
+
+// Now we handle all of this in WebViewCore.cpp.
+PopupMenu::PopupMenu(PopupMenuClient* menuList)
+ : m_popupClient(menuList)
+{
+}
+
+PopupMenu::~PopupMenu()
+{
+}
+
+void PopupMenu::show(const IntRect&, FrameView*, int)
+{
+}
+
+void PopupMenu::hide()
+{
+}
+
+void PopupMenu::updateFromElement()
+{
+}
+
+bool PopupMenu::itemWritingDirectionIsNatural()
+{
+ return false;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/android/SearchPopupMenuAndroid.cpp b/WebCore/platform/android/SearchPopupMenuAndroid.cpp
new file mode 100644
index 0000000..0d67fdd
--- /dev/null
+++ b/WebCore/platform/android/SearchPopupMenuAndroid.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006, The Android Open Source Project
+ *
+ * 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 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 "SearchPopupMenu.h"
+
+namespace WebCore {
+
+// Save the past searches stored in 'searchItems' to a database associated with 'name'
+void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+{
+}
+
+// Load past searches associated with 'name' from the database to 'searchItems'
+void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
+{
+}
+
+// Create a search popup menu - not sure what else we have to do here
+SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client)
+ : PopupMenu(client)
+{
+}
+
+bool SearchPopupMenu::enabled()
+{
+ return false;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/cf/BinaryPropertyList.cpp b/WebCore/platform/cf/BinaryPropertyList.cpp
index f0facae..27b44d4 100644
--- a/WebCore/platform/cf/BinaryPropertyList.cpp
+++ b/WebCore/platform/cf/BinaryPropertyList.cpp
@@ -26,9 +26,9 @@
#include "config.h"
#include "BinaryPropertyList.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
#include <limits>
using namespace std;
diff --git a/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm b/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
index e532d57..bafc96e 100644
--- a/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
+++ b/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
@@ -452,9 +452,8 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
HIThemeDrawTrack(&trackInfo, 0, drawingContext->platformContext(), kHIThemeOrientationNormal);
}
- if (!canDrawDirectly) {
- context->drawImage(imageBuffer->image(), DeviceColorSpace, scrollbar->frameRect().location());
- }
+ if (!canDrawDirectly)
+ context->drawImageBuffer(imageBuffer.get(), DeviceColorSpace, scrollbar->frameRect().location());
return true;
}
diff --git a/WebCore/platform/chromium/SearchPopupMenuChromium.cpp b/WebCore/platform/chromium/SearchPopupMenuChromium.cpp
index d4d4ff5..dc06b5a 100644
--- a/WebCore/platform/chromium/SearchPopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/SearchPopupMenuChromium.cpp
@@ -32,8 +32,8 @@
#include "config.h"
#include "SearchPopupMenuChromium.h"
-#include "AtomicString.h"
#include "NotImplemented.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/platform/efl/ClipboardEfl.cpp b/WebCore/platform/efl/ClipboardEfl.cpp
index 60146b5..caff813 100644
--- a/WebCore/platform/efl/ClipboardEfl.cpp
+++ b/WebCore/platform/efl/ClipboardEfl.cpp
@@ -24,7 +24,7 @@
#include "Editor.h"
#include "FileList.h"
#include "NotImplemented.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*)
diff --git a/WebCore/platform/efl/CookieJarEfl.cpp b/WebCore/platform/efl/CookieJarEfl.cpp
index 01dcddb..6c78dbd 100644
--- a/WebCore/platform/efl/CookieJarEfl.cpp
+++ b/WebCore/platform/efl/CookieJarEfl.cpp
@@ -30,9 +30,8 @@
#include "KURL.h"
#include "PlatformString.h"
-#include "StringHash.h"
-
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/efl/LocalizedStringsEfl.cpp b/WebCore/platform/efl/LocalizedStringsEfl.cpp
index a58dba2..6023205 100644
--- a/WebCore/platform/efl/LocalizedStringsEfl.cpp
+++ b/WebCore/platform/efl/LocalizedStringsEfl.cpp
@@ -350,6 +350,26 @@ String imageTitle(const String& filename, const IntSize& size)
return String();
}
+#if ENABLE(VIDEO)
+String localizedMediaControlElementString(const String& name)
+{
+ notImplemented();
+ return String();
+}
+
+String localizedMediaControlElementHelpText(const String& name)
+{
+ notImplemented();
+ return String();
+}
+
+String localizedMediaTimeDescription(float time)
+{
+ notImplemented();
+ return String();
+}
+#endif
+
String mediaElementLoadingStateText()
{
return String::fromUTF8("Loading...");
diff --git a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
index 70e317e..fd84b15 100644
--- a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
+++ b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
@@ -33,7 +33,6 @@
#include "PlatformKeyboardEvent.h"
#include "NotImplemented.h"
-#include "StringHash.h"
#include "TextEncoding.h"
#include "WindowsKeyboardCodes.h"
@@ -41,6 +40,7 @@
#include <stdio.h>
#include <wtf/HashMap.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/ANGLEWebKitBridge.cpp b/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
new file mode 100644
index 0000000..9a14820
--- /dev/null
+++ b/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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"
+
+#if ENABLE(3D_CANVAS)
+
+#include "ANGLEWebKitBridge.h"
+
+namespace WebCore {
+
+
+ANGLEWebKitBridge::ANGLEWebKitBridge() :
+ builtCompilers(false)
+{
+ ShInitialize();
+}
+
+ANGLEWebKitBridge::~ANGLEWebKitBridge()
+{
+ if (builtCompilers) {
+ ShDestruct(m_fragmentCompiler);
+ ShDestruct(m_vertexCompiler);
+ }
+
+ ShFinalize();
+}
+
+bool ANGLEWebKitBridge::validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog)
+{
+ if (!builtCompilers) {
+ m_fragmentCompiler = ShConstructCompiler(EShLangFragment, EShSpecWebGL, &m_resources);
+ m_vertexCompiler = ShConstructCompiler(EShLangVertex, EShSpecWebGL, &m_resources);
+
+ builtCompilers = true;
+ }
+
+ ShHandle compiler;
+
+ if (shaderType == SHADER_TYPE_VERTEX)
+ compiler = m_vertexCompiler;
+ else
+ compiler = m_fragmentCompiler;
+
+ const char* const shaderSourceStrings[] = { shaderSource };
+
+ bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, EShOptNone, EDebugOpIntermediate);
+
+ translatedShaderSource = ShGetObjectCode(compiler);
+ shaderValidationLog = ShGetInfoLog(compiler);
+
+ return validateSuccess;
+}
+
+}
+
+#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSCanvasNumberArrayCustom.cpp b/WebCore/platform/graphics/ANGLEWebKitBridge.h
index be10ac0..d01de8f 100644
--- a/WebCore/bindings/js/JSCanvasNumberArrayCustom.cpp
+++ b/WebCore/platform/graphics/ANGLEWebKitBridge.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * 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
@@ -23,24 +23,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
+#ifndef ANGLEWebKitBridge_h
+#define ANGLEWebKitBridge_h
-#if ENABLE(3D_CANVAS)
+#include "ANGLE/ShaderLang.h"
+#include "PlatformString.h"
-#include "JSCanvasNumberArray.h"
+#include <wtf/text/CString.h>
-#include "CanvasNumberArray.h"
+namespace WebCore {
-using namespace JSC;
+enum ANGLEShaderType {
+ SHADER_TYPE_VERTEX = EShLangVertex,
+ SHADER_TYPE_FRAGMENT = EShLangFragment
+};
-namespace WebCore {
+class ANGLEWebKitBridge {
+public:
+
+ ANGLEWebKitBridge();
+ ~ANGLEWebKitBridge();
+
+ void setResources(TBuiltInResource resources) { m_resources = resources; }
+
+ bool validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog);
+
+private:
+
+ ShHandle m_fragmentCompiler;
+ ShHandle m_vertexCompiler;
+
+ bool builtCompilers;
-JSValue JSCanvasNumberArray::getByIndex(JSC::ExecState* exec, unsigned int index)
-{
- JSC::JSValue result = jsNumber(exec, impl()->item(index));
- return result;
-}
+ TBuiltInResource m_resources;
+};
} // namespace WebCore
-#endif // ENABLE(3D_CANVAS)
+#endif
diff --git a/WebCore/platform/graphics/FontCache.cpp b/WebCore/platform/graphics/FontCache.cpp
index cb54cdd..ff865c2 100644
--- a/WebCore/platform/graphics/FontCache.cpp
+++ b/WebCore/platform/graphics/FontCache.cpp
@@ -34,10 +34,10 @@
#include "FontFallbackList.h"
#include "FontPlatformData.h"
#include "FontSelector.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/ListHashSet.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
using namespace WTF;
diff --git a/WebCore/platform/graphics/FontDescription.h b/WebCore/platform/graphics/FontDescription.h
index 86a4349..48fcaad 100644
--- a/WebCore/platform/graphics/FontDescription.h
+++ b/WebCore/platform/graphics/FontDescription.h
@@ -103,7 +103,11 @@ public:
void setIsAbsoluteSize(bool s) { m_isAbsoluteSize = s; }
void setWeight(FontWeight w) { m_weight = w; }
void setGenericFamily(GenericFamilyType genericFamily) { m_genericFamily = genericFamily; }
+#if PLATFORM(CHROMIUM) && OS(DARWIN)
+ void setUsePrinterFont(bool) { }
+#else
void setUsePrinterFont(bool p) { m_usePrinterFont = p; }
+#endif
void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
void setKeywordSize(unsigned s) { m_keywordSize = s; }
void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
diff --git a/WebCore/platform/graphics/FontFamily.h b/WebCore/platform/graphics/FontFamily.h
index 126bd83..21a6b64 100644
--- a/WebCore/platform/graphics/FontFamily.h
+++ b/WebCore/platform/graphics/FontFamily.h
@@ -26,9 +26,9 @@
#ifndef FontFamily_h
#define FontFamily_h
-#include "AtomicString.h"
#include <wtf/RefCounted.h>
#include <wtf/ListRefPtr.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/GeneratedImage.cpp b/WebCore/platform/graphics/GeneratedImage.cpp
index cd0748e..5df2608 100644
--- a/WebCore/platform/graphics/GeneratedImage.cpp
+++ b/WebCore/platform/graphics/GeneratedImage.cpp
@@ -63,11 +63,8 @@ void GeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcR
GraphicsContext* graphicsContext = imageBuffer->context();
graphicsContext->fillRect(FloatRect(FloatPoint(), adjustedSize), *m_generator.get());
- // Grab the final image from the image buffer.
- Image* bitmap = imageBuffer->image();
-
- // Now just call drawTiled on that image.
- bitmap->drawPattern(context, adjustedSrcRect, patternTransform, phase, styleColorSpace, compositeOp, destRect);
+ // Tile the image buffer into the context.
+ imageBuffer->drawPattern(context, adjustedSrcRect, patternTransform, phase, styleColorSpace, compositeOp, destRect);
}
}
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index bee3ef6..bb4f858 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -30,6 +30,7 @@
#include "Font.h"
#include "Generator.h"
#include "GraphicsContextPrivate.h"
+#include "ImageBuffer.h"
using namespace std;
@@ -442,6 +443,57 @@ void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, c
restore();
}
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op)
+{
+ drawImageBuffer(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, bool useLowQualityScale)
+{
+ drawImageBuffer(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, useLowQualityScale);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op)
+{
+ drawImageBuffer(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, bool useLowQualityScale)
+{
+ drawImageBuffer(image, styleColorSpace, FloatRect(dest), srcRect, op, useLowQualityScale);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, bool useLowQualityScale)
+{
+ if (paintingDisabled() || !image)
+ return;
+
+ float tsw = src.width();
+ float tsh = src.height();
+ float tw = dest.width();
+ float th = dest.height();
+
+ if (tsw == -1)
+ tsw = image->width();
+ if (tsh == -1)
+ tsh = image->height();
+
+ if (tw == -1)
+ tw = image->width();
+ if (th == -1)
+ th = image->height();
+
+ if (useLowQualityScale) {
+ save();
+ setImageInterpolationQuality(InterpolationNone);
+ }
+
+ image->draw(this, styleColorSpace, dest, src, op, useLowQualityScale);
+
+ if (useLowQualityScale)
+ restore();
+}
+
void GraphicsContext::addRoundedRectClip(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight,
const IntSize& bottomLeft, const IntSize& bottomRight)
{
@@ -460,6 +512,13 @@ void GraphicsContext::clipOutRoundedRect(const IntRect& rect, const IntSize& top
clipOut(Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight));
}
+void GraphicsContext::clipToImageBuffer(ImageBuffer* buffer, const FloatRect& rect)
+{
+ if (paintingDisabled())
+ return;
+ buffer->clip(this, rect);
+}
+
int GraphicsContext::textDrawingMode()
{
return m_common->state.textDrawingMode;
@@ -541,4 +600,14 @@ void GraphicsContext::adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2
}
}
+#if !PLATFORM(SKIA)
+void GraphicsContext::setGraphicsContext3D(GraphicsContext3D*, const IntSize&)
+{
+}
+
+void GraphicsContext::syncSoftwareCanvas()
+{
+}
+#endif
+
}
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 9cae2f1..c48f91a 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -104,6 +104,12 @@ typedef unsigned char UInt8;
#endif
#endif
+#if PLATFORM(CHROMIUM)
+#define CanvasInterpolationQuality InterpolationMedium
+#else
+#define CanvasInterpolationQuality InterpolationDefault
+#endif
+
#if PLATFORM(QT) && defined(Q_WS_WIN)
#include <windows.h>
#endif
@@ -267,6 +273,13 @@ namespace WebCore {
Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver);
+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver);
+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ void drawImageBuffer(ImageBuffer*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),
+ CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+
void setImageInterpolationQuality(InterpolationQuality);
InterpolationQuality imageInterpolationQuality() const;
@@ -277,8 +290,8 @@ namespace WebCore {
void clipOutEllipseInRect(const IntRect&);
void clipOutRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight);
void clipPath(WindRule);
- void clipToImageBuffer(const FloatRect&, const ImageBuffer*);
void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias = true);
+ void clipToImageBuffer(ImageBuffer*, const FloatRect&);
int textDrawingMode();
void setTextDrawingMode(int);
@@ -415,6 +428,7 @@ namespace WebCore {
#if PLATFORM(QT)
bool inTransparencyLayer() const;
PlatformPath* currentPath();
+ void pushTransparencyLayerInternal(const QRect &rect, qreal opacity, QPixmap& alphaMask);
QPen pen();
static QPainter::CompositionMode toQtCompositionMode(CompositeOperator op);
#endif
@@ -429,10 +443,8 @@ namespace WebCore {
pattern getHaikuStrokeStyle();
#endif
-#if PLATFORM(SKIA)
void setGraphicsContext3D(GraphicsContext3D*, const IntSize&);
void syncSoftwareCanvas();
-#endif
private:
void savePlatformState();
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 79f6ecf..51c4cd5 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -816,6 +816,21 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
return true;
}
+#if !PLATFORM(CHROMIUM)
+bool GraphicsContext3D::supportsBGRA()
+{
+ // For OpenGL ES2.0, this requires checking for
+ // GL_EXT_texture_format_BGRA8888 and GL_EXT_read_format_bgra.
+ // For desktop GL, BGRA has been supported since OpenGL 1.2.
+
+ // However, note that the GL ES2 extension requires the internalFormat to
+ // glTexImage2D() be GL_BGRA, while desktop GL will not accept GL_BGRA
+ // (must be GL_RGBA), so this must be checked on each platform.
+ // Returning false for now to be safe.
+ return false;
+}
+#endif
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index d702096..25d1d06 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -26,9 +26,13 @@
#ifndef GraphicsContext3D_h
#define GraphicsContext3D_h
+#if PLATFORM(MAC)
+#include "ANGLEWebKitBridge.h"
+#endif
#include "GraphicsLayer.h"
#include "PlatformString.h"
+#include <wtf/HashMap.h>
#include <wtf/ListHashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
@@ -403,7 +407,9 @@ public:
// WebGL-specific enums
UNPACK_FLIP_Y_WEBGL = 0x9240,
- UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241
+ UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
+
+ BGRA_EXT = 0x80E1
};
// Context creation attributes.
@@ -716,11 +722,13 @@ public:
void paintRenderingResultsToCanvas(CanvasRenderingContext* context);
- // Helpers for notification about paint events
- void beginPaint(CanvasRenderingContext* context);
- void endPaint();
#if PLATFORM(QT)
void paint(QPainter* painter, const QRect& rect) const;
+ bool paintsIntoCanvasBuffer() const { return true; }
+#elif PLATFORM(CHROMIUM)
+ bool paintsIntoCanvasBuffer() const;
+#else
+ bool paintsIntoCanvasBuffer() const { return false; }
#endif
// Support for buffer creation and deletion
@@ -748,6 +756,8 @@ public:
// getError in the order they were added.
void synthesizeGLError(unsigned long error);
+ bool supportsBGRA();
+
private:
GraphicsContext3D(Attributes attrs, HostWindow* hostWindow);
@@ -807,7 +817,16 @@ public:
int m_currentWidth, m_currentHeight;
+ typedef struct {
+ String source;
+ String log;
+ bool isValid;
+ } ShaderSourceEntry;
+ HashMap<Platform3DObject, ShaderSourceEntry> m_shaderSourceMap;
+
#if PLATFORM(MAC)
+ ANGLEWebKitBridge m_compiler;
+
Attributes m_attrs;
Vector<Vector<float> > m_vertexArray;
diff --git a/WebCore/platform/graphics/Image.h b/WebCore/platform/graphics/Image.h
index 7c00b71..3c5e7fd 100644
--- a/WebCore/platform/graphics/Image.h
+++ b/WebCore/platform/graphics/Image.h
@@ -154,6 +154,9 @@ public:
static PassRefPtr<Image> loadPlatformThemeIcon(const char* name, int size);
#endif
+ virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
+
protected:
Image(ImageObserver* = 0);
@@ -171,9 +174,6 @@ protected:
virtual bool mayFillWithSolidColor() { return false; }
virtual Color solidColor() const { return Color(); }
- virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
- const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
-
private:
RefPtr<SharedBuffer> m_data; // The encoded raw data for the image.
ImageObserver* m_imageObserver;
diff --git a/WebCore/platform/graphics/ImageBuffer.h b/WebCore/platform/graphics/ImageBuffer.h
index a54c721..3c0508e 100644
--- a/WebCore/platform/graphics/ImageBuffer.h
+++ b/WebCore/platform/graphics/ImageBuffer.h
@@ -29,6 +29,7 @@
#define ImageBuffer_h
#include "AffineTransform.h"
+#include "FloatRect.h"
#include "Image.h"
#include "IntSize.h"
#include "ImageBufferData.h"
@@ -71,16 +72,13 @@ namespace WebCore {
~ImageBuffer();
const IntSize& size() const { return m_size; }
+ int width() const { return m_size.width(); }
+ int height() const { return m_size.height(); }
+
GraphicsContext* context() const;
- Image* image() const;
-#if PLATFORM(QT)
- Image* imageForRendering() const;
-#else
- Image* imageForRendering() const { return image(); }
-#endif
-
- void clearImage() { m_image.clear(); }
+ bool drawsUsingCopy() const; // If the image buffer has to render using a copied image, it will return true.
+ PassRefPtr<Image> copyImage() const; // Return a new image that is a copy of the buffer.
PassRefPtr<ImageData> getUnmultipliedImageData(const IntRect&) const;
PassRefPtr<ImageData> getPremultipliedImageData(const IntRect&) const;
@@ -96,12 +94,23 @@ namespace WebCore {
#else
AffineTransform baseTransform() const { return AffineTransform(1, 0, 0, -1, 0, m_size.height()); }
#endif
+
+ private:
+ void clip(GraphicsContext*, const FloatRect&) const;
+
+ // The draw method draws the contents of the buffer without copying it.
+ void draw(GraphicsContext*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),
+ CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
+ friend class GraphicsContext;
+ friend class GeneratedImage;
+
private:
ImageBufferData m_data;
IntSize m_size;
OwnPtr<GraphicsContext> m_context;
- mutable RefPtr<Image> m_image;
#if !PLATFORM(CG)
Vector<int> m_linearRgbLUT;
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index b8b742d..e72987a 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -173,7 +173,7 @@ static Vector<MediaPlayerFactory*>& installedMediaEngines()
#if PLATFORM(WIN)
MediaPlayerPrivateQuickTimeVisualContext::registerMediaEngine(addMediaEngine);
-#elif !PLATFORM(GTK)
+#elif !PLATFORM(GTK) && !PLATFORM(EFL)
// FIXME: currently all the MediaEngines are named
// MediaPlayerPrivate. This code will need an update when bug
// 36663 is adressed.
@@ -257,8 +257,8 @@ void MediaPlayer::load(const String& url, const ContentType& contentType)
// if we don't know the MIME type, see if the extension can help
if (type.isEmpty() || type == "application/octet-stream" || type == "text/plain") {
- int pos = url.reverseFind('.');
- if (pos >= 0) {
+ size_t pos = url.reverseFind('.');
+ if (pos != notFound) {
String extension = url.substring(pos + 1);
String mediaType = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
if (!mediaType.isEmpty())
diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h
index 4da697a..643f17f 100644
--- a/WebCore/platform/graphics/MediaPlayer.h
+++ b/WebCore/platform/graphics/MediaPlayer.h
@@ -34,12 +34,12 @@
#include "Document.h"
#include "IntRect.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringHash.h>
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayer.h"
diff --git a/WebCore/platform/graphics/Path.cpp b/WebCore/platform/graphics/Path.cpp
index af94be7..333afcb 100644
--- a/WebCore/platform/graphics/Path.cpp
+++ b/WebCore/platform/graphics/Path.cpp
@@ -266,8 +266,6 @@ Path Path::createCircle(const FloatPoint& center, float r)
Path Path::createLine(const FloatPoint& start, const FloatPoint& end)
{
Path path;
- if (start.x() == end.x() && start.y() == end.y())
- return path;
path.moveTo(start);
path.addLineTo(end);
diff --git a/WebCore/platform/graphics/Path.h b/WebCore/platform/graphics/Path.h
index 43ba889..61ea328 100644
--- a/WebCore/platform/graphics/Path.h
+++ b/WebCore/platform/graphics/Path.h
@@ -156,6 +156,10 @@ namespace WebCore {
private:
PlatformPathPtr m_path;
+
+#if PLATFORM(QT)
+ int m_lastMoveToIndex;
+#endif
};
}
diff --git a/WebCore/platform/graphics/Pattern.cpp b/WebCore/platform/graphics/Pattern.cpp
index bb07307..82d0a24 100644
--- a/WebCore/platform/graphics/Pattern.cpp
+++ b/WebCore/platform/graphics/Pattern.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-Pattern::Pattern(Image* image, bool repeatX, bool repeatY)
+Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY)
: m_tileImage(image)
, m_repeatX(repeatX)
, m_repeatY(repeatY)
@@ -39,7 +39,7 @@ Pattern::Pattern(Image* image, bool repeatX, bool repeatY)
, m_pattern(0)
#endif
{
- ASSERT(image);
+ ASSERT(m_tileImage);
}
Pattern::~Pattern()
diff --git a/WebCore/platform/graphics/Pattern.h b/WebCore/platform/graphics/Pattern.h
index 48e8d8b..e215f3d 100644
--- a/WebCore/platform/graphics/Pattern.h
+++ b/WebCore/platform/graphics/Pattern.h
@@ -29,6 +29,7 @@
#define Pattern_h
#include "AffineTransform.h"
+#include "Image.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -64,11 +65,10 @@ typedef void* PlatformPatternPtr;
namespace WebCore {
class AffineTransform;
-class Image;
class Pattern : public RefCounted<Pattern> {
public:
- static PassRefPtr<Pattern> create(Image* tileImage, bool repeatX, bool repeatY)
+ static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
{
return adoptRef(new Pattern(tileImage, repeatX, repeatY));
}
@@ -91,7 +91,7 @@ public:
bool repeatY() const { return m_repeatY; }
private:
- Pattern(Image*, bool repeatX, bool repeatY);
+ Pattern(PassRefPtr<Image>, bool repeatX, bool repeatY);
RefPtr<Image> m_tileImage;
bool m_repeatX;
diff --git a/WebCore/platform/graphics/WOFFFileFormat.cpp b/WebCore/platform/graphics/WOFFFileFormat.cpp
index 908e288..25b3b00 100644
--- a/WebCore/platform/graphics/WOFFFileFormat.cpp
+++ b/WebCore/platform/graphics/WOFFFileFormat.cpp
@@ -31,6 +31,9 @@
#include "SharedBuffer.h"
#if !PLATFORM(WIN)
+#if OS(UNIX)
+#include <netinet/in.h>
+#endif
#include <zlib.h>
#if PLATFORM(BREWMP)
#include <AEEStdLib.h>
diff --git a/WebCore/platform/graphics/cairo/GRefPtrCairo.cpp b/WebCore/platform/graphics/cairo/GRefPtrCairo.cpp
new file mode 100644
index 0000000..d244954
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/GRefPtrCairo.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * 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 "GRefPtrCairo.h"
+
+#include <cairo.h>
+
+namespace WTF {
+
+template <> cairo_t* refGPtr(cairo_t* ptr)
+{
+ if (ptr)
+ cairo_reference(ptr);
+ return ptr;
+}
+
+template <> void derefGPtr(cairo_t* ptr)
+{
+ if (ptr)
+ cairo_destroy(ptr);
+}
+
+template <> cairo_surface_t* refGPtr(cairo_surface_t* ptr)
+{
+ if (ptr)
+ cairo_surface_reference(ptr);
+ return ptr;
+}
+
+template <> void derefGPtr(cairo_surface_t* ptr)
+{
+ if (ptr)
+ cairo_surface_destroy(ptr);
+}
+
+}
diff --git a/WebCore/platform/graphics/cairo/GRefPtrCairo.h b/WebCore/platform/graphics/cairo/GRefPtrCairo.h
new file mode 100644
index 0000000..aef51fe
--- /dev/null
+++ b/WebCore/platform/graphics/cairo/GRefPtrCairo.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef GRefPtrCairo_h
+#define GRefPtrCairo_h
+
+#include "GRefPtr.h"
+
+typedef struct _cairo cairo_t;
+typedef struct _cairo_surface cairo_surface_t;
+
+namespace WTF {
+
+template <> cairo_t* refGPtr(cairo_t* ptr);
+template <> void derefGPtr(cairo_t* ptr);
+
+template <> cairo_surface_t* refGPtr(cairo_surface_t* ptr);
+template <> void derefGPtr(cairo_surface_t* ptr);
+
+}
+
+#endif
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index f3fc943..9b3096e 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -908,14 +908,6 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness
cairo_set_fill_rule(cr, savedFillRule);
}
-void GraphicsContext::clipToImageBuffer(const FloatRect& rect, const ImageBuffer* imageBuffer)
-{
- if (paintingDisabled())
- return;
-
- notImplemented();
-}
-
void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace)
{
// Cairo doesn't support shadows natively, they are drawn manually in the draw*
@@ -936,7 +928,7 @@ void GraphicsContext::createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const
// draw the shadow without blurring, if kernelSize is zero
if (!kernelSize) {
setColor(cr, shadowColor);
- cairo_mask_surface(cr, buffer->image()->nativeImageForCurrentFrame(), shadowRect.x(), shadowRect.y());
+ cairo_mask_surface(cr, buffer->m_data.m_surface, shadowRect.x(), shadowRect.y());
return;
}
@@ -956,7 +948,7 @@ void GraphicsContext::createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const
// Mask the filter with the shadow color and draw it to the context.
// Masking makes it possible to just blur the alpha channel.
setColor(cr, shadowColor);
- cairo_mask_surface(cr, blur->resultImage()->image()->nativeImageForCurrentFrame(), shadowRect.x(), shadowRect.y());
+ cairo_mask_surface(cr, blur->resultImage()->m_data.m_surface, shadowRect.x(), shadowRect.y());
#endif
}
diff --git a/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
index 1a43e54..db66276 100644
--- a/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
@@ -35,6 +35,7 @@
#include "GraphicsContext.h"
#include "ImageData.h"
#include "MIMETypeRegistry.h"
+#include "NotImplemented.h"
#include "Pattern.h"
#include "PlatformString.h"
@@ -97,26 +98,34 @@ GraphicsContext* ImageBuffer::context() const
return m_context.get();
}
-Image* ImageBuffer::image() const
+bool ImageBuffer::drawsUsingCopy() const
{
- if (!m_image) {
- // It's assumed that if image() is called, the actual rendering to the
- // GraphicsContext must be done.
- ASSERT(context());
-
- // This creates a COPY of the image and will cache that copy. This means
- // that if subsequent operations take place on the context, neither the
- // currently-returned image, nor the results of future image() calls,
- // will contain that operation.
- //
- // This seems silly, but is the way the CG port works: image() is
- // intended to be used only when rendering is "complete."
- cairo_surface_t* newsurface = copySurface(m_data.m_surface);
-
- // BitmapImage will release the passed in surface on destruction
- m_image = BitmapImage::create(newsurface);
- }
- return m_image.get();
+ return true;
+}
+
+PassRefPtr<Image> ImageBuffer::copyImage() const
+{
+ // BitmapImage will release the passed in surface on destruction
+ return BitmapImage::create(copySurface(m_data.m_surface));
+}
+
+void ImageBuffer::clip(GraphicsContext*, const FloatRect&) const
+{
+ notImplemented();
+}
+
+void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+ CompositeOperator op , bool useLowQualityScale)
+{
+ RefPtr<Image> imageCopy = copyImage();
+ context->drawImage(imageCopy.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
+}
+
+void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ RefPtr<Image> imageCopy = copyImage();
+ imageCopy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
diff --git a/WebCore/platform/graphics/cairo/ImageCairo.cpp b/WebCore/platform/graphics/cairo/ImageCairo.cpp
index 64fbedf..1582671 100644
--- a/WebCore/platform/graphics/cairo/ImageCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageCairo.cpp
@@ -33,6 +33,7 @@
#include "AffineTransform.h"
#include "Color.h"
#include "FloatRect.h"
+#include "GRefPtrCairo.h"
#include "GraphicsContext.h"
#include "ImageBuffer.h"
#include "ImageObserver.h"
@@ -184,17 +185,14 @@ void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, con
cairo_t* cr = context->platformContext();
context->save();
- IntRect imageSize = enclosingIntRect(tileRect);
- OwnPtr<ImageBuffer> imageSurface = ImageBuffer::create(imageSize.size());
-
- if (!imageSurface)
- return;
-
+ GRefPtr<cairo_surface_t> clippedImageSurface = 0;
if (tileRect.size() != size()) {
- cairo_t* clippedImageContext = imageSurface->context()->platformContext();
- cairo_set_source_surface(clippedImageContext, image, -tileRect.x(), -tileRect.y());
- cairo_paint(clippedImageContext);
- image = imageSurface->image()->nativeImageForCurrentFrame();
+ IntRect imageSize = enclosingIntRect(tileRect);
+ clippedImageSurface = adoptGRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, imageSize.width(), imageSize.height()));
+ GRefPtr<cairo_t> clippedImageContext(cairo_create(clippedImageSurface.get()));
+ cairo_set_source_surface(clippedImageContext.get(), image, -tileRect.x(), -tileRect.y());
+ cairo_paint(clippedImageContext.get());
+ image = clippedImageSurface.get();
}
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(image);
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index 2de4d14..e5079dc 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -753,18 +753,6 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness
CGContextEOClip(context);
}
-void GraphicsContext::clipToImageBuffer(const FloatRect& rect, const ImageBuffer* imageBuffer)
-{
- if (paintingDisabled())
- return;
-
- CGContextTranslateCTM(platformContext(), rect.x(), rect.y() + rect.height());
- CGContextScaleCTM(platformContext(), 1, -1);
- CGContextClipToMask(platformContext(), FloatRect(FloatPoint(), rect.size()), imageBuffer->image()->getCGImageRef());
- CGContextScaleCTM(platformContext(), 1, -1);
- CGContextTranslateCTM(platformContext(), -rect.x(), -rect.y() - rect.height());
-}
-
void GraphicsContext::beginTransparencyLayer(float opacity)
{
if (paintingDisabled())
@@ -950,9 +938,17 @@ void GraphicsContext::clip(const Path& path)
if (paintingDisabled())
return;
CGContextRef context = platformContext();
- CGContextBeginPath(context);
- CGContextAddPath(context, path.platformPath());
- CGContextClip(context);
+
+ // CGContextClip does nothing if the path is empty, so in this case, we
+ // instead clip against a zero rect to reduce the clipping region to
+ // nothing - which is the intended behavior of clip() if the path is empty.
+ if (path.isEmpty())
+ CGContextClipToRect(context, CGRectZero);
+ else {
+ CGContextBeginPath(context);
+ CGContextAddPath(context, path.platformPath());
+ CGContextClip(context);
+ }
m_data->clip(path);
}
diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index feb8cec..ecbcf60 100644
--- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -46,6 +46,11 @@ using namespace std;
namespace WebCore {
+static void releaseImageData(void*, const void* data, size_t)
+{
+ fastFree(const_cast<void*>(data));
+}
+
ImageBufferData::ImageBufferData(const IntSize&)
: m_data(0)
{
@@ -56,42 +61,46 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
, m_size(size)
{
success = false; // Make early return mean failure.
- unsigned bytesPerRow;
if (size.width() < 0 || size.height() < 0)
return;
- bytesPerRow = size.width();
+
+ unsigned bytesPerRow = size.width();
if (imageColorSpace != GrayScale) {
// Protect against overflow
if (bytesPerRow > 0x3FFFFFFF)
return;
bytesPerRow *= 4;
}
+ m_data.m_bytesPerRow = bytesPerRow;
+ size_t dataSize = size.height() * bytesPerRow;
if (!tryFastCalloc(size.height(), bytesPerRow).getValue(m_data.m_data))
return;
ASSERT((reinterpret_cast<size_t>(m_data.m_data) & 2) == 0);
- RetainPtr<CGColorSpaceRef> colorSpace;
switch(imageColorSpace) {
case DeviceRGB:
- colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
+ m_data.m_colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
break;
case GrayScale:
- colorSpace.adoptCF(CGColorSpaceCreateDeviceGray());
+ m_data.m_colorSpace.adoptCF(CGColorSpaceCreateDeviceGray());
break;
#if ((PLATFORM(MAC) || PLATFORM(CHROMIUM)) && !defined(BUILDING_ON_TIGER))
case LinearRGB:
- colorSpace.adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
+ m_data.m_colorSpace.adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
break;
+
#endif
default:
- colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
+ m_data.m_colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
break;
}
+ m_data.m_grayScale = imageColorSpace == GrayScale;
+ m_data.m_bitmapInfo = m_data.m_grayScale ? kCGImageAlphaNone : kCGImageAlphaPremultipliedLast;
RetainPtr<CGContextRef> cgContext(AdoptCF, CGBitmapContextCreate(m_data.m_data, size.width(), size.height(), 8, bytesPerRow,
- colorSpace.get(), (imageColorSpace == GrayScale) ? kCGImageAlphaNone : kCGImageAlphaPremultipliedLast));
+ m_data.m_colorSpace.get(), m_data.m_bitmapInfo));
if (!cgContext)
return;
@@ -99,11 +108,13 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
m_context->scale(FloatSize(1, -1));
m_context->translate(0, -size.height());
success = true;
+
+ // Create a live image that wraps the data.
+ m_data.m_dataProvider.adoptCF(CGDataProviderCreateWithData(0, m_data.m_data, dataSize, releaseImageData));
}
ImageBuffer::~ImageBuffer()
{
- fastFree(m_data.m_data);
}
GraphicsContext* ImageBuffer::context() const
@@ -111,17 +122,59 @@ GraphicsContext* ImageBuffer::context() const
return m_context.get();
}
-Image* ImageBuffer::image() const
+bool ImageBuffer::drawsUsingCopy() const
+{
+ return false;
+}
+
+PassRefPtr<Image> ImageBuffer::copyImage() const
+{
+ // BitmapImage will release the passed in CGImage on destruction
+ return BitmapImage::create(CGBitmapContextCreateImage(context()->platformContext()));
+}
+
+static CGImageRef cgImage(const IntSize& size, const ImageBufferData& data)
{
- if (!m_image) {
- // It's assumed that if image() is called, the actual rendering to the
- // GraphicsContext must be done.
- ASSERT(context());
- CGImageRef cgImage = CGBitmapContextCreateImage(context()->platformContext());
- // BitmapImage will release the passed in CGImage on destruction
- m_image = BitmapImage::create(cgImage);
+ return CGImageCreate(size.width(), size.height(), 8, data.m_grayScale ? 8 : 32, data.m_bytesPerRow,
+ data.m_colorSpace.get(), data.m_bitmapInfo, data.m_dataProvider.get(), 0, true, kCGRenderingIntentDefault);
+}
+
+void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+ CompositeOperator op, bool useLowQualityScale)
+{
+ if (destContext == context()) {
+ // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first.
+ RefPtr<Image> copy = copyImage();
+ destContext->drawImage(copy.get(), DeviceColorSpace, destRect, srcRect, op, useLowQualityScale);
+ } else {
+ RefPtr<Image> imageForRendering = BitmapImage::create(cgImage(m_size, m_data));
+ destContext->drawImage(imageForRendering.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
+ }
+}
+
+void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ if (destContext == context()) {
+ // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first.
+ RefPtr<Image> copy = copyImage();
+ copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ } else {
+ RefPtr<Image> imageForRendering = BitmapImage::create(cgImage(m_size, m_data));
+ imageForRendering->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
- return m_image.get();
+}
+
+void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
+{
+ RetainPtr<CGImageRef> image(AdoptCF, cgImage(m_size, m_data));
+
+ CGContextRef platformContext = context->platformContext();
+ CGContextTranslateCTM(platformContext, rect.x(), rect.y() + rect.height());
+ CGContextScaleCTM(platformContext, 1, -1);
+ CGContextClipToMask(platformContext, FloatRect(FloatPoint(), rect.size()), image.get());
+ CGContextScaleCTM(platformContext, 1, -1);
+ CGContextTranslateCTM(platformContext, -rect.x(), -rect.y() - rect.height());
}
template <Multiply multiplied>
diff --git a/WebCore/platform/graphics/cg/ImageBufferData.h b/WebCore/platform/graphics/cg/ImageBufferData.h
index 5e6fc4c..2f9d854 100644
--- a/WebCore/platform/graphics/cg/ImageBufferData.h
+++ b/WebCore/platform/graphics/cg/ImageBufferData.h
@@ -26,6 +26,14 @@
#ifndef ImageBufferData_h
#define ImageBufferData_h
+#include "Image.h"
+#include <wtf/RefPtr.h>
+#include <wtf/RetainPtr.h>
+
+typedef struct CGColorSpace *CGColorSpaceRef;
+typedef struct CGDataProvider *CGDataProviderRef;
+typedef uint32_t CGBitmapInfo;
+
namespace WebCore {
class IntSize;
@@ -35,6 +43,12 @@ public:
ImageBufferData(const IntSize&);
void* m_data;
+
+ RetainPtr<CGDataProviderRef> m_dataProvider;
+ CGBitmapInfo m_bitmapInfo;
+ bool m_grayScale;
+ unsigned m_bytesPerRow;
+ RetainPtr<CGColorSpaceRef> m_colorSpace;
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/cg/ImageSourceCGWin.cpp b/WebCore/platform/graphics/cg/ImageSourceCGWin.cpp
index c7d9a0b..ef69e5e 100644
--- a/WebCore/platform/graphics/cg/ImageSourceCGWin.cpp
+++ b/WebCore/platform/graphics/cg/ImageSourceCGWin.cpp
@@ -27,8 +27,8 @@
#include "ImageSourceCG.h"
#include "StdLibExtras.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
index 8ba37c6..7c3e450 100644
--- a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
@@ -38,8 +38,8 @@
#include "HashMap.h"
#include "HashSet.h"
#include "SimpleFontData.h"
-#include "StringHash.h"
#include <unicode/uniset.h>
+#include <wtf/text/StringHash.h>
#include <windows.h>
#include <objidl.h>
diff --git a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
index 53f4a52..2fda22d 100644
--- a/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheLinux.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "FontCache.h"
-#include "AtomicString.h"
#include "ChromiumBridge.h"
#include "Font.h"
#include "FontDescription.h"
@@ -46,6 +45,7 @@
#include <unicode/utf16.h>
#include <wtf/Assertions.h>
+#include <wtf/text/AtomicString.h>
#include <wtf/text/CString.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index 1953dd8..ec79b82 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -166,6 +166,9 @@ public:
, m_offsetX(m_startingX)
, m_run(getTextRun(run))
, m_iterateBackwards(m_run.rtl())
+ , m_wordSpacingAdjustment(0)
+ , m_padding(0)
+ , m_padError(0)
{
// Do not use |run| inside this constructor. Use |m_run| instead.
@@ -207,6 +210,56 @@ public:
delete[] m_item.string;
}
+ // setWordSpacingAdjustment sets a delta (in pixels) which is applied at
+ // each word break in the TextRun.
+ void setWordSpacingAdjustment(int wordSpacingAdjustment)
+ {
+ m_wordSpacingAdjustment = wordSpacingAdjustment;
+ }
+
+ // setLetterSpacingAdjustment sets an additional number of pixels that is
+ // added to the advance after each output cluster. This matches the behaviour
+ // of WidthIterator::advance.
+ //
+ // (NOTE: currently does nothing because I don't know how to get the
+ // cluster information from Harfbuzz.)
+ void setLetterSpacingAdjustment(int letterSpacingAdjustment)
+ {
+ m_letterSpacing = letterSpacingAdjustment;
+ }
+
+ bool isWordBreak(unsigned i, bool isRTL)
+ {
+ if (!isRTL)
+ return i && isCodepointSpace(m_item.string[i]) && !isCodepointSpace(m_item.string[i - 1]);
+ return i != m_item.stringLength - 1 && isCodepointSpace(m_item.string[i]) && !isCodepointSpace(m_item.string[i + 1]);
+ }
+
+ // setPadding sets a number of pixels to be distributed across the TextRun.
+ // WebKit uses this to justify text.
+ void setPadding(int padding)
+ {
+ m_padding = padding;
+ if (!m_padding)
+ return;
+
+ // If we have padding to distribute, then we try to give an equal
+ // amount to each space. The last space gets the smaller amount, if
+ // any.
+ unsigned numWordBreaks = 0;
+ bool isRTL = m_iterateBackwards;
+
+ for (unsigned i = 0; i < m_item.stringLength; i++) {
+ if (isWordBreak(i, isRTL))
+ numWordBreaks++;
+ }
+
+ if (numWordBreaks)
+ m_padPerWordBreak = m_padding / numWordBreaks;
+ else
+ m_padPerWordBreak = 0;
+ }
+
void reset()
{
if (m_iterateBackwards)
@@ -453,8 +506,15 @@ private:
void setGlyphXPositions(bool isRTL)
{
double position = 0;
+ // logClustersIndex indexes logClusters for the first (or last when
+ // RTL) codepoint of the current glyph. Each time we advance a glyph,
+ // we skip over all the codepoints that contributed to the current
+ // glyph.
+ unsigned logClustersIndex = isRTL ? m_item.num_glyphs - 1 : 0;
+
for (int iter = 0; iter < m_item.num_glyphs; ++iter) {
- // Glyphs are stored in logical order, but for layout purposes we always go left to right.
+ // Glyphs are stored in logical order, but for layout purposes we
+ // always go left to right.
int i = isRTL ? m_item.num_glyphs - iter - 1 : iter;
m_glyphs16[i] = m_item.glyphs[i];
@@ -462,12 +522,48 @@ private:
m_xPositions[i] = m_offsetX + position + offsetX;
double advance = truncateFixedPointToInteger(m_item.advances[i]);
+ unsigned glyphIndex = m_item.item.pos + logClustersIndex;
+ if (isWordBreak(glyphIndex, isRTL)) {
+ advance += m_wordSpacingAdjustment;
+
+ if (m_padding > 0) {
+ unsigned toPad = roundf(m_padPerWordBreak + m_padError);
+ m_padError += m_padPerWordBreak - toPad;
+
+ if (m_padding < toPad)
+ toPad = m_padding;
+ m_padding -= toPad;
+ advance += toPad;
+ }
+ }
+
+ // We would like to add m_letterSpacing after each cluster, but I
+ // don't know where the cluster information is. This is typically
+ // fine for Roman languages, but breaks more complex languages
+ // terribly.
+ // advance += m_letterSpacing;
+
+ if (isRTL) {
+ while (logClustersIndex > 0 && logClusters()[logClustersIndex] == i)
+ logClustersIndex--;
+ } else {
+ while (logClustersIndex < m_item.num_glyphs && logClusters()[logClustersIndex] == i)
+ logClustersIndex++;
+ }
+
position += advance;
}
+
m_pixelWidth = position;
m_offsetX += m_pixelWidth;
}
+ static bool isCodepointSpace(HB_UChar16 c)
+ {
+ // This matches the logic in RenderBlock::findNextLineBreak
+ return c == ' ' || c == '\t';
+ }
+
void mirrorCharacters(UChar* destination, const UChar* source, int length) const
{
int position = 0;
@@ -498,6 +594,14 @@ private:
OwnArrayPtr<UChar> m_normalizedBuffer; // A buffer for normalized run.
const TextRun& m_run;
bool m_iterateBackwards;
+ int m_wordSpacingAdjustment; // delta adjustment (pixels) for each word break.
+ float m_padding; // pixels to be distributed over the line at word breaks.
+ float m_padPerWordBreak; // pixels to be added to each word break.
+ float m_padError; // |m_padPerWordBreak| might have a fractional component.
+ // Since we only add a whole number of padding pixels at
+ // each word break we accumulate error. This is the
+ // number of pixels that we are behind so far.
+ unsigned m_letterSpacing; // pixels to be added after each glyph.
};
static void setupForTextPainting(SkPaint* paint, SkColor color)
@@ -534,6 +638,9 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
TextRunWalker walker(run, point.x(), this);
bool haveMultipleLayers = isCanvasMultiLayered(canvas);
+ walker.setWordSpacingAdjustment(wordSpacing());
+ walker.setLetterSpacingAdjustment(letterSpacing());
+ walker.setPadding(run.padding());
while (walker.nextScriptRun()) {
if (fill) {
@@ -553,6 +660,8 @@ void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
{
TextRunWalker walker(run, 0, this);
+ walker.setWordSpacingAdjustment(wordSpacing());
+ walker.setLetterSpacingAdjustment(letterSpacing());
return walker.widthOfFullRun();
}
@@ -588,6 +697,8 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
// (Mac code ignores includePartialGlyphs, and they don't know what it's
// supposed to do, so we just ignore it as well.)
TextRunWalker walker(run, 0, this);
+ walker.setWordSpacingAdjustment(wordSpacing());
+ walker.setLetterSpacingAdjustment(letterSpacing());
// If this is RTL text, the first glyph from the left is actually the last
// code point. So we need to know how many code points there are total in
@@ -664,6 +775,8 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
{
int fromX = -1, toX = -1, fromAdvance = -1, toAdvance = -1;
TextRunWalker walker(run, 0, this);
+ walker.setWordSpacingAdjustment(wordSpacing());
+ walker.setLetterSpacingAdjustment(letterSpacing());
// Base will point to the x offset for the current script run. Note that, in
// the LTR case, width will be 0.
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
index 1d6cc8e..beac0bf 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
@@ -34,10 +34,10 @@
#include "config.h"
-#include "StringImpl.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringImpl.h>
#include <usp10.h>
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
index 9b54732..b51eb8c 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
@@ -35,11 +35,12 @@
#include "HarfbuzzSkia.h"
#include "NotImplemented.h"
#include "PlatformString.h"
-#include "StringImpl.h"
#include "SkPaint.h"
#include "SkTypeface.h"
+#include <wtf/text/StringImpl.h>
+
namespace WebCore {
static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h
index de12832..363e55f 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.h
@@ -32,10 +32,10 @@
#define FontPlatformDataLinux_h
#include "FontRenderStyle.h"
-#include "StringImpl.h"
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringImpl.h>
#include <SkPaint.h>
class SkTypeface;
diff --git a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
index 78170a9..e725c50 100644
--- a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
@@ -34,11 +34,11 @@
#include <limits>
#include "PlatformString.h"
-#include "StringHash.h"
#include "UniscribeHelper.h"
#include <unicode/locid.h>
#include <unicode/uchar.h>
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
index 8a9bde1..534de7b 100644
--- a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
+++ b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
@@ -38,14 +38,15 @@
#include "FloatRect.h"
#include "GLES2Texture.h"
#include "GraphicsContext3D.h"
+#include "IntRect.h"
#include "PlatformString.h"
#include "Uint16Array.h"
#define _USE_MATH_DEFINES
#include <math.h>
-#include <wtf/text/CString.h>
#include <wtf/OwnArrayPtr.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -221,7 +222,6 @@ void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRe
checkGLError("glUseProgram");
m_context->activeTexture(GraphicsContext3D::TEXTURE0);
- texture->bind();
m_context->uniform1i(m_texSamplerLocation, 0);
checkGLError("glUniform1i");
@@ -229,28 +229,52 @@ void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRe
m_context->uniform1f(m_texAlphaLocation, alpha);
checkGLError("glUniform1f for alpha");
+ m_context->vertexAttribPointer(m_texPositionLocation, 3, GraphicsContext3D::FLOAT, false, 0, 0);
+
+ m_context->enableVertexAttribArray(m_texPositionLocation);
+
+ const TilingData& tiles = texture->tiles();
+ IntRect tileIdxRect = tiles.overlappedTileIndices(srcRect);
+
+ for (int y = tileIdxRect.y(); y <= tileIdxRect.bottom(); y++) {
+ for (int x = tileIdxRect.x(); x <= tileIdxRect.right(); x++)
+ drawTexturedRectTile(texture, tiles.tileIndex(x, y), srcRect, dstRect, transform);
+ }
+}
+
+void GLES2Canvas::drawTexturedRectTile(GLES2Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform)
+{
+ if (dstRect.isEmpty())
+ return;
+
+ const TilingData& tiles = texture->tiles();
+
+ texture->bindTile(tile);
+
+ FloatRect srcRectClippedInTileSpace;
+ FloatRect dstRectIntersected;
+ tiles.intersectDrawQuad(srcRect, dstRect, tile, &srcRectClippedInTileSpace, &dstRectIntersected);
+
+ IntRect tileBoundsWithBorder = tiles.tileBoundsWithBorder(tile);
+
AffineTransform matrix(m_flipMatrix);
matrix.multLeft(transform);
- matrix.translate(dstRect.x(), dstRect.y());
- matrix.scale(dstRect.width(), dstRect.height());
+ matrix.translate(dstRectIntersected.x(), dstRectIntersected.y());
+ matrix.scale(dstRectIntersected.width(), dstRectIntersected.height());
float mat[9];
affineTo3x3(matrix, mat);
m_context->uniformMatrix3fv(m_texMatrixLocation, false /*transpose*/, mat, 1 /*count*/);
checkGLError("glUniformMatrix3fv");
AffineTransform texMatrix;
- texMatrix.scale(1.0f / texture->width(), 1.0f / texture->height());
- texMatrix.translate(srcRect.x(), srcRect.y());
- texMatrix.scale(srcRect.width(), srcRect.height());
+ texMatrix.scale(1.0f / tileBoundsWithBorder.width(), 1.0f / tileBoundsWithBorder.height());
+ texMatrix.translate(srcRectClippedInTileSpace.x(), srcRectClippedInTileSpace.y());
+ texMatrix.scale(srcRectClippedInTileSpace.width(), srcRectClippedInTileSpace.height());
float texMat[9];
affineTo3x3(texMatrix, texMat);
m_context->uniformMatrix3fv(m_texTexMatrixLocation, false /*transpose*/, texMat, 1 /*count*/);
checkGLError("glUniformMatrix3fv");
- m_context->vertexAttribPointer(m_texPositionLocation, 3, GraphicsContext3D::FLOAT, false, 0, 0);
-
- m_context->enableVertexAttribArray(m_texPositionLocation);
-
m_context->drawElements(GraphicsContext3D::TRIANGLES, 6, GraphicsContext3D::UNSIGNED_SHORT, 0);
checkGLError("glDrawElements");
}
diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.h b/WebCore/platform/graphics/chromium/GLES2Canvas.h
index cea90ae..0ad07fc 100644
--- a/WebCore/platform/graphics/chromium/GLES2Canvas.h
+++ b/WebCore/platform/graphics/chromium/GLES2Canvas.h
@@ -81,6 +81,7 @@ public:
GLES2Texture* getTexture(NativeImagePtr);
private:
+ void drawTexturedRectTile(GLES2Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&);
void applyCompositeOperator(CompositeOperator);
void checkGLError(const char* header);
unsigned getQuadVertices();
diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.cpp b/WebCore/platform/graphics/chromium/GLES2Texture.cpp
index 5e8a141..ae230db 100644
--- a/WebCore/platform/graphics/chromium/GLES2Texture.cpp
+++ b/WebCore/platform/graphics/chromium/GLES2Texture.cpp
@@ -35,45 +35,27 @@
#include "GLES2Texture.h"
#include "GraphicsContext3D.h"
-
+#include "IntRect.h"
#include <wtf/OwnArrayPtr.h>
namespace WebCore {
-GLES2Texture::GLES2Texture(GraphicsContext3D* context, unsigned textureId, Format format, int width, int height)
+
+GLES2Texture::GLES2Texture(GraphicsContext3D* context, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize)
: m_context(context)
- , m_textureId(textureId)
, m_format(format)
- , m_width(width)
- , m_height(height)
+ , m_tiles(maxTextureSize, width, height, true)
+ , m_tileTextureIds(tileTextureIds)
{
}
GLES2Texture::~GLES2Texture()
{
- m_context->deleteTexture(m_textureId);
-}
-
-PassRefPtr<GLES2Texture> GLES2Texture::create(GraphicsContext3D* context, Format format, int width, int height)
-{
- int max;
- context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &max);
- if (width > max || height > max) {
- ASSERT(!"texture too big");
- return 0;
- }
-
- unsigned textureId = context->createTexture();
- if (!textureId)
- return 0;
-
- context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
- context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, width, height, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0);
-
- return adoptRef(new GLES2Texture(context, textureId, format, width, height));
+ for (unsigned int i = 0; i < m_tileTextureIds->size(); i++)
+ m_context->deleteTexture(m_tileTextureIds->at(i));
}
-static void convertFormat(GLES2Texture::Format format, unsigned int* glFormat, unsigned int* glType, bool* swizzle)
+static void convertFormat(GraphicsContext3D* context, GLES2Texture::Format format, unsigned int* glFormat, unsigned int* glType, bool* swizzle)
{
*swizzle = false;
switch (format) {
@@ -82,43 +64,113 @@ static void convertFormat(GLES2Texture::Format format, unsigned int* glFormat, u
*glType = GraphicsContext3D::UNSIGNED_BYTE;
break;
case GLES2Texture::BGRA8:
-// FIXME: Once we have support for extensions, we should check for EXT_texture_format_BGRA8888,
-// and use that if present.
- *glFormat = GraphicsContext3D::RGBA;
- *glType = GraphicsContext3D::UNSIGNED_BYTE;
- *swizzle = true;
+ if (context->supportsBGRA()) {
+ *glFormat = GraphicsContext3D::BGRA_EXT;
+ *glType = GraphicsContext3D::UNSIGNED_BYTE;
+ } else {
+ *glFormat = GraphicsContext3D::RGBA;
+ *glType = GraphicsContext3D::UNSIGNED_BYTE;
+ *swizzle = true;
+ }
break;
default:
- ASSERT(!"bad format");
+ ASSERT_NOT_REACHED();
break;
}
}
+PassRefPtr<GLES2Texture> GLES2Texture::create(GraphicsContext3D* context, Format format, int width, int height)
+{
+ int maxTextureSize = 0;
+ context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize);
+
+ TilingData tiling(maxTextureSize, width, height, true);
+ int numTiles = tiling.numTiles();
+
+ OwnPtr<Vector<unsigned int> > textureIds(new Vector<unsigned int>(numTiles));
+ textureIds->fill(0, numTiles);
+
+ for (int i = 0; i < numTiles; i++) {
+ int textureId = context->createTexture();
+ if (!textureId) {
+ for (int i = 0; i < numTiles; i++)
+ context->deleteTexture(textureIds->at(i));
+ return 0;
+ }
+ textureIds->at(i) = textureId;
+
+ IntRect tileBoundsWithBorder = tiling.tileBoundsWithBorder(i);
+
+ unsigned int glFormat, glType;
+ bool swizzle;
+ convertFormat(context, format, &glFormat, &glType, &swizzle);
+ context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
+ context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, glFormat,
+ tileBoundsWithBorder.width(),
+ tileBoundsWithBorder.height(),
+ 0, glFormat, glType, 0);
+ }
+ return adoptRef(new GLES2Texture(context, textureIds.leakPtr(), format, width, height, maxTextureSize));
+}
+
+template <bool swizzle>
+static uint32_t* copySubRect(uint32_t* src, int srcX, int srcY, uint32_t* dst, int width, int height, int srcStride)
+{
+ uint32_t* srcOffset = src + srcX + srcY * srcStride;
+
+ if (!swizzle && width == srcStride)
+ return srcOffset;
+
+ uint32_t* dstPixel = dst;
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width ; x++) {
+ uint32_t pixel = srcOffset[x + y * srcStride];
+ if (swizzle)
+ *dstPixel = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ else
+ *dstPixel = pixel;
+ dstPixel++;
+ }
+ }
+ return dst;
+}
+
void GLES2Texture::load(void* pixels)
{
+ uint32_t* pixels32 = static_cast<uint32_t*>(pixels);
unsigned int glFormat, glType;
bool swizzle;
- convertFormat(m_format, &glFormat, &glType, &swizzle);
- m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId);
+ convertFormat(m_context, m_format, &glFormat, &glType, &swizzle);
if (swizzle) {
ASSERT(glFormat == GraphicsContext3D::RGBA && glType == GraphicsContext3D::UNSIGNED_BYTE);
// FIXME: This could use PBO's to save doing an extra copy here.
- int size = m_width * m_height;
- unsigned* pixels32 = static_cast<unsigned*>(pixels);
- OwnArrayPtr<unsigned> buf(new unsigned[size]);
- unsigned* bufptr = buf.get();
- for (int i = 0; i < size; ++i) {
- unsigned pixel = pixels32[i];
- bufptr[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ }
+ OwnArrayPtr<uint32_t> tempBuff(new uint32_t[m_tiles.maxTextureSize() * m_tiles.maxTextureSize()]);
+
+ for (int i = 0; i < m_tiles.numTiles(); i++) {
+ IntRect tileBoundsWithBorder = m_tiles.tileBoundsWithBorder(i);
+
+ uint32_t* uploadBuff = 0;
+ if (swizzle) {
+ uploadBuff = copySubRect<true>(
+ pixels32, tileBoundsWithBorder.x(), tileBoundsWithBorder.y(),
+ tempBuff.get(), tileBoundsWithBorder.width(), tileBoundsWithBorder.height(), m_tiles.totalSizeX());
+ } else {
+ uploadBuff = copySubRect<false>(
+ pixels32, tileBoundsWithBorder.x(), tileBoundsWithBorder.y(),
+ tempBuff.get(), tileBoundsWithBorder.width(), tileBoundsWithBorder.height(), m_tiles.totalSizeX());
}
- m_context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, m_width, m_height, glFormat, glType, buf.get());
- } else
- m_context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, m_width, m_height, glFormat, glType, pixels);
+
+ m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_tileTextureIds->at(i));
+ m_context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, 0, 0,
+ tileBoundsWithBorder.width(),
+ tileBoundsWithBorder.height(), glFormat, glType, uploadBuff);
+ }
}
-void GLES2Texture::bind()
+void GLES2Texture::bindTile(int tile)
{
- m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId);
+ m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_tileTextureIds->at(tile));
m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.h b/WebCore/platform/graphics/chromium/GLES2Texture.h
index 4d351cd..43a4955 100644
--- a/WebCore/platform/graphics/chromium/GLES2Texture.h
+++ b/WebCore/platform/graphics/chromium/GLES2Texture.h
@@ -35,6 +35,10 @@
#include "RefCounted.h"
#include "RefPtr.h"
+#include "TilingData.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
namespace WebCore {
class GraphicsContext3D;
@@ -44,18 +48,16 @@ public:
~GLES2Texture();
enum Format { RGBA8, BGRA8 };
static PassRefPtr<GLES2Texture> create(GraphicsContext3D*, Format, int width, int height);
- void bind();
+ void bindTile(int tile);
void load(void* pixels);
Format format() const { return m_format; }
- int width() const { return m_width; }
- int height() const { return m_height; }
+ const TilingData& tiles() const { return m_tiles; }
private:
- GLES2Texture(GraphicsContext3D*, unsigned textureId, Format, int width, int height);
+ GLES2Texture(GraphicsContext3D*, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize);
GraphicsContext3D* m_context;
- unsigned m_textureId;
Format m_format;
- int m_width;
- int m_height;
+ TilingData m_tiles;
+ OwnPtr<Vector<unsigned int> > m_tileTextureIds;
};
}
diff --git a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
index 9f6ee17..3cc7cad 100644
--- a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
@@ -114,7 +114,7 @@ void ImageLayerChromium::updateTextureContents(unsigned textureId)
case kCGColorSpaceModelDeviceN:
break;
default:
- colorSpace.adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
+ colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
break;
}
RetainPtr<CGContextRef> tempContext(AdoptCF, CGBitmapContextCreate(tempVector.data(),
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
index bba65f4..21d8d12 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -180,8 +180,7 @@ void LayerChromium::updateTextureContents(unsigned textureId)
int rowBytes = 4 * dirtyRect.width();
tempVector.resize(rowBytes * dirtyRect.height());
memset(tempVector.data(), 0, tempVector.size());
- // FIXME: unsure whether this is the best color space choice.
- RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
+ RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
RetainPtr<CGContextRef> contextCG(AdoptCF, CGBitmapContextCreate(tempVector.data(),
dirtyRect.width(), dirtyRect.height(), 8, rowBytes,
colorSpace.get(),
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.h b/WebCore/platform/graphics/chromium/LayerChromium.h
index ebb4504..9fba415 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerChromium.h
@@ -38,12 +38,12 @@
#include "GraphicsContext.h"
#include "GraphicsLayerChromium.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include "TransformationMatrix.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace skia {
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 15acfa5..2f70efa 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -255,8 +255,7 @@ void LayerRendererChromium::setRootLayerCanvasSize(const IntSize& size)
int rowBytes = 4 * size.width();
m_rootLayerBackingStore.resize(rowBytes * size.height());
memset(m_rootLayerBackingStore.data(), 0, m_rootLayerBackingStore.size());
- // FIXME: unsure whether this is the best color space choice.
- RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
+ RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
m_rootLayerCGContext.adoptCF(CGBitmapContextCreate(m_rootLayerBackingStore.data(),
size.width(), size.height(), 8, rowBytes,
colorSpace.get(),
diff --git a/WebCore/platform/graphics/chromium/TilingData.cpp b/WebCore/platform/graphics/chromium/TilingData.cpp
new file mode 100755
index 0000000..c52288d
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/TilingData.cpp
@@ -0,0 +1,218 @@
+/*
+ * 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 "TilingData.h"
+
+#include "FloatRect.h"
+#include "IntRect.h"
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+static int computeNumTiles(int maxTextureSize, int totalSize, int borderTexels)
+{
+ return max(1, 1 + (totalSize - 1 - 2 * borderTexels) / (maxTextureSize - 2 * borderTexels));
+}
+
+TilingData::TilingData(int maxTextureSize, int totalSizeX, int totalSizeY, bool hasBorderTexels)
+ : m_maxTextureSize(maxTextureSize)
+ , m_totalSizeX(totalSizeX)
+ , m_totalSizeY(totalSizeY)
+ , m_borderTexels(hasBorderTexels ? 1 : 0)
+{
+ m_numTilesX = computeNumTiles(maxTextureSize, m_totalSizeX, m_borderTexels);
+ m_numTilesY = computeNumTiles(maxTextureSize, m_totalSizeY, m_borderTexels);
+}
+
+int TilingData::tileXIndexFromSrcCoord(int srcPos) const
+{
+ int x = (srcPos - m_borderTexels) / (m_maxTextureSize - 2 * m_borderTexels);
+ return min(max(x, 0), numTilesX() - 1);
+}
+
+int TilingData::tileYIndexFromSrcCoord(int srcPos) const
+{
+ int y = (srcPos - m_borderTexels) / (m_maxTextureSize - 2 * m_borderTexels);
+ return min(max(y, 0), numTilesY() - 1);
+}
+
+IntRect TilingData::tileBounds(int tile) const
+{
+ assertTile(tile);
+ int ix = tileXIndex(tile);
+ int iy = tileYIndex(tile);
+ int x = tilePositionX(ix);
+ int y = tilePositionY(iy);
+ int width = tileSizeX(ix);
+ int height = tileSizeY(iy);
+ ASSERT(x >= 0 && y >= 0 && width >= 0 && height >= 0);
+ ASSERT(x <= totalSizeX() && y <= totalSizeY());
+ return IntRect(x, y, width, height);
+}
+
+IntRect TilingData::tileBoundsWithBorder(int tile) const
+{
+ IntRect bounds = tileBounds(tile);
+
+ if (m_borderTexels) {
+ int x1 = bounds.x();
+ int x2 = bounds.right();
+ int y1 = bounds.y();
+ int y2 = bounds.bottom();
+
+ if (tileXIndex(tile) > 0)
+ x1--;
+ if (tileXIndex(tile) < (numTilesX() - 1))
+ x2++;
+ if (tileYIndex(tile) > 0)
+ y1--;
+ if (tileYIndex(tile) < (numTilesY() - 1))
+ y2++;
+
+ bounds = IntRect(x1, y1, x2 - x1, y2 - y1);
+ }
+
+ return bounds;
+}
+
+FloatRect TilingData::tileBoundsNormalized(int tile) const
+{
+ assertTile(tile);
+ FloatRect bounds(tileBounds(tile));
+ bounds.scale(1.0f / m_totalSizeX, 1.0f / m_totalSizeY);
+ return bounds;
+}
+
+int TilingData::tilePositionX(int xIndex) const
+{
+ ASSERT(xIndex >= 0 && xIndex < numTilesX());
+
+ if (!xIndex)
+ return 0;
+ return tilePositionX(xIndex - 1) + tileSizeX(xIndex - 1);
+}
+
+int TilingData::tilePositionY(int yIndex) const
+{
+ ASSERT(yIndex >= 0 && yIndex < numTilesY());
+
+ if (!yIndex)
+ return 0;
+ return tilePositionX(yIndex - 1) + tileSizeY(yIndex - 1);
+}
+
+int TilingData::tileSizeX(int xIndex) const
+{
+ ASSERT(xIndex >= 0 && xIndex < numTilesX());
+
+ int size = maxTextureSize();
+ size = min(size, totalSizeX());
+
+ if (!xIndex && m_numTilesX == 1)
+ return m_totalSizeX;
+ if (!xIndex && m_numTilesX > 1)
+ return m_maxTextureSize - m_borderTexels;
+ if (xIndex < numTilesX() - 1)
+ return m_maxTextureSize - 2 * m_borderTexels;
+ if (xIndex == numTilesX() - 1)
+ return m_totalSizeX - tilePositionX(xIndex);
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+int TilingData::tileSizeY(int yIndex) const
+{
+ ASSERT(yIndex >= 0 && yIndex < numTilesY());
+
+ int size = maxTextureSize();
+ size = min(size, totalSizeY());
+
+ if (!yIndex && m_numTilesY == 1)
+ return m_totalSizeY;
+ if (!yIndex && m_numTilesY > 1)
+ return m_maxTextureSize - m_borderTexels;
+ if (yIndex < numTilesY() - 1)
+ return m_maxTextureSize - 2 * m_borderTexels;
+ if (yIndex == numTilesY() - 1)
+ return m_totalSizeY - tilePositionY(yIndex);
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+IntRect TilingData::overlappedTileIndices(const WebCore::IntRect &srcRect) const
+{
+ int x = tileXIndexFromSrcCoord(srcRect.x());
+ int y = tileYIndexFromSrcCoord(srcRect.y());
+ int r = tileXIndexFromSrcCoord(srcRect.right());
+ int b = tileYIndexFromSrcCoord(srcRect.bottom());
+ return IntRect(x, y, r - x, b - y);
+}
+
+IntRect TilingData::overlappedTileIndices(const WebCore::FloatRect &srcRect) const
+{
+ return overlappedTileIndices(enclosingIntRect(srcRect));
+}
+
+void TilingData::intersectDrawQuad(const FloatRect& srcRect, const FloatRect& dstRect, int tile,
+ FloatRect* newSrc, FloatRect* newDst) const
+{
+ // Intersect with tile
+ FloatRect tileBounds = this->tileBounds(tile);
+ FloatRect srcRectIntersected = srcRect;
+ srcRectIntersected.intersect(tileBounds);
+
+ if (srcRectIntersected.isEmpty()) {
+ *newSrc = *newDst = FloatRect(0, 0, 0, 0);
+ return;
+ }
+
+ float srcRectIntersectedNormX = (srcRectIntersected.x() - srcRect.x()) / srcRect.width();
+ float srcRectIntersectedNormY = (srcRectIntersected.y() - srcRect.y()) / srcRect.height();
+ float srcRectIntersectedNormW = srcRectIntersected.width() / srcRect.width();
+ float srcRectIntersectedNormH = srcRectIntersected.height() / srcRect.height();
+
+ *newSrc = srcRectIntersected;
+ newSrc->move(
+ -tileBounds.x() + ((tileXIndex(tile) > 0) ? m_borderTexels : 0),
+ -tileBounds.y() + ((tileYIndex(tile) > 0) ? m_borderTexels : 0));
+
+ *newDst = FloatRect(
+ srcRectIntersectedNormX * dstRect.width() + dstRect.x(),
+ srcRectIntersectedNormY * dstRect.height() + dstRect.y(),
+ srcRectIntersectedNormW * dstRect.width(),
+ srcRectIntersectedNormH * dstRect.height());
+}
+
+}
diff --git a/WebCore/platform/graphics/chromium/TilingData.h b/WebCore/platform/graphics/chromium/TilingData.h
new file mode 100755
index 0000000..f12e66e
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/TilingData.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2010, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 TilingData_h
+#define TilingData_h
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class FloatRect;
+class IntRect;
+
+class TilingData : public Noncopyable {
+public:
+ TilingData(int maxTextureSize, int totalSizeX, int totalSizeY, bool hasBorderTexels);
+ int maxTextureSize() const { return m_maxTextureSize; }
+ int totalSizeX() const { return m_totalSizeX; }
+ int totalSizeY() const { return m_totalSizeY; }
+
+ int numTiles() const { return numTilesX() * numTilesY(); }
+ int numTilesX() const { return m_numTilesX; }
+ int numTilesY() const { return m_numTilesY; }
+ int tileIndex(int x, int y) const { return x + y * numTilesX(); }
+ int tileXIndex(int tile) const { assertTile(tile); return tile % numTilesX(); }
+ int tileYIndex(int tile) const { assertTile(tile); return tile / numTilesX(); }
+ int tileXIndexFromSrcCoord(int) const;
+ int tileYIndexFromSrcCoord(int) const;
+
+ IntRect tileBounds(int tile) const;
+ IntRect tileBoundsWithBorder(int tile) const;
+ FloatRect tileBoundsNormalized(int tile) const;
+ int tilePositionX(int xIndex) const;
+ int tilePositionY(int yIndex) const;
+ int tileSizeX(int xIndex) const;
+ int tileSizeY(int yIndex) const;
+ IntRect overlappedTileIndices(const IntRect& srcRect) const;
+ IntRect overlappedTileIndices(const FloatRect& srcRect) const;
+
+ // Given a set of source and destination coordinates for a drawing quad
+ // in texel units, returns adjusted data to render just the one tile.
+ void intersectDrawQuad(const FloatRect& srcRect, const FloatRect& dstRect, int tile, FloatRect* newSrc, FloatRect* newDst) const;
+
+private:
+ TilingData() : m_maxTextureSize(0), m_totalSizeX(0), m_totalSizeY(0) {}
+ void assertTile(int tile) const { ASSERT(tile >= 0 && tile < numTiles()); }
+
+ int m_maxTextureSize;
+ int m_totalSizeX;
+ int m_totalSizeY;
+ int m_borderTexels; // 0 or 1
+
+ // computed values:
+ int m_numTilesX;
+ int m_numTilesY;
+};
+
+}
+
+#endif // TilingData_h
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index c5ae3b9..7718066 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -164,7 +164,7 @@ void FEColorMatrix::apply(Filter* filter)
if (!filterContext)
return;
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
IntRect imageRect(IntPoint(), resultImage()->size());
PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index 18df3b2..0bafc48 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -131,26 +131,26 @@ void FEComposite::apply(Filter* filter)
FloatRect srcRect = FloatRect(0.f, 0.f, -1.f, -1.f);
switch (m_type) {
case FECOMPOSITE_OPERATOR_OVER:
- filterContext->drawImage(m_in2->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
break;
case FECOMPOSITE_OPERATOR_IN:
filterContext->save();
- filterContext->clipToImageBuffer(calculateDrawingRect(m_in2->scaledSubRegion()), m_in2->resultImage());
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->clipToImageBuffer(m_in->resultImage(), calculateDrawingRect(m_in2->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
filterContext->restore();
break;
case FECOMPOSITE_OPERATOR_OUT:
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
- filterContext->drawImage(m_in2->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()), srcRect, CompositeDestinationOut);
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()), srcRect, CompositeDestinationOut);
break;
case FECOMPOSITE_OPERATOR_ATOP:
- filterContext->drawImage(m_in2->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()), srcRect, CompositeSourceAtop);
+ filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()), srcRect, CompositeSourceAtop);
break;
case FECOMPOSITE_OPERATOR_XOR:
- filterContext->drawImage(m_in2->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()), srcRect, CompositeXOR);
+ filterContext->drawImageBuffer(m_in2->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in2->scaledSubRegion()));
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, calculateDrawingRect(m_in->scaledSubRegion()), srcRect, CompositeXOR);
break;
case FECOMPOSITE_OPERATOR_ARITHMETIC: {
IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index 61aea90..70465a0 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -3,6 +3,7 @@
2004, 2005 Rob Buis <buis@kde.org>
2005 Eric Seidel <eric@webkit.org>
2009 Dirk Schulze <krit@webkit.org>
+ 2010 Igalia, S.L.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -29,18 +30,19 @@
#include "Filter.h"
#include "GraphicsContext.h"
#include "ImageData.h"
-#include <math.h>
#include <wtf/MathExtras.h>
using std::max;
+static const float gGaussianKernelFactor = (3 * sqrtf(2 * piFloat) / 4.f);
+
namespace WebCore {
FEGaussianBlur::FEGaussianBlur(FilterEffect* in, const float& x, const float& y)
: FilterEffect()
, m_in(in)
- , m_x(x)
- , m_y(y)
+ , m_stdX(x)
+ , m_stdY(y)
{
}
@@ -51,30 +53,27 @@ PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(FilterEffect* in, const float&
float FEGaussianBlur::stdDeviationX() const
{
- return m_x;
+ return m_stdX;
}
void FEGaussianBlur::setStdDeviationX(float x)
{
- m_x = x;
+ m_stdX = x;
}
float FEGaussianBlur::stdDeviationY() const
{
- return m_y;
+ return m_stdY;
}
void FEGaussianBlur::setStdDeviationY(float y)
{
- m_y = y;
+ m_stdY = y;
}
static void boxBlur(CanvasPixelArray*& srcPixelArray, CanvasPixelArray*& dstPixelArray,
- unsigned dx, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
+ unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
{
- int dxLeft = dx / 2;
- int dxRight = dx - dxLeft;
-
for (int y = 0; y < effectHeight; ++y) {
int line = y * strideLine;
for (int channel = 3; channel >= 0; --channel) {
@@ -99,6 +98,34 @@ static void boxBlur(CanvasPixelArray*& srcPixelArray, CanvasPixelArray*& dstPixe
}
}
+void FEGaussianBlur::kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight)
+{
+ // check http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement for details
+ switch (boxBlur) {
+ case 0:
+ if (!(std % 2)) {
+ dLeft = std / 2 - 1;
+ dRight = std - dLeft;
+ } else {
+ dLeft = std / 2;
+ dRight = std - dLeft;
+ }
+ break;
+ case 1:
+ if (!(std % 2)) {
+ dLeft++;
+ dRight--;
+ }
+ break;
+ case 2:
+ if (!(std % 2)) {
+ dRight++;
+ std++;
+ }
+ break;
+ }
+}
+
void FEGaussianBlur::apply(Filter* filter)
{
m_in->apply(filter);
@@ -110,26 +137,50 @@ void FEGaussianBlur::apply(Filter* filter)
setIsAlphaImage(m_in->isAlphaImage());
- if (m_x == 0 || m_y == 0)
+ IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
+ RefPtr<ImageData> srcImageData(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect));
+ IntRect imageRect(IntPoint(), resultImage()->size());
+
+ if (!m_stdX && !m_stdY) {
+ resultImage()->putPremultipliedImageData(srcImageData.get(), imageRect, IntPoint());
return;
+ }
- unsigned sdx = static_cast<unsigned>(floor(m_x * filter->filterResolution().width() * 3 * sqrt(2 * piDouble) / 4.f + 0.5f));
- unsigned sdy = static_cast<unsigned>(floor(m_y * filter->filterResolution().height() * 3 * sqrt(2 * piDouble) / 4.f + 0.5f));
- sdx = max(sdx, static_cast<unsigned>(1));
- sdy = max(sdy, static_cast<unsigned>(1));
+ unsigned kernelSizeX = 0;
+ if (m_stdX)
+ kernelSizeX = max(2U, static_cast<unsigned>(floor(m_stdX * filter->filterResolution().width() * gGaussianKernelFactor + 0.5f)));
- IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
- RefPtr<ImageData> srcImageData(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect));
- CanvasPixelArray* srcPixelArray(srcImageData->data());
+ unsigned kernelSizeY = 0;
+ if (m_stdY)
+ kernelSizeY = max(2U, static_cast<unsigned>(floor(m_stdY * filter->filterResolution().height() * gGaussianKernelFactor + 0.5f)));
- IntRect imageRect(IntPoint(), resultImage()->size());
+ CanvasPixelArray* srcPixelArray(srcImageData->data());
RefPtr<ImageData> tmpImageData = ImageData::create(imageRect.width(), imageRect.height());
CanvasPixelArray* tmpPixelArray(tmpImageData->data());
int stride = 4 * imageRect.width();
+ int dxLeft = 0;
+ int dxRight = 0;
+ int dyLeft = 0;
+ int dyRight = 0;
for (int i = 0; i < 3; ++i) {
- boxBlur(srcPixelArray, tmpPixelArray, sdx, 4, stride, imageRect.width(), imageRect.height(), isAlphaImage());
- boxBlur(tmpPixelArray, srcPixelArray, sdy, stride, 4, imageRect.height(), imageRect.width(), isAlphaImage());
+ if (kernelSizeX) {
+ kernelPosition(i, kernelSizeX, dxLeft, dxRight);
+ boxBlur(srcPixelArray, tmpPixelArray, kernelSizeX, dxLeft, dxRight, 4, stride, imageRect.width(), imageRect.height(), isAlphaImage());
+ } else {
+ CanvasPixelArray* auxPixelArray = tmpPixelArray;
+ tmpPixelArray = srcPixelArray;
+ srcPixelArray = auxPixelArray;
+ }
+
+ if (kernelSizeY) {
+ kernelPosition(i, kernelSizeY, dyLeft, dyRight);
+ boxBlur(tmpPixelArray, srcPixelArray, kernelSizeY, dyLeft, dyRight, stride, 4, imageRect.height(), imageRect.width(), isAlphaImage());
+ } else {
+ CanvasPixelArray* auxPixelArray = tmpPixelArray;
+ tmpPixelArray = srcPixelArray;
+ srcPixelArray = auxPixelArray;
+ }
}
resultImage()->putPremultipliedImageData(srcImageData.get(), imageRect, IntPoint());
@@ -144,7 +195,7 @@ TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, int indent) c
writeIndent(ts, indent);
ts << "[feGaussianBlur";
FilterEffect::externalRepresentation(ts);
- ts << " stdDeviation=\"" << m_x << ", " << m_y << "\"]\n";
+ ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
m_in->externalRepresentation(ts, indent + 1);
return ts;
}
diff --git a/WebCore/platform/graphics/filters/FEGaussianBlur.h b/WebCore/platform/graphics/filters/FEGaussianBlur.h
index bcc030e..4c7c43c 100644
--- a/WebCore/platform/graphics/filters/FEGaussianBlur.h
+++ b/WebCore/platform/graphics/filters/FEGaussianBlur.h
@@ -45,10 +45,11 @@ public:
private:
FEGaussianBlur(FilterEffect*, const float&, const float&);
+ static void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
RefPtr<FilterEffect> m_in;
- float m_x;
- float m_y;
+ float m_stdX;
+ float m_stdY;
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/filters/Filter.h b/WebCore/platform/graphics/filters/Filter.h
index 8924b94..16d499f 100644
--- a/WebCore/platform/graphics/filters/Filter.h
+++ b/WebCore/platform/graphics/filters/Filter.h
@@ -24,11 +24,11 @@
#include "FloatRect.h"
#include "FloatSize.h"
#include "ImageBuffer.h"
-#include "StringHash.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.cpp b/WebCore/platform/graphics/filters/SourceAlpha.cpp
index eb23814..37b0023 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.cpp
+++ b/WebCore/platform/graphics/filters/SourceAlpha.cpp
@@ -63,9 +63,9 @@ void SourceAlpha::apply(Filter* filter)
setIsAlphaImage(true);
- FloatRect imageRect(FloatPoint(), filter->sourceImage()->image()->size());
+ FloatRect imageRect(FloatPoint(), filter->sourceImage()->size());
filterContext->save();
- filterContext->clipToImageBuffer(imageRect, filter->sourceImage());
+ filterContext->clipToImageBuffer(filter->sourceImage(), imageRect);
filterContext->fillRect(imageRect, Color::black, DeviceColorSpace);
filterContext->restore();
}
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.cpp b/WebCore/platform/graphics/filters/SourceGraphic.cpp
index a1864d6..5730d34 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.cpp
+++ b/WebCore/platform/graphics/filters/SourceGraphic.cpp
@@ -60,7 +60,7 @@ void SourceGraphic::apply(Filter* filter)
if (!filterContext)
return;
- filterContext->drawImage(filter->sourceImage()->image(), DeviceColorSpace, IntPoint());
+ filterContext->drawImageBuffer(filter->sourceImage(), DeviceColorSpace, IntPoint());
}
void SourceGraphic::dump()
diff --git a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
index d3b5f1b..1059b59 100644
--- a/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -780,9 +780,13 @@ void StreamingClient::didFail(ResourceHandle*, const ResourceError& error)
void StreamingClient::wasBlocked(ResourceHandle*)
{
+ GST_ERROR_OBJECT(m_src, "Request was blocked");
+ GST_ELEMENT_ERROR(m_src, RESOURCE, OPEN_READ, ("Access to \"%s\" was blocked", m_src->priv->uri), (0));
}
void StreamingClient::cannotShowURL(ResourceHandle*)
{
+ GST_ERROR_OBJECT(m_src, "Cannot show URL");
+ GST_ELEMENT_ERROR(m_src, RESOURCE, OPEN_READ, ("Can't show \"%s\"", m_src->priv->uri), (0));
}
diff --git a/WebCore/platform/graphics/gtk/ImageGtk.cpp b/WebCore/platform/graphics/gtk/ImageGtk.cpp
index 30db6d7..5272243 100644
--- a/WebCore/platform/graphics/gtk/ImageGtk.cpp
+++ b/WebCore/platform/graphics/gtk/ImageGtk.cpp
@@ -27,81 +27,60 @@
#include "BitmapImage.h"
#include "CairoUtilities.h"
-#include "GOwnPtr.h"
+#include "GOwnPtrGtk.h"
#include "SharedBuffer.h"
#include <wtf/text/CString.h>
#include <cairo.h>
#include <gtk/gtk.h>
-#ifdef _WIN32
-# include <mbstring.h>
-# include <shlobj.h>
-/* search for data relative to where we are installed */
+#if PLATFORM(WIN)
+#include <mbstring.h>
+#include <shlobj.h>
static HMODULE hmodule;
-#ifdef __cplusplus
extern "C" {
-#endif
-BOOL WINAPI
-DllMain(HINSTANCE hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
- switch (fdwReason) {
- case DLL_PROCESS_ATTACH:
+ if (fdwReason == DLL_PROCESS_ATTACH)
hmodule = hinstDLL;
- break;
- }
-
return TRUE;
}
-#ifdef __cplusplus
}
-#endif
-static char *
-get_webkit_datadir(void)
+static const char* getWebKitDataDirectory()
{
- static char retval[1000];
- static int beenhere = 0;
-
- unsigned char *p;
-
- if (beenhere)
- return retval;
+ static char* dataDirectory = 0;
+ if (dataDirectory)
+ return dataDirectory;
- if (!GetModuleFileName (hmodule, (CHAR *) retval, sizeof(retval) - 10))
+ dataDirectory = new char[PATH_MAX];
+ if (!GetModuleFileName(hmodule, static_cast<CHAR*>(dataDirectory), sizeof(dataDirectory) - 10))
return DATA_DIR;
- p = _mbsrchr((const unsigned char *) retval, '\\');
+ // FIXME: This is pretty ugly. Ideally we should be using Windows API
+ // functions or GLib methods to calculate paths.
+ unsigned char *p;
+ p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
*p = '\0';
- p = _mbsrchr((const unsigned char *) retval, '\\');
+ p = _mbsrchr(static_cast<const unsigned char *>(dataDirectory), '\\');
if (p) {
if (!stricmp((const char *) (p+1), "bin"))
*p = '\0';
}
- strcat(retval, "\\share");
-
- beenhere = 1;
+ strcat(dataDirectory, "\\share");
- return retval;
+ return dataDirectory;
}
-#undef DATA_DIR
-#define DATA_DIR get_webkit_datadir ()
-#endif
-
+#else
-namespace WTF {
-
-template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo* info)
+static const char* getWebKitDataDirectory()
{
- if (info)
- gtk_icon_info_free(info);
+ return DATA_DIR;
}
-}
+#endif
namespace WebCore {
@@ -158,11 +137,9 @@ PassRefPtr<Image> Image::loadPlatformResource(const char* name)
if (!strcmp("missingImage", name))
fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
if (fileName.isNull()) {
- gchar* imagename = g_strdup_printf("%s.png", name);
- gchar* glibFileName = g_build_filename(DATA_DIR, "webkit-1.0", "images", imagename, NULL);
- fileName = glibFileName;
- g_free(imagename);
- g_free(glibFileName);
+ GOwnPtr<gchar> imageName(g_strdup_printf("%s.png", name));
+ GOwnPtr<gchar> glibFileName(g_build_filename(getWebKitDataDirectory(), "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", imageName.get(), NULL));
+ fileName = glibFileName.get();
}
return loadImageFromFile(fileName);
diff --git a/WebCore/platform/graphics/mac/FontPlatformData.h b/WebCore/platform/graphics/mac/FontPlatformData.h
index 07ae4f8..dc876a8 100644
--- a/WebCore/platform/graphics/mac/FontPlatformData.h
+++ b/WebCore/platform/graphics/mac/FontPlatformData.h
@@ -24,7 +24,7 @@
#ifndef FontPlatformData_h
#define FontPlatformData_h
-#include "StringImpl.h"
+#include <wtf/text/StringImpl.h>
#ifdef __OBJC__
@class NSFont;
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index fd503fc..be1d278 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -31,6 +31,7 @@
#import "BlockExceptions.h"
+#include "ANGLE/ResourceLimits.h"
#include "ArrayBuffer.h"
#include "ArrayBufferView.h"
#include "WebGLObject.h"
@@ -181,6 +182,30 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi
::glGenRenderbuffersEXT(1, &m_multisampleDepthStencilBuffer);
}
+ // ANGLE initialization.
+
+ TBuiltInResource ANGLEResources;
+
+ ANGLEResources.maxVertexAttribs = 0;
+ getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.maxVertexAttribs);
+ ANGLEResources.maxVertexUniformVectors = 0;
+ getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &ANGLEResources.maxVertexUniformVectors);
+ ANGLEResources.maxVaryingVectors = 0;
+ getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &ANGLEResources.maxVaryingVectors);
+ ANGLEResources.maxVertexTextureImageUnits = 0;
+ getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &ANGLEResources.maxVertexTextureImageUnits);
+ ANGLEResources.maxCombinedTextureImageUnits = 0;
+ getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &ANGLEResources.maxCombinedTextureImageUnits);
+ ANGLEResources.maxTextureImageUnits = 0;
+ getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &ANGLEResources.maxTextureImageUnits);
+ ANGLEResources.maxFragmentUniformVectors = 0;
+ getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &ANGLEResources.maxFragmentUniformVectors);
+
+ // Always set to 1 for OpenGL ES.
+ ANGLEResources.maxDrawBuffers = 1;
+
+ m_compiler.setResources(ANGLEResources);
+
::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
::glClearColor(0, 0, 0, 0);
}
@@ -282,15 +307,6 @@ void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* co
canvas->width(), canvas->height(), imageBuffer->context()->platformContext());
}
-void GraphicsContext3D::beginPaint(CanvasRenderingContext* context)
-{
- UNUSED_PARAM(context);
-}
-
-void GraphicsContext3D::endPaint()
-{
-}
-
bool GraphicsContext3D::isGLES2Compliant() const
{
return false;
@@ -617,7 +633,52 @@ void GraphicsContext3D::compileShader(Platform3DObject shader)
{
ASSERT(shader);
ensureContext(m_contextObj);
+
+ int GLshaderType;
+ ANGLEShaderType shaderType;
+
+ glGetShaderiv(shader, SHADER_TYPE, &GLshaderType);
+
+ if (GLshaderType == VERTEX_SHADER)
+ shaderType = SHADER_TYPE_VERTEX;
+ else if (GLshaderType == FRAGMENT_SHADER)
+ shaderType = SHADER_TYPE_FRAGMENT;
+ else
+ return; // Invalid shader type.
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ if (result == m_shaderSourceMap.end())
+ return;
+
+ ShaderSourceEntry& entry = result->second;
+
+ String translatedShaderSource;
+ String shaderInfoLog;
+
+ bool isValid = m_compiler.validateShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog);
+
+ entry.log = shaderInfoLog;
+ entry.isValid = isValid;
+
+ if (!isValid)
+ return; // Shader didn't validate, don't move forward with compiling translated source
+
+ int translatedShaderLength = translatedShaderSource.length();
+
+ const CString& translatedShaderCString = translatedShaderSource.utf8();
+ const char* translatedShaderPtr = translatedShaderCString.data();
+
+ ::glShaderSource((GLuint) shader, 1, &translatedShaderPtr, &translatedShaderLength);
+
::glCompileShader((GLuint) shader);
+
+ int GLCompileSuccess;
+
+ ::glGetShaderiv((GLuint) shader, COMPILE_STATUS, &GLCompileSuccess);
+
+ // ASSERT that ANGLE generated GLSL will be accepted by OpenGL
+ ASSERT(GLCompileSuccess == GL_TRUE);
}
void GraphicsContext3D::copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border)
@@ -998,11 +1059,12 @@ void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& stri
ASSERT(shader);
ensureContext(m_contextObj);
- const CString& cs = string.utf8();
- const char* s = cs.data();
-
- int length = string.length();
- ::glShaderSource((GLuint) shader, 1, &s, &length);
+
+ ShaderSourceEntry entry;
+
+ entry.source = string;
+
+ m_shaderSourceMap.set(shader, entry);
}
void GraphicsContext3D::stencilFunc(unsigned long func, long ref, unsigned long mask)
@@ -1346,26 +1408,77 @@ void GraphicsContext3D::getShaderiv(Platform3DObject shader, unsigned long pname
ASSERT(shader);
ensureContext(m_contextObj);
- ::glGetShaderiv((GLuint) shader, pname, value);
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ switch (pname) {
+ case DELETE_STATUS:
+ case SHADER_TYPE:
+ // Let OpenGL handle these.
+
+ ::glGetShaderiv((GLuint) shader, pname, value);
+ break;
+
+ case COMPILE_STATUS:
+ if (result == m_shaderSourceMap.end()) {
+ (*value) = static_cast<int>(false);
+ return;
+ }
+
+ (*value) = static_cast<int>(result->second.isValid);
+ break;
+
+ case INFO_LOG_LENGTH:
+ if (result == m_shaderSourceMap.end()) {
+ (*value) = 0;
+ return;
+ }
+
+ (*value) = getShaderInfoLog(shader).length();
+ break;
+
+ case SHADER_SOURCE_LENGTH:
+ (*value) = getShaderSource(shader).length();
+ break;
+
+ default:
+ synthesizeGLError(INVALID_ENUM);
+ }
}
String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
{
ASSERT(shader);
-
+
ensureContext(m_contextObj);
GLint length;
::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
-
- GLsizei size;
- GLchar* info = (GLchar*) fastMalloc(length);
- if (!info)
- return "";
-
- ::glGetShaderInfoLog((GLuint) shader, length, &size, info);
- String s(info);
- fastFree(info);
- return s;
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ if (result == m_shaderSourceMap.end())
+ return "";
+
+ ShaderSourceEntry entry = result->second;
+
+ if (entry.isValid) {
+ GLint length;
+ ::glGetShaderiv((GLuint) shader, GL_INFO_LOG_LENGTH, &length);
+
+ GLsizei size;
+ GLchar* info = (GLchar*) fastMalloc(length);
+ if (!info)
+ return "";
+
+ ::glGetShaderInfoLog((GLuint) shader, length, &size, info);
+
+ String s(info);
+ fastFree(info);
+ return s;
+ }
+ else {
+ return entry.log;
+ }
}
String GraphicsContext3D::getShaderSource(Platform3DObject shader)
@@ -1373,18 +1486,13 @@ String GraphicsContext3D::getShaderSource(Platform3DObject shader)
ASSERT(shader);
ensureContext(m_contextObj);
- GLint length;
- ::glGetShaderiv((GLuint) shader, GL_SHADER_SOURCE_LENGTH, &length);
-
- GLsizei size;
- GLchar* info = (GLchar*) fastMalloc(length);
- if (!info)
+
+ HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
+
+ if (result == m_shaderSourceMap.end())
return "";
-
- ::glGetShaderSource((GLuint) shader, length, &size, info);
- String s(info);
- fastFree(info);
- return s;
+
+ return result->second.source;
}
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
index ee70338..a9f747a 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
@@ -29,11 +29,11 @@
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayer.h"
-#include "StringHash.h"
#include "WebLayer.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/RetainPtr.h>
+#include <wtf/text/StringHash.h>
@class CABasicAnimation;
@class CAKeyframeAnimation;
diff --git a/WebCore/platform/graphics/qt/ContextShadow.cpp b/WebCore/platform/graphics/qt/ContextShadow.cpp
new file mode 100644
index 0000000..0511218
--- /dev/null
+++ b/WebCore/platform/graphics/qt/ContextShadow.cpp
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2010 Sencha, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContextShadow.h"
+
+namespace WebCore {
+
+ContextShadow::ContextShadow()
+ : type(NoShadow)
+ , blurRadius(0)
+{
+}
+
+ContextShadow::ContextShadow(const QColor& c, float r, qreal dx, qreal dy)
+ : color(c)
+ , blurRadius(qRound(r))
+ , offset(dx, dy)
+{
+ // The type of shadow is decided by the blur radius, shadow offset, and shadow color.
+ if (!color.isValid() || !color.alpha()) {
+ // Can't paint the shadow with invalid or invisible color.
+ type = NoShadow;
+ } else if (r > 0) {
+ // Shadow is always blurred, even the offset is zero.
+ type = BlurShadow;
+ } else if (offset.isNull()) {
+ // Without blur and zero offset means the shadow is fully hidden.
+ type = NoShadow;
+ } else {
+ if (color.alpha() > 0)
+ type = AlphaSolidShadow;
+ else
+ type = OpaqueSolidShadow;
+ }
+}
+
+void ContextShadow::clear()
+{
+ type = NoShadow;
+ color = QColor();
+ blurRadius = 0;
+ offset = QPointF(0, 0);
+}
+
+// Instead of integer division, we use 18.14 for fixed-point division.
+static const int BlurSumShift = 14;
+
+// Note: image must be RGB32 format
+static void blurHorizontal(QImage& image, int radius, bool swap = false)
+{
+ Q_ASSERT(image.format() == QImage::Format_ARGB32_Premultiplied);
+
+ // See comments in http://webkit.org/b/40793, it seems sensible
+ // to follow Skia's limit of 128 pixels of blur radius
+ radius = qMin(128, radius);
+
+ int imgWidth = image.width();
+ int imgHeight = image.height();
+
+ // Check http://www.w3.org/TR/SVG/filters.html#feGaussianBlur
+ // for the approaches when the box-blur radius is even vs odd.
+ int dmax = radius >> 1;
+ int dmin = qMax(0, dmax - 1 + (radius & 1));
+
+ for (int y = 0; y < imgHeight; ++y) {
+
+ unsigned char* pixels = image.scanLine(y);
+
+ int left;
+ int right;
+ int pixelCount;
+ int prev;
+ int next;
+ int firstAlpha;
+ int lastAlpha;
+ int totalAlpha;
+ unsigned char* target;
+ unsigned char* prevPtr;
+ unsigned char* nextPtr;
+
+ int invCount;
+
+ static const int alphaChannel = 3;
+ static const int blueChannel = 0;
+ static const int greenChannel = 1;
+
+ // For each step, we use sliding window algorithm. This is much more
+ // efficient than computing the sum of each pixels covered by the box
+ // kernel size for each x.
+
+ // As noted in the SVG filter specification, running box blur 3x
+ // approximates a real gaussian blur nicely.
+
+ // Step 1: blur alpha channel and store the result in the blue channel.
+ left = swap ? dmax : dmin;
+ right = swap ? dmin : dmax;
+ pixelCount = left + 1 + right;
+ invCount = (1 << BlurSumShift) / pixelCount;
+ prev = -left;
+ next = 1 + right;
+ firstAlpha = pixels[alphaChannel];
+ lastAlpha = pixels[(imgWidth - 1) * 4 + alphaChannel];
+ totalAlpha = 0;
+ for (int i = 0; i < pixelCount; ++i)
+ totalAlpha += pixels[qBound(0, i - left, imgWidth - 1) * 4 + alphaChannel];
+ target = pixels + blueChannel;
+ prevPtr = pixels + prev * 4 + alphaChannel;
+ nextPtr = pixels + next * 4 + alphaChannel;
+ for (int x = 0; x < imgWidth; ++x, ++prev, ++next, target += 4, prevPtr += 4, nextPtr += 4) {
+ *target = (totalAlpha * invCount) >> BlurSumShift;
+ int delta = ((next < imgWidth) ? *nextPtr : lastAlpha) -
+ ((prev > 0) ? *prevPtr : firstAlpha);
+ totalAlpha += delta;
+ }
+
+ // Step 2: blur blue channel and store the result in the green channel.
+ left = swap ? dmin : dmax;
+ right = swap ? dmax : dmin;
+ pixelCount = left + 1 + right;
+ invCount = (1 << BlurSumShift) / pixelCount;
+ prev = -left;
+ next = 1 + right;
+ firstAlpha = pixels[blueChannel];
+ lastAlpha = pixels[(imgWidth - 1) * 4 + blueChannel];
+ totalAlpha = 0;
+ for (int i = 0; i < pixelCount; ++i)
+ totalAlpha += pixels[qBound(0, i - left, imgWidth - 1) * 4 + blueChannel];
+ target = pixels + greenChannel;
+ prevPtr = pixels + prev * 4 + blueChannel;
+ nextPtr = pixels + next * 4 + blueChannel;
+ for (int x = 0; x < imgWidth; ++x, ++prev, ++next, target += 4, prevPtr += 4, nextPtr += 4) {
+ *target = (totalAlpha * invCount) >> BlurSumShift;
+ int delta = ((next < imgWidth) ? *nextPtr : lastAlpha) -
+ ((prev > 0) ? *prevPtr : firstAlpha);
+ totalAlpha += delta;
+ }
+
+ // Step 3: blur green channel and store the result in the alpha channel.
+ left = dmax;
+ right = dmax;
+ pixelCount = left + 1 + right;
+ invCount = (1 << BlurSumShift) / pixelCount;
+ prev = -left;
+ next = 1 + right;
+ firstAlpha = pixels[greenChannel];
+ lastAlpha = pixels[(imgWidth - 1) * 4 + greenChannel];
+ totalAlpha = 0;
+ for (int i = 0; i < pixelCount; ++i)
+ totalAlpha += pixels[qBound(0, i - left, imgWidth - 1) * 4 + greenChannel];
+ target = pixels + alphaChannel;
+ prevPtr = pixels + prev * 4 + greenChannel;
+ nextPtr = pixels + next * 4 + greenChannel;
+ for (int x = 0; x < imgWidth; ++x, ++prev, ++next, target += 4, prevPtr += 4, nextPtr += 4) {
+ *target = (totalAlpha * invCount) >> BlurSumShift;
+ int delta = ((next < imgWidth) ? *nextPtr : lastAlpha) -
+ ((prev > 0) ? *prevPtr : firstAlpha);
+ totalAlpha += delta;
+ }
+ }
+}
+
+static void shadowBlur(QImage& image, int radius, const QColor& shadowColor)
+{
+ blurHorizontal(image, radius);
+
+ QTransform transform;
+ transform.rotate(90);
+ image = image.transformed(transform);
+ blurHorizontal(image, radius, true);
+ transform.reset();
+ transform.rotate(270);
+ image = image.transformed(transform);
+
+ // "Colorize" with the right shadow color.
+ QPainter p(&image);
+ p.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ p.fillRect(image.rect(), shadowColor.rgb());
+ p.end();
+}
+
+void ContextShadow::drawShadowRect(QPainter* p, const QRectF& rect)
+{
+ if (type == NoShadow)
+ return;
+
+ if (type == BlurShadow) {
+ QRectF shadowRect = rect.translated(offset);
+
+ // We expand the area by the blur radius * 2 to give extra space
+ // for the blur transition.
+ int extra = blurRadius * 2;
+ QRectF bufferRect = shadowRect.adjusted(-extra, -extra, extra, extra);
+ QRect alignedBufferRect = bufferRect.toAlignedRect();
+
+ QRect clipRect;
+ if (p->hasClipping())
+ clipRect = p->clipRegion().boundingRect();
+ else
+ clipRect = p->transform().inverted().mapRect(p->window());
+
+ if (!clipRect.contains(alignedBufferRect)) {
+
+ // No need to have the buffer larger that the clip.
+ alignedBufferRect = alignedBufferRect.intersected(clipRect);
+ if (alignedBufferRect.isEmpty())
+ return;
+
+ // We adjust again because the pixels at the borders are still
+ // potentially affected by the pixels outside the buffer.
+ alignedBufferRect.adjust(-extra, -extra, extra, extra);
+ }
+
+ QImage shadowImage(alignedBufferRect.size(), QImage::Format_ARGB32_Premultiplied);
+ shadowImage.fill(Qt::transparent);
+ QPainter shadowPainter(&shadowImage);
+
+ shadowPainter.fillRect(shadowRect.translated(-alignedBufferRect.topLeft()), color);
+ shadowPainter.end();
+
+ shadowBlur(shadowImage, blurRadius, color);
+
+ p->drawImage(alignedBufferRect.topLeft(), shadowImage);
+
+ return;
+ }
+
+ p->fillRect(rect.translated(offset), color);
+}
+
+
+}
diff --git a/WebCore/platform/graphics/qt/ContextShadow.h b/WebCore/platform/graphics/qt/ContextShadow.h
new file mode 100644
index 0000000..e114ebc
--- /dev/null
+++ b/WebCore/platform/graphics/qt/ContextShadow.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Sencha, Inc.
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ContextShadow_h
+#define ContextShadow_h
+
+#include <QPainter>
+
+namespace WebCore {
+
+// This is to track and keep the shadow state. We use this rather than
+// using GraphicsContextState to allow possible optimizations (right now
+// only to determine the shadow type, but in future it might covers things
+// like cached scratch image, persistent shader, etc).
+
+// This class should be copyable since GraphicsContextQt keeps a stack of
+// the shadow state for savePlatformState and restorePlatformState.
+
+class ContextShadow {
+public:
+ enum {
+ NoShadow,
+ OpaqueSolidShadow,
+ AlphaSolidShadow,
+ BlurShadow
+ } type;
+
+ QColor color;
+ int blurRadius;
+ QPointF offset;
+
+ ContextShadow();
+ ContextShadow(const QColor& c, float r, qreal dx, qreal dy);
+
+ void clear();
+
+ // Draws the shadow for colored rectangle (can't be filled with pattern
+ // or gradient) according to the shadow parameters.
+ // Note: 'rect' specifies the rectangle which casts the shadow,
+ // NOT the bounding box of the shadow.
+ void drawShadowRect(QPainter* p, const QRectF& rect);
+
+};
+
+} // namespace WebCore
+
+#endif // ContextShadow_h
diff --git a/WebCore/platform/graphics/qt/FontCacheQt.cpp b/WebCore/platform/graphics/qt/FontCacheQt.cpp
index bfcc5c3..c59c523 100644
--- a/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -29,10 +29,10 @@
#include "FontPlatformData.h"
#include "Font.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <utility>
#include <wtf/ListHashSet.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#include <QFont>
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 273e2dd..d5e7b3f 100644
--- a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -512,15 +512,6 @@ void GraphicsContext3D::makeContextCurrent()
m_internal->m_glWidget->makeCurrent();
}
-void GraphicsContext3D::beginPaint(CanvasRenderingContext* context)
-{
- paintRenderingResultsToCanvas();
-}
-
-void GraphicsContext3D::endPaint()
-{
-}
-
void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context)
{
m_internal->m_glWidget->makeCurrent();
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index d4a145f..1632804 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -8,6 +8,7 @@
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2008 Dirk Schulze <vbs85@gmx.de>
+ * Copyright (C) 2010 Sencha, Inc.
*
* All rights reserved.
*
@@ -42,6 +43,7 @@
#include "AffineTransform.h"
#include "Color.h"
+#include "ContextShadow.h"
#include "FloatConversion.h"
#include "Font.h"
#include "GraphicsContextPrivate.h"
@@ -50,6 +52,7 @@
#include "Path.h"
#include "Pattern.h"
#include "Pen.h"
+#include "TransparencyLayer.h"
#include <QBrush>
#include <QDebug>
@@ -166,48 +169,6 @@ static inline Qt::FillRule toQtFillRule(WindRule rule)
return Qt::OddEvenFill;
}
-struct TransparencyLayer : FastAllocBase {
- TransparencyLayer(const QPainter* p, const QRect &rect, qreal opacity, QPixmap& alphaMask)
- : pixmap(rect.width(), rect.height())
- , opacity(opacity)
- , alphaMask(alphaMask)
- , saveCounter(1) // see the comment for saveCounter
- {
- offset = rect.topLeft();
- pixmap.fill(Qt::transparent);
- painter.begin(&pixmap);
- painter.setRenderHint(QPainter::Antialiasing, p->testRenderHint(QPainter::Antialiasing));
- painter.translate(-offset);
- painter.setPen(p->pen());
- painter.setBrush(p->brush());
- painter.setTransform(p->transform(), true);
- painter.setOpacity(p->opacity());
- painter.setFont(p->font());
- if (painter.paintEngine()->hasFeature(QPaintEngine::PorterDuff))
- painter.setCompositionMode(p->compositionMode());
- // if the path is an empty region, this assignment disables all painting
- if (!p->clipPath().isEmpty())
- painter.setClipPath(p->clipPath());
- }
-
- TransparencyLayer()
- {
- }
-
- QPixmap pixmap;
- QPoint offset;
- QPainter painter;
- qreal opacity;
- // for clipToImageBuffer
- QPixmap alphaMask;
- // saveCounter is only used in combination with alphaMask
- // otherwise, its value is unspecified
- int saveCounter;
-private:
- TransparencyLayer(const TransparencyLayer &) {}
- TransparencyLayer & operator=(const TransparencyLayer &) { return *this; }
-};
-
class GraphicsContextPlatformPrivate : public Noncopyable {
public:
GraphicsContextPlatformPrivate(QPainter* painter);
@@ -240,6 +201,14 @@ public:
// Only used by SVG for now.
QPainterPath currentPath;
+ ContextShadow shadow;
+ QStack<ContextShadow> shadowStack;
+
+ bool hasShadow() const
+ {
+ return shadow.type != ContextShadow::NoShadow;
+ }
+
private:
QPainter* painter;
};
@@ -307,6 +276,7 @@ void GraphicsContext::savePlatformState()
if (!m_data->layers.isEmpty() && !m_data->layers.top()->alphaMask.isNull())
++m_data->layers.top()->saveCounter;
m_data->p()->save();
+ m_data->shadowStack.push(m_data->shadow);
}
void GraphicsContext::restorePlatformState()
@@ -321,9 +291,16 @@ void GraphicsContext::restorePlatformState()
QTransform matrix = m_common->state.pathTransform;
m_data->currentPath = m_data->currentPath * matrix;
}
+
+ if (m_data->shadowStack.isEmpty())
+ m_data->shadow = ContextShadow();
+ else
+ m_data->shadow = m_data->shadowStack.pop();
}
// Draws a filled rectangle with a stroked border.
+// This is only used to draw borders (real fill is done via fillRect), and
+// thus it must not cast any shadow.
void GraphicsContext::drawRect(const IntRect& rect)
{
if (paintingDisabled())
@@ -333,24 +310,13 @@ void GraphicsContext::drawRect(const IntRect& rect)
const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
- if (m_common->state.shadowColor.isValid()) {
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (getShadow(shadowSize, shadowBlur, shadowColor)) {
- IntRect shadowRect = rect;
- shadowRect.move(shadowSize.width(), shadowSize.height());
- shadowRect.inflate(static_cast<int>(p->pen().widthF()));
- p->fillRect(shadowRect, QColor(shadowColor));
- }
- }
-
p->drawRect(rect);
p->setRenderHint(QPainter::Antialiasing, antiAlias);
}
// This is only used to draw borders.
+// Must not cast any shadow.
void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
{
if (paintingDisabled())
@@ -372,17 +338,6 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
adjustLineToPixelBoundaries(p1, p2, width, style);
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (textDrawingMode() == cTextFill && getShadow(shadowSize, shadowBlur, shadowColor)) {
- p->save();
- p->translate(shadowSize.width(), shadowSize.height());
- p->setPen(shadowColor);
- p->drawLine(p1, p2);
- p->restore();
- }
-
int patWidth = 0;
switch (style) {
case NoStroke:
@@ -474,16 +429,14 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
p->setRenderHint(QPainter::Antialiasing, true);
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
startAngle *= 16;
angleSpan *= 16;
- if (getShadow(shadowSize, shadowBlur, shadowColor)) {
+
+ if (m_data->hasShadow()) {
p->save();
- p->translate(shadowSize.width(), shadowSize.height());
+ p->translate(m_data->shadow.offset);
QPen pen(p->pen());
- pen.setColor(shadowColor);
+ pen.setColor(m_data->shadow.color);
p->setPen(pen);
p->drawArc(rect, startAngle, angleSpan);
p->restore();
@@ -509,17 +462,14 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
QPainter* p = m_data->p();
p->save();
p->setRenderHint(QPainter::Antialiasing, shouldAntialias);
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (getShadow(shadowSize, shadowBlur, shadowColor)) {
+ if (m_data->hasShadow()) {
p->save();
- p->translate(shadowSize.width(), shadowSize.height());
+ p->translate(m_data->shadow.offset);
if (p->brush().style() != Qt::NoBrush)
- p->setBrush(QBrush(shadowColor));
+ p->setBrush(QBrush(m_data->shadow.color));
QPen pen(p->pen());
if (pen.style() != Qt::NoPen) {
- pen.setColor(shadowColor);
+ pen.setColor(m_data->shadow.color);
p->setPen(pen);
}
p->drawConvexPolygon(polygon);
@@ -553,18 +503,6 @@ QPen GraphicsContext::pen()
return p->pen();
}
-static void inline drawFilledShadowPath(GraphicsContext* context, QPainter* p, const QPainterPath& path)
-{
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
- p->translate(shadowSize.width(), shadowSize.height());
- p->fillPath(path, QBrush(shadowColor));
- p->translate(-shadowSize.width(), -shadowSize.height());
- }
-}
-
void GraphicsContext::fillPath()
{
if (paintingDisabled())
@@ -574,7 +512,11 @@ void GraphicsContext::fillPath()
QPainterPath& path = m_data->currentPath; // Avoid detaching the QPainterPath
path.setFillRule(toQtFillRule(fillRule()));
- drawFilledShadowPath(this, p, path);
+ if (m_data->hasShadow()) {
+ p->translate(m_data->shadow.offset);
+ p->fillPath(path, m_data->shadow.color);
+ p->translate(-m_data->shadow.offset);
+ }
if (m_common->state.fillPattern) {
AffineTransform affine;
p->fillPath(path, QBrush(m_common->state.fillPattern->createPlatformPattern(affine)));
@@ -598,16 +540,12 @@ void GraphicsContext::strokePath()
QPainterPath& path = m_data->currentPath; // Avoid detaching the QPainterPath
path.setFillRule(toQtFillRule(fillRule()));
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (getShadow(shadowSize, shadowBlur, shadowColor)) {
- QTransform t(p->worldTransform());
- p->translate(shadowSize.width(), shadowSize.height());
+ if (m_data->hasShadow()) {
+ p->translate(m_data->shadow.offset);
QPen shadowPen(pen);
- shadowPen.setColor(shadowColor);
+ shadowPen.setColor(m_data->shadow.color);
p->strokePath(path, shadowPen);
- p->setWorldTransform(t);
+ p->translate(-m_data->shadow.offset);
}
if (m_common->state.strokePattern) {
AffineTransform affine;
@@ -625,18 +563,6 @@ void GraphicsContext::strokePath()
m_data->currentPath = QPainterPath();
}
-static inline void drawBorderlessRectShadow(GraphicsContext* context, QPainter* p, const FloatRect& rect)
-{
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
- FloatRect shadowRect(rect);
- shadowRect.move(shadowSize.width(), shadowSize.height());
- p->fillRect(shadowRect, QColor(shadowColor));
- }
-}
-
static inline void drawRepeatPattern(QPainter* p, QPixmap* image, const FloatRect& rect, const bool repeatX, const bool repeatY)
{
// Patterns must be painted so that the top left of the first image is anchored at
@@ -712,22 +638,18 @@ void GraphicsContext::fillRect(const FloatRect& rect)
QPainter* p = m_data->p();
FloatRect normalizedRect = rect.normalized();
- FloatSize shadowSize;
- float shadowBlur;
- Color shadowColor;
- bool hasShadow = getShadow(shadowSize, shadowBlur, shadowColor);
- FloatRect shadowDestRect;
+ QRectF shadowDestRect;
QImage* shadowImage = 0;
QPainter* pShadow = 0;
- if (hasShadow) {
+ if (m_data->hasShadow()) {
shadowImage = new QImage(roundedIntSize(normalizedRect.size()), QImage::Format_ARGB32_Premultiplied);
pShadow = new QPainter(shadowImage);
shadowDestRect = normalizedRect;
- shadowDestRect.move(shadowSize.width(), shadowSize.height());
+ shadowDestRect.translate(m_data->shadow.offset);
pShadow->setCompositionMode(QPainter::CompositionMode_Source);
- pShadow->fillRect(shadowImage->rect(), shadowColor);
+ pShadow->fillRect(shadowImage->rect(), m_data->shadow.color);
pShadow->setCompositionMode(QPainter::CompositionMode_DestinationIn);
}
@@ -737,7 +659,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
QBrush brush(m_common->state.fillPattern->createPlatformPattern(affine));
QPixmap* image = m_common->state.fillPattern->tileImage()->nativeImageForCurrentFrame();
- if (hasShadow) {
+ if (m_data->hasShadow()) {
drawRepeatPattern(pShadow, image, FloatRect(static_cast<QRectF>(shadowImage->rect())), m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
pShadow->end();
p->drawImage(shadowDestRect, *shadowImage, shadowImage->rect());
@@ -747,14 +669,14 @@ void GraphicsContext::fillRect(const FloatRect& rect)
QBrush brush(*m_common->state.fillGradient->platformGradient());
brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
- if (hasShadow) {
+ if (m_data->hasShadow()) {
pShadow->fillRect(shadowImage->rect(), brush);
pShadow->end();
p->drawImage(shadowDestRect, *shadowImage, shadowImage->rect());
}
p->fillRect(normalizedRect, brush);
} else {
- if (hasShadow) {
+ if (m_data->hasShadow()) {
pShadow->fillRect(shadowImage->rect(), p->brush());
pShadow->end();
p->drawImage(shadowDestRect, *shadowImage, shadowImage->rect());
@@ -774,8 +696,10 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
m_data->solidColor.setColor(color);
QPainter* p = m_data->p();
- if (m_common->state.shadowColor.isValid())
- drawBorderlessRectShadow(this, p, rect);
+
+ if (m_data->hasShadow())
+ m_data->shadow.drawShadowRect(p, rect);
+
p->fillRect(rect, m_data->solidColor);
}
@@ -786,7 +710,11 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
Path path = Path::createRoundedRectangle(rect, topLeft, topRight, bottomLeft, bottomRight);
QPainter* p = m_data->p();
- drawFilledShadowPath(this, p, path.platformPath());
+ if (m_data->hasShadow()) {
+ p->translate(m_data->shadow.offset);
+ p->fillPath(path.platformPath(), m_data->shadow.color);
+ p->translate(-m_data->shadow.offset);
+ }
p->fillPath(path.platformPath(), QColor(color));
}
@@ -928,7 +856,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect)
return FloatRect(roundedOrigin, roundedLowerRight - roundedOrigin);
}
-void GraphicsContext::setPlatformShadow(const FloatSize& size, float, const Color&, ColorSpace)
+void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const Color& color, ColorSpace)
{
// Qt doesn't support shadows natively, they are drawn manually in the draw*
// functions
@@ -937,13 +865,20 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float, const Colo
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
m_common->state.shadowSize = FloatSize(size.width(), -size.height());
+ m_data->shadow = ContextShadow(color, blur, size.width(), -size.height());
+ } else {
+ m_data->shadow = ContextShadow(color, blur, size.width(), size.height());
}
}
void GraphicsContext::clearPlatformShadow()
{
- // Qt doesn't support shadows natively, they are drawn manually in the draw*
- // functions
+ m_data->shadow.clear();
+}
+
+void GraphicsContext::pushTransparencyLayerInternal(const QRect &rect, qreal opacity, QPixmap& alphaMask)
+{
+ m_data->layers.push(new TransparencyLayer(m_data->p(), m_data->p()->transform().mapRect(rect), 1.0, alphaMask));
}
void GraphicsContext::beginTransparencyLayer(float opacity)
@@ -1226,23 +1161,6 @@ void GraphicsContext::clipOutEllipseInRect(const IntRect& rect)
}
}
-void GraphicsContext::clipToImageBuffer(const FloatRect& floatRect, const ImageBuffer* image)
-{
- if (paintingDisabled())
- return;
-
- QPixmap* nativeImage = image->image()->nativeImageForCurrentFrame();
- if (!nativeImage)
- return;
-
- IntRect rect(floatRect);
- QPixmap alphaMask = *nativeImage;
- if (alphaMask.width() != rect.width() || alphaMask.height() != rect.height())
- alphaMask = alphaMask.scaled(rect.width(), rect.height());
-
- m_data->layers.push(new TransparencyLayer(m_data->p(), m_data->p()->transform().mapRect(rect), 1.0, alphaMask));
-}
-
void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect,
int thickness)
{
diff --git a/WebCore/platform/graphics/qt/ImageBufferData.h b/WebCore/platform/graphics/qt/ImageBufferData.h
index 222dabe..aa32253 100644
--- a/WebCore/platform/graphics/qt/ImageBufferData.h
+++ b/WebCore/platform/graphics/qt/ImageBufferData.h
@@ -26,6 +26,9 @@
#ifndef ImageBufferData_h
#define ImageBufferData_h
+#include "Image.h"
+#include <wtf/RefPtr.h>
+
#include <QPainter>
#include <QPixmap>
@@ -41,6 +44,7 @@ public:
QPixmap m_pixmap;
OwnPtr<QPainter> m_painter;
+ RefPtr<Image> m_image;
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 761a4fe..11ca377 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -33,6 +33,7 @@
#include "ImageData.h"
#include "MIMETypeRegistry.h"
#include "StillImageQt.h"
+#include "TransparencyLayer.h"
#include <wtf/text/CString.h>
#include <QBuffer>
@@ -74,6 +75,8 @@ ImageBufferData::ImageBufferData(const IntSize& size)
brush.setColor(Qt::black);
painter->setBrush(brush);
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
+
+ m_image = StillImage::createForRendering(&m_pixmap);
}
ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace, bool& success)
@@ -98,24 +101,50 @@ GraphicsContext* ImageBuffer::context() const
return m_context.get();
}
-Image* ImageBuffer::imageForRendering() const
+bool ImageBuffer::drawsUsingCopy() const
{
- if (!m_image)
- m_image = StillImage::createForRendering(&m_data.m_pixmap);
+ return false;
+}
- return m_image.get();
+PassRefPtr<Image> ImageBuffer::copyImage() const
+{
+ return StillImage::create(m_data.m_pixmap);
}
-Image* ImageBuffer::image() const
+void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+ CompositeOperator op, bool useLowQualityScale)
{
- if (!m_image) {
- // It's assumed that if image() is called, the actual rendering to the
- // GraphicsContext must be done.
- ASSERT(context());
- m_image = StillImage::create(m_data.m_pixmap);
- }
+ if (destContext == context()) {
+ // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first.
+ RefPtr<Image> copy = copyImage();
+ destContext->drawImage(copy.get(), DeviceColorSpace, destRect, srcRect, op, useLowQualityScale);
+ } else
+ destContext->drawImage(m_data.m_image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
+}
+
+void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ if (destContext == context()) {
+ // We're drawing into our own buffer. In order for this to work, we need to copy the source buffer first.
+ RefPtr<Image> copy = copyImage();
+ copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ } else
+ m_data.m_image->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+}
+
+void ImageBuffer::clip(GraphicsContext* context, const FloatRect& floatRect) const
+{
+ QPixmap* nativeImage = m_data.m_image->nativeImageForCurrentFrame();
+ if (!nativeImage)
+ return;
+
+ IntRect rect(floatRect);
+ QPixmap alphaMask = *nativeImage;
+ if (alphaMask.width() != rect.width() || alphaMask.height() != rect.height())
+ alphaMask = alphaMask.scaled(rect.width(), rect.height());
- return m_image.get();
+ context->pushTransparencyLayerInternal(rect, 1.0, alphaMask);
}
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index fb3d621..858cc44 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -78,6 +78,9 @@ void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
m_buffer->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
m_reader.set(new QImageReader(m_buffer.get(), m_format));
+ // This will force the JPEG decoder to use JDCT_IFAST
+ m_reader->setQuality(49);
+
// QImageReader only allows retrieving the format before reading the image
m_format = m_reader->format();
}
@@ -186,20 +189,16 @@ void ImageDecoderQt::internalReadImage(size_t frameIndex)
bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
{
QPixmap pixmap;
- bool pixmapLoaded;
- const int imageCount = m_reader->imageCount();
- if (imageCount == 0 || imageCount == 1)
- pixmapLoaded = pixmap.loadFromData((const uchar*)(m_data->data()), m_data->size(), m_format);
- else {
- QImage img;
- const bool imageLoaded = m_reader->read(&img);
- if (imageLoaded) {
- pixmap = QPixmap::fromImage(img);
- pixmapLoaded = true;
- }
- }
- if (!pixmapLoaded) {
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+ pixmap = QPixmap::fromImageReader(m_reader.get());
+#else
+ QImage img;
+ if (m_reader->read(&img))
+ pixmap = QPixmap::fromImage(img);
+#endif
+
+ if (pixmap.isNull()) {
frameCount();
repetitionCount();
clearPointers();
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
index 3c6c5aa..08eb816 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
@@ -534,7 +534,11 @@ void MediaPlayerPrivate::aboutToFinish()
void MediaPlayerPrivate::totalTimeChanged(qint64 totalTime)
{
+#if OS(WINDOWS)
+ LOG(Media, "MediaPlayerPrivatePhonon::totalTimeChanged(%I64d)", totalTime);
+#else
LOG(Media, "MediaPlayerPrivatePhonon::totalTimeChanged(%lld)", totalTime);
+#endif
LOG_MEDIAOBJECT();
}
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
index 525aaf4..4ad5571 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
@@ -25,6 +25,7 @@
#include "GraphicsContext.h"
#include "HTMLMediaElement.h"
#include "HTMLVideoElement.h"
+#include "NotImplemented.h"
#include "TimeRanges.h"
#include "Widget.h"
#include "qwebframe.h"
@@ -95,6 +96,7 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
, m_isSeeking(false)
, m_composited(false)
, m_queuedSeek(-1)
+ , m_preload(MediaPlayer::Auto)
{
m_mediaPlayer->bind(m_videoItem);
m_videoScene->addItem(m_videoItem);
@@ -106,6 +108,8 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
this, SLOT(stateChanged(QMediaPlayer::State)));
connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)),
this, SLOT(handleError(QMediaPlayer::Error)));
+ connect(m_mediaPlayer, SIGNAL(bufferStatusChanged(int)),
+ this, SLOT(bufferStatusChanged(int)));
connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)),
this, SLOT(durationChanged(qint64)));
connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)),
@@ -145,6 +149,20 @@ bool MediaPlayerPrivate::hasAudio() const
void MediaPlayerPrivate::load(const String& url)
{
+ m_mediaUrl = url;
+
+ // QtMultimedia does not have an API to throttle loading
+ // so we handle this ourselves by delaying the load
+ if (m_preload == MediaPlayer::None) {
+ m_delayingLoad = true;
+ return;
+ }
+
+ commitLoad(url);
+}
+
+void MediaPlayerPrivate::commitLoad(const String& url)
+{
// We are now loading
if (m_networkState != MediaPlayer::Loading) {
m_networkState = MediaPlayer::Loading;
@@ -208,6 +226,21 @@ void MediaPlayerPrivate::load(const String& url)
// engine which does.
m_mediaPlayer->setMuted(element->muted());
m_mediaPlayer->setVolume(static_cast<int>(element->volume() * 100.0));
+
+ // Setting a media source will start loading the media, but we need
+ // to pre-roll as well to get video size-hints and buffer-status
+ if (element->paused())
+ m_mediaPlayer->pause();
+ else
+ m_mediaPlayer->play();
+}
+
+void MediaPlayerPrivate::resumeLoad()
+{
+ m_delayingLoad = false;
+
+ if (!m_mediaUrl.isNull())
+ commitLoad(m_mediaUrl);
}
void MediaPlayerPrivate::cancelLoad()
@@ -216,6 +249,12 @@ void MediaPlayerPrivate::cancelLoad()
updateStates();
}
+void MediaPlayerPrivate::prepareToPlay()
+{
+ if (m_mediaPlayer->media().isNull() || m_delayingLoad)
+ resumeLoad();
+}
+
void MediaPlayerPrivate::play()
{
if (m_mediaPlayer->state() != QMediaPlayer::PlayingState)
@@ -322,24 +361,11 @@ float MediaPlayerPrivate::maxTimeSeekable() const
unsigned MediaPlayerPrivate::bytesLoaded() const
{
- unsigned percentage = m_mediaPlayer->bufferStatus();
-
- if (percentage == 100) {
- if (m_networkState != MediaPlayer::Idle) {
- m_networkState = MediaPlayer::Idle;
- m_player->networkStateChanged();
- }
- if (m_readyState != MediaPlayer::HaveEnoughData) {
- m_readyState = MediaPlayer::HaveEnoughData;
- m_player->readyStateChanged();
- }
- }
-
QLatin1String bytesLoadedKey("bytes-loaded");
if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey))
return m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt();
- return percentage;
+ return m_mediaPlayer->bufferStatus();
}
unsigned MediaPlayerPrivate::totalBytes() const
@@ -350,6 +376,13 @@ unsigned MediaPlayerPrivate::totalBytes() const
return 100;
}
+void MediaPlayerPrivate::setPreload(MediaPlayer::Preload preload)
+{
+ m_preload = preload;
+ if (m_delayingLoad && m_preload != MediaPlayer::None)
+ resumeLoad();
+}
+
void MediaPlayerPrivate::setRate(float rate)
{
m_mediaPlayer->setPlaybackRate(rate);
@@ -439,6 +472,11 @@ void MediaPlayerPrivate::positionChanged(qint64)
}
}
+void MediaPlayerPrivate::bufferStatusChanged(int)
+{
+ notImplemented();
+}
+
void MediaPlayerPrivate::durationChanged(qint64)
{
m_player->durationChanged();
diff --git a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
index d72404c..165efde 100644
--- a/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
+++ b/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
@@ -50,10 +50,13 @@ public:
bool hasAudio() const;
void load(const String &url);
+ void commitLoad(const String& url);
+ void resumeLoad();
void cancelLoad();
void play();
void pause();
+ void prepareToPlay();
bool paused() const;
bool seeking() const;
@@ -68,6 +71,8 @@ public:
bool supportsMuting() const;
void setMuted(bool);
+ void setPreload(MediaPlayer::Preload);
+
MediaPlayer::NetworkState networkState() const;
MediaPlayer::ReadyState readyState() const;
@@ -103,6 +108,7 @@ private slots:
void seekTimeout();
void positionChanged(qint64);
void durationChanged(qint64);
+ void bufferStatusChanged(int);
void volumeChanged(int);
void mutedChanged(bool);
void repaint();
@@ -127,6 +133,10 @@ private:
bool m_isSeeking;
bool m_composited;
qint64 m_queuedSeek;
+ MediaPlayer::Preload m_preload;
+ bool m_delayingLoad;
+ String m_mediaUrl;
+
};
}
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index de9de07..ce5da2e 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -51,6 +51,7 @@
namespace WebCore {
Path::Path()
+ : m_lastMoveToIndex(0)
{
}
@@ -60,12 +61,14 @@ Path::~Path()
Path::Path(const Path& other)
: m_path(other.m_path)
+ , m_lastMoveToIndex(other.m_lastMoveToIndex)
{
}
Path& Path::operator=(const Path& other)
{
m_path = other.m_path;
+ m_lastMoveToIndex = other.m_lastMoveToIndex;
return *this;
}
@@ -180,6 +183,7 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
void Path::moveTo(const FloatPoint& point)
{
+ m_lastMoveToIndex = m_path.elementCount();
m_path.moveTo(point);
}
@@ -260,7 +264,26 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
void Path::closeSubpath()
{
- m_path.closeSubpath();
+ const int elementCount = m_path.elementCount();
+
+ if (!elementCount)
+ return;
+
+ QPointF lastMoveToPoint = m_path.elementAt(m_lastMoveToIndex);
+ int elementsInLastSubpath = 0;
+
+ for (int i = m_lastMoveToIndex; i < elementCount; ++i) {
+ QPainterPath::Element element = m_path.elementAt(i);
+ if (element.isLineTo() || element.isCurveTo()) {
+ // All we need to know is if there are 1 or more elements in the last subpath.
+ if (++elementsInLastSubpath == 2) {
+ m_path.lineTo(lastMoveToPoint);
+ return;
+ }
+ }
+ }
+
+ moveTo(lastMoveToPoint);
}
#define DEGREES(t) ((t) * 180.0 / M_PI)
@@ -440,7 +463,7 @@ void Path::transform(const AffineTransform& transform)
// QTransform.map doesn't handle the MoveTo element because of the isEmpty issue
if (m_path.isEmpty() && m_path.elementCount()) {
QPointF point = qTransform.map(m_path.currentPosition());
- m_path.moveTo(point);
+ moveTo(point);
} else
#endif
m_path = qTransform.map(m_path);
diff --git a/WebCore/platform/graphics/qt/TransparencyLayer.h b/WebCore/platform/graphics/qt/TransparencyLayer.h
new file mode 100644
index 0000000..0d9c121
--- /dev/null
+++ b/WebCore/platform/graphics/qt/TransparencyLayer.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
+ * Copyright (C) 2006 Allan Sandfeld Jensen <sandfeld@kde.org>
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2008 Dirk Schulze <vbs85@gmx.de>
+ *
+ * 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 TransparencyLayer_h
+#define TransparencyLayer_h
+
+#include <QPaintEngine>
+#include <QPainter>
+#include <QPixmap>
+
+namespace WebCore {
+
+struct TransparencyLayer : FastAllocBase {
+ TransparencyLayer(const QPainter* p, const QRect &rect, qreal opacity, QPixmap& alphaMask)
+ : pixmap(rect.width(), rect.height())
+ , opacity(opacity)
+ , alphaMask(alphaMask)
+ , saveCounter(1) // see the comment for saveCounter
+ {
+ offset = rect.topLeft();
+ pixmap.fill(Qt::transparent);
+ painter.begin(&pixmap);
+ painter.setRenderHint(QPainter::Antialiasing, p->testRenderHint(QPainter::Antialiasing));
+ painter.translate(-offset);
+ painter.setPen(p->pen());
+ painter.setBrush(p->brush());
+ painter.setTransform(p->transform(), true);
+ painter.setOpacity(p->opacity());
+ painter.setFont(p->font());
+ if (painter.paintEngine()->hasFeature(QPaintEngine::PorterDuff))
+ painter.setCompositionMode(p->compositionMode());
+ // if the path is an empty region, this assignment disables all painting
+ if (!p->clipPath().isEmpty())
+ painter.setClipPath(p->clipPath());
+ }
+
+ TransparencyLayer()
+ {
+ }
+
+ QPixmap pixmap;
+ QPoint offset;
+ QPainter painter;
+ qreal opacity;
+ // for clipToImageBuffer
+ QPixmap alphaMask;
+ // saveCounter is only used in combination with alphaMask
+ // otherwise, its value is unspecified
+ int saveCounter;
+private:
+ TransparencyLayer(const TransparencyLayer &) {}
+ TransparencyLayer & operator=(const TransparencyLayer &) { return *this; }
+};
+
+} // namespace WebCore
+
+#endif // TransparencyLayer_h
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 7bcd84b..fe7f6ce 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -53,6 +53,7 @@
#include <math.h>
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
+#include <wtf/UnusedParam.h>
#if USE(GLES2_RENDERING)
#include "GLES2Canvas.h"
@@ -455,17 +456,6 @@ void GraphicsContext::clipPath(WindRule clipRule)
platformContext()->clipPathAntiAliased(path);
}
-void GraphicsContext::clipToImageBuffer(const FloatRect& rect,
- const ImageBuffer* imageBuffer)
-{
- if (paintingDisabled())
- return;
-
-#if OS(LINUX) || OS(WINDOWS)
- platformContext()->beginLayerClippedToImage(rect, imageBuffer);
-#endif
-}
-
void GraphicsContext::concatCTM(const AffineTransform& affine)
{
if (paintingDisabled())
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index eaa91ec..a63eec5 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -87,20 +87,35 @@ GraphicsContext* ImageBuffer::context() const
return m_context.get();
}
-Image* ImageBuffer::image() const
+bool ImageBuffer::drawsUsingCopy() const
{
- if (!m_image) {
- // This creates a COPY of the image and will cache that copy. This means
- // that if subsequent operations take place on the context, neither the
- // currently-returned image, nor the results of future image() calls,
- // will contain that operation.
- //
- // This seems silly, but is the way the CG port works: image() is
- // intended to be used only when rendering is "complete."
- m_image = BitmapImageSingleFrameSkia::create(
- *m_data.m_platformContext.bitmap());
- }
- return m_image.get();
+ return true;
+}
+
+PassRefPtr<Image> ImageBuffer::copyImage() const
+{
+ return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap());
+}
+
+void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
+{
+#if OS(LINUX) || OS(WINDOWS)
+ context->platformContext()->beginLayerClippedToImage(rect, this);
+#endif
+}
+
+void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+ CompositeOperator op, bool useLowQualityScale)
+{
+ RefPtr<Image> imageCopy = copyImage();
+ context->drawImage(imageCopy.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
+}
+
+void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ RefPtr<Image> imageCopy = copyImage();
+ imageCopy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index 024bf50..b514b1a 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -465,18 +465,18 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect,
if (!bm)
return; // It's too early and we don't have an image yet.
-#if USE(GLES2_RENDERING)
- if (ctxt->platformContext()->useGPU()) {
- drawBitmapGLES2(ctxt, bm, srcRect, dstRect, colorSpace, compositeOp);
- return;
- }
-#endif
FloatRect normDstRect = normalizeRect(dstRect);
FloatRect normSrcRect = normalizeRect(srcRect);
if (normSrcRect.isEmpty() || normDstRect.isEmpty())
return; // Nothing to draw.
+#if USE(GLES2_RENDERING)
+ if (ctxt->platformContext()->useGPU()) {
+ drawBitmapGLES2(ctxt, bm, normSrcRect, normDstRect, colorSpace, compositeOp);
+ return;
+ }
+#endif
ctxt->platformContext()->prepareForSoftwareDraw();
paintSkBitmap(ctxt->platformContext(),
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index abf04f9..1161224 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -39,6 +39,7 @@
#include "NativeImageSkia.h"
#include "PlatformContextSkia.h"
#include "SkiaUtils.h"
+#include "TilingData.h"
#include "skia/ext/image_operations.h"
#include "skia/ext/platform_canvas.h"
@@ -706,6 +707,7 @@ void PlatformContextSkia::setGraphicsContext3D(GraphicsContext3D* context, const
{
m_useGPU = true;
m_gpuCanvas = new GLES2Canvas(context, size);
+ m_uploadTexture.clear();
#if USE(ACCELERATED_COMPOSITING)
CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(context->platformLayer());
layer->setPrepareTextureCallback(PrepareTextureCallbackImpl::create(this));
@@ -791,13 +793,13 @@ void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const
{
const SkBitmap& bitmap = m_canvas->getDevice()->accessBitmap(false);
SkAutoLockPixels lock(bitmap);
- // FIXME: Keep a texture around for this rather than constantly creating/destroying one.
GraphicsContext3D* context = m_gpuCanvas->context();
- RefPtr<GLES2Texture> texture = GLES2Texture::create(context, GLES2Texture::BGRA8, bitmap.width(), bitmap.height());
- texture->load(bitmap.getPixels());
+ if (!m_uploadTexture || m_uploadTexture->tiles().totalSizeX() < bitmap.width() || m_uploadTexture->tiles().totalSizeY() < bitmap.height())
+ m_uploadTexture = GLES2Texture::create(context, GLES2Texture::BGRA8, bitmap.width(), bitmap.height());
+ m_uploadTexture->load(bitmap.getPixels());
IntRect rect(0, 0, bitmap.width(), bitmap.height());
AffineTransform identity;
- gpuCanvas()->drawTexturedRect(texture.get(), rect, rect, identity, 1.0, DeviceColorSpace, op);
+ gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), rect, rect, identity, 1.0, DeviceColorSpace, op);
}
void PlatformContextSkia::readbackHardwareToSoftware() const
@@ -810,11 +812,15 @@ void PlatformContextSkia::readbackHardwareToSoftware() const
// Flips the image vertically.
for (int y = 0; y < height; ++y) {
uint32_t* pixels = bitmap.getAddr32(0, y);
- context->readPixels(0, height - 1 - y, width, 1, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels);
- for (int i = 0; i < width; ++i) {
- uint32_t pixel = pixels[i];
- // Swizzles from RGBA -> BGRA.
- pixels[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ if (context->supportsBGRA())
+ context->readPixels(0, height - 1 - y, width, 1, GraphicsContext3D::BGRA_EXT, GraphicsContext3D::UNSIGNED_BYTE, pixels);
+ else {
+ context->readPixels(0, height - 1 - y, width, 1, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels);
+ for (int i = 0; i < width; ++i) {
+ uint32_t pixel = pixels[i];
+ // Swizzles from RGBA -> BGRA.
+ pixels[i] = pixel & 0xFF00FF00 | ((pixel & 0x00FF0000) >> 16) | ((pixel & 0x000000FF) << 16);
+ }
}
}
}
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index ff80d1b..6c84797 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -48,6 +48,7 @@ namespace WebCore {
#if USE(GLES2_RENDERING)
enum CompositeOperator;
class GLES2Canvas;
+class GLES2Texture;
class GraphicsContext3D;
#endif
@@ -240,6 +241,7 @@ private:
bool m_useGPU;
OwnPtr<GLES2Canvas> m_gpuCanvas;
mutable enum { None, Software, Mixed, Hardware } m_backingStoreState;
+ mutable RefPtr<GLES2Texture> m_uploadTexture;
#endif
};
diff --git a/WebCore/platform/graphics/win/FontCacheWin.cpp b/WebCore/platform/graphics/win/FontCacheWin.cpp
index d050243..2240f80 100644
--- a/WebCore/platform/graphics/win/FontCacheWin.cpp
+++ b/WebCore/platform/graphics/win/FontCacheWin.cpp
@@ -31,11 +31,11 @@
#include "FontCache.h"
#include "Font.h"
#include "SimpleFontData.h"
-#include "StringHash.h"
#include "UnicodeRange.h"
#include <mlang.h>
#include <windows.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if PLATFORM(CG)
#include <ApplicationServices/ApplicationServices.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
diff --git a/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp b/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
index a804432..9234229 100644
--- a/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
@@ -25,12 +25,12 @@
#include "FontPlatformData.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <ApplicationServices/ApplicationServices.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
using std::min;
diff --git a/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp b/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp
index 9b916bd..0f5c365 100644
--- a/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp
+++ b/WebCore/platform/graphics/win/FontPlatformDataCairoWin.cpp
@@ -27,10 +27,10 @@
#include "FontPlatformData.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#include <cairo-win32.h>
diff --git a/WebCore/platform/graphics/win/FontPlatformDataWin.cpp b/WebCore/platform/graphics/win/FontPlatformDataWin.cpp
index 99f364c..09ed4a6 100644
--- a/WebCore/platform/graphics/win/FontPlatformDataWin.cpp
+++ b/WebCore/platform/graphics/win/FontPlatformDataWin.cpp
@@ -26,10 +26,10 @@
#include "FontPlatformData.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
using std::min;
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index e0ecf78..9bc68d1 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -43,7 +43,6 @@
#include "Settings.h"
#include "SoftLinking.h"
#include "StringBuilder.h"
-#include "StringHash.h"
#include "TimeRanges.h"
#include "Timer.h"
#include <AssertMacros.h>
@@ -54,6 +53,7 @@
#include <wtf/MainThread.h>
#include <wtf/MathExtras.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayerCACF.h"
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
index 69aaeaf..34f1135 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
@@ -39,7 +39,6 @@
#include "ScrollView.h"
#include "SoftLinking.h"
#include "StringBuilder.h"
-#include "StringHash.h"
#include "TimeRanges.h"
#include "Timer.h"
#include <Wininet.h>
@@ -47,6 +46,7 @@
#include <wtf/HashSet.h>
#include <wtf/MathExtras.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsLayerCACF.h"
diff --git a/WebCore/platform/graphics/win/WKCACFLayer.h b/WebCore/platform/graphics/win/WKCACFLayer.h
index ed39297..abc04c8 100644
--- a/WebCore/platform/graphics/win/WKCACFLayer.h
+++ b/WebCore/platform/graphics/win/WKCACFLayer.h
@@ -28,8 +28,6 @@
#if USE(ACCELERATED_COMPOSITING)
-#include "StringHash.h"
-
#include <wtf/RefCounted.h>
#include <QuartzCore/CACFLayer.h>
@@ -37,6 +35,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#include "GraphicsContext.h"
#include "PlatformString.h"
diff --git a/WebCore/platform/graphics/wince/FontPlatformData.cpp b/WebCore/platform/graphics/wince/FontPlatformData.cpp
index 74cadc2..d84a7cc 100644
--- a/WebCore/platform/graphics/wince/FontPlatformData.cpp
+++ b/WebCore/platform/graphics/wince/FontPlatformData.cpp
@@ -26,10 +26,10 @@
#include "FontData.h"
#include "PlatformString.h"
#include "SimpleFontData.h"
-#include "StringHash.h"
#include "UnicodeRange.h"
#include "wtf/OwnPtr.h"
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#include <windows.h>
#include <mlang.h>
diff --git a/WebCore/platform/graphics/wince/PathWince.cpp b/WebCore/platform/graphics/wince/PathWince.cpp
index 747e650..6aa2864 100644
--- a/WebCore/platform/graphics/wince/PathWince.cpp
+++ b/WebCore/platform/graphics/wince/PathWince.cpp
@@ -160,11 +160,9 @@ bool Path::hasCurrentPoint() const
return !isEmpty();
}
-FloatPoint Path::currentPoint() const
+FloatPoint Path::currentPoint() const
{
- // FIXME: return current point of subpath.
- float quietNaN = std::numeric_limits<float>::quiet_NaN();
- return FloatPoint(quietNaN, quietNaN);
+ return m_path->lastPoint();
}
-}
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/wx/FontPlatformData.h b/WebCore/platform/graphics/wx/FontPlatformData.h
index 4f8d740..b328545 100644
--- a/WebCore/platform/graphics/wx/FontPlatformData.h
+++ b/WebCore/platform/graphics/wx/FontPlatformData.h
@@ -30,10 +30,10 @@
#define FontPlatformData_h
#include "FontDescription.h"
-#include "AtomicString.h"
#include "StringImpl.h"
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicString.h>
#include <wtf/text/CString.h>
#include <wx/defs.h>
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 4d5afd7..2428e7e 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -378,11 +378,6 @@ void GraphicsContext::canvasClip(const Path& path)
clip(path);
}
-void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*)
-{
- notImplemented();
-}
-
AffineTransform GraphicsContext::getCTM() const
{
#if USE(WXGC)
diff --git a/WebCore/platform/graphics/wx/ImageBufferWx.cpp b/WebCore/platform/graphics/wx/ImageBufferWx.cpp
index 775e018..2522cbd 100644
--- a/WebCore/platform/graphics/wx/ImageBufferWx.cpp
+++ b/WebCore/platform/graphics/wx/ImageBufferWx.cpp
@@ -82,12 +82,36 @@ String ImageBuffer::toDataURL(const String&, const double*) const
return String();
}
-Image* ImageBuffer::image() const
+bool ImageBuffer::drawsUsingCopy() const
+{
+ return true;
+}
+
+PassRefPtr<Image> ImageBuffer::copyImage() const
{
notImplemented();
return 0;
}
+void ImageBuffer::clip(GraphicsContext*, const FloatRect&) const
+{
+ notImplemented();
+}
+
+void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+ CompositeOperator op, bool useLowQualityScale)
+{
+ RefPtr<Image> imageCopy = copyImage();
+ context->drawImage(imageCopy.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
+}
+
+void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+{
+ RefPtr<Image> imageCopy = copyImage();
+ imageCopy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+}
+
void ImageBuffer::platformTransformColorSpace(const Vector<int>&)
{
notImplemented();
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index 7003cf0..21ebe4c 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -30,9 +30,9 @@
#include "PasteboardHelper.h"
#include "RenderImage.h"
#include "ScriptExecutionContext.h"
-#include "StringHash.h"
#include "markup.h"
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
#include <gtk/gtk.h>
namespace WebCore {
diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h
index 8fba938..a7d8baf 100644
--- a/WebCore/platform/gtk/DataObjectGtk.h
+++ b/WebCore/platform/gtk/DataObjectGtk.h
@@ -23,9 +23,9 @@
#include <GRefPtr.h>
#include "KURL.h"
#include "Range.h"
-#include "StringHash.h"
#include <wtf/RefCounted.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkDragContext GdkDragContext;
diff --git a/WebCore/platform/gtk/GOwnPtrGtk.cpp b/WebCore/platform/gtk/GOwnPtrGtk.cpp
index 0558f33..9b693f4 100644
--- a/WebCore/platform/gtk/GOwnPtrGtk.cpp
+++ b/WebCore/platform/gtk/GOwnPtrGtk.cpp
@@ -19,8 +19,7 @@
#include "config.h"
#include "GOwnPtrGtk.h"
-#include <gdk/gdk.h>
-#include <glib.h>
+#include <gtk/gtk.h>
namespace WTF {
@@ -30,4 +29,10 @@ template <> void freeOwnedGPtr<GdkEvent>(GdkEvent* ptr)
gdk_event_free(ptr);
}
+template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo* info)
+{
+ if (info)
+ gtk_icon_info_free(info);
+}
+
}
diff --git a/WebCore/platform/gtk/GOwnPtrGtk.h b/WebCore/platform/gtk/GOwnPtrGtk.h
index 674ea58..8341661 100644
--- a/WebCore/platform/gtk/GOwnPtrGtk.h
+++ b/WebCore/platform/gtk/GOwnPtrGtk.h
@@ -23,10 +23,12 @@
#include "GOwnPtr.h"
typedef union _GdkEvent GdkEvent;
+typedef struct _GtkIconInfo GtkIconInfo;
namespace WTF {
-template<> void freeOwnedGPtr<GdkEvent>(GdkEvent*);
+template <> void freeOwnedGPtr<GdkEvent>(GdkEvent*);
+template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo*);
}
diff --git a/WebCore/platform/gtk/GtkVersioning.cpp b/WebCore/platform/gtk/GtkVersioning.cpp
new file mode 100644
index 0000000..e7734a8
--- /dev/null
+++ b/WebCore/platform/gtk/GtkVersioning.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Collabora Ltd.
+ *
+ * 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 "GtkVersioning.h"
+
+#include <gtk/gtk.h>
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value)
+{
+ m_adjustment->value = m_currentPos;
+ gtk_adjustment_value_changed(m_adjustment);
+}
+
+void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
+ gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize)
+{
+ g_object_freeze_notify(G_OBJECT(adjustment));
+
+ g_object_set(adjustment,
+ "lower", lower,
+ "upper", upper,
+ "step-increment", stepIncrement,
+ "page-increment", pageIncrement,
+ "page-size", pageSize,
+ NULL);
+
+ g_object_thaw_notify(G_OBJECT(adjustment));
+
+ gtk_adjustment_changed(adjustment);
+ gtk_adjustment_value_changed(adjustment);
+}
+#endif
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
index ebb1645..6b45228 100644
--- a/WebCore/platform/gtk/GtkVersioning.h
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -58,6 +58,11 @@
#define gtk_selection_data_get_data(data) (data)->data
#define gtk_selection_data_get_target(data) (data)->target
#define gtk_adjustment_set_page_size(adj, value) (adj)->page_size = value
+
+void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
+ gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize);
+
+void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
#endif // GTK_CHECK_VERSION(2, 14, 0)
#endif // GtkVersioning_h
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index bc0d147..36fccf0 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -485,7 +485,7 @@ void RenderThemeGtk::adjustSearchFieldResultsButtonStyle(CSSStyleSelector* selec
bool RenderThemeGtk::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- return paintMozillaGtkWidget(this, MOZ_GTK_DROPDOWN_ARROW, o, i, rect);
+ return paintSearchFieldResultsDecoration(o, i, rect);
}
void RenderThemeGtk::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
@@ -501,7 +501,12 @@ void RenderThemeGtk::adjustSearchFieldResultsDecorationStyle(CSSStyleSelector* s
bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- return paintMozillaGtkWidget(this, MOZ_GTK_CHECKMENUITEM, o, i, rect);
+ GraphicsContext* context = i.context;
+
+ static Image* searchImage = Image::loadPlatformThemeIcon(GTK_STOCK_FIND, rect.width()).releaseRef();
+ context->drawImage(searchImage, DeviceColorSpace, rect);
+
+ return false;
}
void RenderThemeGtk::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
@@ -517,7 +522,13 @@ void RenderThemeGtk::adjustSearchFieldCancelButtonStyle(CSSStyleSelector* select
bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& i, const IntRect& rect)
{
- return paintMozillaGtkWidget(this, MOZ_GTK_CHECKMENUITEM, o, i, rect);
+ GraphicsContext* context = i.context;
+
+ // TODO: Brightening up the image on hover is desirable here, I believe.
+ static Image* cancelImage = Image::loadPlatformThemeIcon(GTK_STOCK_CLEAR, rect.width()).releaseRef();
+ context->drawImage(cancelImage, DeviceColorSpace, rect);
+
+ return false;
}
void RenderThemeGtk::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
diff --git a/WebCore/platform/gtk/ScrollViewGtk.cpp b/WebCore/platform/gtk/ScrollViewGtk.cpp
index e705fe0..871a0bf 100644
--- a/WebCore/platform/gtk/ScrollViewGtk.cpp
+++ b/WebCore/platform/gtk/ScrollViewGtk.cpp
@@ -36,6 +36,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
+#include "GtkVersioning.h"
#include "HostWindow.h"
#include "IntRect.h"
#include "Page.h"
@@ -72,29 +73,6 @@ PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientati
return Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
}
-#if !GTK_CHECK_VERSION(2, 14, 0)
-#define gtk_adjustment_configure AdjustmentConfigure
-
-static void AdjustmentConfigure(GtkAdjustment* adjustment, gdouble value, gdouble lower, gdouble upper,
- gdouble stepIncrement, gdouble pageIncrement, gdouble pageSize)
-{
- g_object_freeze_notify(G_OBJECT(adjustment));
-
- g_object_set(adjustment,
- "lower", lower,
- "upper", upper,
- "step-increment", stepIncrement,
- "page-increment", pageIncrement,
- "page-size", pageSize,
- NULL);
-
- g_object_thaw_notify(G_OBJECT(adjustment));
-
- gtk_adjustment_changed(adjustment);
- gtk_adjustment_value_changed(adjustment);
-}
-#endif
-
/*
* The following is assumed:
* (hadj && vadj) || (!hadj && !vadj)
diff --git a/WebCore/platform/gtk/ScrollbarGtk.cpp b/WebCore/platform/gtk/ScrollbarGtk.cpp
index 8081fb8..3b86ec9 100644
--- a/WebCore/platform/gtk/ScrollbarGtk.cpp
+++ b/WebCore/platform/gtk/ScrollbarGtk.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007, 2009 Holger Hans Peter Freyther zecke@selfish.org
* Copyright (C) 2010 Gustavo Noronha Silva <gns@gnome.org>
+ * Copyright (C) 2010 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,10 +21,10 @@
#include "config.h"
#include "ScrollbarGtk.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
#include "GtkVersioning.h"
#include "IntRect.h"
-#include "GraphicsContext.h"
-#include "FrameView.h"
#include "ScrollbarTheme.h"
#include <gtk/gtk.h>
@@ -120,15 +121,8 @@ void ScrollbarGtk::detachAdjustment()
// For the case where we only operate on the GtkAdjustment it is best to
// reset the values so that the surrounding scrollbar gets updated, or
// e.g. for a GtkScrolledWindow the scrollbar gets hidden.
-#if GTK_CHECK_VERSION(2, 14, 0)
gtk_adjustment_configure(m_adjustment, 0, 0, 0, 0, 0, 0);
-#else
- m_adjustment->lower = 0;
- m_adjustment->upper = 0;
- m_adjustment->value = 0;
- gtk_adjustment_changed(m_adjustment);
- gtk_adjustment_value_changed(m_adjustment);
-#endif
+
g_object_unref(m_adjustment);
m_adjustment = 0;
}
@@ -162,19 +156,12 @@ void ScrollbarGtk::frameRectsChanged()
void ScrollbarGtk::updateThumbPosition()
{
- if (gtk_adjustment_get_value(m_adjustment) != m_currentPos) {
-#if GTK_CHECK_VERSION(2, 14, 0)
+ if (gtk_adjustment_get_value(m_adjustment) != m_currentPos)
gtk_adjustment_set_value(m_adjustment, m_currentPos);
-#else
- m_adjustment->value = m_currentPos;
- gtk_adjustment_value_changed(m_adjustment);
-#endif
- }
}
void ScrollbarGtk::updateThumbProportion()
{
-#if GTK_CHECK_VERSION(2, 14, 0)
gtk_adjustment_configure(m_adjustment,
gtk_adjustment_get_value(m_adjustment),
gtk_adjustment_get_lower(m_adjustment),
@@ -182,13 +169,6 @@ void ScrollbarGtk::updateThumbProportion()
m_lineStep,
m_pageStep,
m_visibleSize);
-#else
- m_adjustment->step_increment = m_lineStep;
- m_adjustment->page_increment = m_pageStep;
- m_adjustment->page_size = m_visibleSize;
- m_adjustment->upper = m_totalSize;
- gtk_adjustment_changed(m_adjustment);
-#endif
}
void ScrollbarGtk::setFrameRect(const IntRect& rect)
diff --git a/WebCore/platform/gtk/SharedTimerGtk.cpp b/WebCore/platform/gtk/SharedTimerGtk.cpp
index 092df95..ee4d75b 100644
--- a/WebCore/platform/gtk/SharedTimerGtk.cpp
+++ b/WebCore/platform/gtk/SharedTimerGtk.cpp
@@ -30,6 +30,7 @@
#include <wtf/Assertions.h>
#include <wtf/CurrentTime.h>
+#include <gdk/gdk.h>
#include <glib.h>
namespace WebCore {
@@ -63,7 +64,7 @@ void setSharedTimerFireTime(double fireTime)
}
stopSharedTimer();
- sharedTimer = g_timeout_add(intervalInMS, timeout_cb, NULL);
+ sharedTimer = g_timeout_add_full(GDK_PRIORITY_REDRAW, intervalInMS, timeout_cb, 0, 0);
}
void stopSharedTimer()
diff --git a/WebCore/platform/haiku/ClipboardHaiku.cpp b/WebCore/platform/haiku/ClipboardHaiku.cpp
index 9931131..da242c1 100644
--- a/WebCore/platform/haiku/ClipboardHaiku.cpp
+++ b/WebCore/platform/haiku/ClipboardHaiku.cpp
@@ -31,13 +31,13 @@
#include "IntPoint.h"
#include "NotImplemented.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <support/Locker.h>
#include <app/Clipboard.h>
#include <Message.h>
#include <String.h>
#include <wtf/HashTable.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/haiku/CookieJarHaiku.cpp b/WebCore/platform/haiku/CookieJarHaiku.cpp
index f619f00..471ac59 100644
--- a/WebCore/platform/haiku/CookieJarHaiku.cpp
+++ b/WebCore/platform/haiku/CookieJarHaiku.cpp
@@ -32,9 +32,8 @@
#include "Cookie.h"
#include "KURL.h"
#include "PlatformString.h"
-#include "StringHash.h"
-
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp b/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
index 109409a..ea73c61 100644
--- a/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
+++ b/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
@@ -21,8 +21,8 @@
#include "config.h"
#include "SearchPopupMenuHaiku.h"
-#include "AtomicString.h"
#include "NotImplemented.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/platform/mac/DragImageMac.mm b/WebCore/platform/mac/DragImageMac.mm
index 7b51018..f444b6e 100644
--- a/WebCore/platform/mac/DragImageMac.mm
+++ b/WebCore/platform/mac/DragImageMac.mm
@@ -87,9 +87,9 @@ RetainPtr<NSImage> createDragImageIconForCachedImage(CachedImage* image)
{
const String& filename = image->response().suggestedFilename();
NSString *extension = nil;
- int dotIndex = filename.reverseFind('.');
+ size_t dotIndex = filename.reverseFind('.');
- if (dotIndex > 0 && dotIndex < (int)(filename.length() - 1)) // require that a . exists after the first character and before the last
+ if (dotIndex != notFound && dotIndex < (filename.length() - 1)) // require that a . exists after the first character and before the last
extension = filename.substring(dotIndex + 1);
else {
// It might be worth doing a further lookup to pull the extension from the MIME type.
diff --git a/WebCore/platform/mac/ScrollbarThemeMac.mm b/WebCore/platform/mac/ScrollbarThemeMac.mm
index 067f28f..bfa584a 100644
--- a/WebCore/platform/mac/ScrollbarThemeMac.mm
+++ b/WebCore/platform/mac/ScrollbarThemeMac.mm
@@ -396,7 +396,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
return true;
HIThemeDrawTrack(&trackInfo, 0, imageBuffer->context()->platformContext(), kHIThemeOrientationNormal);
- context->drawImage(imageBuffer->image(), DeviceColorSpace, scrollbar->frameRect().location());
+ context->drawImageBuffer(imageBuffer.get(), DeviceColorSpace, scrollbar->frameRect().location());
}
return true;
diff --git a/WebCore/platform/mac/SearchPopupMenuMac.mm b/WebCore/platform/mac/SearchPopupMenuMac.mm
index 69018ee..47d6e57 100644
--- a/WebCore/platform/mac/SearchPopupMenuMac.mm
+++ b/WebCore/platform/mac/SearchPopupMenuMac.mm
@@ -21,7 +21,7 @@
#import "config.h"
#import "SearchPopupMenuMac.h"
-#import "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/platform/mac/ThreadCheck.mm b/WebCore/platform/mac/ThreadCheck.mm
index ddee05c..4792191 100644
--- a/WebCore/platform/mac/ThreadCheck.mm
+++ b/WebCore/platform/mac/ThreadCheck.mm
@@ -26,9 +26,9 @@
#import "config.h"
#import "ThreadCheck.h"
-#import "StringHash.h"
#import <wtf/HashSet.h>
#import <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/mock/SpeechInputClientMock.cpp b/WebCore/platform/mock/SpeechInputClientMock.cpp
index 74a3151..c3d74d1 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.cpp
+++ b/WebCore/platform/mock/SpeechInputClientMock.cpp
@@ -41,34 +41,42 @@ SpeechInputClientMock::SpeechInputClientMock()
: m_recording(false)
, m_timer(this, &SpeechInputClientMock::timerFired)
, m_listener(0)
+ , m_requestId(0)
{
}
-bool SpeechInputClientMock::startRecognition(SpeechInputListener* listener)
+void SpeechInputClientMock::setListener(SpeechInputListener* listener)
+{
+ m_listener = listener;
+}
+
+bool SpeechInputClientMock::startRecognition(int requestId)
{
if (m_timer.isActive())
return false;
- m_listener = listener;
+ m_requestId = requestId;
m_recording = true;
m_timer.startOneShot(0);
return true;
}
-void SpeechInputClientMock::stopRecording()
+void SpeechInputClientMock::stopRecording(int requestId)
{
+ ASSERT(requestId == m_requestId);
if (m_timer.isActive() && m_recording) {
m_timer.stop();
timerFired(&m_timer);
}
}
-void SpeechInputClientMock::cancelRecognition()
+void SpeechInputClientMock::cancelRecognition(int requestId)
{
+ ASSERT(requestId == m_requestId);
if (m_timer.isActive()) {
m_timer.stop();
m_recording = false;
- m_listener->didCompleteRecognition();
- m_listener = 0;
+ m_listener->didCompleteRecognition(m_requestId);
+ m_requestId = 0;
}
}
@@ -81,12 +89,12 @@ void SpeechInputClientMock::timerFired(WebCore::Timer<SpeechInputClientMock>*)
{
if (m_recording) {
m_recording = false;
- m_listener->didCompleteRecording();
+ m_listener->didCompleteRecording(m_requestId);
m_timer.startOneShot(0);
} else {
- m_listener->setRecognitionResult(m_recognitionResult);
- m_listener->didCompleteRecognition();
- m_listener = 0;
+ m_listener->setRecognitionResult(m_requestId, m_recognitionResult);
+ m_listener->didCompleteRecognition(m_requestId);
+ m_requestId = 0;
}
}
diff --git a/WebCore/platform/mock/SpeechInputClientMock.h b/WebCore/platform/mock/SpeechInputClientMock.h
index faca444..7d5fda2 100644
--- a/WebCore/platform/mock/SpeechInputClientMock.h
+++ b/WebCore/platform/mock/SpeechInputClientMock.h
@@ -49,9 +49,10 @@ public:
void setRecognitionResult(const String& result);
// SpeechInputClient methods.
- bool startRecognition(SpeechInputListener*);
- void stopRecording();
- void cancelRecognition();
+ void setListener(SpeechInputListener*);
+ bool startRecognition(int);
+ void stopRecording(int);
+ void cancelRecognition(int);
private:
void timerFired(Timer<SpeechInputClientMock>*);
@@ -59,6 +60,7 @@ private:
bool m_recording;
Timer<SpeechInputClientMock> m_timer;
SpeechInputListener* m_listener;
+ int m_requestId;
String m_recognitionResult;
};
diff --git a/WebCore/platform/network/BlobData.cpp b/WebCore/platform/network/BlobData.cpp
new file mode 100644
index 0000000..bb256d0
--- /dev/null
+++ b/WebCore/platform/network/BlobData.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 "BlobData.h"
+
+namespace WebCore {
+
+const long long BlobDataItem::toEndOfFile = -1;
+const double BlobDataItem::doNotCheckFileChange = 0;
+
+void BlobDataItem::copy(const BlobDataItem& item)
+{
+ type = item.type;
+ data = item.data; // This is OK because the underlying storage is Vector<char>.
+ path = item.path.crossThreadString();
+ url = item.url.copy();
+ offset = item.offset;
+ length = item.length;
+ expectedModificationTime = item.expectedModificationTime;
+}
+
+PassOwnPtr<BlobData> BlobData::copy() const
+{
+ OwnPtr<BlobData> blobData = adoptPtr(new BlobData());
+ blobData->m_contentType = m_contentType.crossThreadString();
+ blobData->m_contentDisposition = m_contentDisposition.crossThreadString();
+ blobData->m_items.resize(m_items.size());
+ for (size_t i = 0; i < m_items.size(); ++i)
+ blobData->m_items.at(i).copy(m_items.at(i));
+
+ return blobData.release();
+}
+
+void BlobData::appendData(const CString& data)
+{
+ m_items.append(BlobDataItem(data));
+}
+
+void BlobData::appendFile(const String& path)
+{
+ m_items.append(BlobDataItem(path));
+}
+
+void BlobData::appendFile(const String& path, long long offset, long long length, double expectedModificationTime)
+{
+ m_items.append(BlobDataItem(path, offset, length, expectedModificationTime));
+}
+
+void BlobData::appendBlob(const KURL& url, long long offset, long long length)
+{
+ m_items.append(BlobDataItem(url, offset, length));
+}
+
+void BlobData::swapItems(BlobDataItemList& items)
+{
+ m_items.swap(items);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/network/BlobData.h b/WebCore/platform/network/BlobData.h
new file mode 100644
index 0000000..17cdfdd
--- /dev/null
+++ b/WebCore/platform/network/BlobData.h
@@ -0,0 +1,152 @@
+/*
+ * 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 BlobData_h
+#define BlobData_h
+
+#include "KURL.h"
+#include "PlatformString.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+struct BlobDataItem {
+ static const long long toEndOfFile;
+ static const double doNotCheckFileChange;
+
+ // Default constructor.
+ BlobDataItem()
+ : offset(0)
+ , length(toEndOfFile)
+ , expectedModificationTime(doNotCheckFileChange)
+ {
+ }
+
+ // Constructor for String type.
+ BlobDataItem(const CString& data)
+ : type(Data)
+ , data(data)
+ , offset(0)
+ , length(toEndOfFile)
+ , expectedModificationTime(doNotCheckFileChange)
+ {
+ }
+
+ // Constructor for File type (complete file).
+ BlobDataItem(const String& path)
+ : type(File)
+ , path(path)
+ , offset(0)
+ , length(toEndOfFile)
+ , expectedModificationTime(doNotCheckFileChange)
+ {
+ }
+
+ // Constructor for File type (partial file).
+ BlobDataItem(const String& path, long long offset, long long length, double expectedModificationTime)
+ : type(File)
+ , path(path)
+ , offset(offset)
+ , length(length)
+ , expectedModificationTime(expectedModificationTime)
+ {
+ }
+
+ // Constructor for Blob type.
+ BlobDataItem(const KURL& url, long long offset, long long length)
+ : type(Blob)
+ , url(url)
+ , offset(offset)
+ , length(length)
+ , expectedModificationTime(doNotCheckFileChange)
+ {
+ }
+
+ // Gets a copy of the data suitable for passing to another thread.
+ void copy(const BlobDataItem&);
+
+ enum { Data, File, Blob } type;
+
+ // For Data type.
+ CString data;
+
+ // For File type.
+ String path;
+
+ // For Blob type.
+ KURL url;
+
+ // For File and Blob type.
+ long long offset;
+ long long length;
+
+ // For File type only.
+ double expectedModificationTime;
+};
+
+typedef Vector<BlobDataItem> BlobDataItemList;
+
+class BlobData {
+public:
+ static PassOwnPtr<BlobData> create()
+ {
+ return adoptPtr(new BlobData());
+ }
+
+ // Gets a copy of the data suitable for passing to another thread.
+ PassOwnPtr<BlobData> copy() const;
+
+ const String& contentType() const { return m_contentType; }
+ void setContentType(const String& contentType) { m_contentType = contentType; }
+
+ const String& contentDisposition() const { return m_contentDisposition; }
+ void setContentDisposition(const String& contentDisposition) { m_contentDisposition = contentDisposition; }
+
+ const BlobDataItemList& items() const { return m_items; }
+ void swapItems(BlobDataItemList&);
+
+ void appendData(const CString&);
+ void appendFile(const String& path);
+ void appendFile(const String& path, long long offset, long long length, double expectedModificationTime);
+ void appendBlob(const KURL&, long long offset, long long length);
+
+private:
+ BlobData() { }
+
+ String m_contentType;
+ String m_contentDisposition;
+ BlobDataItemList m_items;
+};
+
+} // namespace WebCore
+
+#endif // BlobData_h
diff --git a/WebCore/platform/network/BlobRegistry.h b/WebCore/platform/network/BlobRegistry.h
new file mode 100644
index 0000000..fcd7b1c
--- /dev/null
+++ b/WebCore/platform/network/BlobRegistry.h
@@ -0,0 +1,64 @@
+/*
+ * 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 BlobRegistry_h
+#define BlobRegistry_h
+
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class BlobData;
+class KURL;
+class ResourceError;
+class ResourceHandle;
+class ResourceHandleClient;
+class ResourceRequest;
+class ResourceResponse;
+
+// BlobRegistry is not thread-safe. It should only be called from main thread.
+class BlobRegistry {
+public:
+ static BlobRegistry& instance();
+
+ virtual void registerBlobURL(const KURL&, PassOwnPtr<BlobData>) = 0;
+ virtual void registerBlobURL(const KURL&, const KURL& srcURL) = 0;
+ virtual void unregisterBlobURL(const KURL&) = 0;
+ virtual PassRefPtr<ResourceHandle> createResourceHandle(const ResourceRequest&, ResourceHandleClient*) = 0;
+ virtual bool loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data) = 0;
+
+ virtual ~BlobRegistry() { }
+};
+
+} // namespace WebCore
+
+#endif // BlobRegistry_h
diff --git a/WebCore/platform/network/BlobRegistryImpl.cpp b/WebCore/platform/network/BlobRegistryImpl.cpp
new file mode 100644
index 0000000..bbbb8f0
--- /dev/null
+++ b/WebCore/platform/network/BlobRegistryImpl.cpp
@@ -0,0 +1,177 @@
+/*
+ * 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 "BlobRegistryImpl.h"
+
+#include "FileStream.h"
+#include "FileStreamProxy.h"
+#include "FileSystem.h"
+#include "ResourceError.h"
+#include "ResourceHandle.h"
+#include "ResourceLoader.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include <wtf/MainThread.h>
+#include <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+bool BlobRegistryImpl::shouldLoadResource(const ResourceRequest& request) const
+{
+ // If the resource is not fetched using the GET method, bail out.
+ if (!equalIgnoringCase(request.httpMethod(), "GET"))
+ return false;
+
+ return true;
+}
+
+PassRefPtr<ResourceHandle> BlobRegistryImpl::createResourceHandle(const ResourceRequest& request, ResourceHandleClient*)
+{
+ if (!shouldLoadResource(request))
+ return 0;
+
+ // FIXME: To be implemented.
+ return 0;
+}
+
+bool BlobRegistryImpl::loadResourceSynchronously(const ResourceRequest& request, ResourceError&, ResourceResponse&, Vector<char>&)
+{
+ if (!shouldLoadResource(request))
+ return false;
+
+ // FIXME: To be implemented.
+ return false;
+}
+
+BlobRegistry& BlobRegistry::instance()
+{
+ ASSERT(isMainThread());
+ DEFINE_STATIC_LOCAL(BlobRegistryImpl, instance, ());
+ return instance;
+}
+
+void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, const BlobStorageDataItemList& items)
+{
+ for (BlobStorageDataItemList::const_iterator iter = items.begin(); iter != items.end(); ++iter) {
+ if (iter->type == BlobStorageDataItem::Data)
+ blobStorageData->appendData(iter->data, iter->offset, iter->length);
+ else {
+ ASSERT(iter->type == BlobStorageDataItem::File);
+ blobStorageData->appendFile(iter->path, iter->offset, iter->length, iter->expectedModificationTime);
+ }
+ }
+}
+
+void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, const BlobStorageDataItemList& items, long long offset, long long length)
+{
+ ASSERT(length != BlobDataItem::toEndOfFile);
+
+ BlobStorageDataItemList::const_iterator iter = items.begin();
+ if (offset) {
+ for (; iter != items.end(); ++iter) {
+ if (offset >= iter->length)
+ offset -= iter->length;
+ else
+ break;
+ }
+ }
+
+ for (; iter != items.end() && length > 0; ++iter) {
+ long long currentLength = iter->length - offset;
+ long long newLength = currentLength > length ? length : currentLength;
+ if (iter->type == BlobStorageDataItem::Data)
+ blobStorageData->appendData(iter->data, iter->offset + offset, newLength);
+ else {
+ ASSERT(iter->type == BlobStorageDataItem::File);
+ blobStorageData->appendFile(iter->path, iter->offset + offset, newLength, iter->expectedModificationTime);
+ }
+ offset = 0;
+ }
+}
+
+void BlobRegistryImpl::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blobData)
+{
+ ASSERT(isMainThread());
+
+ RefPtr<BlobStorageData> blobStorageData = BlobStorageData::create();
+ blobStorageData->setContentType(blobData->contentType());
+ blobStorageData->setContentDisposition(blobData->contentDisposition());
+
+ for (BlobDataItemList::const_iterator iter = blobData->items().begin(); iter != blobData->items().end(); ++iter) {
+ switch (iter->type) {
+ case BlobDataItem::Data:
+ blobStorageData->appendData(iter->data, 0, iter->data.length());
+ break;
+ case BlobDataItem::File:
+ blobStorageData->appendFile(iter->path, iter->offset, iter->length, iter->expectedModificationTime);
+ break;
+ case BlobDataItem::Blob:
+ if (m_blobs.contains(iter->url.string()))
+ appendStorageItems(blobStorageData.get(), m_blobs.get(iter->url.string())->items(), iter->offset, iter->length);
+ break;
+ }
+ }
+
+
+ m_blobs.set(url.string(), blobStorageData);
+}
+
+void BlobRegistryImpl::registerBlobURL(const KURL& url, const KURL& srcURL)
+{
+ ASSERT(isMainThread());
+
+ RefPtr<BlobStorageData> src = m_blobs.get(srcURL.string());
+ ASSERT(src);
+ if (!src)
+ return;
+
+ RefPtr<BlobStorageData> blobStorageData = BlobStorageData::create();
+ blobStorageData->setContentType(src->contentType());
+ blobStorageData->setContentDisposition(src->contentDisposition());
+ appendStorageItems(blobStorageData.get(), src->items());
+
+ m_blobs.set(url.string(), blobStorageData);
+}
+
+void BlobRegistryImpl::unregisterBlobURL(const KURL& url)
+{
+ ASSERT(isMainThread());
+ m_blobs.remove(url.string());
+}
+
+PassRefPtr<BlobStorageData> BlobRegistryImpl::getBlobDataFromURL(const KURL& url) const
+{
+ ASSERT(isMainThread());
+ return m_blobs.get(url.string());
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/network/BlobRegistryImpl.h b/WebCore/platform/network/BlobRegistryImpl.h
new file mode 100644
index 0000000..42693bc
--- /dev/null
+++ b/WebCore/platform/network/BlobRegistryImpl.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:
+ *
+ * * 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 BlobRegistryImpl_h
+#define BlobRegistryImpl_h
+
+#include "BlobData.h"
+#include "BlobRegistry.h"
+#include "BlobStorageData.h"
+#include "PlatformString.h"
+#include <wtf/HashMap.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class KURL;
+class ResourceError;
+class ResourceHandle;
+class ResourceHandleClient;
+class ResourceRequest;
+class ResourceResponse;
+
+// BlobRegistryImpl is not thread-safe. It should only be called from main thread.
+class BlobRegistryImpl : public BlobRegistry {
+public:
+ virtual ~BlobRegistryImpl() { }
+
+ virtual void registerBlobURL(const KURL&, PassOwnPtr<BlobData>);
+ virtual void registerBlobURL(const KURL&, const KURL& srcURL);
+ virtual void unregisterBlobURL(const KURL&);
+ virtual PassRefPtr<ResourceHandle> createResourceHandle(const ResourceRequest&, ResourceHandleClient*);
+ virtual bool loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data);
+
+ PassRefPtr<BlobStorageData> getBlobDataFromURL(const KURL&) const;
+
+private:
+ bool shouldLoadResource(const ResourceRequest& request) const;
+ void appendStorageItems(BlobStorageData*, const BlobStorageDataItemList&);
+ void appendStorageItems(BlobStorageData*, const BlobStorageDataItemList&, long long offset, long long length);
+
+ HashMap<String, RefPtr<BlobStorageData> > m_blobs;
+};
+
+} // namespace WebCore
+
+#endif // BlobRegistryImpl_h
diff --git a/WebCore/platform/network/BlobStorageData.h b/WebCore/platform/network/BlobStorageData.h
new file mode 100644
index 0000000..f4125a4
--- /dev/null
+++ b/WebCore/platform/network/BlobStorageData.h
@@ -0,0 +1,108 @@
+/*
+ * 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 BlobStorageData_h
+#define BlobStorageData_h
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+struct BlobStorageDataItem {
+ enum BlobStoreDataItemType { Data, File };
+ BlobStoreDataItemType type;
+ long long offset;
+ long long length;
+
+ // For string data.
+ CString data;
+
+ // For file data.
+ String path;
+ double expectedModificationTime;
+
+ BlobStorageDataItem(const CString& data, long long offset, long long length)
+ : type(Data)
+ , offset(offset)
+ , length(length)
+ , data(data)
+ , expectedModificationTime(0)
+ {
+ }
+
+ BlobStorageDataItem(const String& path, long long offset, long long length, double expectedModificationTime)
+ : type(File)
+ , offset(offset)
+ , length(length)
+ , path(path)
+ , expectedModificationTime(expectedModificationTime)
+ {
+ }
+};
+
+typedef Vector<BlobStorageDataItem> BlobStorageDataItemList;
+
+class BlobStorageData : public RefCounted<BlobStorageData> {
+public:
+ static PassRefPtr<BlobStorageData> create()
+ {
+ return adoptRef(new BlobStorageData());
+ }
+
+ const String& contentType() const { return m_contentType; }
+ void setContentType(const String& contentType) { m_contentType = contentType; }
+
+ const String& contentDisposition() const { return m_contentDisposition; }
+ void setContentDisposition(const String& contentDisposition) { m_contentDisposition = contentDisposition; }
+
+ const BlobStorageDataItemList& items() const { return m_items; }
+
+ void appendData(const CString& data, long long offset, long long length)
+ {
+ m_items.append(BlobStorageDataItem(data, offset, length));
+ }
+
+ void appendFile(const String& path, long long offset, long long length, double expectedModificationTime)
+ {
+ m_items.append(BlobStorageDataItem(path, offset, length, expectedModificationTime));
+ }
+
+private:
+ String m_contentType;
+ String m_contentDisposition;
+ BlobStorageDataItemList m_items;
+};
+
+} // namespace WebCore
+
+#endif // BlobStorageData_h
diff --git a/WebCore/platform/network/CredentialStorage.cpp b/WebCore/platform/network/CredentialStorage.cpp
index 14f4086..4fb7799 100644
--- a/WebCore/platform/network/CredentialStorage.cpp
+++ b/WebCore/platform/network/CredentialStorage.cpp
@@ -29,8 +29,8 @@
#include "Credential.h"
#include "KURL.h"
#include "ProtectionSpaceHash.h"
-#include "StringHash.h"
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/StdLibExtras.h>
@@ -75,9 +75,9 @@ static String protectionSpaceMapKeyFromURL(const KURL& url)
unsigned directoryURLPathStart = url.pathStart();
ASSERT(directoryURL[directoryURLPathStart] == '/');
if (directoryURL.length() > directoryURLPathStart + 1) {
- int index = directoryURL.reverseFind('/');
- ASSERT(index > 0);
- directoryURL = directoryURL.substring(0, (static_cast<unsigned>(index) != directoryURLPathStart) ? static_cast<unsigned>(index) : directoryURLPathStart + 1);
+ size_t index = directoryURL.reverseFind('/');
+ ASSERT(index != notFound);
+ directoryURL = directoryURL.substring(0, (index != directoryURLPathStart) ? index : directoryURLPathStart + 1);
}
ASSERT(directoryURL.length() == directoryURLPathStart + 1 || directoryURL[directoryURL.length() - 1] != '/');
@@ -132,9 +132,9 @@ static PathToDefaultProtectionSpaceMap::iterator findDefaultProtectionSpaceForUR
if (directoryURL.length() == directoryURLPathStart + 1) // path is "/" already, cannot shorten it any more
return map.end();
- int index = directoryURL.reverseFind('/', -2);
- ASSERT(index > 0);
- directoryURL = directoryURL.substring(0, (static_cast<unsigned>(index) == directoryURLPathStart) ? index + 1 : index);
+ size_t index = directoryURL.reverseFind('/', directoryURL.length() - 2);
+ ASSERT(index != notFound);
+ directoryURL = directoryURL.substring(0, (index == directoryURLPathStart) ? index + 1 : index);
ASSERT(directoryURL.length() > directoryURLPathStart);
ASSERT(directoryURL.length() == directoryURLPathStart + 1 || directoryURL[directoryURL.length() - 1] != '/');
}
diff --git a/WebCore/platform/network/HTTPHeaderMap.h b/WebCore/platform/network/HTTPHeaderMap.h
index 557ddb3..c6145bd 100644
--- a/WebCore/platform/network/HTTPHeaderMap.h
+++ b/WebCore/platform/network/HTTPHeaderMap.h
@@ -27,13 +27,13 @@
#ifndef HTTPHeaderMap_h
#define HTTPHeaderMap_h
-#include "AtomicString.h"
-#include "AtomicStringHash.h"
-#include "StringHash.h"
#include <utility>
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/AtomicStringHash.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/network/HTTPParsers.cpp b/WebCore/platform/network/HTTPParsers.cpp
index 6252bfc..b3f3d45 100644
--- a/WebCore/platform/network/HTTPParsers.cpp
+++ b/WebCore/platform/network/HTTPParsers.cpp
@@ -42,9 +42,9 @@ using namespace WTF;
namespace WebCore {
// true if there is more to parse
-static inline bool skipWhiteSpace(const String& str, int& pos, bool fromHttpEquivMeta)
+static inline bool skipWhiteSpace(const String& str, unsigned& pos, bool fromHttpEquivMeta)
{
- int len = str.length();
+ unsigned len = str.length();
if (fromHttpEquivMeta) {
while (pos != len && str[pos] <= ' ')
@@ -59,9 +59,9 @@ static inline bool skipWhiteSpace(const String& str, int& pos, bool fromHttpEqui
// Returns true if the function can match the whole token (case insensitive).
// Note: Might return pos == str.length()
-static inline bool skipToken(const String& str, int& pos, const char* token)
+static inline bool skipToken(const String& str, unsigned& pos, const char* token)
{
- int len = str.length();
+ unsigned len = str.length();
while (pos != len && *token) {
if (toASCIILower(str[pos]) != *token++)
@@ -104,8 +104,8 @@ ContentDispositionType contentDispositionType(const String& contentDisposition)
bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url)
{
- int len = refresh.length();
- int pos = 0;
+ unsigned len = refresh.length();
+ unsigned pos = 0;
if (!skipWhiteSpace(refresh, pos, fromHttpEquivMeta))
return false;
@@ -126,7 +126,7 @@ bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del
++pos;
skipWhiteSpace(refresh, pos, fromHttpEquivMeta);
- int urlStartPos = pos;
+ unsigned urlStartPos = pos;
if (refresh.find("url", urlStartPos, false) == urlStartPos) {
urlStartPos += 3;
skipWhiteSpace(refresh, urlStartPos, fromHttpEquivMeta);
@@ -137,7 +137,7 @@ bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del
urlStartPos = pos; // e.g. "Refresh: 0; url.html"
}
- int urlEndPos = len;
+ unsigned urlEndPos = len;
if (refresh[urlStartPos] == '"' || refresh[urlStartPos] == '\'') {
UChar quotationMark = refresh[urlStartPos];
@@ -173,8 +173,8 @@ String filenameFromHTTPContentDisposition(const String& value)
unsigned length = keyValuePairs.size();
for (unsigned i = 0; i < length; i++) {
- int valueStartPos = keyValuePairs[i].find('=');
- if (valueStartPos < 0)
+ size_t valueStartPos = keyValuePairs[i].find('=');
+ if (valueStartPos == notFound)
continue;
String key = keyValuePairs[i].left(valueStartPos).stripWhiteSpace();
@@ -241,12 +241,12 @@ void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u
charsetPos = start;
charsetLen = 0;
- int pos = start;
- int length = (int)mediaType.length();
+ size_t pos = start;
+ unsigned length = mediaType.length();
while (pos < length) {
pos = mediaType.find("charset", pos, false);
- if (pos <= 0) {
+ if (pos == notFound || pos == 0) {
charsetLen = 0;
return;
}
@@ -270,7 +270,7 @@ void findCharsetInMediaType(const String& mediaType, unsigned int& charsetPos, u
++pos;
// we don't handle spaces within quoted parameter values, because charset names cannot have any
- int endpos = pos;
+ unsigned endpos = pos;
while (pos != length && mediaType[endpos] > ' ' && mediaType[endpos] != '"' && mediaType[endpos] != '\'' && mediaType[endpos] != ';')
++endpos;
@@ -290,8 +290,8 @@ XSSProtectionDisposition parseXSSProtectionHeader(const String& header)
if (stippedHeader[0] == '0')
return XSSProtectionDisabled;
- int length = (int)header.length();
- int pos = 0;
+ unsigned length = header.length();
+ unsigned pos = 0;
if (stippedHeader[pos++] == '1'
&& skipWhiteSpace(stippedHeader, pos, false)
&& stippedHeader[pos++] == ';'
@@ -309,7 +309,7 @@ XSSProtectionDisposition parseXSSProtectionHeader(const String& header)
String extractReasonPhraseFromHTTPStatusLine(const String& statusLine)
{
- int spacePos = statusLine.find(' ');
+ size_t spacePos = statusLine.find(' ');
// Remove status code from the status line.
spacePos = statusLine.find(' ', spacePos + 1);
return statusLine.substring(spacePos + 1);
diff --git a/WebCore/platform/network/NetworkingContext.h b/WebCore/platform/network/NetworkingContext.h
new file mode 100644
index 0000000..31f3025
--- /dev/null
+++ b/WebCore/platform/network/NetworkingContext.h
@@ -0,0 +1,68 @@
+/*
+ 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 NetworkingContext_h
+#define NetworkingContext_h
+
+#include <wtf/RefCounted.h>
+
+#if PLATFORM(MAC)
+#include "SchedulePair.h"
+#endif
+
+#if PLATFORM(QT)
+class QObject;
+class QNetworkAccessManager;
+#endif
+
+namespace WebCore {
+
+class ResourceError;
+class ResourceRequest;
+
+class NetworkingContext : public RefCounted<NetworkingContext> {
+public:
+ virtual ~NetworkingContext() { }
+
+ virtual bool isValid() const { return true; }
+
+#if PLATFORM(MAC)
+ virtual bool needsSiteSpecificQuirks() const = 0;
+ virtual bool localFileContentSniffingEnabled() const = 0;
+ virtual SchedulePairHashSet* scheduledRunLoopPairs() const = 0;
+ virtual ResourceError blockedError(const ResourceRequest&) const = 0;
+#endif
+
+#if PLATFORM(QT)
+ virtual QObject* originatingObject() const = 0;
+ virtual QNetworkAccessManager* networkAccessManager() const = 0;
+#endif
+
+#if PLATFORM(WIN)
+ virtual String userAgent() const = 0;
+ virtual String referrer() const = 0;
+#endif
+
+protected:
+ NetworkingContext() { }
+};
+
+}
+
+#endif // NetworkingContext_h
diff --git a/WebCore/platform/network/ResourceResponseBase.cpp b/WebCore/platform/network/ResourceResponseBase.cpp
index f30344e..e231652 100644
--- a/WebCore/platform/network/ResourceResponseBase.cpp
+++ b/WebCore/platform/network/ResourceResponseBase.cpp
@@ -439,8 +439,8 @@ bool ResourceResponseBase::isAttachment() const
DEFINE_STATIC_LOCAL(const AtomicString, headerName, ("content-disposition"));
String value = m_httpHeaderFields.get(headerName);
- int loc = value.find(';');
- if (loc != -1)
+ size_t loc = value.find(';');
+ if (loc != notFound)
value = value.left(loc);
value = value.stripWhiteSpace();
DEFINE_STATIC_LOCAL(const AtomicString, attachmentString, ("attachment"));
@@ -591,9 +591,9 @@ static void parseCacheHeader(const String& header, Vector<pair<String, String> >
const String safeHeader = header.removeCharacters(isControlCharacter);
unsigned max = safeHeader.length();
for (unsigned pos = 0; pos < max; /* pos incremented in loop */) {
- int nextCommaPosition = safeHeader.find(',', pos);
- int nextEqualSignPosition = safeHeader.find('=', pos);
- if (nextEqualSignPosition >= 0 && (nextEqualSignPosition < nextCommaPosition || nextCommaPosition < 0)) {
+ size_t nextCommaPosition = safeHeader.find(',', pos);
+ size_t nextEqualSignPosition = safeHeader.find('=', pos);
+ if (nextEqualSignPosition != notFound && (nextEqualSignPosition < nextCommaPosition || nextCommaPosition == notFound)) {
// Get directive name, parse right hand side of equal sign, then add to map
String directive = trimToNextSeparator(safeHeader.substring(pos, nextEqualSignPosition - pos).stripWhiteSpace());
pos += nextEqualSignPosition - pos + 1;
@@ -601,14 +601,14 @@ static void parseCacheHeader(const String& header, Vector<pair<String, String> >
String value = safeHeader.substring(pos, max - pos).stripWhiteSpace();
if (value[0] == '"') {
// The value is a quoted string
- int nextDoubleQuotePosition = value.find('"', 1);
- if (nextDoubleQuotePosition >= 0) {
+ size_t nextDoubleQuotePosition = value.find('"', 1);
+ if (nextDoubleQuotePosition != notFound) {
// Store the value as a quoted string without quotes
result.append(pair<String, String>(directive, value.substring(1, nextDoubleQuotePosition - 1).stripWhiteSpace()));
pos += (safeHeader.find('"', pos) - pos) + nextDoubleQuotePosition + 1;
// Move past next comma, if there is one
- int nextCommaPosition2 = safeHeader.find(',', pos);
- if (nextCommaPosition2 >= 0)
+ size_t nextCommaPosition2 = safeHeader.find(',', pos);
+ if (nextCommaPosition2 != notFound)
pos += nextCommaPosition2 - pos + 1;
else
return; // Parse error if there is anything left with no comma
@@ -619,8 +619,8 @@ static void parseCacheHeader(const String& header, Vector<pair<String, String> >
}
} else {
// The value is a token until the next comma
- int nextCommaPosition2 = value.find(',', 0);
- if (nextCommaPosition2 >= 0) {
+ size_t nextCommaPosition2 = value.find(',', 0);
+ if (nextCommaPosition2 != notFound) {
// The value is delimited by the next comma
result.append(pair<String, String>(directive, trimToNextSeparator(value.substring(0, nextCommaPosition2).stripWhiteSpace())));
pos += (safeHeader.find(',', pos) - pos) + 1;
@@ -630,7 +630,7 @@ static void parseCacheHeader(const String& header, Vector<pair<String, String> >
return;
}
}
- } else if (nextCommaPosition >= 0 && (nextCommaPosition < nextEqualSignPosition || nextEqualSignPosition < 0)) {
+ } else if (nextCommaPosition != notFound && (nextCommaPosition < nextEqualSignPosition || nextEqualSignPosition == notFound)) {
// Add directive to map with empty string as value
result.append(pair<String, String>(trimToNextSeparator(safeHeader.substring(pos, nextCommaPosition - pos).stripWhiteSpace()), ""));
pos += nextCommaPosition - pos + 1;
diff --git a/WebCore/platform/network/cf/DNSCFNet.cpp b/WebCore/platform/network/cf/DNSCFNet.cpp
index bda9e41..fbceb7d 100644
--- a/WebCore/platform/network/cf/DNSCFNet.cpp
+++ b/WebCore/platform/network/cf/DNSCFNet.cpp
@@ -27,11 +27,11 @@
#include "config.h"
#include "DNS.h"
-#include "StringHash.h"
#include "Timer.h"
#include <wtf/HashSet.h>
#include <wtf/RetainPtr.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
#if PLATFORM(WIN)
#include "LoaderRunLoopCF.h"
diff --git a/WebCore/platform/network/curl/CookieJarCurl.cpp b/WebCore/platform/network/curl/CookieJarCurl.cpp
index 7c906a0..e05947c 100644
--- a/WebCore/platform/network/curl/CookieJarCurl.cpp
+++ b/WebCore/platform/network/curl/CookieJarCurl.cpp
@@ -21,9 +21,8 @@
#include "Document.h"
#include "KURL.h"
#include "PlatformString.h"
-#include "StringHash.h"
-
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp
index 6ca4830..f677d28 100644
--- a/WebCore/platform/qt/ClipboardQt.cpp
+++ b/WebCore/platform/qt/ClipboardQt.cpp
@@ -43,8 +43,8 @@
#include "PlatformString.h"
#include "Range.h"
#include "RenderImage.h"
-#include "StringHash.h"
#include "markup.h"
+#include <wtf/text/StringHash.h>
#include <QApplication>
#include <QClipboard>
diff --git a/WebCore/platform/sql/SQLiteDatabase.cpp b/WebCore/platform/sql/SQLiteDatabase.cpp
index 05a2a22..80d3946 100644
--- a/WebCore/platform/sql/SQLiteDatabase.cpp
+++ b/WebCore/platform/sql/SQLiteDatabase.cpp
@@ -33,6 +33,7 @@
#include "SQLiteStatement.h"
#include <sqlite3.h>
#include <wtf/Threading.h>
+#include <wtf/text/CString.h>
namespace WebCore {
@@ -156,7 +157,11 @@ void SQLiteDatabase::setMaximumSize(int64_t size)
SQLiteStatement statement(*this, "PRAGMA max_page_count = " + String::number(newMaxPageCount));
statement.prepare();
if (statement.step() != SQLResultRow)
+#if OS(WINDOWS)
+ LOG_ERROR("Failed to set maximum size of database to %I64i bytes", static_cast<long long>(size));
+#else
LOG_ERROR("Failed to set maximum size of database to %lli bytes", static_cast<long long>(size));
+#endif
enableAuthorizer(true);
diff --git a/WebCore/platform/sql/SQLiteStatement.cpp b/WebCore/platform/sql/SQLiteStatement.cpp
index ac467a6..4dc80fb 100644
--- a/WebCore/platform/sql/SQLiteStatement.cpp
+++ b/WebCore/platform/sql/SQLiteStatement.cpp
@@ -30,6 +30,7 @@
#include "SQLValue.h"
#include <sqlite3.h>
#include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
namespace WebCore {
diff --git a/WebCore/platform/text/AtomicString.h b/WebCore/platform/text/AtomicString.h
deleted file mode 100644
index 6ce63b5..0000000
--- a/WebCore/platform/text/AtomicString.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * 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 WebCoreAtomicString_h
-#define WebCoreAtomicString_h
-
-// FIXME: remove this header, use the forward from wtf directly.
-#include <wtf/text/AtomicString.h>
-
-#endif // AtomicString_h
diff --git a/WebCore/platform/text/AtomicStringImpl.h b/WebCore/platform/text/AtomicStringImpl.h
deleted file mode 100644
index 64bce77..0000000
--- a/WebCore/platform/text/AtomicStringImpl.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * 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 WebCoreAtomicStringImpl_h
-#define WebCoreAtomicStringImpl_h
-
-// FIXME: remove this header, use the forward from wtf directly.
-#include <wtf/text/AtomicStringImpl.h>
-
-#endif
diff --git a/WebCore/platform/text/AtomicStringKeyedMRUCache.h b/WebCore/platform/text/AtomicStringKeyedMRUCache.h
index a47585a..b3004f7 100644
--- a/WebCore/platform/text/AtomicStringKeyedMRUCache.h
+++ b/WebCore/platform/text/AtomicStringKeyedMRUCache.h
@@ -26,6 +26,8 @@
#ifndef AtomicStringKeyedMRUCache_h
#define AtomicStringKeyedMRUCache_h
+#include <wtf/text/AtomicString.h>
+
namespace WebCore {
template<typename T, size_t capacity = 4>
diff --git a/WebCore/platform/text/SegmentedString.cpp b/WebCore/platform/text/SegmentedString.cpp
index 04d6c77..b9ff503 100644
--- a/WebCore/platform/text/SegmentedString.cpp
+++ b/WebCore/platform/text/SegmentedString.cpp
@@ -52,6 +52,7 @@ const SegmentedString& SegmentedString::operator=(const SegmentedString &other)
else
m_currentChar = other.m_currentChar;
m_closed = other.m_closed;
+ m_numberOfCharactersConsumedPriorToCurrentString = other.m_numberOfCharactersConsumedPriorToCurrentString;
return *this;
}
@@ -99,6 +100,7 @@ void SegmentedString::append(const SegmentedSubstring &s)
ASSERT(!m_closed);
if (s.m_length) {
if (!m_currentString.m_length) {
+ m_numberOfCharactersConsumedPriorToCurrentString += m_currentString.numberOfCharactersConsumed();
m_currentString = s;
} else {
m_substrings.append(s);
@@ -110,7 +112,15 @@ void SegmentedString::append(const SegmentedSubstring &s)
void SegmentedString::prepend(const SegmentedSubstring &s)
{
ASSERT(!escaped());
+ ASSERT(!s.numberOfCharactersConsumed());
if (s.m_length) {
+ // FIXME: We're assuming that the prepend were originally consumed by
+ // this SegmentedString. We're also ASSERTing that s is a fresh
+ // SegmentedSubstring. These assumptions are sufficient for our
+ // current use, but we might need to handle the more elaborate
+ // cases in the future.
+ m_numberOfCharactersConsumedPriorToCurrentString += m_currentString.numberOfCharactersConsumed();
+ m_numberOfCharactersConsumedPriorToCurrentString -= s.m_length;
if (!m_currentString.m_length)
m_currentString = s;
else {
@@ -160,7 +170,12 @@ void SegmentedString::prepend(const SegmentedString &s)
void SegmentedString::advanceSubstring()
{
if (m_composite) {
+ m_numberOfCharactersConsumedPriorToCurrentString += m_currentString.numberOfCharactersConsumed();
m_currentString = m_substrings.takeFirst();
+ // If we've previously consumed some characters of the non-current
+ // string, we now account for those characters as part of the current
+ // string, not as part of "prior to current string."
+ m_numberOfCharactersConsumedPriorToCurrentString -= m_currentString.numberOfCharactersConsumed();
if (m_substrings.isEmpty())
m_composite = false;
} else {
diff --git a/WebCore/platform/text/SegmentedString.h b/WebCore/platform/text/SegmentedString.h
index 1d3098d..91c2cbe 100644
--- a/WebCore/platform/text/SegmentedString.h
+++ b/WebCore/platform/text/SegmentedString.h
@@ -45,6 +45,8 @@ public:
void setExcludeLineNumbers() { m_doNotExcludeLineNumbers = false; }
+ int numberOfCharactersConsumed() const { return m_string.length() - m_length; }
+
void appendTo(String& str) const
{
if (m_string.characters() == m_current) {
@@ -69,10 +71,26 @@ private:
class SegmentedString {
public:
SegmentedString()
- : m_pushedChar1(0), m_pushedChar2(0), m_currentChar(0), m_composite(false), m_closed(false) {}
+ : m_pushedChar1(0)
+ , m_pushedChar2(0)
+ , m_currentChar(0)
+ , m_numberOfCharactersConsumedPriorToCurrentString(0)
+ , m_composite(false)
+ , m_closed(false)
+ {
+ }
+
SegmentedString(const String& str)
- : m_pushedChar1(0), m_pushedChar2(0), m_currentString(str)
- , m_currentChar(m_currentString.m_current), m_composite(false), m_closed(false) {}
+ : m_pushedChar1(0)
+ , m_pushedChar2(0)
+ , m_currentString(str)
+ , m_currentChar(m_currentString.m_current)
+ , m_numberOfCharactersConsumedPriorToCurrentString(0)
+ , m_composite(false)
+ , m_closed(false)
+ {
+ }
+
SegmentedString(const SegmentedString&);
const SegmentedString& operator=(const SegmentedString&);
@@ -173,6 +191,13 @@ public:
bool escaped() const { return m_pushedChar1; }
+ int numberOfCharactersConsumed()
+ {
+ // We don't currently handle the case when there are pushed character.
+ ASSERT(!m_pushedChar1);
+ return m_numberOfCharactersConsumedPriorToCurrentString + m_currentString.numberOfCharactersConsumed();
+ }
+
String toString() const;
const UChar& operator*() const { return *current(); }
@@ -221,6 +246,7 @@ private:
UChar m_pushedChar2;
SegmentedSubstring m_currentString;
const UChar* m_currentChar;
+ int m_numberOfCharactersConsumedPriorToCurrentString;
Deque<SegmentedSubstring> m_substrings;
bool m_composite;
bool m_closed;
diff --git a/WebCore/platform/text/StringBuilder.cpp b/WebCore/platform/text/StringBuilder.cpp
index 213daab..1c47129 100644
--- a/WebCore/platform/text/StringBuilder.cpp
+++ b/WebCore/platform/text/StringBuilder.cpp
@@ -30,7 +30,7 @@
#include "config.h"
#include "StringBuilder.h"
-#include "StringBuffer.h"
+#include <wtf/text/StringBuffer.h>
namespace WebCore {
diff --git a/WebCore/platform/text/StringHash.h b/WebCore/platform/text/StringHash.h
deleted file mode 100644
index 35de30d..0000000
--- a/WebCore/platform/text/StringHash.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved
- * Copyright (C) Research In Motion Limited 2009. 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 WebCoreStringHash_h
-#define WebCoreStringHash_h
-
-// FIXME: remove this header, use the forward from wtf directly.
-#include <wtf/text/StringHash.h>
-
-#endif
diff --git a/WebCore/platform/text/StringImpl.h b/WebCore/platform/text/StringImpl.h
deleted file mode 100644
index fa79b61..0000000
--- a/WebCore/platform/text/StringImpl.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WebCoreStringImpl_h
-#define WebCoreStringImpl_h
-
-// FIXME: remove this header, use the forward from wtf directly.
-#include <wtf/text/StringImpl.h>
-
-#endif
diff --git a/WebCore/platform/text/TextBoundaries.cpp b/WebCore/platform/text/TextBoundaries.cpp
index 2455f6d..8eaffca 100644
--- a/WebCore/platform/text/TextBoundaries.cpp
+++ b/WebCore/platform/text/TextBoundaries.cpp
@@ -27,8 +27,8 @@
#include "config.h"
#include "TextBoundaries.h"
-#include "StringImpl.h"
#include "TextBreakIterator.h"
+#include <wtf/text/StringImpl.h>
#include <wtf/unicode/Unicode.h>
using namespace WTF;
diff --git a/WebCore/platform/text/TextCodecLatin1.cpp b/WebCore/platform/text/TextCodecLatin1.cpp
index 1e9385d..4f9cbe0 100644
--- a/WebCore/platform/text/TextCodecLatin1.cpp
+++ b/WebCore/platform/text/TextCodecLatin1.cpp
@@ -27,9 +27,9 @@
#include "TextCodecLatin1.h"
#include "PlatformString.h"
-#include "StringBuffer.h"
#include <stdio.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringBuffer.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/WebCore/platform/text/TextCodecUTF16.cpp b/WebCore/platform/text/TextCodecUTF16.cpp
index 16f8431..5c23732 100644
--- a/WebCore/platform/text/TextCodecUTF16.cpp
+++ b/WebCore/platform/text/TextCodecUTF16.cpp
@@ -27,8 +27,8 @@
#include "TextCodecUTF16.h"
#include "PlatformString.h"
-#include "StringBuffer.h"
#include <wtf/text/CString.h>
+#include <wtf/text/StringBuffer.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/WebCore/platform/text/TextCodecUserDefined.cpp b/WebCore/platform/text/TextCodecUserDefined.cpp
index 851d693..70d8673 100644
--- a/WebCore/platform/text/TextCodecUserDefined.cpp
+++ b/WebCore/platform/text/TextCodecUserDefined.cpp
@@ -27,9 +27,9 @@
#include "TextCodecUserDefined.h"
#include "PlatformString.h"
-#include "StringBuffer.h"
#include <stdio.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringBuffer.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
diff --git a/WebCore/platform/text/cf/HyphenationCF.cpp b/WebCore/platform/text/cf/HyphenationCF.cpp
index b983979..8be537d 100644
--- a/WebCore/platform/text/cf/HyphenationCF.cpp
+++ b/WebCore/platform/text/cf/HyphenationCF.cpp
@@ -28,7 +28,6 @@
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-#include "AtomicString.h"
#include "AtomicStringKeyedMRUCache.h"
#include "TextBreakIteratorInternalICU.h"
#include <wtf/ListHashSet.h>
diff --git a/WebCore/platform/text/cf/StringImplCF.cpp b/WebCore/platform/text/cf/StringImplCF.cpp
index 18e137f..0157918 100644
--- a/WebCore/platform/text/cf/StringImplCF.cpp
+++ b/WebCore/platform/text/cf/StringImplCF.cpp
@@ -19,7 +19,7 @@
*/
#include "config.h"
-#include "StringImpl.h"
+#include <wtf/text/StringImpl.h>
#if PLATFORM(CF)
diff --git a/WebCore/platform/text/mac/HyphenationMac.mm b/WebCore/platform/text/mac/HyphenationMac.mm
index 56122df..d5c9283 100644
--- a/WebCore/platform/text/mac/HyphenationMac.mm
+++ b/WebCore/platform/text/mac/HyphenationMac.mm
@@ -28,7 +28,6 @@
#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
-#import "AtomicString.h"
#import "AtomicStringKeyedMRUCache.h"
#import "TextBreakIteratorInternalICU.h"
#import "WebCoreSystemInterface.h"
diff --git a/WebCore/platform/text/mac/StringImplMac.mm b/WebCore/platform/text/mac/StringImplMac.mm
index 843f396..6f5e953 100644
--- a/WebCore/platform/text/mac/StringImplMac.mm
+++ b/WebCore/platform/text/mac/StringImplMac.mm
@@ -19,7 +19,7 @@
*/
#include "config.h"
-#include "StringImpl.h"
+#include <wtf/text/StringImpl.h>
#include "FoundationExtras.h"
diff --git a/WebCore/platform/text/transcoder/FontTranscoder.h b/WebCore/platform/text/transcoder/FontTranscoder.h
index 1fdc936..67db977 100644
--- a/WebCore/platform/text/transcoder/FontTranscoder.h
+++ b/WebCore/platform/text/transcoder/FontTranscoder.h
@@ -31,9 +31,9 @@
#ifndef FontTranscoder_h
#define FontTranscoder_h
-#include "AtomicStringHash.h"
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/platform/text/wince/TextCodecWinCE.cpp b/WebCore/platform/text/wince/TextCodecWinCE.cpp
index 644b12f..578f789 100644
--- a/WebCore/platform/text/wince/TextCodecWinCE.cpp
+++ b/WebCore/platform/text/wince/TextCodecWinCE.cpp
@@ -27,13 +27,13 @@
#include "ce_textcodecs.h"
#include "FontCache.h"
#include "PlatformString.h"
-#include "StringHash.h"
#include <mlang.h>
#include <winbase.h>
#include <winnls.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
#include <wtf/unicode/UTF8.h>
namespace WebCore {
diff --git a/WebCore/platform/win/BString.cpp b/WebCore/platform/win/BString.cpp
index 618ecf3..4d6d11e 100644
--- a/WebCore/platform/win/BString.cpp
+++ b/WebCore/platform/win/BString.cpp
@@ -26,9 +26,9 @@
#include "config.h"
#include "BString.h"
-#include "AtomicString.h"
#include "KURL.h"
#include "PlatformString.h"
+#include <wtf/text/AtomicString.h>
#include <tchar.h>
#include <windows.h>
@@ -90,7 +90,7 @@ BString::BString(const UString& s)
if (s.isNull())
m_bstr = 0;
else
- m_bstr = SysAllocStringLen(s.data(), s.size());
+ m_bstr = SysAllocStringLen(s.characters(), s.length());
}
#if PLATFORM(CF)
diff --git a/WebCore/platform/win/COMPtr.h b/WebCore/platform/win/COMPtr.h
index 692706f..6b84256 100644
--- a/WebCore/platform/win/COMPtr.h
+++ b/WebCore/platform/win/COMPtr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 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
@@ -44,7 +44,7 @@ enum AdoptCOMTag { AdoptCOM };
enum QueryTag { Query };
enum CreateTag { Create };
-template <typename T> class COMPtr {
+template<typename T> class COMPtr {
public:
COMPtr() : m_ptr(0) { }
COMPtr(T* ptr) : m_ptr(ptr) { if (m_ptr) m_ptr->AddRef(); }
@@ -52,7 +52,7 @@ public:
COMPtr(const COMPtr& o) : m_ptr(o.m_ptr) { if (T* ptr = m_ptr) ptr->AddRef(); }
COMPtr(QueryTag, IUnknown* ptr) : m_ptr(copyQueryInterfaceRef(ptr)) { }
- template <typename U> COMPtr(QueryTag, const COMPtr<U>& ptr) : m_ptr(copyQueryInterfaceRef(ptr.get())) { }
+ template<typename U> COMPtr(QueryTag, const COMPtr<U>& ptr) : m_ptr(copyQueryInterfaceRef(ptr.get())) { }
COMPtr(CreateTag, const IID& clsid) : m_ptr(createInstance(clsid)) { }
@@ -63,7 +63,9 @@ public:
~COMPtr() { if (m_ptr) m_ptr->Release(); }
T* get() const { return m_ptr; }
- T* releaseRef() { T* tmp = m_ptr; m_ptr = 0; return tmp; }
+
+ void clear();
+ T* leakRef();
T& operator*() const { return *m_ptr; }
T* operator->() const { return m_ptr; }
@@ -78,16 +80,19 @@ public:
COMPtr& operator=(const COMPtr&);
COMPtr& operator=(T*);
- template <typename U> COMPtr& operator=(const COMPtr<U>&);
+ template<typename U> COMPtr& operator=(const COMPtr<U>&);
void query(IUnknown* ptr) { adoptRef(copyQueryInterfaceRef(ptr)); }
- template <typename U> void query(const COMPtr<U>& ptr) { query(ptr.get()); }
+ template<typename U> void query(const COMPtr<U>& ptr) { query(ptr.get()); }
void create(const IID& clsid) { adoptRef(createInstance(clsid)); }
- template <typename U> HRESULT copyRefTo(U**);
+ template<typename U> HRESULT copyRefTo(U**);
void adoptRef(T*);
+ // FIXME: Remove releaseRef once we change all callers to call leakRef instead.
+ T* releaseRef() { return leakRef(); }
+
private:
static T* copyQueryInterfaceRef(IUnknown*);
static T* createInstance(const IID& clsid);
@@ -96,7 +101,22 @@ private:
T* m_ptr;
};
-template <typename T> inline T* COMPtr<T>::createInstance(const IID& clsid)
+template<typename T> inline void COMPtr<T>::clear()
+{
+ if (T* ptr = m_ptr) {
+ m_ptr = 0;
+ ptr->Release();
+ }
+}
+
+template<typename T> inline T* COMPtr<T>::leakRef()
+{
+ T* ptr = m_ptr;
+ m_ptr = 0;
+ return ptr;
+}
+
+template<typename T> inline T* COMPtr<T>::createInstance(const IID& clsid)
{
T* result;
if (FAILED(CoCreateInstance(clsid, 0, CLSCTX_ALL, __uuidof(result), reinterpret_cast<void**>(&result))))
@@ -104,7 +124,7 @@ template <typename T> inline T* COMPtr<T>::createInstance(const IID& clsid)
return result;
}
-template <typename T> inline T* COMPtr<T>::copyQueryInterfaceRef(IUnknown* ptr)
+template<typename T> inline T* COMPtr<T>::copyQueryInterfaceRef(IUnknown* ptr)
{
if (!ptr)
return 0;
@@ -114,7 +134,7 @@ template <typename T> inline T* COMPtr<T>::copyQueryInterfaceRef(IUnknown* ptr)
return result;
}
-template <typename T> template <typename U> inline HRESULT COMPtr<T>::copyRefTo(U** ptr)
+template<typename T> template<typename U> inline HRESULT COMPtr<T>::copyRefTo(U** ptr)
{
if (!ptr)
return E_POINTER;
@@ -124,14 +144,14 @@ template <typename T> template <typename U> inline HRESULT COMPtr<T>::copyRefTo(
return S_OK;
}
-template <typename T> inline void COMPtr<T>::adoptRef(T *ptr)
+template<typename T> inline void COMPtr<T>::adoptRef(T *ptr)
{
if (m_ptr)
m_ptr->Release();
m_ptr = ptr;
}
-template <typename T> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<T>& o)
+template<typename T> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<T>& o)
{
T* optr = o.get();
if (optr)
@@ -143,7 +163,7 @@ template <typename T> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<T>& o)
return *this;
}
-template <typename T> template <typename U> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<U>& o)
+template<typename T> template<typename U> inline COMPtr<T>& COMPtr<T>::operator=(const COMPtr<U>& o)
{
T* optr = o.get();
if (optr)
@@ -155,7 +175,7 @@ template <typename T> template <typename U> inline COMPtr<T>& COMPtr<T>::operato
return *this;
}
-template <typename T> inline COMPtr<T>& COMPtr<T>::operator=(T* optr)
+template<typename T> inline COMPtr<T>& COMPtr<T>::operator=(T* optr)
{
if (optr)
optr->AddRef();
@@ -166,32 +186,32 @@ template <typename T> inline COMPtr<T>& COMPtr<T>::operator=(T* optr)
return *this;
}
-template <typename T, typename U> inline bool operator==(const COMPtr<T>& a, const COMPtr<U>& b)
+template<typename T, typename U> inline bool operator==(const COMPtr<T>& a, const COMPtr<U>& b)
{
return a.get() == b.get();
}
-template <typename T, typename U> inline bool operator==(const COMPtr<T>& a, U* b)
+template<typename T, typename U> inline bool operator==(const COMPtr<T>& a, U* b)
{
return a.get() == b;
}
-template <typename T, typename U> inline bool operator==(T* a, const COMPtr<U>& b)
+template<typename T, typename U> inline bool operator==(T* a, const COMPtr<U>& b)
{
return a == b.get();
}
-template <typename T, typename U> inline bool operator!=(const COMPtr<T>& a, const COMPtr<U>& b)
+template<typename T, typename U> inline bool operator!=(const COMPtr<T>& a, const COMPtr<U>& b)
{
return a.get() != b.get();
}
-template <typename T, typename U> inline bool operator!=(const COMPtr<T>& a, U* b)
+template<typename T, typename U> inline bool operator!=(const COMPtr<T>& a, U* b)
{
return a.get() != b;
}
-template <typename T, typename U> inline bool operator!=(T* a, const COMPtr<U>& b)
+template<typename T, typename U> inline bool operator!=(T* a, const COMPtr<U>& b)
{
return a != b.get();
}
@@ -200,8 +220,8 @@ namespace WTF {
template<typename P> struct HashTraits<COMPtr<P> > : GenericHashTraits<COMPtr<P> > {
static const bool emptyValueIsZero = true;
- static void constructDeletedValue(COMPtr<P>& slot) { slot.releaseRef(); *&slot = reinterpret_cast<P*>(-1); }
- static bool isDeletedValue(const COMPtr<P>& value) { return value == reinterpret_cast<P*>(-1); }
+ static void constructDeletedValue(COMPtr<P>& slot) { new (&slot) COMPtr<P>(HashTableDeletedValue); }
+ static bool isDeletedValue(const COMPtr<P>& value) { return value.isHashTableDeletedValue(); }
};
template<typename P> struct PtrHash<COMPtr<P> > : PtrHash<P*> {
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 6e026d6..2915f9d 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -49,7 +49,6 @@
#include "RenderImage.h"
#include "ResourceResponse.h"
#include "SharedBuffer.h"
-#include "StringHash.h"
#include "WCDataObject.h"
#include "csshelper.h"
#include "markup.h"
@@ -57,6 +56,7 @@
#include <wininet.h>
#include <wtf/RefPtr.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
using namespace std;
diff --git a/WebCore/platform/win/SearchPopupMenuWin.cpp b/WebCore/platform/win/SearchPopupMenuWin.cpp
index 6655b1b..7ae800b 100644
--- a/WebCore/platform/win/SearchPopupMenuWin.cpp
+++ b/WebCore/platform/win/SearchPopupMenuWin.cpp
@@ -21,7 +21,7 @@
#include "config.h"
#include "SearchPopupMenuWin.h"
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
#if PLATFORM(CF)
#include <wtf/RetainPtr.h>
diff --git a/WebCore/platform/win/SharedBufferWin.cpp b/WebCore/platform/win/SharedBufferWin.cpp
index bbecb86..59a5a76 100644
--- a/WebCore/platform/win/SharedBufferWin.cpp
+++ b/WebCore/platform/win/SharedBufferWin.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "SharedBuffer.h"
+#include <wtf/text/CString.h>
// INVALID_FILE_SIZE is not defined on WinCE.
#ifndef INVALID_FILE_SIZE
diff --git a/WebCore/platform/wince/SearchPopupMenuWince.cpp b/WebCore/platform/wince/SearchPopupMenuWince.cpp
index 756b7cf..f9d65a6 100644
--- a/WebCore/platform/wince/SearchPopupMenuWince.cpp
+++ b/WebCore/platform/wince/SearchPopupMenuWince.cpp
@@ -20,8 +20,8 @@
#include "config.h"
#include "SearchPopupMenu.h"
-#include "AtomicString.h"
#include "NotImplemented.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/platform/wx/ClipboardWx.cpp b/WebCore/platform/wx/ClipboardWx.cpp
index 336881d..2ef943f 100644
--- a/WebCore/platform/wx/ClipboardWx.cpp
+++ b/WebCore/platform/wx/ClipboardWx.cpp
@@ -32,7 +32,7 @@
#include "NotImplemented.h"
#include "Pasteboard.h"
#include "PlatformString.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/plugins/DOMMimeTypeArray.cpp b/WebCore/plugins/DOMMimeTypeArray.cpp
index f36f2a2..8c81bb7 100644
--- a/WebCore/plugins/DOMMimeTypeArray.cpp
+++ b/WebCore/plugins/DOMMimeTypeArray.cpp
@@ -20,11 +20,11 @@
#include "config.h"
#include "DOMMimeTypeArray.h"
-#include "AtomicString.h"
#include "DOMPlugin.h"
#include "Frame.h"
#include "Page.h"
#include "PluginData.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/plugins/DOMPlugin.cpp b/WebCore/plugins/DOMPlugin.cpp
index 11ec929..ac4fd03 100644
--- a/WebCore/plugins/DOMPlugin.cpp
+++ b/WebCore/plugins/DOMPlugin.cpp
@@ -19,9 +19,9 @@
#include "config.h"
#include "DOMPlugin.h"
-#include "AtomicString.h"
#include "PluginData.h"
#include "Frame.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/plugins/DOMPluginArray.cpp b/WebCore/plugins/DOMPluginArray.cpp
index fb11da8..3717f32 100644
--- a/WebCore/plugins/DOMPluginArray.cpp
+++ b/WebCore/plugins/DOMPluginArray.cpp
@@ -20,11 +20,11 @@
#include "config.h"
#include "DOMPluginArray.h"
-#include "AtomicString.h"
#include "DOMPlugin.h"
#include "Frame.h"
#include "Page.h"
#include "PluginData.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/plugins/PluginDatabase.h b/WebCore/plugins/PluginDatabase.h
index ea3559d..287857e 100644
--- a/WebCore/plugins/PluginDatabase.h
+++ b/WebCore/plugins/PluginDatabase.h
@@ -30,10 +30,9 @@
#include "PlatformString.h"
#include "PluginPackage.h"
-#include "StringHash.h"
-
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#if defined(ANDROID_PLUGINS)
namespace android {
diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp
index c7d8b22..48c44f0 100644
--- a/WebCore/plugins/PluginPackage.cpp
+++ b/WebCore/plugins/PluginPackage.cpp
@@ -191,7 +191,6 @@ void PluginPackage::determineQuirks(const String& mimeType)
#if PLATFORM(QT)
m_quirks.add(PluginQuirkRequiresGtkToolKit);
#endif
- m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
} else {
// Flash 9 and older requests windowless plugins if we return a mozilla user agent
m_quirks.add(PluginQuirkWantsMozillaUserAgent);
@@ -201,6 +200,7 @@ void PluginPackage::determineQuirks(const String& mimeType)
#endif
}
+ m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
m_quirks.add(PluginQuirkThrottleInvalidate);
m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
m_quirks.add(PluginQuirkFlashURLNotifyBug);
diff --git a/WebCore/plugins/PluginPackage.h b/WebCore/plugins/PluginPackage.h
index 659f5ff..92a9c52 100644
--- a/WebCore/plugins/PluginPackage.h
+++ b/WebCore/plugins/PluginPackage.h
@@ -30,11 +30,11 @@
#include "FileSystem.h"
#include "PlatformString.h"
#include "PluginQuirkSet.h"
-#include "StringHash.h"
#include "Timer.h"
#include "npruntime_internal.h"
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringHash.h>
#if OS(SYMBIAN)
class QPluginLoader;
diff --git a/WebCore/plugins/PluginStream.h b/WebCore/plugins/PluginStream.h
index f9f927e..ae69539 100644
--- a/WebCore/plugins/PluginStream.h
+++ b/WebCore/plugins/PluginStream.h
@@ -34,7 +34,6 @@
#include "PluginQuirkSet.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
-#include "StringHash.h"
#include "Timer.h"
#include "npruntime_internal.h"
#include <wtf/HashMap.h>
@@ -42,6 +41,7 @@
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
class Frame;
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index 2f5f342..5a33b78 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2010 Girish Ramakrishnan <girish@forwardbias.in>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -708,6 +709,12 @@ NPError PluginView::setValue(NPPVariable variable, void* value)
}
#endif // defined(XP_MACOSX)
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ case NPPVpluginWindowlessLocalBool:
+ m_renderToImage = true;
+ return NPERR_NO_ERROR;
+#endif
+
default:
#ifdef PLUGIN_PLATFORM_SETVALUE
return platformSetValue(variable, value);
@@ -919,6 +926,9 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p
, m_colormap(0)
, m_pluginDisplay(0)
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ , m_renderToImage(false)
+#endif
, m_loadManually(loadManually)
, m_manualStream(0)
, m_isJavaScriptPaused(false)
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index cc36665..2b272ec 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -62,6 +62,10 @@ typedef PlatformWidget PlatformPluginWidget;
#include <QPixmap>
#endif
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+#include <QImage>
+class QPainter;
+#endif
#if USE(JSC)
namespace JSC {
@@ -420,6 +424,12 @@ private:
void initXEvent(XEvent* event);
#endif
+#if PLATFORM(QT) && defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ QImage m_image;
+ bool m_renderToImage;
+ void paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect);
+#endif
+
IntRect m_clipRect; // The clip rect to apply to a windowed plug-in
IntRect m_windowRect; // Our window rect.
#ifdef ANDROID_PLUGINS
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index 0ca356b..3b41072 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -111,12 +111,20 @@ void PluginView::updatePluginWidget()
return;
if (!m_isWindowed && m_windowRect.size() != oldWindowRect.size()) {
- if (m_drawable)
- XFreePixmap(QX11Info::display(), m_drawable);
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ // On Maemo5, Flash always renders to 16-bit buffer
+ if (m_renderToImage)
+ m_image = QImage(m_windowRect.width(), m_windowRect.height(), QImage::Format_RGB16);
+ else
+#endif
+ {
+ if (m_drawable)
+ XFreePixmap(QX11Info::display(), m_drawable);
- m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
- ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
- QApplication::syncX(); // make sure that the server knows about the Drawable
+ m_drawable = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), m_windowRect.width(), m_windowRect.height(),
+ ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
+ QApplication::syncX(); // make sure that the server knows about the Drawable
+ }
}
// do not call setNPWindowIfNeeded immediately, will be called on paint()
@@ -160,6 +168,48 @@ void PluginView::hide()
Widget::hide();
}
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+void PluginView::paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect)
+{
+ if (m_isTransparent) {
+ // On Maemo5, Flash expects the buffer to contain the contents that are below it.
+ // We don't support transparency, so clean the image before giving to Flash.
+ QPainter imagePainter(&m_image);
+ imagePainter.fillRect(exposedRect, Qt::white);
+ }
+
+ NPImageExpose imageExpose;
+ imageExpose.data = reinterpret_cast<char*>(m_image.bits());
+ imageExpose.stride = m_image.bytesPerLine();
+ imageExpose.depth = m_image.depth();
+ imageExpose.x = exposedRect.x();
+ imageExpose.y = exposedRect.y();
+ imageExpose.width = exposedRect.width();
+ imageExpose.height = exposedRect.height();
+ imageExpose.dataSize.width = m_image.width();
+ imageExpose.dataSize.height = m_image.height();
+ imageExpose.translateX = 0;
+ imageExpose.translateY = 0;
+ imageExpose.scaleX = 1;
+ imageExpose.scaleY = 1;
+
+ XEvent xevent;
+ memset(&xevent, 0, sizeof(XEvent));
+ XGraphicsExposeEvent& exposeEvent = xevent.xgraphicsexpose;
+ exposeEvent.type = GraphicsExpose;
+ exposeEvent.display = 0;
+ exposeEvent.drawable = reinterpret_cast<XID>(&imageExpose);
+ exposeEvent.x = exposedRect.x();
+ exposeEvent.y = exposedRect.y();
+ exposeEvent.width = exposedRect.width();
+ exposeEvent.height = exposedRect.height();
+
+ dispatchNPEvent(xevent);
+
+ painter->drawImage(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), m_image, exposedRect);
+}
+#endif
+
void PluginView::paint(GraphicsContext* context, const IntRect& rect)
{
if (!m_isStarted) {
@@ -172,19 +222,32 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
setNPWindowIfNeeded();
- if (m_isWindowed || !m_drawable)
+ if (m_isWindowed)
return;
- const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
+ if (!m_drawable
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ && m_image.isNull()
+#endif
+ )
+ return;
QPainter* painter = context->platformContext();
IntRect exposedRect(rect);
exposedRect.intersect(frameRect());
exposedRect.move(-frameRect().x(), -frameRect().y());
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ if (!m_image.isNull()) {
+ paintUsingImageSurfaceExtension(painter, exposedRect);
+ return;
+ }
+#endif
+
QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
ASSERT(drawableDepth == qtDrawable.depth());
+ const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
// When printing, Qt uses a QPicture to capture the output in preview mode. The
// QPicture holds a reference to the X Pixmap. As a result, the print preview would
@@ -587,6 +650,13 @@ bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPErr
*result = NPERR_NO_ERROR;
return true;
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ case NPNVSupportsWindowlessLocal:
+ *static_cast<NPBool*>(value) = true;
+ *result = NPERR_NO_ERROR;
+ return true;
+#endif
+
default:
return false;
}
@@ -662,7 +732,7 @@ static Display *getPluginDisplay()
// support gdk based plugins (like flash) that use a different X connection.
// The code below has the same effect as this one:
// Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
- QLibrary library("libgdk-x11-2.0");
+ QLibrary library("libgdk-x11-2.0.so.0");
if (!library.load())
return 0;
diff --git a/WebCore/plugins/symbian/PluginViewSymbian.cpp b/WebCore/plugins/symbian/PluginViewSymbian.cpp
index baa9839..b9f82ad 100644
--- a/WebCore/plugins/symbian/PluginViewSymbian.cpp
+++ b/WebCore/plugins/symbian/PluginViewSymbian.cpp
@@ -242,8 +242,11 @@ void PluginView::setParent(ScrollView* parent)
{
Widget::setParent(parent);
- if (parent)
+ if (parent) {
init();
+ if (m_status == PluginStatusLoadedSuccessfully)
+ updatePluginWidget();
+ }
}
void PluginView::setNPWindowRect(const IntRect&)
diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp
index 80dea93..f3dd781 100644
--- a/WebCore/plugins/win/PluginPackageWin.cpp
+++ b/WebCore/plugins/win/PluginPackageWin.cpp
@@ -181,7 +181,7 @@ bool PluginPackage::fetchInfo()
VS_FIXEDFILEINFO* info;
UINT infoSize;
- if (!VerQueryValue(versionInfoData.get(), TEXT("\\"), (LPVOID*) &info, &infoSize) || infoSize < sizeof(VS_FIXEDFILEINFO))
+ if (!VerQueryValueW(versionInfoData.get(), L"\\", (LPVOID*) &info, &infoSize) || infoSize < sizeof(VS_FIXEDFILEINFO))
return false;
m_moduleVersion.leastSig = info->dwFileVersionLS;
m_moduleVersion.mostSig = info->dwFileVersionMS;
diff --git a/WebCore/rendering/InlineTextBox.h b/WebCore/rendering/InlineTextBox.h
index fcbf23a..7d828f3 100644
--- a/WebCore/rendering/InlineTextBox.h
+++ b/WebCore/rendering/InlineTextBox.h
@@ -67,6 +67,7 @@ public:
bool hasHyphen() const { return m_hasEllipsisBoxOrHyphen; }
void setHasHyphen(bool hasHyphen) { m_hasEllipsisBoxOrHyphen = hasHyphen; }
+ static inline bool compareByStart(const InlineTextBox* first, const InlineTextBox* second) { return first->start() < second->start(); }
private:
virtual int selectionTop();
diff --git a/WebCore/rendering/RenderApplet.h b/WebCore/rendering/RenderApplet.h
index 343421e..62f46cd 100644
--- a/WebCore/rendering/RenderApplet.h
+++ b/WebCore/rendering/RenderApplet.h
@@ -23,7 +23,7 @@
#define RenderApplet_h
#include "RenderWidget.h"
-#include "StringHash.h"
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index c982d26..574d389 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -1021,8 +1021,8 @@ void RenderBlock::removeChild(RenderObject* oldChild)
// If this was our last child be sure to clear out our line boxes.
if (childrenInline())
lineBoxes()->deleteLineBoxes(renderArena());
- // If we're now an empty anonymous block then go ahead and delete ourselves.
- else if (isAnonymousBlock() && parent() && parent()->isRenderBlock() && !continuation())
+ // If we're now an empty anonymous columns or column span block, then go ahead and delete ourselves.
+ else if ((isAnonymousColumnsBlock() || isAnonymousColumnSpanBlock()) && parent() && parent()->isRenderBlock() && !continuation())
destroy();
}
}
@@ -2120,7 +2120,7 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty)
PaintInfo info(paintInfo);
info.phase = newPhase;
info.updatePaintingRootForChildren(this);
- bool checkPageBreaks = document()->printing() && !document()->settings()->paginateDuringLayoutEnabled();
+ bool checkPageBreaks = document()->paginated() && !document()->settings()->paginateDuringLayoutEnabled();
bool checkColumnBreaks = !checkPageBreaks && !view()->printRect().isEmpty() && !document()->settings()->paginateDuringLayoutEnabled();
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
@@ -4109,7 +4109,7 @@ void RenderBlock::calcColumnWidth()
int desiredColumnWidth = contentWidth();
// For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
- if (document()->printing() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth())) {
+ if (document()->paginated() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth())) {
setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
return;
}
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index e11c7ad..8a3ea8e 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -1476,6 +1476,12 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
&& (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
return true;
+ // Button, input, select, textarea, legend and datagrid treat
+ // width value of 'auto' as 'intrinsic' unless it's in a
+ // stretching vertical flexbox.
+ if (width.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag) || node()->hasTagName(datagridTag)))
+ return true;
+
return false;
}
@@ -1579,9 +1585,9 @@ void RenderBox::calcHeight()
// is specified. When we're printing, we also need this quirk if the body or root has a percentage
// height since we don't set a height in RenderView when we're printing. So without this quirk, the
// height has nothing to be a percentage of, and it ends up being 0. That is bad.
- bool printingNeedsBaseHeight = document()->printing() && h.isPercent()
+ bool paginatedContentNeedsBaseHeight = document()->paginated() && h.isPercent()
&& (isRoot() || (isBody() && document()->documentElement()->renderer()->style()->height().isPercent()));
- if (stretchesToViewHeight() || printingNeedsBaseHeight) {
+ if (stretchesToViewHeight() || paginatedContentNeedsBaseHeight) {
int margins = collapsedMarginTop() + collapsedMarginBottom();
int visHeight = document()->printing() ? view()->frameView()->pageHeight() : view()->viewHeight();
if (isRoot())
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 9117ed8..78618d1 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -531,7 +531,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
// The mask has been created. Now we just need to clip to it.
context->save();
- context->clipToImageBuffer(maskRect, maskImage.get());
+ context->clipToImageBuffer(maskImage.get(), maskRect);
}
StyleImage* bg = bgLayer->image();
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
index e72825e..55b230b 100644
--- a/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -231,8 +231,8 @@ void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
url = p->value();
if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
serviceType = p->value();
- int pos = serviceType.find(";");
- if (pos != -1)
+ size_t pos = serviceType.find(";");
+ if (pos != notFound)
serviceType = serviceType.left(pos);
}
if (!embed && !name.isEmpty()) {
diff --git a/WebCore/rendering/RenderInputSpeech.cpp b/WebCore/rendering/RenderInputSpeech.cpp
index df17944..5472025 100644
--- a/WebCore/rendering/RenderInputSpeech.cpp
+++ b/WebCore/rendering/RenderInputSpeech.cpp
@@ -36,6 +36,7 @@
#include "GraphicsContext.h"
#include "HTMLNames.h"
#include "RenderBox.h"
+#include "TextControlInnerElements.h"
namespace WebCore {
@@ -79,7 +80,16 @@ bool RenderInputSpeech::paintInputFieldSpeechButton(RenderObject* object, const
buttonRect.move(rect.x(), rect.y());
DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateNormal, (Image::loadPlatformResource("inputSpeech")));
- paintInfo.context->drawImage(imageStateNormal.get(), object->style()->colorSpace(), buttonRect);
+ DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateRecording, (Image::loadPlatformResource("inputSpeechRecording")));
+ DEFINE_STATIC_LOCAL(RefPtr<Image>, imageStateWaiting, (Image::loadPlatformResource("inputSpeechWaiting")));
+
+ InputFieldSpeechButtonElement* speechButton = reinterpret_cast<InputFieldSpeechButtonElement*>(object->node());
+ Image* image = imageStateNormal.get();
+ if (speechButton->state() == InputFieldSpeechButtonElement::Recording)
+ image = imageStateRecording.get();
+ else if (speechButton->state() == InputFieldSpeechButtonElement::Recognizing)
+ image = imageStateWaiting.get();
+ paintInfo.context->drawImage(image, object->style()->colorSpace(), buttonRect);
return false;
}
diff --git a/WebCore/rendering/RenderRubyRun.cpp b/WebCore/rendering/RenderRubyRun.cpp
index d6b724b..d48646b 100644
--- a/WebCore/rendering/RenderRubyRun.cpp
+++ b/WebCore/rendering/RenderRubyRun.cpp
@@ -143,14 +143,15 @@ void RenderRubyRun::addChild(RenderObject* child, RenderObject* beforeChild)
RenderBlock::removeChild(beforeChild);
newRun->addChild(beforeChild);
} else {
- ASSERT(hasRubyBase()); // Otherwise beforeChild would be borked.
- // Insertion before a ruby base object.
- // In this case we need insert a new run before the current one and split the base.
- RenderObject* ruby = parent();
- RenderRubyRun* newRun = staticCreateRubyRun(ruby);
- ruby->addChild(newRun, this);
- newRun->addChild(child);
- rubyBaseSafe()->moveChildren(newRun->rubyBaseSafe(), beforeChild);
+ if (hasRubyBase()) {
+ // Insertion before a ruby base object.
+ // In this case we need insert a new run before the current one and split the base.
+ RenderObject* ruby = parent();
+ RenderRubyRun* newRun = staticCreateRubyRun(ruby);
+ ruby->addChild(newRun, this);
+ newRun->addChild(child);
+ rubyBaseSafe()->moveChildren(newRun->rubyBaseSafe(), beforeChild);
+ }
}
} else {
// child is not a text -> insert it into the base
@@ -171,13 +172,14 @@ void RenderRubyRun::removeChild(RenderObject* child)
if (base && rightNeighbour && rightNeighbour->isRubyRun()) {
// Ruby run without a base can happen only at the first run.
RenderRubyRun* rightRun = static_cast<RenderRubyRun*>(rightNeighbour);
- ASSERT(rightRun->hasRubyBase());
- RenderRubyBase* rightBase = rightRun->rubyBaseSafe();
- // Collect all children in a single base, then swap the bases.
- rightBase->moveChildren(base);
- moveChildTo(rightRun, base);
- rightRun->moveChildTo(this, rightBase);
- // The now empty ruby base will be removed below.
+ if (rightRun->hasRubyBase()) {
+ RenderRubyBase* rightBase = rightRun->rubyBaseSafe();
+ // Collect all children in a single base, then swap the bases.
+ rightBase->moveChildren(base);
+ moveChildTo(rightRun, base);
+ rightRun->moveChildTo(this, rightBase);
+ // The now empty ruby base will be removed below.
+ }
}
}
diff --git a/WebCore/rendering/RenderSVGAllInOne.cpp b/WebCore/rendering/RenderSVGAllInOne.cpp
index fa5709e..2d44ca2 100644
--- a/WebCore/rendering/RenderSVGAllInOne.cpp
+++ b/WebCore/rendering/RenderSVGAllInOne.cpp
@@ -53,6 +53,7 @@
#include "RenderSVGViewportContainer.cpp"
#include "SVGCharacterData.cpp"
#include "SVGCharacterLayoutInfo.cpp"
+#include "SVGImageBufferTools.cpp"
#include "SVGInlineFlowBox.cpp"
#include "SVGInlineTextBox.cpp"
#include "SVGMarkerLayoutInfo.cpp"
diff --git a/WebCore/rendering/RenderSVGGradientStop.cpp b/WebCore/rendering/RenderSVGGradientStop.cpp
index 3494aa7..ebf7385 100644
--- a/WebCore/rendering/RenderSVGGradientStop.cpp
+++ b/WebCore/rendering/RenderSVGGradientStop.cpp
@@ -47,6 +47,8 @@ RenderSVGGradientStop::~RenderSVGGradientStop()
void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderObject::styleDidChange(diff, oldStyle);
+ if (diff == StyleDifferenceEqual)
+ return;
// <stop> elements should only be allowed to make renderers under gradient elements
// but I can imagine a few cases we might not be catching, so let's not crash if our parent isn't a gradient.
@@ -60,7 +62,7 @@ void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderSty
ASSERT(renderer->isSVGResourceContainer());
RenderSVGResourceContainer* container = renderer->toRenderSVGResourceContainer();
- container->invalidateClients();
+ container->removeAllClientsFromCache();
}
void RenderSVGGradientStop::layout()
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index 993278c..893a4ea 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -177,7 +177,7 @@ void RenderSVGImage::imageChanged(WrappedImagePtr image, const IntRect* rect)
// The image resource defaults to nullImage until the resource arrives.
// This empty image may be cached by SVG resources which must be invalidated.
if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this))
- resources->invalidateClient(this);
+ resources->removeClientFromCache(this);
// Eventually notify parent resources, that we've changed.
RenderSVGResource::markForLayoutAndParentResourceInvalidation(this, false);
diff --git a/WebCore/rendering/RenderSVGImage.h b/WebCore/rendering/RenderSVGImage.h
index 6ee0179..38e3a13 100644
--- a/WebCore/rendering/RenderSVGImage.h
+++ b/WebCore/rendering/RenderSVGImage.h
@@ -81,6 +81,21 @@ private:
mutable FloatRect m_cachedLocalRepaintRect;
};
+inline RenderSVGImage* toRenderSVGImage(RenderObject* object)
+{
+ ASSERT(!object || object->isSVGImage());
+ return static_cast<RenderSVGImage*>(object);
+}
+
+inline const RenderSVGImage* toRenderSVGImage(const RenderObject* object)
+{
+ ASSERT(!object || object->isSVGImage());
+ return static_cast<const RenderSVGImage*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderSVGImage(const RenderSVGImage*);
+
} // namespace WebCore
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderSVGResource.cpp b/WebCore/rendering/RenderSVGResource.cpp
index 9c89d3c..0c943e5 100644
--- a/WebCore/rendering/RenderSVGResource.cpp
+++ b/WebCore/rendering/RenderSVGResource.cpp
@@ -171,7 +171,7 @@ void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject*
RenderObject* current = object->parent();
while (current) {
if (current->isSVGResourceContainer()) {
- current->toRenderSVGResourceContainer()->invalidateClients();
+ current->toRenderSVGResourceContainer()->removeAllClientsFromCache();
break;
}
diff --git a/WebCore/rendering/RenderSVGResource.h b/WebCore/rendering/RenderSVGResource.h
index e2d8216..a70ce52 100644
--- a/WebCore/rendering/RenderSVGResource.h
+++ b/WebCore/rendering/RenderSVGResource.h
@@ -57,8 +57,8 @@ public:
RenderSVGResource() { }
virtual ~RenderSVGResource() { }
- virtual void invalidateClients() = 0;
- virtual void invalidateClient(RenderObject*) = 0;
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true) = 0;
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) = 0;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) = 0;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short) { }
diff --git a/WebCore/rendering/RenderSVGResourceClipper.cpp b/WebCore/rendering/RenderSVGResourceClipper.cpp
index a201d1f..626a880 100644
--- a/WebCore/rendering/RenderSVGResourceClipper.cpp
+++ b/WebCore/rendering/RenderSVGResourceClipper.cpp
@@ -64,7 +64,7 @@ RenderSVGResourceClipper::~RenderSVGResourceClipper()
m_clipper.clear();
}
-void RenderSVGResourceClipper::invalidateClients()
+void RenderSVGResourceClipper::removeAllClientsFromCache(bool markForInvalidation)
{
if (m_invalidationBlocked)
return;
@@ -75,20 +75,19 @@ void RenderSVGResourceClipper::invalidateClients()
m_clipper.clear();
}
- markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
+ markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
}
-void RenderSVGResourceClipper::invalidateClient(RenderObject* client)
+void RenderSVGResourceClipper::removeClientFromCache(RenderObject* client, bool markForInvalidation)
{
ASSERT(client);
if (m_invalidationBlocked)
return;
- ASSERT(client->selfNeedsLayout());
if (m_clipper.contains(client))
delete m_clipper.take(client);
- markClientForInvalidation(client, BoundariesInvalidation);
+ markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
bool RenderSVGResourceClipper::applyResource(RenderObject* object, RenderStyle*, GraphicsContext*& context, unsigned short resourceMode)
@@ -174,7 +173,7 @@ bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* object, cons
if (!clipperData->clipMaskImage)
return false;
- context->clipToImageBuffer(repaintRect, clipperData->clipMaskImage.get());
+ context->clipToImageBuffer(clipperData->clipMaskImage.get(), repaintRect);
return true;
}
diff --git a/WebCore/rendering/RenderSVGResourceClipper.h b/WebCore/rendering/RenderSVGResourceClipper.h
index d334c7d..0f68c67 100644
--- a/WebCore/rendering/RenderSVGResourceClipper.h
+++ b/WebCore/rendering/RenderSVGResourceClipper.h
@@ -47,8 +47,8 @@ public:
virtual const char* renderName() const { return "RenderSVGResourceClipper"; }
- virtual void invalidateClients();
- virtual void invalidateClient(RenderObject*);
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true);
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
virtual FloatRect resourceBoundingBox(RenderObject*);
diff --git a/WebCore/rendering/RenderSVGResourceContainer.cpp b/WebCore/rendering/RenderSVGResourceContainer.cpp
index 7e43300..5652dcc 100644
--- a/WebCore/rendering/RenderSVGResourceContainer.cpp
+++ b/WebCore/rendering/RenderSVGResourceContainer.cpp
@@ -52,7 +52,7 @@ void RenderSVGResourceContainer::layout()
{
// Invalidate all resources if our layout changed.
if (m_everHadLayout && selfNeedsLayout())
- invalidateClients();
+ removeAllClientsFromCache();
RenderSVGHiddenContainer::layout();
}
@@ -76,7 +76,7 @@ void RenderSVGResourceContainer::styleDidChange(StyleDifference diff, const Rend
void RenderSVGResourceContainer::idChanged()
{
// Invalidate all our current clients.
- invalidateClients();
+ removeAllClientsFromCache();
// Remove old id, that is guaranteed to be present in cache.
SVGDocumentExtensions* extensions = svgExtensionsFromNode(node());
@@ -92,17 +92,32 @@ void RenderSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode
return;
bool needsLayout = mode == LayoutAndBoundariesInvalidation;
+ bool markForInvalidation = mode != ParentOnlyInvalidation;
HashSet<RenderObject*>::iterator end = m_clients.end();
for (HashSet<RenderObject*>::iterator it = m_clients.begin(); it != end; ++it) {
RenderObject* client = *it;
if (client->isSVGResourceContainer()) {
- client->toRenderSVGResourceContainer()->invalidateClients();
+ client->toRenderSVGResourceContainer()->removeAllClientsFromCache(markForInvalidation);
continue;
}
- markClientForInvalidation(client, mode);
- RenderSVGResource::markForLayoutAndParentResourceInvalidation(client, needsLayout);
+ if (markForInvalidation)
+ markClientForInvalidation(client, mode);
+
+ if (needsLayout)
+ client->setNeedsLayout(true);
+
+ // Invalidate resources in ancestor chain, if needed.
+ RenderObject* current = client->parent();
+ while (current) {
+ if (current->isSVGResourceContainer()) {
+ current->toRenderSVGResourceContainer()->removeAllClientsFromCache(markForInvalidation);
+ break;
+ }
+
+ current = current->parent();
+ }
}
}
@@ -120,6 +135,8 @@ void RenderSVGResourceContainer::markClientForInvalidation(RenderObject* client,
if (client->view())
client->repaint();
break;
+ case ParentOnlyInvalidation:
+ break;
}
}
diff --git a/WebCore/rendering/RenderSVGResourceContainer.h b/WebCore/rendering/RenderSVGResourceContainer.h
index 4271a5f..08e18d4 100644
--- a/WebCore/rendering/RenderSVGResourceContainer.h
+++ b/WebCore/rendering/RenderSVGResourceContainer.h
@@ -49,7 +49,8 @@ protected:
enum InvalidationMode {
LayoutAndBoundariesInvalidation,
BoundariesInvalidation,
- RepaintInvalidation
+ RepaintInvalidation,
+ ParentOnlyInvalidation
};
// Used from the invalidateClient/invalidateClients methods from classes, inheriting from us.
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index bc5feaf..09e83f4 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -67,25 +67,24 @@ RenderSVGResourceFilter::~RenderSVGResourceFilter()
m_filter.clear();
}
-void RenderSVGResourceFilter::invalidateClients()
+void RenderSVGResourceFilter::removeAllClientsFromCache(bool markForInvalidation)
{
if (!m_filter.isEmpty()) {
deleteAllValues(m_filter);
m_filter.clear();
}
- markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
+ markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
}
-void RenderSVGResourceFilter::invalidateClient(RenderObject* client)
+void RenderSVGResourceFilter::removeClientFromCache(RenderObject* client, bool markForInvalidation)
{
ASSERT(client);
- ASSERT(client->selfNeedsLayout());
if (m_filter.contains(client))
delete m_filter.take(client);
- markClientForInvalidation(client, BoundariesInvalidation);
+ markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
@@ -243,7 +242,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
FilterData* filterData = m_filter.get(object);
if (!filterData->builded) {
if (!filterData->savedContext) {
- invalidateClient(object);
+ removeClientFromCache(object);
return;
}
@@ -271,7 +270,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
#if !PLATFORM(CG)
resultImage->transformColorSpace(LinearRGB, DeviceRGB);
#endif
- context->drawImage(resultImage->image(), object->style()->colorSpace(), lastEffect->subRegion());
+ context->drawImageBuffer(resultImage, object->style()->colorSpace(), lastEffect->subRegion());
}
}
diff --git a/WebCore/rendering/RenderSVGResourceFilter.h b/WebCore/rendering/RenderSVGResourceFilter.h
index 7b5ab09..314c94d 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.h
+++ b/WebCore/rendering/RenderSVGResourceFilter.h
@@ -64,8 +64,8 @@ public:
virtual const char* renderName() const { return "RenderSVGResourceFilter"; }
- virtual void invalidateClients();
- virtual void invalidateClient(RenderObject*);
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true);
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode);
diff --git a/WebCore/rendering/RenderSVGResourceGradient.cpp b/WebCore/rendering/RenderSVGResourceGradient.cpp
index 73b2ab6..d29192a 100644
--- a/WebCore/rendering/RenderSVGResourceGradient.cpp
+++ b/WebCore/rendering/RenderSVGResourceGradient.cpp
@@ -28,6 +28,7 @@
#include "GradientAttributes.h"
#include "GraphicsContext.h"
+#include "SVGImageBufferTools.h"
#include "SVGRenderSupport.h"
#include <wtf/UnusedParam.h>
@@ -50,81 +51,64 @@ RenderSVGResourceGradient::~RenderSVGResourceGradient()
m_gradient.clear();
}
-void RenderSVGResourceGradient::invalidateClients()
+void RenderSVGResourceGradient::removeAllClientsFromCache(bool markForInvalidation)
{
if (!m_gradient.isEmpty()) {
deleteAllValues(m_gradient);
m_gradient.clear();
}
- markAllClientsForInvalidation(RepaintInvalidation);
+ markAllClientsForInvalidation(markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
}
-void RenderSVGResourceGradient::invalidateClient(RenderObject* client)
+void RenderSVGResourceGradient::removeClientFromCache(RenderObject* client, bool markForInvalidation)
{
ASSERT(client);
- ASSERT(client->selfNeedsLayout());
if (m_gradient.contains(client))
delete m_gradient.take(client);
- markClientForInvalidation(client, RepaintInvalidation);
+ markClientForInvalidation(client, markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
}
#if PLATFORM(CG)
-static inline AffineTransform absoluteTransformFromContext(GraphicsContext* context)
-{
- // Extract current transformation matrix used in the original context. Note that this coordinate
- // system is flipped compared to SVGs internal coordinate system, done in WebKit level. Fix
- // this transformation by flipping the y component.
- return context->getCTM() * AffineTransform().flipY();
-}
-
static inline bool createMaskAndSwapContextForTextGradient(GraphicsContext*& context,
GraphicsContext*& savedContext,
OwnPtr<ImageBuffer>& imageBuffer,
const RenderObject* object)
{
const RenderObject* textRootBlock = SVGRenderSupport::findTextRootObject(object);
+ ASSERT(textRootBlock);
- AffineTransform transform(absoluteTransformFromContext(context));
- FloatRect maskAbsoluteBoundingBox = transform.mapRect(textRootBlock->repaintRectInLocalCoordinates());
+ AffineTransform absoluteTransform(SVGImageBufferTools::absoluteTransformFromContext(context));
+ FloatRect absoluteTargetRect = absoluteTransform.mapRect(textRootBlock->repaintRectInLocalCoordinates());
- IntRect maskImageRect = enclosingIntRect(maskAbsoluteBoundingBox);
- if (maskImageRect.isEmpty())
+ OwnPtr<ImageBuffer> maskImage;
+ if (!SVGImageBufferTools::createImageBuffer(absoluteTransform, absoluteTargetRect, maskImage, DeviceRGB))
return false;
- // Allocate an image buffer as big as the absolute unclipped size of the object
- OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskImageRect.size());
- if (!maskImage)
- return false;
-
- GraphicsContext* maskImageContext = maskImage->context();
-
- // Transform the mask image coordinate system to absolute screen coordinates
- maskImageContext->translate(-maskAbsoluteBoundingBox.x(), -maskAbsoluteBoundingBox.y());
- maskImageContext->concatCTM(transform);
-
- imageBuffer = maskImage.release();
+ ASSERT(maskImage);
savedContext = context;
- context = maskImageContext;
-
+ context = maskImage->context();
+ imageBuffer = maskImage.release();
return true;
}
static inline AffineTransform clipToTextMask(GraphicsContext* context,
OwnPtr<ImageBuffer>& imageBuffer,
+ FloatRect& repaintRect,
const RenderObject* object,
GradientData* gradientData)
{
const RenderObject* textRootBlock = SVGRenderSupport::findTextRootObject(object);
+ ASSERT(textRootBlock);
- // The mask image has been created in the device coordinate space, as the image should not be scaled.
- // So the actual masking process has to be done in the device coordinate space as well.
- AffineTransform transform(absoluteTransformFromContext(context));
- context->concatCTM(transform.inverse());
- context->clipToImageBuffer(transform.mapRect(textRootBlock->repaintRectInLocalCoordinates()), imageBuffer.get());
- context->concatCTM(transform);
+ repaintRect = textRootBlock->repaintRectInLocalCoordinates();
+
+ AffineTransform absoluteTransform(SVGImageBufferTools::absoluteTransformFromContext(context));
+ FloatRect absoluteTargetRect = absoluteTransform.mapRect(repaintRect);
+
+ SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, absoluteTargetRect, imageBuffer.get());
AffineTransform matrix;
if (gradientData->boundingBoxMode) {
@@ -146,7 +130,7 @@ bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle*
// Be sure to synchronize all SVG properties on the gradientElement _before_ processing any further.
// Otherwhise the call to collectGradientAttributes() in createTileImage(), may cause the SVG DOM property
- // synchronization to kick in, which causes invalidateClients() to be called, which in turn deletes our
+ // synchronization to kick in, which causes removeAllClientsFromCache() to be called, which in turn deletes our
// GradientData object! Leaving out the line below will cause svg/dynamic-updates/SVG*GradientElement-svgdom* to crash.
SVGGradientElement* gradientElement = static_cast<SVGGradientElement*>(node());
if (!gradientElement)
@@ -232,12 +216,11 @@ void RenderSVGResourceGradient::postApplyResource(RenderObject* object, Graphics
context = m_savedContext;
m_savedContext = 0;
- gradientData->gradient->setGradientSpaceTransform(clipToTextMask(context, m_imageBuffer, object, gradientData));
+ FloatRect repaintRect;
+ gradientData->gradient->setGradientSpaceTransform(clipToTextMask(context, m_imageBuffer, repaintRect, object, gradientData));
context->setFillGradient(gradientData->gradient);
- const RenderObject* textRootBlock = SVGRenderSupport::findTextRootObject(object);
- context->fillRect(textRootBlock->repaintRectInLocalCoordinates());
-
+ context->fillRect(repaintRect);
m_imageBuffer.clear();
}
#else
diff --git a/WebCore/rendering/RenderSVGResourceGradient.h b/WebCore/rendering/RenderSVGResourceGradient.h
index b01af6d..4de4272 100644
--- a/WebCore/rendering/RenderSVGResourceGradient.h
+++ b/WebCore/rendering/RenderSVGResourceGradient.h
@@ -50,8 +50,8 @@ public:
RenderSVGResourceGradient(SVGGradientElement*);
virtual ~RenderSVGResourceGradient();
- virtual void invalidateClients();
- virtual void invalidateClient(RenderObject*);
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true);
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode);
diff --git a/WebCore/rendering/RenderSVGResourceMarker.cpp b/WebCore/rendering/RenderSVGResourceMarker.cpp
index fa00fa3..1d5663b 100644
--- a/WebCore/rendering/RenderSVGResourceMarker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMarker.cpp
@@ -50,7 +50,7 @@ void RenderSVGResourceMarker::layout()
{
// Invalidate all resources if our layout changed.
if (m_everHadLayout && selfNeedsLayout())
- invalidateClients();
+ removeAllClientsFromCache();
// RenderSVGHiddenContainer overwrites layout(). We need the
// layouting of RenderSVGContainer for calculating local
@@ -58,16 +58,15 @@ void RenderSVGResourceMarker::layout()
RenderSVGContainer::layout();
}
-void RenderSVGResourceMarker::invalidateClients()
+void RenderSVGResourceMarker::removeAllClientsFromCache(bool markForInvalidation)
{
- markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
+ markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
}
-void RenderSVGResourceMarker::invalidateClient(RenderObject* client)
+void RenderSVGResourceMarker::removeClientFromCache(RenderObject* client, bool markForInvalidation)
{
ASSERT(client);
- ASSERT(client->selfNeedsLayout());
- markClientForInvalidation(client, BoundariesInvalidation);
+ markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
void RenderSVGResourceMarker::applyViewportClip(PaintInfo& paintInfo)
diff --git a/WebCore/rendering/RenderSVGResourceMarker.h b/WebCore/rendering/RenderSVGResourceMarker.h
index 8509aca..e41096e 100644
--- a/WebCore/rendering/RenderSVGResourceMarker.h
+++ b/WebCore/rendering/RenderSVGResourceMarker.h
@@ -41,8 +41,8 @@ public:
virtual const char* renderName() const { return "RenderSVGResourceMarker"; }
- virtual void invalidateClients();
- virtual void invalidateClient(RenderObject*);
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true);
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
void draw(PaintInfo&, const AffineTransform&);
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 2c36c96..9713dd6 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -35,6 +35,7 @@
#include "IntRect.h"
#include "RenderSVGResource.h"
#include "SVGElement.h"
+#include "SVGImageBufferTools.h"
#include "SVGMaskElement.h"
#include "SVGStyledElement.h"
#include "SVGUnitTypes.h"
@@ -59,26 +60,25 @@ RenderSVGResourceMasker::~RenderSVGResourceMasker()
m_masker.clear();
}
-void RenderSVGResourceMasker::invalidateClients()
+void RenderSVGResourceMasker::removeAllClientsFromCache(bool markForInvalidation)
{
- m_maskBoundaries = FloatRect();
+ m_maskContentBoundaries = FloatRect();
if (!m_masker.isEmpty()) {
deleteAllValues(m_masker);
m_masker.clear();
}
- markAllClientsForInvalidation(LayoutAndBoundariesInvalidation);
+ markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
}
-void RenderSVGResourceMasker::invalidateClient(RenderObject* client)
+void RenderSVGResourceMasker::removeClientFromCache(RenderObject* client, bool markForInvalidation)
{
ASSERT(client);
- ASSERT(client->selfNeedsLayout());
if (m_masker.contains(client))
delete m_masker.take(client);
- markClientForInvalidation(client, BoundariesInvalidation);
+ markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*, GraphicsContext*& context, unsigned short resourceMode)
@@ -95,73 +95,47 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
m_masker.set(object, new MaskerData);
MaskerData* maskerData = m_masker.get(object);
- if (!maskerData->maskImage && !maskerData->emptyMask) {
+
+ AffineTransform absoluteTransform(SVGImageBufferTools::absoluteTransformFromContext(context));
+ FloatRect maskRect = absoluteTransform.mapRect(object->repaintRectInLocalCoordinates());
+
+ if (!maskerData->maskImage && !maskRect.isEmpty()) {
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
if (!maskElement)
return false;
- createMaskImage(maskerData, maskElement, object);
+
+ if (!SVGImageBufferTools::createImageBuffer(absoluteTransform, maskRect, maskerData->maskImage, LinearRGB))
+ return false;
+
+ ASSERT(maskerData->maskImage);
+ drawContentIntoMaskImage(maskRect, maskerData, maskElement, object);
}
if (!maskerData->maskImage)
return false;
- context->clipToImageBuffer(maskerData->maskRect, maskerData->maskImage.get());
+ SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, maskRect, maskerData->maskImage.get());
return true;
}
-void RenderSVGResourceMasker::createMaskImage(MaskerData* maskerData, const SVGMaskElement* maskElement, RenderObject* object)
+void RenderSVGResourceMasker::drawContentIntoMaskImage(const FloatRect& maskRect, MaskerData* maskerData, const SVGMaskElement* maskElement, RenderObject* object)
{
- FloatRect objectBoundingBox = object->objectBoundingBox();
-
- // Mask rect clipped with clippingBoundingBox and filterBoundingBox as long as they are present.
- maskerData->maskRect = object->repaintRectInLocalCoordinates();
- if (maskerData->maskRect.isEmpty()) {
- maskerData->emptyMask = true;
- return;
- }
-
- if (m_maskBoundaries.isEmpty())
- calculateMaskContentRepaintRect();
+ IntRect maskImageRect = enclosingIntRect(maskRect);
+ maskImageRect.setLocation(IntPoint());
- FloatRect repaintRect = m_maskBoundaries;
- AffineTransform contextTransform;
- // We need to scale repaintRect for objectBoundingBox to get the drawing area.
+ // Eventually adjust the mask image context according to the target objectBoundingBox.
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
- contextTransform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
- FloatPoint contextAdjustment = repaintRect.location();
- repaintRect = contextTransform.mapRect(repaintRect);
- repaintRect.move(objectBoundingBox.x(), objectBoundingBox.y());
- contextTransform.translate(-contextAdjustment.x(), -contextAdjustment.y());
- }
- repaintRect.intersect(maskerData->maskRect);
- maskerData->maskRect = repaintRect;
- IntRect maskImageRect = enclosingIntRect(maskerData->maskRect);
-
- maskImageRect.setLocation(IntPoint());
+ GraphicsContext* maskImageContext = maskerData->maskImage->context();
+ ASSERT(maskImageContext);
- // Don't create ImageBuffers with image size of 0
- if (maskImageRect.isEmpty()) {
- maskerData->emptyMask = true;
- return;
+ FloatRect objectBoundingBox = object->objectBoundingBox();
+ AffineTransform contextTransform;
+ contextTransform.translate(objectBoundingBox.x(), objectBoundingBox.y());
+ contextTransform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
+ maskImageContext->concatCTM(contextTransform);
}
- // FIXME: This changes color space to linearRGB, the default color space
- // for masking operations in SVG. We need a switch for the other color-space
- // attribute values sRGB, inherit and auto.
- maskerData->maskImage = ImageBuffer::create(maskImageRect.size(), LinearRGB);
- if (!maskerData->maskImage)
- return;
-
- GraphicsContext* maskImageContext = maskerData->maskImage->context();
- ASSERT(maskImageContext);
-
- maskImageContext->save();
-
- if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
- maskImageContext->translate(-maskerData->maskRect.x(), -maskerData->maskRect.y());
- maskImageContext->concatCTM(contextTransform);
-
- // draw the content into the ImageBuffer
+ // Draw the content into the ImageBuffer.
for (Node* node = maskElement->firstChild(); node; node = node->nextSibling()) {
RenderObject* renderer = node->renderer();
if (!node->isSVGElement() || !static_cast<SVGElement*>(node)->isStyled() || !renderer)
@@ -172,8 +146,6 @@ void RenderSVGResourceMasker::createMaskImage(MaskerData* maskerData, const SVGM
SVGRenderSupport::renderSubtreeToImage(maskerData->maskImage.get(), renderer);
}
- maskImageContext->restore();
-
#if !PLATFORM(CG)
maskerData->maskImage->transformColorSpace(DeviceRGB, LinearRGB);
#endif
@@ -206,31 +178,31 @@ void RenderSVGResourceMasker::calculateMaskContentRepaintRect()
RenderStyle* style = renderer->style();
if (!style || style->display() == NONE || style->visibility() != VISIBLE)
continue;
- m_maskBoundaries.unite(renderer->localToParentTransform().mapRect(renderer->repaintRectInLocalCoordinates()));
+ m_maskContentBoundaries.unite(renderer->localToParentTransform().mapRect(renderer->repaintRectInLocalCoordinates()));
}
}
FloatRect RenderSVGResourceMasker::resourceBoundingBox(RenderObject* object)
{
- // Resource was not layouted yet. Give back clipping rect of the mask.
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
+ ASSERT(maskElement);
+
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = maskElement->maskBoundingBox(objectBoundingBox);
+
+ // Resource was not layouted yet. Give back clipping rect of the mask.
if (selfNeedsLayout())
return maskBoundaries;
- if (m_maskBoundaries.isEmpty())
+ if (m_maskContentBoundaries.isEmpty())
calculateMaskContentRepaintRect();
- if (!maskElement)
- return FloatRect();
-
- FloatRect maskRect = m_maskBoundaries;
+ FloatRect maskRect = m_maskContentBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
- maskRect = transform.mapRect(maskRect);
+ maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
diff --git a/WebCore/rendering/RenderSVGResourceMasker.h b/WebCore/rendering/RenderSVGResourceMasker.h
index f6301cb..f2d8cb2 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.h
+++ b/WebCore/rendering/RenderSVGResourceMasker.h
@@ -36,14 +36,7 @@
namespace WebCore {
struct MaskerData {
- MaskerData()
- : emptyMask(false)
- {
- }
-
OwnPtr<ImageBuffer> maskImage;
- FloatRect maskRect;
- bool emptyMask;
};
class RenderSVGResourceMasker : public RenderSVGResourceContainer {
@@ -53,9 +46,8 @@ public:
virtual const char* renderName() const { return "RenderSVGResourceMasker"; }
- virtual void invalidateClients();
- virtual void invalidateClient(RenderObject*);
-
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true);
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
virtual FloatRect resourceBoundingBox(RenderObject*);
@@ -66,10 +58,10 @@ public:
static RenderSVGResourceType s_resourceType;
private:
- void createMaskImage(MaskerData*, const SVGMaskElement*, RenderObject*);
+ void drawContentIntoMaskImage(const FloatRect& maskRect, MaskerData*, const SVGMaskElement*, RenderObject*);
void calculateMaskContentRepaintRect();
- FloatRect m_maskBoundaries;
+ FloatRect m_maskContentBoundaries;
HashMap<RenderObject*, MaskerData*> m_masker;
};
diff --git a/WebCore/rendering/RenderSVGResourcePattern.cpp b/WebCore/rendering/RenderSVGResourcePattern.cpp
index 902ff02..f4f5cf4 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.cpp
+++ b/WebCore/rendering/RenderSVGResourcePattern.cpp
@@ -47,25 +47,24 @@ RenderSVGResourcePattern::~RenderSVGResourcePattern()
m_pattern.clear();
}
-void RenderSVGResourcePattern::invalidateClients()
+void RenderSVGResourcePattern::removeAllClientsFromCache(bool markForInvalidation)
{
if (!m_pattern.isEmpty()) {
deleteAllValues(m_pattern);
m_pattern.clear();
}
- markAllClientsForInvalidation(RepaintInvalidation);
+ markAllClientsForInvalidation(markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
}
-void RenderSVGResourcePattern::invalidateClient(RenderObject* client)
+void RenderSVGResourcePattern::removeClientFromCache(RenderObject* client, bool markForInvalidation)
{
ASSERT(client);
- ASSERT(client->selfNeedsLayout());
if (m_pattern.contains(client))
delete m_pattern.take(client);
- markClientForInvalidation(client, RepaintInvalidation);
+ markClientForInvalidation(client, markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
}
bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode)
@@ -77,7 +76,7 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
// Be sure to synchronize all SVG properties on the patternElement _before_ processing any further.
// Otherwhise the call to collectPatternAttributes() in createTileImage(), may cause the SVG DOM property
- // synchronization to kick in, which causes invalidateClients() to be called, which in turn deletes our
+ // synchronization to kick in, which causes removeAllClientsFromCache() to be called, which in turn deletes our
// PatternData object! Leaving out the line below will cause svg/dynamic-updates/SVGPatternElement-svgdom* to crash.
SVGPatternElement* patternElement = static_cast<SVGPatternElement*>(node());
if (!patternElement)
@@ -298,14 +297,15 @@ PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(PatternData* p
void RenderSVGResourcePattern::buildPattern(PatternData* patternData, PassOwnPtr<ImageBuffer> tileImage) const
{
- if (!tileImage->image()) {
+ RefPtr<Image> copiedImage = tileImage->copyImage();
+ if (!copiedImage) {
patternData->pattern = 0;
return;
}
-
- IntRect tileRect = tileImage->image()->rect();
+
+ IntRect tileRect = copiedImage->rect();
if (tileRect.width() <= patternData->boundaries.width() && tileRect.height() <= patternData->boundaries.height()) {
- patternData->pattern = Pattern::create(tileImage->image(), true, true);
+ patternData->pattern = Pattern::create(copiedImage, true, true);
return;
}
@@ -331,13 +331,13 @@ void RenderSVGResourcePattern::buildPattern(PatternData* patternData, PassOwnPtr
newTileImageContext->translate(0, patternData->boundaries.height());
for (int j = numX; j > 0; --j) {
newTileImageContext->translate(patternData->boundaries.width(), 0);
- newTileImageContext->drawImage(tileImage->image(), style()->colorSpace(), tileRect, tileRect);
+ newTileImageContext->drawImage(copiedImage.get(), style()->colorSpace(), tileRect, tileRect);
}
newTileImageContext->translate(-patternData->boundaries.width() * numX, 0);
}
newTileImageContext->restore();
- patternData->pattern = Pattern::create(newTileImage->image(), true, true);
+ patternData->pattern = Pattern::create(newTileImage->copyImage(), true, true);
}
}
diff --git a/WebCore/rendering/RenderSVGResourcePattern.h b/WebCore/rendering/RenderSVGResourcePattern.h
index 690b0de..52bf09d 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.h
+++ b/WebCore/rendering/RenderSVGResourcePattern.h
@@ -51,8 +51,8 @@ public:
virtual const char* renderName() const { return "RenderSVGResourcePattern"; }
- virtual void invalidateClients();
- virtual void invalidateClient(RenderObject*);
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true);
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode);
diff --git a/WebCore/rendering/RenderSVGResourceSolidColor.h b/WebCore/rendering/RenderSVGResourceSolidColor.h
index ad7fd27..44109db 100644
--- a/WebCore/rendering/RenderSVGResourceSolidColor.h
+++ b/WebCore/rendering/RenderSVGResourceSolidColor.h
@@ -33,8 +33,8 @@ public:
RenderSVGResourceSolidColor();
virtual ~RenderSVGResourceSolidColor();
- virtual void invalidateClients() { }
- virtual void invalidateClient(RenderObject*) { }
+ virtual void removeAllClientsFromCache(bool = true) { }
+ virtual void removeClientFromCache(RenderObject*, bool = true) { }
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode);
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index e192e29..8cb54c0 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -25,7 +25,6 @@
#include "config.h"
#include "RenderTableSection.h"
-
#include "CachedImage.h"
#include "Document.h"
#include "HitTestResult.h"
@@ -1116,38 +1115,43 @@ void RenderTableSection::paintObject(PaintInfo& paintInfo, int tx, int ty)
// If some cell overflows, just paint all of them.
if (!m_hasOverflowingCell) {
- for (; startrow < totalRows; startrow++) {
- if (ty + m_rowPos[startrow + 1] >= y - os)
- break;
- }
- if (startrow == totalRows && ty + m_rowPos[totalRows] + table()->outerBorderBottom() >= y - os)
- startrow--;
+ int relativeY = y - ty;
+ int top = relativeY - os;
+ // binary search to find a row
+ startrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), top) - m_rowPos.begin();
+
+ // The binary search above gives us the first row with
+ // a y position >= the top of the paint rect. Thus, the previous
+ // may need to be repainted as well.
+ if (startrow == m_rowPos.size() || (startrow > 0 && (m_rowPos[startrow] > top)))
+ --startrow;
+
+ int bottom = relativeY + h + os - 1;
+ endrow = std::lower_bound(m_rowPos.begin(), m_rowPos.end(), bottom) - m_rowPos.begin();
+ if ((endrow == m_rowPos.size()) || (endrow > 0 && m_rowPos[endrow - 1] == bottom))
+ --endrow;
- for (; endrow > 0; endrow--) {
- if (ty + m_rowPos[endrow - 1] <= y + h + os)
- break;
- }
if (!endrow && ty + m_rowPos[0] - table()->outerBorderTop() <= y + h + os)
- endrow++;
+ ++endrow;
}
-
unsigned startcol = 0;
unsigned endcol = totalCols;
// FIXME: Implement RTL.
if (!m_hasOverflowingCell && style()->direction() == LTR) {
- for (; startcol < totalCols; startcol++) {
- if (tx + table()->columnPositions()[startcol + 1] >= x - os)
- break;
- }
- if (startcol == totalCols && tx + table()->columnPositions()[totalCols] + table()->outerBorderRight() >= x - os)
- startcol--;
+ int relativeX = x - tx;
+ int left = relativeX - os;
+ Vector<int>& columnPos = table()->columnPositions();
+ startcol = std::lower_bound(columnPos.begin(), columnPos.end(), left) - columnPos.begin();
+ if ((startcol == columnPos.size()) || (startcol > 0 && (columnPos[startcol] > left)))
+ --startcol;
+
+ int right = relativeX + w + os - 1;
+ endcol = std::lower_bound(columnPos.begin(), columnPos.end(), right) - columnPos.begin();
+ if (endcol == columnPos.size() || (endcol > 0 && (columnPos[endcol - 1] == right)))
+ --endcol;
- for (; endcol > 0; endcol--) {
- if (tx + table()->columnPositions()[endcol - 1] <= x + w + os)
- break;
- }
if (!endcol && tx + table()->columnPositions()[0] - table()->outerBorderLeft() <= y + w + os)
- endcol++;
+ ++endcol;
}
#ifdef ANDROID_LAYOUT
@@ -1282,6 +1286,10 @@ void RenderTableSection::splitColumn(int pos, int first)
// Hit Testing
bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int xPos, int yPos, int tx, int ty, HitTestAction action)
{
+ // If we have no children then we have nothing to do.
+ if (!firstChild())
+ return false;
+
// Table sections cannot ever be hit tested. Effectively they do not exist.
// Just forward to our children always.
tx += x();
@@ -1290,17 +1298,56 @@ bool RenderTableSection::nodeAtPoint(const HitTestRequest& request, HitTestResul
if (hasOverflowClip() && !overflowClipRect(tx, ty).intersects(result.rectFromPoint(xPos, yPos)))
return false;
- for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
- // FIXME: We have to skip over inline flows, since they can show up inside table rows
- // at the moment (a demoted inline <form> for example). If we ever implement a
- // table-specific hit-test method (which we should do for performance reasons anyway),
- // then we can remove this check.
- if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
+ if (m_hasOverflowingCell) {
+ for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
+ // FIXME: We have to skip over inline flows, since they can show up inside table rows
+ // at the moment (a demoted inline <form> for example). If we ever implement a
+ // table-specific hit-test method (which we should do for performance reasons anyway),
+ // then we can remove this check.
+ if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && child->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
+ updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
+ return true;
+ }
+ }
+ return false;
+ }
+
+ int relativeY = yPos - ty;
+ // leftrow corresponds to the first row that starts after the y mouse position
+ unsigned leftrow = std::upper_bound(m_rowPos.begin(), m_rowPos.end(), relativeY) - m_rowPos.begin();
+ if (leftrow == m_rowPos.size())
+ return false;
+ // Grab the last row that starts before the y mouse position.
+ if (leftrow > 0)
+ --leftrow;
+
+ Vector<int>& columnPos = table()->columnPositions();
+ bool rtl = style()->direction() == RTL;
+ int relativeX = xPos - tx;
+ if (rtl)
+ relativeX = columnPos[columnPos.size() - 1] - relativeX;
+
+ unsigned leftcol = std::lower_bound(columnPos.begin(), columnPos.end(), relativeX) - columnPos.begin();
+ if (leftcol == columnPos.size())
+ return false;
+ if (leftcol > 0)
+ --leftcol;
+
+ CellStruct& current = cellAt(leftrow, leftcol);
+
+ // If the cell is empty, there's nothing to do
+ if (!current.hasCells())
+ return false;
+
+ for (int i = current.cells.size() - 1; i >= 0; --i) {
+ RenderTableCell* cell = current.cells[i];
+ if (static_cast<RenderObject*>(cell)->nodeAtPoint(request, result, xPos, yPos, tx, ty, action)) {
updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
return true;
}
}
return false;
+
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index bd050d8..da152b0 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -37,13 +37,13 @@
#include "RenderBlock.h"
#include "RenderLayer.h"
#include "RenderView.h"
-#include "StringBuffer.h"
#include "Text.h"
#include "TextBreakIterator.h"
#include "TextResourceDecoder.h"
#include "VisiblePosition.h"
#include "break_lines.h"
#include <wtf/AlwaysInline.h>
+#include <wtf/text/StringBuffer.h>
using namespace std;
using namespace WTF;
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index d1c8039..5f8c788 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -29,6 +29,7 @@
#include "EventNames.h"
#include "Frame.h"
#include "HTMLBRElement.h"
+#include "HTMLFormControlElement.h"
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "RenderLayer.h"
@@ -217,12 +218,14 @@ int RenderTextControl::selectionEnd()
void RenderTextControl::setSelectionStart(int start)
{
- setSelectionRange(start, max(start, selectionEnd()));
+ HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*>(node());
+ setSelectionRange(start, max(start, element->selectionEnd()));
}
void RenderTextControl::setSelectionEnd(int end)
{
- setSelectionRange(min(end, selectionStart()), end);
+ HTMLTextFormControlElement* element = static_cast<HTMLTextFormControlElement*>(node());
+ setSelectionRange(min(end, element->selectionStart()), end);
}
void RenderTextControl::select()
diff --git a/WebCore/rendering/RenderTheme.h b/WebCore/rendering/RenderTheme.h
index 1e0b54c..aedb8eb 100644
--- a/WebCore/rendering/RenderTheme.h
+++ b/WebCore/rendering/RenderTheme.h
@@ -29,7 +29,6 @@
#include "ThemeTypes.h"
#endif
#include "RenderObject.h"
-#include "RenderTheme.h"
#include "ScrollTypes.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
diff --git a/WebCore/rendering/RenderThemeChromiumMac.h b/WebCore/rendering/RenderThemeChromiumMac.h
index 2309081..d1875fc 100644
--- a/WebCore/rendering/RenderThemeChromiumMac.h
+++ b/WebCore/rendering/RenderThemeChromiumMac.h
@@ -41,8 +41,11 @@ protected:
virtual bool shouldRenderMediaControlPart(ControlPart, Element*);
virtual String extraMediaControlsStyleSheet();
+ virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual IntPoint volumeSliderOffsetFromMuteButton(Node*, const IntSize&) const;
#endif
diff --git a/WebCore/rendering/RenderThemeChromiumMac.mm b/WebCore/rendering/RenderThemeChromiumMac.mm
index a43da1e..e8ffe6c 100644
--- a/WebCore/rendering/RenderThemeChromiumMac.mm
+++ b/WebCore/rendering/RenderThemeChromiumMac.mm
@@ -134,6 +134,11 @@ String RenderThemeChromiumMac::extraMediaControlsStyleSheet()
return String(mediaControlsChromiumUserAgentStyleSheet, sizeof(mediaControlsChromiumUserAgentStyleSheet));
}
+bool RenderThemeChromiumMac::paintMediaVolumeSliderContainer(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+{
+ return true;
+}
+
bool RenderThemeChromiumMac::paintMediaVolumeSliderTrack(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSlider, object, paintInfo, rect);
@@ -144,6 +149,15 @@ bool RenderThemeChromiumMac::paintMediaVolumeSliderThumb(RenderObject* object, c
return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSliderThumb, object, paintInfo, rect);
}
+bool RenderThemeChromiumMac::paintMediaSliderThumb(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+{
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaSliderThumb, object, paintInfo, rect);
+}
+
+IntPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(Node* muteButton, const IntSize& size) const
+{
+ return RenderTheme::volumeSliderOffsetFromMuteButton(muteButton, size);
+}
#endif
} // namespace WebCore
diff --git a/WebCore/rendering/RenderThemeMac.mm b/WebCore/rendering/RenderThemeMac.mm
index cc2ff1f..7982834 100644
--- a/WebCore/rendering/RenderThemeMac.mm
+++ b/WebCore/rendering/RenderThemeMac.mm
@@ -963,7 +963,8 @@ bool RenderThemeMac::paintProgressBar(RenderObject* renderObject, const PaintInf
paintInfo.context->translate(2 * rect.x() + rect.width(), 0);
paintInfo.context->scale(FloatSize(-1, 1));
}
- paintInfo.context->drawImage(imageBuffer->image(), DeviceColorSpace, rect.location());
+
+ paintInfo.context->drawImageBuffer(imageBuffer.get(), DeviceColorSpace, rect.location());
paintInfo.context->restore();
return false;
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index 408015c..e10c2f1 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -442,7 +442,7 @@ void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavi
return;
}
if (o.isSVGImage()) {
- writeSVGImage(ts, *toRenderImage(&o), indent);
+ writeSVGImage(ts, *toRenderSVGImage(&o), indent);
return;
}
#endif
diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp
index ab969cc..0f444b2 100644
--- a/WebCore/rendering/RenderVideo.cpp
+++ b/WebCore/rendering/RenderVideo.cpp
@@ -134,13 +134,14 @@ void RenderVideo::imageChanged(WrappedImagePtr newImage, const IntRect* rect)
RenderMedia::imageChanged(newImage, rect);
// Cache the image intrinsic size so we can continue to use it to draw the image correctly
- // even after we know the video intrisic size but aren't able to draw video frames yet
- // (we don't want to scale the poster to the video size).
- if (videoElement()->shouldDisplayPosterImage()) {
- if (errorOccurred())
- updateIntrinsicSize();
+ // even if we know the video intrinsic size but aren't able to draw video frames yet
+ // (we don't want to scale the poster to the video size without keeping aspect ratio).
+ if (videoElement()->shouldDisplayPosterImage())
m_cachedImageSize = intrinsicSize();
- }
+
+ // The intrinsic size is now that of the image, but in case we already had the
+ // intrinsic size of the video we call this here to restore the video size.
+ updateIntrinsicSize();
}
IntRect RenderVideo::videoBox() const
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 449c15c..acb8487 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -186,7 +186,7 @@ void RenderView::paint(PaintInfo& paintInfo, int tx, int ty)
ASSERT(!needsLayout());
// Cache the print rect because the dirty rect could get changed during painting.
- if (printing())
+ if (document()->paginated())
setPrintRect(paintInfo.rect);
else
setPrintRect(IntRect());
diff --git a/WebCore/rendering/SVGImageBufferTools.cpp b/WebCore/rendering/SVGImageBufferTools.cpp
new file mode 100644
index 0000000..5b45ccc
--- /dev/null
+++ b/WebCore/rendering/SVGImageBufferTools.cpp
@@ -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.
+*/
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGImageBufferTools.h"
+
+#include "GraphicsContext.h"
+#include "RenderObject.h"
+
+namespace WebCore {
+
+AffineTransform SVGImageBufferTools::absoluteTransformFromContext(GraphicsContext* context)
+{
+ // Extract current transformation matrix used in the original context. Note that this coordinate
+ // system is flipped compared to SVGs internal coordinate system, done in WebKit level. Fix
+ // this transformation by flipping the y component.
+ return context->getCTM() * AffineTransform().flipY();
+}
+
+bool SVGImageBufferTools::createImageBuffer(const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, OwnPtr<ImageBuffer>& imageBuffer, ImageColorSpace colorSpace)
+{
+ IntRect imageRect = enclosingIntRect(absoluteTargetRect);
+ if (imageRect.isEmpty())
+ return false;
+
+ // Allocate an image buffer as big as the absolute unclipped size of the object
+ OwnPtr<ImageBuffer> image = ImageBuffer::create(imageRect.size(), colorSpace);
+ if (!image)
+ return false;
+
+ GraphicsContext* imageContext = image->context();
+
+ // Transform the mask image coordinate system to absolute screen coordinates
+ imageContext->translate(-absoluteTargetRect.x(), -absoluteTargetRect.y());
+ imageContext->concatCTM(absoluteTransform);
+
+ imageBuffer = image.release();
+ return true;
+}
+
+void SVGImageBufferTools::clipToImageBuffer(GraphicsContext* context, const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, ImageBuffer* imageBuffer)
+{
+ ASSERT(context);
+ ASSERT(imageBuffer);
+
+ // The mask image has been created in the device coordinate space, as the image should not be scaled.
+ // So the actual masking process has to be done in the device coordinate space as well.
+ context->concatCTM(absoluteTransform.inverse());
+ context->clipToImageBuffer(imageBuffer, absoluteTargetRect);
+ context->concatCTM(absoluteTransform);
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGImageBufferTools.h b/WebCore/rendering/SVGImageBufferTools.h
new file mode 100644
index 0000000..bdbcb1c
--- /dev/null
+++ b/WebCore/rendering/SVGImageBufferTools.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ aint with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef SVGImageBufferTools_h
+#define SVGImageBufferTools_h
+
+#if ENABLE(SVG)
+#include "ImageBuffer.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class AffineTransform;
+class FloatRect;
+class GraphicsContext;
+class RenderObject;
+
+class SVGImageBufferTools : public Noncopyable {
+public:
+ static bool createImageBuffer(const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, OwnPtr<ImageBuffer>&, ImageColorSpace);
+ static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absoluteTransform, const FloatRect& absoluteTargetRect, ImageBuffer*);
+
+ static AffineTransform absoluteTransformFromContext(GraphicsContext*);
+
+private:
+ SVGImageBufferTools() { }
+ ~SVGImageBufferTools() { }
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp
index 67e19f2..e265b2b 100644
--- a/WebCore/rendering/SVGRenderSupport.cpp
+++ b/WebCore/rendering/SVGRenderSupport.cpp
@@ -229,9 +229,20 @@ static inline RenderSVGRoot* svgRootTreeObject(RenderObject* start)
return toRenderSVGRoot(start);
}
+static inline void invalidateResourcesOfChildren(RenderObject* start)
+{
+ ASSERT(!start->needsLayout());
+ if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(start))
+ resources->removeClientFromCache(start, false);
+
+ for (RenderObject* child = start->firstChild(); child; child = child->nextSibling())
+ invalidateResourcesOfChildren(child);
+}
+
void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout)
{
bool layoutSizeChanged = svgRootTreeObject(start)->isLayoutSizeChanged();
+ HashSet<RenderObject*> notlayoutedObjects;
for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
bool needsLayout = selfNeedsLayout;
@@ -252,11 +263,25 @@ void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout)
if (needsLayout) {
child->setNeedsLayout(true, false);
child->layout();
- } else
- child->layoutIfNeeded();
+ } else {
+ if (child->needsLayout())
+ child->layout();
+ else if (layoutSizeChanged)
+ notlayoutedObjects.add(child);
+ }
ASSERT(!child->needsLayout());
}
+
+ if (!layoutSizeChanged) {
+ ASSERT(notlayoutedObjects.isEmpty());
+ return;
+ }
+
+ // If the layout size changed, invalidate all resources of all children that didn't go through the layout() code path.
+ HashSet<RenderObject*>::iterator end = notlayoutedObjects.end();
+ for (HashSet<RenderObject*>::iterator it = notlayoutedObjects.begin(); it != end; ++it)
+ invalidateResourcesOfChildren(*it);
}
bool SVGRenderSupport::isOverflowHidden(const RenderObject* object)
diff --git a/WebCore/rendering/SVGRenderTreeAsText.cpp b/WebCore/rendering/SVGRenderTreeAsText.cpp
index db4c07a..0c9b7e1 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.cpp
+++ b/WebCore/rendering/SVGRenderTreeAsText.cpp
@@ -43,6 +43,7 @@
#include "RenderPath.h"
#include "RenderSVGContainer.h"
#include "RenderSVGGradientStop.h"
+#include "RenderSVGImage.h"
#include "RenderSVGInlineText.h"
#include "RenderSVGResourceClipper.h"
#include "RenderSVGResourceFilter.h"
@@ -708,7 +709,7 @@ void writeSVGInlineText(TextStream& ts, const RenderText& text, int indent)
writeSVGInlineTextBoxes(ts, text, indent);
}
-void writeSVGImage(TextStream& ts, const RenderImage& image, int indent)
+void writeSVGImage(TextStream& ts, const RenderSVGImage& image, int indent)
{
writeStandardPrefix(ts, image, indent);
writePositionAndStyle(ts, image);
diff --git a/WebCore/rendering/SVGRenderTreeAsText.h b/WebCore/rendering/SVGRenderTreeAsText.h
index 0fda958..d4aeaac 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.h
+++ b/WebCore/rendering/SVGRenderTreeAsText.h
@@ -44,6 +44,7 @@ namespace WebCore {
class RenderObject;
class RenderPath;
class RenderSVGGradientStop;
+ class RenderSVGImage;
class RenderSVGRoot;
class RenderText;
class AffineTransform;
@@ -55,7 +56,7 @@ void write(TextStream&, const RenderSVGRoot&, int indent);
void writeSVGGradientStop(TextStream&, const RenderSVGGradientStop&, int indent);
void writeSVGResourceContainer(TextStream&, const RenderObject&, int indent);
void writeSVGContainer(TextStream&, const RenderObject&, int indent);
-void writeSVGImage(TextStream&, const RenderImage&, int indent);
+void writeSVGImage(TextStream&, const RenderSVGImage&, int indent);
void writeSVGInlineText(TextStream&, const RenderText&, int indent);
void writeSVGText(TextStream&, const RenderBlock&, int indent);
void writeResources(TextStream&, const RenderObject&, int indent);
diff --git a/WebCore/rendering/SVGResources.cpp b/WebCore/rendering/SVGResources.cpp
index 290ef41..799301b 100644
--- a/WebCore/rendering/SVGResources.cpp
+++ b/WebCore/rendering/SVGResources.cpp
@@ -279,7 +279,7 @@ bool SVGResources::buildCachedResources(const RenderObject* object, const SVGRen
return foundResources;
}
-void SVGResources::invalidateClient(RenderObject* object) const
+void SVGResources::removeClientFromCache(RenderObject* object, bool markForInvalidation) const
{
if (!m_clipperFilterMaskerData && !m_markerData && !m_fillStrokeData && !m_linkedResource)
return;
@@ -288,35 +288,35 @@ void SVGResources::invalidateClient(RenderObject* object) const
ASSERT(!m_clipperFilterMaskerData);
ASSERT(!m_markerData);
ASSERT(!m_fillStrokeData);
- m_linkedResource->invalidateClient(object);
+ m_linkedResource->removeClientFromCache(object, markForInvalidation);
return;
}
if (m_clipperFilterMaskerData) {
if (m_clipperFilterMaskerData->clipper)
- m_clipperFilterMaskerData->clipper->invalidateClient(object);
+ m_clipperFilterMaskerData->clipper->removeClientFromCache(object, markForInvalidation);
#if ENABLE(FILTERS)
if (m_clipperFilterMaskerData->filter)
- m_clipperFilterMaskerData->filter->invalidateClient(object);
+ m_clipperFilterMaskerData->filter->removeClientFromCache(object, markForInvalidation);
#endif
if (m_clipperFilterMaskerData->masker)
- m_clipperFilterMaskerData->masker->invalidateClient(object);
+ m_clipperFilterMaskerData->masker->removeClientFromCache(object, markForInvalidation);
}
if (m_markerData) {
if (m_markerData->markerStart)
- m_markerData->markerStart->invalidateClient(object);
+ m_markerData->markerStart->removeClientFromCache(object, markForInvalidation);
if (m_markerData->markerMid)
- m_markerData->markerMid->invalidateClient(object);
+ m_markerData->markerMid->removeClientFromCache(object, markForInvalidation);
if (m_markerData->markerEnd)
- m_markerData->markerEnd->invalidateClient(object);
+ m_markerData->markerEnd->removeClientFromCache(object, markForInvalidation);
}
if (m_fillStrokeData) {
if (m_fillStrokeData->fill)
- m_fillStrokeData->fill->invalidateClient(object);
+ m_fillStrokeData->fill->removeClientFromCache(object, markForInvalidation);
if (m_fillStrokeData->stroke)
- m_fillStrokeData->stroke->invalidateClient(object);
+ m_fillStrokeData->stroke->removeClientFromCache(object, markForInvalidation);
}
}
@@ -330,7 +330,7 @@ void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
ASSERT(!m_clipperFilterMaskerData);
ASSERT(!m_markerData);
ASSERT(!m_fillStrokeData);
- m_linkedResource->invalidateClients();
+ m_linkedResource->removeAllClientsFromCache();
m_linkedResource = 0;
return;
}
@@ -340,7 +340,7 @@ void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
if (!m_clipperFilterMaskerData)
break;
if (m_clipperFilterMaskerData->masker == resource) {
- m_clipperFilterMaskerData->masker->invalidateClients();
+ m_clipperFilterMaskerData->masker->removeAllClientsFromCache();
m_clipperFilterMaskerData->masker = 0;
}
break;
@@ -348,15 +348,15 @@ void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
if (!m_markerData)
break;
if (m_markerData->markerStart == resource) {
- m_markerData->markerStart->invalidateClients();
+ m_markerData->markerStart->removeAllClientsFromCache();
m_markerData->markerStart = 0;
}
if (m_markerData->markerMid == resource) {
- m_markerData->markerMid->invalidateClients();
+ m_markerData->markerMid->removeAllClientsFromCache();
m_markerData->markerMid = 0;
}
if (m_markerData->markerEnd == resource) {
- m_markerData->markerEnd->invalidateClients();
+ m_markerData->markerEnd->removeAllClientsFromCache();
m_markerData->markerEnd = 0;
}
break;
@@ -366,11 +366,11 @@ void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
if (!m_fillStrokeData)
break;
if (m_fillStrokeData->fill == resource) {
- m_fillStrokeData->fill->invalidateClients();
+ m_fillStrokeData->fill->removeAllClientsFromCache();
m_fillStrokeData->fill = 0;
}
if (m_fillStrokeData->stroke == resource) {
- m_fillStrokeData->stroke->invalidateClients();
+ m_fillStrokeData->stroke->removeAllClientsFromCache();
m_fillStrokeData->stroke = 0;
}
break;
@@ -379,7 +379,7 @@ void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
if (!m_clipperFilterMaskerData)
break;
if (m_clipperFilterMaskerData->filter == resource) {
- m_clipperFilterMaskerData->filter->invalidateClients();
+ m_clipperFilterMaskerData->filter->removeAllClientsFromCache();
m_clipperFilterMaskerData->filter = 0;
}
#else
@@ -390,7 +390,7 @@ void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
if (!m_clipperFilterMaskerData)
break;
if (m_clipperFilterMaskerData->clipper == resource) {
- m_clipperFilterMaskerData->clipper->invalidateClients();
+ m_clipperFilterMaskerData->clipper->removeAllClientsFromCache();
m_clipperFilterMaskerData->clipper = 0;
}
break;
diff --git a/WebCore/rendering/SVGResources.h b/WebCore/rendering/SVGResources.h
index a07a990..5f6e746 100644
--- a/WebCore/rendering/SVGResources.h
+++ b/WebCore/rendering/SVGResources.h
@@ -64,7 +64,7 @@ public:
void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&);
// Methods operating on all cached resources
- void invalidateClient(RenderObject*) const;
+ void removeClientFromCache(RenderObject*, bool markForInvalidation = true) const;
void resourceDestroyed(RenderSVGResourceContainer*);
#ifndef NDEBUG
diff --git a/WebCore/rendering/SVGResourcesCache.cpp b/WebCore/rendering/SVGResourcesCache.cpp
index b922b44..a4089d6 100644
--- a/WebCore/rendering/SVGResourcesCache.cpp
+++ b/WebCore/rendering/SVGResourcesCache.cpp
@@ -121,7 +121,7 @@ void SVGResourcesCache::clientLayoutChanged(RenderObject* object)
if (!resources)
return;
- resources->invalidateClient(object);
+ resources->removeClientFromCache(object);
}
void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifference diff, const RenderStyle* newStyle)
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index cf0e864..9852aa6 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -345,9 +345,21 @@ void SpinButtonElement::setHovered(bool flag)
inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Node* shadowParent)
: TextControlInnerElement(shadowParent->document(), shadowParent)
, m_capturing(false)
+ , m_state(Idle)
+ , m_listenerId(document()->page()->speechInput()->registerListener(this))
{
}
+InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement()
+{
+ SpeechInput* speech = speechInput();
+ if (speech) { // Could be null when page is unloading.
+ if (m_state != Idle)
+ speech->cancelRecognition(m_listenerId);
+ speech->unregisterListener(m_listenerId);
+ }
+}
+
PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(Node* shadowParent)
{
return adoptRef(new InputFieldSpeechButtonElement(shadowParent));
@@ -383,7 +395,18 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
}
if (event->type() == eventNames().clickEvent) {
- speechInput()->startRecognition(this);
+ switch (m_state) {
+ case Idle:
+ if (speechInput()->startRecognition(m_listenerId))
+ setState(Recording);
+ break;
+ case Recording:
+ speechInput()->stopRecording(m_listenerId);
+ break;
+ case Recognizing:
+ // Nothing to do here, we will continue to wait for results.
+ break;
+ }
event->setDefaultHandled();
}
@@ -391,23 +414,30 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
HTMLDivElement::defaultEventHandler(event);
}
+void InputFieldSpeechButtonElement::setState(SpeechInputState state)
+{
+ if (m_state != state) {
+ m_state = state;
+ shadowAncestorNode()->renderer()->repaint();
+ }
+}
+
SpeechInput* InputFieldSpeechButtonElement::speechInput()
{
- return document()->page()->speechInput();
+ return document()->page() ? document()->page()->speechInput() : 0;
}
-void InputFieldSpeechButtonElement::didCompleteRecording()
+void InputFieldSpeechButtonElement::didCompleteRecording(int)
{
- // FIXME: Add UI feedback here to indicate that audio recording stopped and recognition is
- // in progress.
+ setState(Recognizing);
}
-void InputFieldSpeechButtonElement::didCompleteRecognition()
+void InputFieldSpeechButtonElement::didCompleteRecognition(int)
{
- // FIXME: Add UI feedback here to indicate that audio recognition has ended.
+ setState(Idle);
}
-void InputFieldSpeechButtonElement::setRecognitionResult(const String& result)
+void InputFieldSpeechButtonElement::setRecognitionResult(int, const String& result)
{
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
// The call to setValue() below dispatches an event, and an event handler in the page might
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index 2859bd5..3fbc9c8 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -119,21 +119,32 @@ class InputFieldSpeechButtonElement
: public TextControlInnerElement,
public SpeechInputListener {
public:
+ enum SpeechInputState {
+ Idle,
+ Recording,
+ Recognizing,
+ };
+
static PassRefPtr<InputFieldSpeechButtonElement> create(Node*);
+ virtual ~InputFieldSpeechButtonElement();
virtual void detach();
virtual void defaultEventHandler(Event*);
+ SpeechInputState state() const { return m_state; }
// SpeechInputListener methods.
- void didCompleteRecording();
- void didCompleteRecognition();
- void setRecognitionResult(const String& result);
+ void didCompleteRecording(int);
+ void didCompleteRecognition(int);
+ void setRecognitionResult(int, const String& result);
private:
InputFieldSpeechButtonElement(Node*);
SpeechInput* speechInput();
+ void setState(SpeechInputState state);
bool m_capturing;
+ SpeechInputState m_state;
+ int m_listenerId;
};
#endif // ENABLE(INPUT_SPEECH)
diff --git a/WebCore/rendering/style/BindingURI.h b/WebCore/rendering/style/BindingURI.h
index 923f1aa..c844b1d 100644
--- a/WebCore/rendering/style/BindingURI.h
+++ b/WebCore/rendering/style/BindingURI.h
@@ -26,7 +26,7 @@
#define BindingURI_h
#if ENABLE(XBL)
-#include "StringImpl.h"
+#include <wtf/text/StringImpl.h>
namespace WebCore {
diff --git a/WebCore/rendering/style/ContentData.cpp b/WebCore/rendering/style/ContentData.cpp
index 410cad4..b0f9e81 100644
--- a/WebCore/rendering/style/ContentData.cpp
+++ b/WebCore/rendering/style/ContentData.cpp
@@ -23,8 +23,8 @@
#include "ContentData.h"
#include "CounterContent.h"
-#include "StringImpl.h"
#include "StyleImage.h"
+#include <wtf/text/StringImpl.h>
namespace WebCore {
diff --git a/WebCore/rendering/style/CounterContent.h b/WebCore/rendering/style/CounterContent.h
index 702d9c2..52757ad 100644
--- a/WebCore/rendering/style/CounterContent.h
+++ b/WebCore/rendering/style/CounterContent.h
@@ -25,8 +25,8 @@
#ifndef CounterContent_h
#define CounterContent_h
-#include "AtomicString.h"
#include "RenderStyleConstants.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/rendering/style/CounterDirectives.h b/WebCore/rendering/style/CounterDirectives.h
index 9cbdeae..e54028e 100644
--- a/WebCore/rendering/style/CounterDirectives.h
+++ b/WebCore/rendering/style/CounterDirectives.h
@@ -25,9 +25,9 @@
#ifndef CounterDirectives_h
#define CounterDirectives_h
-#include "AtomicStringImpl.h"
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicStringImpl.h>
namespace WebCore {
diff --git a/WebCore/rendering/style/KeyframeList.h b/WebCore/rendering/style/KeyframeList.h
index b1009d2..bb5f180 100644
--- a/WebCore/rendering/style/KeyframeList.h
+++ b/WebCore/rendering/style/KeyframeList.h
@@ -25,10 +25,10 @@
#ifndef KeyframeList_h
#define KeyframeList_h
-#include "AtomicString.h"
#include <wtf/Vector.h>
#include <wtf/HashSet.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h
index 07541d3..ba914d4 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/WebCore/rendering/style/StyleRareInheritedData.h
@@ -25,11 +25,11 @@
#ifndef StyleRareInheritedData_h
#define StyleRareInheritedData_h
-#include "AtomicString.h"
#include "Color.h"
#include "Length.h"
#include <wtf/RefCounted.h>
#include <wtf/PassRefPtr.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/storage/AbstractDatabase.cpp b/WebCore/storage/AbstractDatabase.cpp
index 7827ec8..8d3bf1e 100644
--- a/WebCore/storage/AbstractDatabase.cpp
+++ b/WebCore/storage/AbstractDatabase.cpp
@@ -36,12 +36,12 @@
#include "SQLiteStatement.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/DOMFileSystem.cpp b/WebCore/storage/DOMFileSystem.cpp
index 19c75fc..c3dbd34 100644
--- a/WebCore/storage/DOMFileSystem.cpp
+++ b/WebCore/storage/DOMFileSystem.cpp
@@ -33,7 +33,7 @@
#if ENABLE(FILE_SYSTEM)
-#include "Entry.h"
+#include "DirectoryEntry.h"
namespace WebCore {
@@ -43,9 +43,9 @@ DOMFileSystem::DOMFileSystem(const String& name, const String& rootPath)
{
}
-PassRefPtr<Entry> DOMFileSystem::root()
+PassRefPtr<DirectoryEntry> DOMFileSystem::root()
{
- return Entry::create(this, "/");
+ return DirectoryEntry::create(this, "/");
}
} // namespace
diff --git a/WebCore/storage/DOMFileSystem.h b/WebCore/storage/DOMFileSystem.h
index 454205d..b87aaaf 100644
--- a/WebCore/storage/DOMFileSystem.h
+++ b/WebCore/storage/DOMFileSystem.h
@@ -39,7 +39,7 @@
namespace WebCore {
-class Entry;
+class DirectoryEntry;
class DOMFileSystem : public RefCounted<DOMFileSystem> {
public:
@@ -49,7 +49,7 @@ public:
}
const String& name() const { return m_name; }
- PassRefPtr<Entry> root();
+ PassRefPtr<DirectoryEntry> root();
private:
DOMFileSystem(const String& name, const String& rootPath);
diff --git a/WebCore/storage/DOMFileSystem.idl b/WebCore/storage/DOMFileSystem.idl
index 0241c4a..b7307e2 100644
--- a/WebCore/storage/DOMFileSystem.idl
+++ b/WebCore/storage/DOMFileSystem.idl
@@ -33,6 +33,6 @@ module storage {
Conditional=FILE_SYSTEM
] DOMFileSystem {
readonly attribute DOMString name;
- readonly attribute Entry root;
+ readonly attribute DirectoryEntry root;
};
}
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 9550083..961310d 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -183,13 +183,12 @@ String Database::version() const
bool Database::openAndVerifyVersion(bool setVersionInNewDatabase, ExceptionCode& e)
{
- if (!m_scriptExecutionContext->databaseThread())
+ DatabaseTaskSynchronizer synchronizer;
+ if (!m_scriptExecutionContext->databaseThread() || m_scriptExecutionContext->databaseThread()->terminationRequested(&synchronizer))
return false;
bool success = false;
- DatabaseTaskSynchronizer synchronizer;
OwnPtr<DatabaseOpenTask> task = DatabaseOpenTask::create(this, setVersionInNewDatabase, &synchronizer, e, success);
-
m_scriptExecutionContext->databaseThread()->scheduleImmediateTask(task.release());
synchronizer.waitForTaskCompletion();
@@ -204,14 +203,13 @@ void Database::markAsDeletedAndClose()
LOG(StorageAPI, "Marking %s (%p) as deleted", stringIdentifier().ascii().data(), this);
m_deleted = true;
- if (m_scriptExecutionContext->databaseThread()->terminationRequested()) {
+ DatabaseTaskSynchronizer synchronizer;
+ if (m_scriptExecutionContext->databaseThread()->terminationRequested(&synchronizer)) {
LOG(StorageAPI, "Database handle %p is on a terminated DatabaseThread, cannot be marked for normal closure\n", this);
return;
}
- DatabaseTaskSynchronizer synchronizer;
OwnPtr<DatabaseCloseTask> task = DatabaseCloseTask::create(this, &synchronizer);
-
m_scriptExecutionContext->databaseThread()->scheduleImmediateTask(task.release());
synchronizer.waitForTaskCompletion();
}
@@ -397,12 +395,11 @@ Vector<String> Database::tableNames()
// FIXME: Not using threadsafeCopy on these strings looks ok since threads take strict turns
// in dealing with them. However, if the code changes, this may not be true anymore.
Vector<String> result;
- if (!m_scriptExecutionContext->databaseThread())
+ DatabaseTaskSynchronizer synchronizer;
+ if (!m_scriptExecutionContext->databaseThread() || m_scriptExecutionContext->databaseThread()->terminationRequested(&synchronizer))
return result;
- DatabaseTaskSynchronizer synchronizer;
OwnPtr<DatabaseTableNamesTask> task = DatabaseTableNamesTask::create(this, &synchronizer, result);
-
m_scriptExecutionContext->databaseThread()->scheduleImmediateTask(task.release());
synchronizer.waitForTaskCompletion();
diff --git a/WebCore/storage/DatabaseAuthorizer.h b/WebCore/storage/DatabaseAuthorizer.h
index 66bc5d8..e7c3922 100644
--- a/WebCore/storage/DatabaseAuthorizer.h
+++ b/WebCore/storage/DatabaseAuthorizer.h
@@ -29,10 +29,10 @@
#define DatabaseAuthorizer_h
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashSet.h>
#include <wtf/ThreadSafeShared.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/DatabaseTask.cpp b/WebCore/storage/DatabaseTask.cpp
index 3526d9d..343ae1e 100644
--- a/WebCore/storage/DatabaseTask.cpp
+++ b/WebCore/storage/DatabaseTask.cpp
@@ -37,6 +37,9 @@ namespace WebCore {
DatabaseTaskSynchronizer::DatabaseTaskSynchronizer()
: m_taskCompleted(false)
+#ifndef NDEBUG
+ , m_hasCheckedForTermination(false)
+#endif
{
}
@@ -67,6 +70,7 @@ DatabaseTask::DatabaseTask(Database* database, DatabaseTaskSynchronizer* synchro
DatabaseTask::~DatabaseTask()
{
+ ASSERT(m_complete || !m_synchronizer);
}
void DatabaseTask::performTask()
@@ -81,6 +85,10 @@ void DatabaseTask::performTask()
if (m_synchronizer)
m_synchronizer->taskCompleted();
+
+#ifndef NDEBUG
+ m_complete = true;
+#endif
}
// *** DatabaseOpenTask ***
diff --git a/WebCore/storage/DatabaseTask.h b/WebCore/storage/DatabaseTask.h
index 9673a26..847846d 100644
--- a/WebCore/storage/DatabaseTask.h
+++ b/WebCore/storage/DatabaseTask.h
@@ -52,11 +52,19 @@ public:
// Called by the task.
void taskCompleted();
-private:
+#ifndef NDEBUG
+ bool hasCheckedForTermination() const { return m_hasCheckedForTermination; }
+ void setHasCheckedForTermination() { m_hasCheckedForTermination = true; }
+#endif
+
+private:
bool m_taskCompleted;
Mutex m_synchronousMutex;
ThreadCondition m_synchronousCondition;
+#ifndef NDEBUG
+ bool m_hasCheckedForTermination;
+#endif
};
class DatabaseTask : public Noncopyable {
@@ -66,6 +74,10 @@ public:
void performTask();
Database* database() const { return m_database; }
+#ifndef NDEBUG
+ bool hasSynchronizer() const { return m_synchronizer; }
+ bool hasCheckedForTermination() const { return m_synchronizer->hasCheckedForTermination(); }
+#endif
protected:
DatabaseTask(Database*, DatabaseTaskSynchronizer*);
@@ -77,8 +89,8 @@ private:
DatabaseTaskSynchronizer* m_synchronizer;
#ifndef NDEBUG
- virtual const char* debugTaskName() const = 0;
- bool m_complete;
+ virtual const char* debugTaskName() const = 0;
+ bool m_complete;
#endif
};
diff --git a/WebCore/storage/DatabaseThread.cpp b/WebCore/storage/DatabaseThread.cpp
index ae2a6c0..99cf3b9 100644
--- a/WebCore/storage/DatabaseThread.cpp
+++ b/WebCore/storage/DatabaseThread.cpp
@@ -37,6 +37,7 @@
#include "Logging.h"
#include "SQLTransactionClient.h"
#include "SQLTransactionCoordinator.h"
+#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -75,8 +76,15 @@ void DatabaseThread::requestTermination(DatabaseTaskSynchronizer *cleanupSync)
m_queue.kill();
}
-bool DatabaseThread::terminationRequested() const
+bool DatabaseThread::terminationRequested(DatabaseTaskSynchronizer* taskSynchronizer) const
{
+#ifndef NDEBUG
+ if (taskSynchronizer)
+ taskSynchronizer->setHasCheckedForTermination();
+#else
+ UNUSED_PARAM(taskSynchronizer);
+#endif
+
return m_queue.killed();
}
@@ -148,11 +156,13 @@ void DatabaseThread::recordDatabaseClosed(Database* database)
void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task)
{
+ ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
m_queue.append(task);
}
void DatabaseThread::scheduleImmediateTask(PassOwnPtr<DatabaseTask> task)
{
+ ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
m_queue.prepend(task);
}
diff --git a/WebCore/storage/DatabaseThread.h b/WebCore/storage/DatabaseThread.h
index 3702619..c81e376 100644
--- a/WebCore/storage/DatabaseThread.h
+++ b/WebCore/storage/DatabaseThread.h
@@ -55,7 +55,7 @@ public:
bool start();
void requestTermination(DatabaseTaskSynchronizer* cleanupSync);
- bool terminationRequested() const;
+ bool terminationRequested(DatabaseTaskSynchronizer* taskSynchronizer = 0) const;
void scheduleTask(PassOwnPtr<DatabaseTask>);
void scheduleImmediateTask(PassOwnPtr<DatabaseTask>); // This just adds the task to the front of the queue - the caller needs to be extremely careful not to create deadlocks when waiting for completion.
diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp
index 0764db0..e0ba422 100644
--- a/WebCore/storage/DatabaseTracker.cpp
+++ b/WebCore/storage/DatabaseTracker.cpp
@@ -686,7 +686,11 @@ void DatabaseTracker::setQuota(SecurityOrigin* origin, unsigned long long quota)
}
if (error)
+#if OS(WINDOWS)
+ LOG_ERROR("Failed to set quota %I64u in tracker database for origin %s", quota, origin->databaseIdentifier().ascii().data());
+#else
LOG_ERROR("Failed to set quota %llu in tracker database for origin %s", quota, origin->databaseIdentifier().ascii().data());
+#endif
}
// FIXME: Is it really OK to update the quota in memory if we failed to update it on disk?
diff --git a/WebCore/storage/DatabaseTracker.h b/WebCore/storage/DatabaseTracker.h
index 1557f0a..7145e6b 100644
--- a/WebCore/storage/DatabaseTracker.h
+++ b/WebCore/storage/DatabaseTracker.h
@@ -32,9 +32,9 @@
#if ENABLE(DATABASE)
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
#if !PLATFORM(CHROMIUM)
#include "DatabaseDetails.h"
diff --git a/WebKit/chromium/src/js/InjectDispatch.js b/WebCore/storage/DirectoryEntry.cpp
index cda84e5..60dcace 100644
--- a/WebKit/chromium/src/js/InjectDispatch.js
+++ b/WebCore/storage/DirectoryEntry.cpp
@@ -28,40 +28,39 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/**
- * @fileoverview Injects "injected" object into the inspectable page.
- */
+#include "config.h"
+#include "DirectoryEntry.h"
+#if ENABLE(FILE_SYSTEM)
-var InspectorControllerDispatcher = {};
+#include "DirectoryReader.h"
+#include "EntryCallback.h"
+#include "ErrorCallback.h"
-/**
- * Main dispatch method, all calls from the host to InspectorController go
- * through this one.
- * @param {string} functionName Function to call
- * @param {string} json_args JSON-serialized call parameters.
- * @return {string} JSON-serialized result of the dispatched call.
- */
-InspectorControllerDispatcher.dispatch = function(functionName, json_args)
+namespace WebCore {
+
+DirectoryEntry::DirectoryEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath)
+ : Entry(fileSystem, fullPath)
{
- var params = JSON.parse(json_args);
- InspectorBackend[functionName].apply(InspectorBackend, params);
-};
+}
-/**
- * This is called by the InspectorFrontend for serialization.
- * We serialize the call and send it to the client over the IPC
- * using dispatchOut bound method.
- */
-function dispatch(method, var_args) {
- var args = Array.prototype.slice.call(arguments);
- var call = JSON.stringify(args);
- DevToolsAgentHost.dispatch(call, method);
-};
+PassRefPtr<DirectoryReader> DirectoryEntry::createReader()
+{
+ return DirectoryReader::create(m_fileSystem, m_fullPath);
+}
-function close() {
- // This method is called when InspectorFrontend closes in layout tests.
+void DirectoryEntry::getFile(const String&, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
+{
+ // FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
-function inspectedPageDestroyed() {
+void DirectoryEntry::getDirectory(const String&, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
+{
+ // FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/storage/DirectoryEntry.h b/WebCore/storage/DirectoryEntry.h
new file mode 100644
index 0000000..2ae4fb5
--- /dev/null
+++ b/WebCore/storage/DirectoryEntry.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DirectoryEntry_h
+#define DirectoryEntry_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "Entry.h"
+#include "Flags.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class DirectoryReader;
+class EntryCallback;
+class ErrorCallback;
+
+class DirectoryEntry : public Entry {
+public:
+ static PassRefPtr<DirectoryEntry> create(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath)
+ {
+ return adoptRef(new DirectoryEntry(fileSystem, fullPath));
+ }
+ virtual bool isDirectory() const { return true; }
+
+ PassRefPtr<DirectoryReader> createReader();
+ void getFile(const String& path, PassRefPtr<Flags> options = 0, PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ void getDirectory(const String& path, PassRefPtr<Flags> options = 0, PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+
+private:
+ DirectoryEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath);
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // DirectoryEntry_h
diff --git a/WebCore/storage/DirectoryEntry.idl b/WebCore/storage/DirectoryEntry.idl
new file mode 100644
index 0000000..ac30c7f
--- /dev/null
+++ b/WebCore/storage/DirectoryEntry.idl
@@ -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:
+ *
+ * * 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.
+ */
+
+module storage {
+ interface [
+ Conditional=FILE_SYSTEM,
+ GenerateNativeConverter,
+ GenerateToJS
+ ] DirectoryEntry : Entry {
+ DirectoryReader createReader();
+ void getFile(in DOMString path, in [Optional] Flags options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void getDirectory(in DOMString path, in [Optional] Flags options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ };
+}
diff --git a/WebCore/storage/DirectoryReader.cpp b/WebCore/storage/DirectoryReader.cpp
new file mode 100644
index 0000000..0b30f70
--- /dev/null
+++ b/WebCore/storage/DirectoryReader.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DirectoryReader.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DOMFileSystem.h"
+#include "EntriesCallback.h"
+#include "ErrorCallback.h"
+
+namespace WebCore {
+
+DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystem> fileSystem, const String& path)
+ : m_fileSystem(fileSystem)
+ , m_path(path)
+{
+}
+
+void DirectoryReader::readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>)
+{
+ // FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
+}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/storage/DirectoryReader.h b/WebCore/storage/DirectoryReader.h
new file mode 100644
index 0000000..cf5da8f
--- /dev/null
+++ b/WebCore/storage/DirectoryReader.h
@@ -0,0 +1,66 @@
+/*
+ * 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 DirectoryReader_h
+#define DirectoryReader_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DOMFileSystem.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class EntriesCallback;
+class ErrorCallback;
+
+class DirectoryReader : public RefCounted<DirectoryReader> {
+public:
+ static PassRefPtr<DirectoryReader> create(PassRefPtr<DOMFileSystem> fileSystem, const String& path)
+ {
+ return adoptRef(new DirectoryReader(fileSystem, path));
+ }
+
+ void readEntries(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback = 0);
+
+private:
+ DirectoryReader(PassRefPtr<DOMFileSystem> fileSystem, const String& path);
+
+ RefPtr<DOMFileSystem> m_fileSystem;
+ String m_path;
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // DirectoryReader_h
diff --git a/WebCore/storage/DirectoryReader.idl b/WebCore/storage/DirectoryReader.idl
new file mode 100644
index 0000000..c3c7012
--- /dev/null
+++ b/WebCore/storage/DirectoryReader.idl
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+module storage {
+ interface [
+ Conditional=FILE_SYSTEM
+ ] DirectoryReader {
+ void readEntries(in [Callback] EntriesCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ };
+}
diff --git a/WebCore/storage/EntriesCallback.h b/WebCore/storage/EntriesCallback.h
new file mode 100644
index 0000000..9f812e9
--- /dev/null
+++ b/WebCore/storage/EntriesCallback.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 EntriesCallback_h
+#define EntriesCallback_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class EntryArray;
+
+class EntriesCallback : public RefCounted<EntriesCallback> {
+public:
+ virtual ~EntriesCallback() { }
+ virtual bool handleEvent(EntryArray*) = 0;
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // EntriesCallback_h
diff --git a/WebCore/storage/EntriesCallback.idl b/WebCore/storage/EntriesCallback.idl
new file mode 100644
index 0000000..73b374d
--- /dev/null
+++ b/WebCore/storage/EntriesCallback.idl
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+module storage {
+ interface [
+ Conditional=FILE_SYSTEM,
+ Callback
+ ] EntriesCallback {
+ boolean handleEvent(in EntryArray entries);
+ };
+}
diff --git a/WebCore/storage/Entry.cpp b/WebCore/storage/Entry.cpp
index b882297..6783291 100644
--- a/WebCore/storage/Entry.cpp
+++ b/WebCore/storage/Entry.cpp
@@ -40,46 +40,51 @@
namespace WebCore {
-Entry::Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath, bool isDirectory)
+Entry::Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
- , m_isDirectory(isDirectory)
{
- int index = fullPath.reverseFind("/");
- if (index != -1)
+ size_t index = fullPath.reverseFind("/");
+ if (index != notFound)
m_name = fullPath.substring(index);
else
m_name = fullPath;
}
-void Entry::getMetadata(ScriptExecutionContext*, PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>)
+void Entry::getMetadata(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>)
{
// FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
-void Entry::moveTo(ScriptExecutionContext*, PassRefPtr<Entry>, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
+void Entry::moveTo(PassRefPtr<Entry>, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
{
// FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
-void Entry::copyTo(ScriptExecutionContext*, PassRefPtr<Entry>, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
+void Entry::copyTo(PassRefPtr<Entry>, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
{
// FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
-void Entry::remove(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>)
+void Entry::remove(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>)
{
// FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
-void Entry::getParent(ScriptExecutionContext*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
+void Entry::getParent(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>)
{
// FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
}
String Entry::toURI(const String&)
{
// FIXME: to be implemented.
+ ASSERT_NOT_REACHED();
return String();
}
diff --git a/WebCore/storage/Entry.h b/WebCore/storage/Entry.h
index 1cabe58..7bbb265 100644
--- a/WebCore/storage/Entry.h
+++ b/WebCore/storage/Entry.h
@@ -42,42 +42,35 @@ namespace WebCore {
class EntryCallback;
class ErrorCallback;
class MetadataCallback;
-class ScriptExecutionContext;
class VoidCallback;
class Entry : public RefCounted<Entry> {
public:
- static PassRefPtr<Entry> create(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath, bool isDirectory = false)
- {
- return adoptRef(new Entry(fileSystem, fullPath, isDirectory));
- }
-
virtual ~Entry() { }
- virtual bool isFile() const { return !m_isDirectory; }
- virtual bool isDirectory() const { return m_isDirectory; }
+ virtual bool isFile() const { return false; }
+ virtual bool isDirectory() const { return false; }
const String& fullPath() const { return m_fullPath; }
const String& name() const { return m_name; }
DOMFileSystem* filesystem() const { return m_fileSystem.get(); }
- virtual void getMetadata(ScriptExecutionContext*, PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ virtual void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
- virtual void moveTo(ScriptExecutionContext*, PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
- virtual void copyTo(ScriptExecutionContext*, PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
- virtual void remove(ScriptExecutionContext*, PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
- virtual void getParent(ScriptExecutionContext*, PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ virtual void moveTo(PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ virtual void copyTo(PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ virtual void remove(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
+ virtual void getParent(PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
virtual String toURI(const String& mimeType = String());
protected:
- Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath, bool isDirectory);
+ Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath);
RefPtr<DOMFileSystem> m_fileSystem;
String m_fullPath; // virtual path
String m_name;
- bool m_isDirectory;
};
} // namespace WebCore
diff --git a/WebCore/storage/Entry.idl b/WebCore/storage/Entry.idl
index 972751e..7d4ffee 100644
--- a/WebCore/storage/Entry.idl
+++ b/WebCore/storage/Entry.idl
@@ -38,10 +38,10 @@ module storage {
readonly attribute DOMString fullPath;
readonly attribute DOMFileSystem filesystem;
- [CallWith=ScriptExecutionContext] void moveTo(in Entry parent, in [Optional] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- [CallWith=ScriptExecutionContext] void copyTo(in Entry parent, in [Optional] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void moveTo(in Entry parent, in [Optional] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void copyTo(in Entry parent, in [Optional] DOMString name, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void remove(in [Optional, Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void getParent(in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
DOMString toURI(in [Optional] DOMString mimeType);
- [CallWith=ScriptExecutionContext] void remove(in [Optional, Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- [CallWith=ScriptExecutionContext] void getParent(in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
}
diff --git a/WebCore/storage/EntryArray.cpp b/WebCore/storage/EntryArray.cpp
new file mode 100644
index 0000000..6c4f74f
--- /dev/null
+++ b/WebCore/storage/EntryArray.cpp
@@ -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.
+ */
+
+#include "config.h"
+#include "EntryArray.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+namespace WebCore {
+
+EntryArray::EntryArray()
+{
+}
+
+Entry* EntryArray::item(unsigned index) const
+{
+ if (index >= m_entries.size())
+ return 0;
+ return m_entries[index].get();
+}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/storage/EntryArray.h b/WebCore/storage/EntryArray.h
new file mode 100644
index 0000000..e5957ab
--- /dev/null
+++ b/WebCore/storage/EntryArray.h
@@ -0,0 +1,67 @@
+/*
+ * 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 EntryArray_h
+#define EntryArray_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "Entry.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class EntryArray : public RefCounted<EntryArray> {
+public:
+ static PassRefPtr<EntryArray> create()
+ {
+ return adoptRef(new EntryArray());
+ }
+
+ unsigned length() const { return m_entries.size(); }
+ Entry* item(unsigned index) const;
+ void set(unsigned index, PassRefPtr<Entry> entry);
+
+ bool isEmpty() const { return m_entries.isEmpty(); }
+ void clear() { m_entries.clear(); }
+ void append(PassRefPtr<Entry> entry) { m_entries.append(entry); }
+
+private:
+ EntryArray();
+
+ Vector<RefPtr<Entry> > m_entries;
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // EntryArray_h
diff --git a/WebCore/storage/EntryArray.idl b/WebCore/storage/EntryArray.idl
new file mode 100644
index 0000000..e987ece
--- /dev/null
+++ b/WebCore/storage/EntryArray.idl
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+module storage {
+ interface [
+ Conditional=FILE_SYSTEM,
+ HasIndexGetter,
+ ] EntryArray {
+ readonly attribute unsigned long length;
+ Entry item(in [IsIndex] unsigned long index);
+ };
+}
diff --git a/WebCore/storage/FileEntry.cpp b/WebCore/storage/FileEntry.cpp
new file mode 100644
index 0000000..4bec01d
--- /dev/null
+++ b/WebCore/storage/FileEntry.cpp
@@ -0,0 +1,45 @@
+/*
+ * 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 "FileEntry.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+namespace WebCore {
+
+FileEntry::FileEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath)
+ : Entry(fileSystem, fullPath)
+{
+}
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/storage/FileEntry.h b/WebCore/storage/FileEntry.h
new file mode 100644
index 0000000..b02b5c7
--- /dev/null
+++ b/WebCore/storage/FileEntry.h
@@ -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.
+ */
+
+#ifndef FileEntry_h
+#define FileEntry_h
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "Entry.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class DOMFileSystem;
+
+class FileEntry : public Entry {
+public:
+ static PassRefPtr<FileEntry> create(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath)
+ {
+ return adoptRef(new FileEntry(fileSystem, fullPath));
+ }
+ virtual bool isFile() const { return true; }
+
+private:
+ FileEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath);
+};
+
+} // namespace
+
+#endif // ENABLE(FILE_SYSTEM)
+
+#endif // FileEntry_h
diff --git a/WebCore/storage/FileEntry.idl b/WebCore/storage/FileEntry.idl
new file mode 100644
index 0000000..af3b807
--- /dev/null
+++ b/WebCore/storage/FileEntry.idl
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+module storage {
+ interface [
+ Conditional=FILE_SYSTEM,
+ GenerateNativeConverter,
+ GenerateToJS
+ ] FileEntry : Entry {
+ };
+}
diff --git a/WebCore/storage/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp
index fa1807c..b00695b 100644
--- a/WebCore/storage/IDBDatabase.cpp
+++ b/WebCore/storage/IDBDatabase.cpp
@@ -39,6 +39,7 @@ namespace WebCore {
IDBDatabase::IDBDatabase(PassRefPtr<IDBDatabaseBackendInterface> backend)
: m_backend(backend)
+ , m_description(m_backend->description())
{
// We pass a reference to this object before it can be adopted.
relaxAdoptionRequirement();
diff --git a/WebCore/storage/IDBDatabase.h b/WebCore/storage/IDBDatabase.h
index 6900efd..1ad3c65 100644
--- a/WebCore/storage/IDBDatabase.h
+++ b/WebCore/storage/IDBDatabase.h
@@ -52,7 +52,7 @@ public:
// Implement the IDL
String name() const { return m_backend->name(); }
- String description() const { return m_backend->description(); }
+ String description() const { return m_description; }
String version() const { return m_backend->version(); }
PassRefPtr<DOMStringList> objectStores() const { return m_backend->objectStores(); }
@@ -65,6 +65,8 @@ private:
IDBDatabase(PassRefPtr<IDBDatabaseBackendInterface>);
RefPtr<IDBDatabaseBackendInterface> m_backend;
+
+ String m_description;
};
} // namespace WebCore
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index 09b9dee..e550e18 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -29,22 +29,89 @@
#include "DOMStringList.h"
#include "IDBDatabaseException.h"
#include "IDBObjectStoreBackendImpl.h"
+#include "SQLiteDatabase.h"
+#include "SQLiteStatement.h"
#if ENABLE(INDEXED_DATABASE)
namespace WebCore {
-IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, const String& version)
- : m_name(name)
- , m_description(description)
- , m_version(version)
+static bool extractMetaData(SQLiteDatabase* sqliteDatabase, const String& expectedName, String& foundDescription, String& foundVersion)
{
+ SQLiteStatement metaDataQuery(*sqliteDatabase, "SELECT name, description, 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());
+ ASSERT_NOT_REACHED();
+ }
+ foundDescription = metaDataQuery.getColumnText(1);
+ foundVersion = metaDataQuery.getColumnText(2);
+
+ if (metaDataQuery.step() == SQLResultRow) {
+ LOG_ERROR("More than one row found in MetaData table");
+ ASSERT_NOT_REACHED();
+ }
+
+ return true;
+}
+
+static bool setMetaData(SQLiteDatabase* sqliteDatabase, const String& name, const String& description, const String& version)
+{
+ 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");
+ return false;
+ }
+
+ insert.bindText(1, name);
+ insert.bindText(2, description);
+ insert.bindText(3, version);
+
+ if (insert.step() != SQLResultDone) {
+ LOG_ERROR("Failed to insert row into MetaData for IndexedDB");
+ return false;
+ }
+
+ // FIXME: Should we assert there's only one row?
+
+ return true;
+}
+
+IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> sqliteDatabase)
+ : m_sqliteDatabase(sqliteDatabase)
+ , m_name(name)
+ , m_version("")
+{
+ ASSERT(!m_name.isNull());
+
+ // FIXME: The spec is in flux about how to handle description. Sync it up once a final decision is made.
+ String foundDescription = "";
+ bool result = extractMetaData(m_sqliteDatabase.get(), m_name, foundDescription, m_version);
+ m_description = description.isNull() ? foundDescription : description;
+
+ if (!result || m_description != foundDescription)
+ setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
}
IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl()
{
}
+void IDBDatabaseBackendImpl::setDescription(const String& description)
+{
+ if (description == m_description)
+ return;
+
+ m_description = description;
+ setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
+}
+
PassRefPtr<DOMStringList> IDBDatabaseBackendImpl::objectStores() const
{
RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.h b/WebCore/storage/IDBDatabaseBackendImpl.h
index f6ff058..60bec1f 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.h
+++ b/WebCore/storage/IDBDatabaseBackendImpl.h
@@ -28,21 +28,25 @@
#include "IDBCallbacks.h"
#include "IDBDatabase.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(INDEXED_DATABASE)
namespace WebCore {
+class SQLiteDatabase;
+
class IDBDatabaseBackendImpl : public IDBDatabaseBackendInterface {
public:
- static PassRefPtr<IDBDatabaseBackendInterface> create(const String& name, const String& description, const String& version)
+ static PassRefPtr<IDBDatabaseBackendImpl> create(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database)
{
- return adoptRef(new IDBDatabaseBackendImpl(name, description, version));
+ return adoptRef(new IDBDatabaseBackendImpl(name, description, database));
}
virtual ~IDBDatabaseBackendImpl();
+ void setDescription(const String& description);
+
// Implements IDBDatabase
virtual String name() const { return m_name; }
virtual String description() const { return m_description; }
@@ -54,7 +58,9 @@ public:
virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout);
private:
- IDBDatabaseBackendImpl(const String& name, const String& description, const String& version);
+ IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database);
+
+ OwnPtr<SQLiteDatabase> m_sqliteDatabase;
String m_name;
String m_description;
diff --git a/WebCore/storage/IDBFactory.h b/WebCore/storage/IDBFactory.h
index 61619b9..a96aa38 100644
--- a/WebCore/storage/IDBFactory.h
+++ b/WebCore/storage/IDBFactory.h
@@ -54,7 +54,7 @@ public:
}
~IDBFactory();
- PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
+ PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description = String());
private:
IDBFactory(IDBFactoryBackendInterface*);
diff --git a/WebCore/storage/IDBFactory.idl b/WebCore/storage/IDBFactory.idl
index cd887f0..215d67c 100644
--- a/WebCore/storage/IDBFactory.idl
+++ b/WebCore/storage/IDBFactory.idl
@@ -28,7 +28,7 @@ module storage {
interface [
Conditional=INDEXED_DATABASE
] IDBFactory {
- [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
+ [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in [Optional, ConvertUndefinedOrNullToNullString] DOMString description);
};
}
diff --git a/WebCore/storage/IDBFactoryBackendImpl.cpp b/WebCore/storage/IDBFactoryBackendImpl.cpp
index 7bdd70d..905726f 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.cpp
+++ b/WebCore/storage/IDBFactoryBackendImpl.cpp
@@ -30,7 +30,10 @@
#include "IDBFactoryBackendImpl.h"
#include "DOMStringList.h"
+#include "FileSystem.h"
#include "IDBDatabaseBackendImpl.h"
+#include "IDBDatabaseException.h"
+#include "SQLiteDatabase.h"
#include "SecurityOrigin.h"
#include <wtf/Threading.h>
#include <wtf/UnusedParam.h>
@@ -39,31 +42,74 @@
namespace WebCore {
-PassRefPtr<IDBFactoryBackendImpl> IDBFactoryBackendImpl::create()
+IDBFactoryBackendImpl::IDBFactoryBackendImpl()
{
- return adoptRef(new IDBFactoryBackendImpl);
}
-IDBFactoryBackendImpl::IDBFactoryBackendImpl()
+IDBFactoryBackendImpl::~IDBFactoryBackendImpl()
{
}
-IDBFactoryBackendImpl::~IDBFactoryBackendImpl()
+static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name)
{
+ String pathBase = "/tmp/temporary-indexed-db-files"; // FIXME: Write a PageGroupSettings class and have this value come from that.
+ if (!makeAllDirectories(pathBase)) {
+ // 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("Unabled to create LocalStorage database path %s", pathBase.utf8().data());
+ return 0;
+ }
+
+ String databaseIdentifier = securityOrigin->databaseIdentifier();
+ String santizedName = encodeForFileName(name);
+ String path = pathByAppendingComponent(pathBase, databaseIdentifier + "_" + santizedName + ".indexeddb");
+
+ OwnPtr<SQLiteDatabase> sqliteDatabase = adoptPtr(new SQLiteDatabase());
+ if (!sqliteDatabase->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;
+ }
+
+ return sqliteDatabase.release();
}
-void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin>, Frame*)
+static bool createTables(SQLiteDatabase* sqliteDatabase)
+{
+ static const char* commands[] = {
+ "CREATE TABLE IF NOT EXISTS MetaData (name TEXT, description TEXT, version TEXT)"
+ };
+
+ for (size_t i = 0; i < arraysize(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;
+ }
+ }
+ return true;
+}
+
+void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*)
{
- RefPtr<IDBDatabaseBackendInterface> databaseBackend;
IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
- if (it == m_databaseBackendMap.end()) {
- // FIXME: What should the version be? The spec doesn't define it yet.
- databaseBackend = IDBDatabaseBackendImpl::create(name, description, "");
- m_databaseBackendMap.set(name, databaseBackend);
- } else
- databaseBackend = it->second;
-
- callbacks->onSuccess(databaseBackend.release());
+ if (it != m_databaseBackendMap.end()) {
+ if (!description.isNull())
+ it->second->setDescription(description); // The description may have changed.
+ callbacks->onSuccess(it->second.get());
+ return;
+ }
+
+ // FIXME: Everything from now on should be done on another thread.
+
+ OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name);
+ if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
+ return;
+ }
+
+ RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, description, sqliteDatabase.release());
+ callbacks->onSuccess(databaseBackend.get());
+ m_databaseBackendMap.set(name, databaseBackend.release());
}
} // namespace WebCore
diff --git a/WebCore/storage/IDBFactoryBackendImpl.h b/WebCore/storage/IDBFactoryBackendImpl.h
index bbcc537..e87ea39 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.h
+++ b/WebCore/storage/IDBFactoryBackendImpl.h
@@ -29,18 +29,22 @@
#define IDBFactoryBackendImpl_h
#include "IDBFactoryBackendInterface.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(INDEXED_DATABASE)
namespace WebCore {
class DOMStringList;
+class IDBDatabaseBackendImpl;
class IDBFactoryBackendImpl : public IDBFactoryBackendInterface {
public:
- static PassRefPtr<IDBFactoryBackendImpl> create();
+ static PassRefPtr<IDBFactoryBackendImpl> create()
+ {
+ return adoptRef(new IDBFactoryBackendImpl());
+ }
virtual ~IDBFactoryBackendImpl();
virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*);
@@ -48,7 +52,7 @@ public:
private:
IDBFactoryBackendImpl();
- typedef HashMap<String, RefPtr<IDBDatabaseBackendInterface> > IDBDatabaseBackendMap;
+ typedef HashMap<String, RefPtr<IDBDatabaseBackendImpl> > IDBDatabaseBackendMap;
IDBDatabaseBackendMap m_databaseBackendMap;
// We only create one instance of this class at a time.
diff --git a/WebCore/storage/IDBKeyPath.cpp b/WebCore/storage/IDBKeyPath.cpp
new file mode 100644
index 0000000..8833da0
--- /dev/null
+++ b/WebCore/storage/IDBKeyPath.cpp
@@ -0,0 +1,269 @@
+/*
+ * 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 "IDBKeyPath.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include <wtf/ASCIICType.h>
+#include <wtf/dtoa.h>
+
+namespace WebCore {
+
+class IDBKeyPathLexer {
+public:
+ enum TokenType {
+ TokenLeftBracket,
+ TokenRightBracket,
+ TokenIdentifier,
+ TokenNumber,
+ TokenDot,
+ TokenEnd,
+ TokenError
+ };
+
+ explicit IDBKeyPathLexer(const String& s)
+ : m_string(s)
+ , m_ptr(s.characters())
+ , m_end(s.characters() + s.length())
+ , m_currentTokenType(TokenError)
+ {
+ }
+
+ TokenType currentTokenType() const { return m_currentTokenType; }
+
+ TokenType nextTokenType()
+ {
+ m_currentTokenType = lex(m_currentElement);
+ return m_currentTokenType;
+ }
+
+ const IDBKeyPathElement& currentElement() { return m_currentElement; }
+
+private:
+ TokenType lex(IDBKeyPathElement&);
+ TokenType lexIdentifier(IDBKeyPathElement&);
+ TokenType lexNumber(IDBKeyPathElement&);
+ IDBKeyPathElement m_currentElement;
+ String m_string;
+ const UChar* m_ptr;
+ const UChar* m_end;
+ TokenType m_currentTokenType;
+};
+
+IDBKeyPathLexer::TokenType IDBKeyPathLexer::lex(IDBKeyPathElement& element)
+{
+ while (m_ptr < m_end && isASCIISpace(*m_ptr))
+ ++m_ptr;
+
+ if (m_ptr >= m_end)
+ return TokenEnd;
+
+ ASSERT(m_ptr < m_end);
+ switch (*m_ptr) {
+ case '[':
+ ++m_ptr;
+ return TokenLeftBracket;
+ case ']':
+ ++m_ptr;
+ return TokenRightBracket;
+ case '.':
+ ++m_ptr;
+ return TokenDot;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ return lexNumber(element);
+ default:
+ return lexIdentifier(element);
+ }
+ return TokenError;
+}
+
+static inline bool isSafeIdentifierStartCharacter(UChar c)
+{
+ return isASCIIAlpha(c) || (c == '_') || (c == '$');
+}
+
+static inline bool isSafeIdentifierCharacter(UChar c)
+{
+ return isASCIIAlphanumeric(c) || (c == '_') || (c == '$');
+}
+
+IDBKeyPathLexer::TokenType IDBKeyPathLexer::lexIdentifier(IDBKeyPathElement& element)
+{
+ const UChar* start = m_ptr;
+ if (m_ptr < m_end && isSafeIdentifierStartCharacter(*m_ptr))
+ ++m_ptr;
+ else
+ return TokenError;
+
+ while (m_ptr < m_end && isSafeIdentifierCharacter(*m_ptr))
+ ++m_ptr;
+
+ element.type = IDBKeyPathElement::IsNamed;
+ element.identifier = String(start, m_ptr - start);
+ return TokenIdentifier;
+}
+
+IDBKeyPathLexer::TokenType IDBKeyPathLexer::lexNumber(IDBKeyPathElement& element)
+{
+ if (m_ptr >= m_end)
+ return TokenError;
+
+ const UChar* start = m_ptr;
+ // [0-9]*
+ while (m_ptr < m_end && isASCIIDigit(*m_ptr))
+ ++m_ptr;
+
+ String numberAsString;
+ numberAsString = String(start, m_ptr - start);
+ bool ok = false;
+ unsigned number = numberAsString.toUIntStrict(&ok);
+ if (!ok)
+ return TokenError;
+
+ element.type = IDBKeyPathElement::IsIndexed;
+ element.index = number;
+ return TokenNumber;
+}
+
+void IDBParseKeyPath(const String& keyPath, Vector<IDBKeyPathElement>& elements, IDBKeyPathParseError& error)
+{
+ // This is a simplified parser loosely based on LiteralParser.
+ // An IDBKeyPath is defined as a sequence of:
+ // identifierA{.identifierB{[numeric_value]}
+ // where "{}" represents an optional part
+ // The basic state machine is:
+ // Start => {Identifier, Array}
+ // Identifier => {Dot, Array, End}
+ // Array => {Start, Dot, End}
+ // Dot => {Identifier}
+ // It bails out as soon as it finds an error, but doesn't discard the bits it managed to parse.
+ enum ParserState { Identifier, Array, Dot, End };
+
+ IDBKeyPathLexer lexer(keyPath);
+ IDBKeyPathLexer::TokenType tokenType = lexer.nextTokenType();
+ ParserState state;
+ if (tokenType == IDBKeyPathLexer::TokenIdentifier)
+ state = Identifier;
+ else if (tokenType == IDBKeyPathLexer::TokenLeftBracket)
+ state = Array;
+ else if (tokenType == IDBKeyPathLexer::TokenEnd)
+ state = End;
+ else {
+ error = IDBKeyPathParseErrorStart;
+ return;
+ }
+
+ while (1) {
+ switch (state) {
+ case Identifier : {
+ IDBKeyPathLexer::TokenType tokenType = lexer.currentTokenType();
+ ASSERT(tokenType == IDBKeyPathLexer::TokenIdentifier);
+
+ IDBKeyPathElement element = lexer.currentElement();
+ ASSERT(element.type == IDBKeyPathElement::IsNamed);
+ elements.append(element);
+
+ tokenType = lexer.nextTokenType();
+ if (tokenType == IDBKeyPathLexer::TokenDot)
+ state = Dot;
+ else if (tokenType == IDBKeyPathLexer::TokenLeftBracket)
+ state = Array;
+ else if (tokenType == IDBKeyPathLexer::TokenEnd)
+ state = End;
+ else {
+ error = IDBKeyPathParseErrorIdentifier;
+ return;
+ }
+ break;
+ }
+ case Array : {
+ IDBKeyPathLexer::TokenType tokenType = lexer.currentTokenType();
+ ASSERT(tokenType == IDBKeyPathLexer::TokenLeftBracket);
+
+ tokenType = lexer.nextTokenType();
+ if (tokenType != IDBKeyPathLexer::TokenNumber) {
+ error = IDBKeyPathParseErrorArrayIndex;
+ return;
+ }
+
+ ASSERT(tokenType == IDBKeyPathLexer::TokenNumber);
+ IDBKeyPathElement element = lexer.currentElement();
+ ASSERT(element.type == IDBKeyPathElement::IsIndexed);
+ elements.append(element);
+
+ tokenType = lexer.nextTokenType();
+ if (tokenType != IDBKeyPathLexer::TokenRightBracket) {
+ error = IDBKeyPathParseErrorArrayIndex;
+ return;
+ }
+
+ tokenType = lexer.nextTokenType();
+ if (tokenType == IDBKeyPathLexer::TokenDot)
+ state = Dot;
+ else if (tokenType == IDBKeyPathLexer::TokenLeftBracket)
+ state = Array;
+ else if (tokenType == IDBKeyPathLexer::TokenEnd)
+ state = End;
+ else {
+ error = IDBKeyPathParseErrorAfterArray;
+ return;
+ }
+ break;
+ }
+ case Dot: {
+ IDBKeyPathLexer::TokenType tokenType = lexer.currentTokenType();
+ ASSERT(tokenType == IDBKeyPathLexer::TokenDot);
+
+ tokenType = lexer.nextTokenType();
+ if (tokenType != IDBKeyPathLexer::TokenIdentifier) {
+ error = IDBKeyPathParseErrorDot;
+ return;
+ }
+
+ state = Identifier;
+ break;
+ }
+ case End: {
+ error = IDBKeyPathParseErrorNone;
+ return;
+ }
+ }
+ }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBKeyPath.h b/WebCore/storage/IDBKeyPath.h
new file mode 100644
index 0000000..7787980
--- /dev/null
+++ b/WebCore/storage/IDBKeyPath.h
@@ -0,0 +1,64 @@
+/*
+ * 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 IDBKeyPath_h
+#define IDBKeyPath_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct IDBKeyPathElement {
+ enum Type {
+ IsIndexed,
+ IsNamed,
+ };
+
+ Type type;
+ unsigned index;
+ String identifier;
+};
+
+enum IDBKeyPathParseError {
+ IDBKeyPathParseErrorNone,
+ IDBKeyPathParseErrorStart,
+ IDBKeyPathParseErrorIdentifier,
+ IDBKeyPathParseErrorArrayIndex,
+ IDBKeyPathParseErrorAfterArray,
+ IDBKeyPathParseErrorDot,
+};
+
+void IDBParseKeyPath(const String&, Vector<IDBKeyPathElement>&, IDBKeyPathParseError&);
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBKeyPath_h
diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.h b/WebCore/storage/IDBObjectStoreBackendImpl.h
index fc63658..4b909af 100644
--- a/WebCore/storage/IDBObjectStoreBackendImpl.h
+++ b/WebCore/storage/IDBObjectStoreBackendImpl.h
@@ -27,8 +27,8 @@
#define IDBObjectStoreBackendImpl_h
#include "IDBObjectStoreBackendInterface.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
#if ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/OriginQuotaManager.h b/WebCore/storage/OriginQuotaManager.h
index c904737..ec9620c 100644
--- a/WebCore/storage/OriginQuotaManager.h
+++ b/WebCore/storage/OriginQuotaManager.h
@@ -31,10 +31,10 @@
#if ENABLE(DATABASE)
-#include "StringHash.h"
#include "SecurityOriginHash.h"
#include <wtf/HashMap.h>
#include <wtf/Threading.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/OriginUsageRecord.h b/WebCore/storage/OriginUsageRecord.h
index 25bddf2..a830e68 100644
--- a/WebCore/storage/OriginUsageRecord.h
+++ b/WebCore/storage/OriginUsageRecord.h
@@ -31,10 +31,9 @@
#if ENABLE(DATABASE)
#include "PlatformString.h"
-#include "StringHash.h"
-
#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
+#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLStatement.cpp b/WebCore/storage/SQLStatement.cpp
index 3973157..19e9e38 100644
--- a/WebCore/storage/SQLStatement.cpp
+++ b/WebCore/storage/SQLStatement.cpp
@@ -39,6 +39,7 @@
#include "SQLStatementErrorCallback.h"
#include "SQLTransaction.h"
#include "SQLValue.h"
+#include <wtf/text/CString.h>
namespace WebCore {
diff --git a/WebCore/storage/SQLTransactionCoordinator.h b/WebCore/storage/SQLTransactionCoordinator.h
index 247ad13..94360c0 100644
--- a/WebCore/storage/SQLTransactionCoordinator.h
+++ b/WebCore/storage/SQLTransactionCoordinator.h
@@ -33,11 +33,11 @@
#if ENABLE(DATABASE)
-#include "StringHash.h"
#include <wtf/Deque.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/StorageAreaSync.h b/WebCore/storage/StorageAreaSync.h
index 94c4670..90aa6a7 100644
--- a/WebCore/storage/StorageAreaSync.h
+++ b/WebCore/storage/StorageAreaSync.h
@@ -29,9 +29,9 @@
#if ENABLE(DOM_STORAGE)
#include "SQLiteDatabase.h"
-#include "StringHash.h"
#include "Timer.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/StorageMap.h b/WebCore/storage/StorageMap.h
index fa5f46c..d162124 100644
--- a/WebCore/storage/StorageMap.h
+++ b/WebCore/storage/StorageMap.h
@@ -29,11 +29,10 @@
#if ENABLE(DOM_STORAGE)
#include "PlatformString.h"
-#include "StringHash.h"
-
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/StorageNamespaceImpl.cpp b/WebCore/storage/StorageNamespaceImpl.cpp
index 557dd76..0f07e07 100644
--- a/WebCore/storage/StorageNamespaceImpl.cpp
+++ b/WebCore/storage/StorageNamespaceImpl.cpp
@@ -29,11 +29,11 @@
#if ENABLE(DOM_STORAGE)
#include "SecurityOriginHash.h"
-#include "StringHash.h"
#include "StorageAreaImpl.h"
#include "StorageMap.h"
#include "StorageSyncManager.h"
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/storage/chromium/QuotaTracker.h b/WebCore/storage/chromium/QuotaTracker.h
index b913563..774475e 100644
--- a/WebCore/storage/chromium/QuotaTracker.h
+++ b/WebCore/storage/chromium/QuotaTracker.h
@@ -35,8 +35,8 @@
#include "PlatformString.h"
#include "SecurityOrigin.h"
-#include "StringHash.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/svg/SVGAllInOne.cpp b/WebCore/svg/SVGAllInOne.cpp
index 6bcf945..2cb63af 100644
--- a/WebCore/svg/SVGAllInOne.cpp
+++ b/WebCore/svg/SVGAllInOne.cpp
@@ -107,6 +107,7 @@
#include "SVGNumberList.cpp"
#include "SVGPaint.cpp"
#include "SVGParserUtilities.cpp"
+#include "SVGPathBlender.cpp"
#include "SVGPathBuilder.cpp"
#include "SVGPathByteStreamBuilder.cpp"
#include "SVGPathByteStreamSource.cpp"
@@ -129,6 +130,7 @@
#include "SVGPathSegMoveto.cpp"
#include "SVGPathStringBuilder.cpp"
#include "SVGPathStringSource.cpp"
+#include "SVGPathTraversalStateBuilder.cpp"
#include "SVGPatternElement.cpp"
#include "SVGPointList.cpp"
#include "SVGPolyElement.cpp"
diff --git a/WebCore/svg/SVGAltGlyphElement.h b/WebCore/svg/SVGAltGlyphElement.h
index 8cba5bd..cc5364b 100644
--- a/WebCore/svg/SVGAltGlyphElement.h
+++ b/WebCore/svg/SVGAltGlyphElement.h
@@ -23,9 +23,9 @@
#define SVGAltGlyphElement_h
#if ENABLE(SVG_FONTS)
-#include "AtomicString.h"
#include "SVGTextPositioningElement.h"
#include "SVGURIReference.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/svg/SVGAnimateElement.cpp b/WebCore/svg/SVGAnimateElement.cpp
index 2723804..df0c3bc 100644
--- a/WebCore/svg/SVGAnimateElement.cpp
+++ b/WebCore/svg/SVGAnimateElement.cpp
@@ -42,6 +42,7 @@ SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* doc
, m_fromNumber(0)
, m_toNumber(0)
, m_animatedNumber(numeric_limits<double>::infinity())
+ , m_animatedPathPointer(0)
{
}
@@ -131,19 +132,31 @@ void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeat
}
AnimationMode animationMode = this->animationMode();
if (m_propertyType == PathProperty) {
- if (percentage == 0)
- results->m_animatedPath = m_fromPath;
- else if (percentage == 1.f)
- results->m_animatedPath = m_toPath;
- else {
- if (m_fromPath && m_toPath)
- results->m_animatedPath = SVGPathSegList::createAnimated(m_fromPath.get(), m_toPath.get(), percentage);
- else
- results->m_animatedPath.clear();
+ if (!percentage) {
+ ASSERT(m_fromPath);
+ ASSERT(percentage >= 0);
+ results->m_animatedPathPointer = m_fromPath.get();
+ } else if (percentage == 1.f) {
+ ASSERT(m_toPath);
+ results->m_animatedPathPointer = m_toPath.get();
+ } else {
+ if (m_fromPath && m_toPath) {
+ SVGPathParserFactory* factory = SVGPathParserFactory::self();
+ if (!factory->buildAnimatedSVGPathByteStream(m_fromPath.get(), m_toPath.get(), results->m_animatedPath, percentage)) {
+ results->m_animatedPath.clear();
+ results->m_animatedPathPointer = 0;
+ } else
+ results->m_animatedPathPointer = results->m_animatedPath.get();
+ } else
+ results->m_animatedPathPointer = 0;
// Fall back to discrete animation if the paths are not compatible
- if (!results->m_animatedPath)
- results->m_animatedPath = ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f)
- ? m_toPath : m_fromPath;
+ if (!results->m_animatedPathPointer) {
+ ASSERT(m_fromPath);
+ ASSERT(m_toPath);
+ ASSERT(!results->m_animatedPath);
+ results->m_animatedPathPointer = ((animationMode == FromToAnimation && percentage > 0.5f) || animationMode == ToAnimation || percentage == 1.0f)
+ ? m_toPath.get() : m_fromPath.get();
+ }
}
return;
} else if (m_propertyType == PointsProperty) {
@@ -189,11 +202,9 @@ bool SVGAnimateElement::calculateFromAndToValues(const String& fromString, const
return true;
}
} else if (m_propertyType == PathProperty) {
- m_fromPath = SVGPathSegList::create(SVGNames::dAttr);
SVGPathParserFactory* factory = SVGPathParserFactory::self();
- if (factory->buildSVGPathSegListFromString(fromString, m_fromPath.get(), UnalteredParsing)) {
- m_toPath = SVGPathSegList::create(SVGNames::dAttr);
- if (factory->buildSVGPathSegListFromString(toString, m_toPath.get(), UnalteredParsing))
+ if (factory->buildSVGPathByteStreamFromString(fromString, m_fromPath, UnalteredParsing)) {
+ if (factory->buildSVGPathByteStreamFromString(toString, m_toPath, UnalteredParsing))
return true;
}
m_fromPath.clear();
@@ -256,6 +267,7 @@ void SVGAnimateElement::resetToBaseValue(const String& baseString)
return;
} else if (m_propertyType == PathProperty) {
m_animatedPath.clear();
+ m_animatedPathPointer = 0;
return;
} else if (m_propertyType == PointsProperty) {
m_animatedPoints.clear();
@@ -272,7 +284,7 @@ void SVGAnimateElement::applyResultsToTarget()
else if (m_propertyType == NumberProperty)
valueToApply = String::number(m_animatedNumber) + m_numberUnit;
else if (m_propertyType == PathProperty) {
- if (!m_animatedPath || !m_animatedPath->numberOfItems())
+ if (!m_animatedPathPointer || m_animatedPathPointer->isEmpty())
valueToApply = m_animatedString;
else {
// We need to keep going to string and back because we are currently only able to paint
@@ -280,7 +292,7 @@ void SVGAnimateElement::applyResultsToTarget()
// morphing needs to be done with unprocessed paths.
// FIXME: This could be optimized if paths were not processed at parse time.
SVGPathParserFactory* factory = SVGPathParserFactory::self();
- factory->buildStringFromSVGPathSegList(m_animatedPath.get(), valueToApply, UnalteredParsing);
+ factory->buildStringFromByteStream(m_animatedPathPointer, valueToApply, UnalteredParsing);
}
} else if (m_propertyType == PointsProperty) {
if (!m_animatedPoints || !m_animatedPoints->numberOfItems())
diff --git a/WebCore/svg/SVGAnimateElement.h b/WebCore/svg/SVGAnimateElement.h
index 5c8d1e5..43522a7 100644
--- a/WebCore/svg/SVGAnimateElement.h
+++ b/WebCore/svg/SVGAnimateElement.h
@@ -26,6 +26,8 @@
#include "Color.h"
#include "SVGAnimationElement.h"
+#include "SVGPathByteStream.h"
+#include <wtf/OwnPtr.h>
namespace WebCore {
class SVGPathSegList;
@@ -59,9 +61,10 @@ namespace WebCore {
String m_fromString;
String m_toString;
String m_animatedString;
- RefPtr<SVGPathSegList> m_fromPath;
- RefPtr<SVGPathSegList> m_toPath;
- RefPtr<SVGPathSegList> m_animatedPath;
+ OwnPtr<SVGPathByteStream> m_fromPath;
+ OwnPtr<SVGPathByteStream> m_toPath;
+ OwnPtr<SVGPathByteStream> m_animatedPath;
+ SVGPathByteStream* m_animatedPathPointer;
RefPtr<SVGPointList> m_fromPoints;
RefPtr<SVGPointList> m_toPoints;
RefPtr<SVGPointList> m_animatedPoints;
diff --git a/WebCore/svg/SVGDocumentExtensions.cpp b/WebCore/svg/SVGDocumentExtensions.cpp
index 22ab399..819d12b 100644
--- a/WebCore/svg/SVGDocumentExtensions.cpp
+++ b/WebCore/svg/SVGDocumentExtensions.cpp
@@ -24,7 +24,6 @@
#if ENABLE(SVG)
#include "SVGDocumentExtensions.h"
-#include "AtomicString.h"
#include "Console.h"
#include "DOMWindow.h"
#include "Document.h"
@@ -37,6 +36,7 @@
#include "SVGSVGElement.h"
#include "ScriptController.h"
#include "ScriptableDocumentParser.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/svg/SVGDocumentExtensions.h b/WebCore/svg/SVGDocumentExtensions.h
index ad2fb60..da23cd0 100644
--- a/WebCore/svg/SVGDocumentExtensions.h
+++ b/WebCore/svg/SVGDocumentExtensions.h
@@ -22,13 +22,13 @@
#define SVGDocumentExtensions_h
#if ENABLE(SVG)
-#include "AtomicStringHash.h"
#include "SVGResourcesCache.h"
-#include "StringImpl.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/AtomicStringHash.h>
+#include <wtf/text/StringImpl.h>
namespace WebCore {
diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp
index f481892..92534e8 100644
--- a/WebCore/svg/SVGFEImageElement.cpp
+++ b/WebCore/svg/SVGFEImageElement.cpp
@@ -137,7 +137,7 @@ PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*)
SVGRenderSupport::renderSubtreeToImage(m_targetImage.get(), renderer);
}
- return FEImage::create(m_targetImage ? m_targetImage->image() : m_cachedImage->image(), preserveAspectRatio());
+ return FEImage::create(m_targetImage ? m_targetImage->copyImage() : m_cachedImage->image(), preserveAspectRatio());
}
void SVGFEImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
diff --git a/WebCore/svg/SVGFitToViewBox.cpp b/WebCore/svg/SVGFitToViewBox.cpp
index 83fd952..c78a619 100644
--- a/WebCore/svg/SVGFitToViewBox.cpp
+++ b/WebCore/svg/SVGFitToViewBox.cpp
@@ -30,7 +30,7 @@
#include "SVGNames.h"
#include "SVGParserUtilities.h"
#include "SVGPreserveAspectRatio.h"
-#include "StringImpl.h"
+#include <wtf/text/StringImpl.h>
namespace WebCore {
diff --git a/WebCore/svg/SVGFont.cpp b/WebCore/svg/SVGFont.cpp
index ee7c192..898c259 100644
--- a/WebCore/svg/SVGFont.cpp
+++ b/WebCore/svg/SVGFont.cpp
@@ -182,8 +182,8 @@ static inline bool isCompatibleGlyph(const SVGGlyphIdentifier& identifier, bool
// Split subcode from language, if existant.
String languagePrefix;
- int subCodeSeparator = language.find('-');
- if (subCodeSeparator != -1)
+ size_t subCodeSeparator = language.find('-');
+ if (subCodeSeparator != notFound)
languagePrefix = language.left(subCodeSeparator);
Vector<String>::const_iterator it = identifier.languages.begin();
diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp
index df867f3..c5e4802 100644
--- a/WebCore/svg/SVGImageElement.cpp
+++ b/WebCore/svg/SVGImageElement.cpp
@@ -171,7 +171,7 @@ void SVGImageElement::attach()
{
SVGStyledTransformableElement::attach();
- if (RenderImage* imageObj = toRenderImage(renderer())) {
+ if (RenderSVGImage* imageObj = toRenderSVGImage(renderer())) {
if (imageObj->hasImage())
return;
diff --git a/WebCore/svg/SVGLangSpace.h b/WebCore/svg/SVGLangSpace.h
index e2a5635..64e435d 100644
--- a/WebCore/svg/SVGLangSpace.h
+++ b/WebCore/svg/SVGLangSpace.h
@@ -22,7 +22,7 @@
#define SVGLangSpace_h
#if ENABLE(SVG)
-#include "AtomicString.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/svg/SVGPathBlender.cpp b/WebCore/svg/SVGPathBlender.cpp
new file mode 100644
index 0000000..8320890
--- /dev/null
+++ b/WebCore/svg/SVGPathBlender.cpp
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGPathBlender.h"
+
+#include "SVGPathSeg.h"
+
+namespace WebCore {
+
+SVGPathBlender::SVGPathBlender()
+ : m_fromSource(0)
+ , m_toSource(0)
+ , m_consumer(0)
+ , m_progress(0)
+{
+}
+
+SVGPathBlender::~SVGPathBlender()
+{
+}
+
+float SVGPathBlender::blendAnimatedFloat(float from, float to)
+{
+ return (to - from) * m_progress + from;
+}
+
+FloatPoint SVGPathBlender::blendAnimatedFloatPoint(FloatPoint& from, FloatPoint& to)
+{
+ return FloatPoint((to.x() - from.x()) * m_progress + from.x(), (to.y() - from.y()) * m_progress + from.y());
+}
+
+bool SVGPathBlender::blendMoveToSegment()
+{
+ FloatPoint fromTargetPoint;
+ FloatPoint toTargetPoint;
+ if (!m_fromSource->parseMoveToSegment(fromTargetPoint)
+ || !m_toSource->parseMoveToSegment(toTargetPoint))
+ return false;
+
+ m_consumer->moveTo(blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint), false, m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendLineToSegment()
+{
+ FloatPoint fromTargetPoint;
+ FloatPoint toTargetPoint;
+ if (!m_fromSource->parseLineToSegment(fromTargetPoint)
+ || !m_toSource->parseLineToSegment(toTargetPoint))
+ return false;
+
+ m_consumer->lineTo(blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint), m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendLineToHorizontalSegment()
+{
+ float fromX;
+ float toX;
+ if (!m_fromSource->parseLineToHorizontalSegment(fromX)
+ || !m_toSource->parseLineToHorizontalSegment(toX))
+ return false;
+
+ m_consumer->lineToHorizontal(blendAnimatedFloat(fromX, toX), m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendLineToVerticalSegment()
+{
+ float fromY;
+ float toY;
+ if (!m_fromSource->parseLineToVerticalSegment(fromY)
+ || !m_toSource->parseLineToVerticalSegment(toY))
+ return false;
+
+ m_consumer->lineToVertical(blendAnimatedFloat(fromY, toY), m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendCurveToCubicSegment()
+{
+ FloatPoint fromTargetPoint;
+ FloatPoint fromPoint1;
+ FloatPoint fromPoint2;
+ FloatPoint toTargetPoint;
+ FloatPoint toPoint1;
+ FloatPoint toPoint2;
+ if (!m_fromSource->parseCurveToCubicSegment(fromPoint1, fromPoint2, fromTargetPoint)
+ || !m_toSource->parseCurveToCubicSegment(toPoint1, toPoint2, toTargetPoint))
+ return false;
+
+ m_consumer->curveToCubic(blendAnimatedFloatPoint(fromPoint1, toPoint1),
+ blendAnimatedFloatPoint(fromPoint2, toPoint2),
+ blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+ m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendCurveToCubicSmoothSegment()
+{
+ FloatPoint fromTargetPoint;
+ FloatPoint fromPoint2;
+ FloatPoint toTargetPoint;
+ FloatPoint toPoint2;
+ if (!m_fromSource->parseCurveToCubicSmoothSegment(fromPoint2, fromTargetPoint)
+ || !m_toSource->parseCurveToCubicSmoothSegment(toPoint2, toTargetPoint))
+ return false;
+
+ m_consumer->curveToCubicSmooth(blendAnimatedFloatPoint(fromPoint2, toPoint2),
+ blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+ m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendCurveToQuadraticSegment()
+{
+ FloatPoint fromTargetPoint;
+ FloatPoint fromPoint1;
+ FloatPoint toTargetPoint;
+ FloatPoint toPoint1;
+ if (!m_fromSource->parseCurveToQuadraticSegment(fromPoint1, fromTargetPoint)
+ || !m_toSource->parseCurveToQuadraticSegment(toPoint1, toTargetPoint))
+ return false;
+
+ m_consumer->curveToQuadratic(blendAnimatedFloatPoint(fromPoint1, toPoint1),
+ blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+ m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendCurveToQuadraticSmoothSegment()
+{
+ FloatPoint fromTargetPoint;
+ FloatPoint toTargetPoint;
+ if (!m_fromSource->parseCurveToQuadraticSmoothSegment(fromTargetPoint)
+ || !m_toSource->parseCurveToQuadraticSmoothSegment(toTargetPoint))
+ return false;
+
+ m_consumer->curveToQuadraticSmooth(blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint), m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendArcToSegment()
+{
+ float fromRx;
+ float fromRy;
+ float fromAngle;
+ bool fromLargeArc;
+ bool fromSweep;
+ FloatPoint fromTargetPoint;
+ float toRx;
+ float toRy;
+ float toAngle;
+ bool toLargeArc;
+ bool toSweep;
+ FloatPoint toTargetPoint;
+ if (!m_fromSource->parseArcToSegment(fromRx, fromRy, fromAngle, fromLargeArc, fromSweep, fromTargetPoint)
+ || !m_toSource->parseArcToSegment(toRx, toRy, toAngle, toLargeArc, toSweep, toTargetPoint))
+ return false;
+
+ m_consumer->arcTo(blendAnimatedFloat(fromRx, toRx),
+ blendAnimatedFloat(fromRy, toRy),
+ blendAnimatedFloat(fromAngle, toAngle),
+ m_progress < 0.5 ? fromLargeArc : toLargeArc,
+ m_progress < 0.5 ? fromSweep : toSweep,
+ blendAnimatedFloatPoint(fromTargetPoint, toTargetPoint),
+ m_mode);
+ return true;
+}
+
+bool SVGPathBlender::blendAnimatedPath(float progress, SVGPathSource* fromSource, SVGPathSource* toSource, SVGPathConsumer* consumer)
+{
+ ASSERT(fromSource);
+ ASSERT(toSource);
+ ASSERT(consumer);
+ m_fromSource = fromSource;
+ m_toSource = toSource;
+ m_consumer = consumer;
+
+ m_progress = progress;
+ while (true) {
+ SVGPathSegType fromCommand;
+ SVGPathSegType toCommand;
+ if (!m_fromSource->parseSVGSegmentType(fromCommand) || !m_toSource->parseSVGSegmentType(toCommand))
+ return false;
+ if (fromCommand != toCommand)
+ return false;
+
+ m_mode = AbsoluteCoordinates;
+ switch (fromCommand) {
+ case PathSegMoveToRel:
+ m_mode = RelativeCoordinates;
+ case PathSegMoveToAbs:
+ if (!blendMoveToSegment())
+ return false;
+ break;
+ case PathSegLineToRel:
+ m_mode = RelativeCoordinates;
+ case PathSegLineToAbs:
+ if (!blendLineToSegment())
+ return false;
+ break;
+ case PathSegLineToHorizontalRel:
+ m_mode = RelativeCoordinates;
+ case PathSegLineToHorizontalAbs:
+ if (!blendLineToHorizontalSegment())
+ return false;
+ break;
+ case PathSegLineToVerticalRel:
+ m_mode = RelativeCoordinates;
+ case PathSegLineToVerticalAbs:
+ if (!blendLineToVerticalSegment())
+ return false;
+ break;
+ case PathSegClosePath:
+ m_consumer->closePath();
+ break;
+ case PathSegCurveToCubicRel:
+ m_mode = RelativeCoordinates;
+ case PathSegCurveToCubicAbs:
+ if (!blendCurveToCubicSegment())
+ return false;
+ break;
+ case PathSegCurveToCubicSmoothRel:
+ m_mode = RelativeCoordinates;
+ case PathSegCurveToCubicSmoothAbs:
+ if (!blendCurveToCubicSmoothSegment())
+ return false;
+ break;
+ case PathSegCurveToQuadraticRel:
+ m_mode = RelativeCoordinates;
+ case PathSegCurveToQuadraticAbs:
+ if (!blendCurveToQuadraticSegment())
+ return false;
+ break;
+ case PathSegCurveToQuadraticSmoothRel:
+ m_mode = RelativeCoordinates;
+ case PathSegCurveToQuadraticSmoothAbs:
+ if (!blendCurveToQuadraticSmoothSegment())
+ return false;
+ break;
+ case PathSegArcRel:
+ m_mode = RelativeCoordinates;
+ case PathSegArcAbs:
+ if (!blendArcToSegment())
+ return false;
+ break;
+ default:
+ return false;
+ }
+ if (m_fromSource->hasMoreData() != m_toSource->hasMoreData())
+ return false;
+ if (!m_fromSource->hasMoreData() || !m_toSource->hasMoreData())
+ break;
+ }
+ return true;
+}
+
+void SVGPathBlender::cleanup()
+{
+ ASSERT(m_toSource);
+ ASSERT(m_fromSource);
+ ASSERT(m_consumer);
+
+ m_consumer->cleanup();
+ m_toSource = 0;
+ m_fromSource = 0;
+ m_consumer = 0;
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathBlender.h b/WebCore/svg/SVGPathBlender.h
new file mode 100644
index 0000000..a15c0ad
--- /dev/null
+++ b/WebCore/svg/SVGPathBlender.h
@@ -0,0 +1,62 @@
+/*
+ * 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 SVGPathBlender_h
+#define SVGPathBlender_h
+
+#if ENABLE(SVG)
+#include "SVGPathConsumer.h"
+#include "SVGPathSource.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class SVGPathBlender : public Noncopyable {
+public:
+ SVGPathBlender();
+ ~SVGPathBlender();
+
+ bool blendAnimatedPath(float, SVGPathSource*, SVGPathSource*, SVGPathConsumer*);
+ void cleanup();
+
+private:
+ bool blendMoveToSegment();
+ bool blendLineToSegment();
+ bool blendLineToHorizontalSegment();
+ bool blendLineToVerticalSegment();
+ bool blendCurveToCubicSegment();
+ bool blendCurveToCubicSmoothSegment();
+ bool blendCurveToQuadraticSegment();
+ bool blendCurveToQuadraticSmoothSegment();
+ bool blendArcToSegment();
+
+ float blendAnimatedFloat(float, float);
+ FloatPoint blendAnimatedFloatPoint(FloatPoint&, FloatPoint&);
+
+ SVGPathSource* m_fromSource;
+ SVGPathSource* m_toSource;
+ SVGPathConsumer* m_consumer;
+ PathCoordinateMode m_mode;
+ float m_progress;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathBlender_h
diff --git a/WebCore/svg/SVGPathBuilder.h b/WebCore/svg/SVGPathBuilder.h
index 3a1088d..38eabd4 100644
--- a/WebCore/svg/SVGPathBuilder.h
+++ b/WebCore/svg/SVGPathBuilder.h
@@ -36,6 +36,8 @@ public:
SVGPathBuilder();
void setCurrentPath(Path* path) { m_path = path; }
+ virtual void incrementPathSegmentCount() { }
+ virtual bool continueConsuming() { return true; }
virtual void cleanup() { m_path = 0; }
private:
diff --git a/WebCore/svg/SVGPathByteStreamBuilder.h b/WebCore/svg/SVGPathByteStreamBuilder.h
index f1e7524..c89856f 100644
--- a/WebCore/svg/SVGPathByteStreamBuilder.h
+++ b/WebCore/svg/SVGPathByteStreamBuilder.h
@@ -34,6 +34,8 @@ public:
SVGPathByteStreamBuilder();
void setCurrentByteStream(SVGPathByteStream* byteStream) { m_byteStream = byteStream; }
+ virtual void incrementPathSegmentCount() { }
+ virtual bool continueConsuming() { return true; }
virtual void cleanup() { m_byteStream = 0; }
private:
diff --git a/WebCore/svg/SVGPathConsumer.h b/WebCore/svg/SVGPathConsumer.h
index b0deb52..629c1bf 100644
--- a/WebCore/svg/SVGPathConsumer.h
+++ b/WebCore/svg/SVGPathConsumer.h
@@ -42,6 +42,8 @@ enum PathParsingMode {
class SVGPathConsumer : public Noncopyable {
public:
+ virtual void incrementPathSegmentCount() = 0;
+ virtual bool continueConsuming() = 0;
virtual void cleanup() = 0;
public:
diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp
index 2adc05f..6d801fb 100644
--- a/WebCore/svg/SVGPathElement.cpp
+++ b/WebCore/svg/SVGPathElement.cpp
@@ -69,9 +69,12 @@ FloatPoint SVGPathElement::getPointAtLength(float length)
return toPathData().pointAtLength(length, ok);
}
-unsigned long SVGPathElement::getPathSegAtLength(float length, ExceptionCode& ec)
+unsigned long SVGPathElement::getPathSegAtLength(float length)
{
- return pathSegList()->getPathSegAtLength(length, ec);
+ SVGPathParserFactory* factory = SVGPathParserFactory::self();
+ unsigned long pathSeg = 0;
+ factory->getSVGPathSegAtLengthFromSVGPathSegList(pathSegList(), length, pathSeg);
+ return pathSeg;
}
PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath()
diff --git a/WebCore/svg/SVGPathElement.h b/WebCore/svg/SVGPathElement.h
index 718f05b..07612c6 100644
--- a/WebCore/svg/SVGPathElement.h
+++ b/WebCore/svg/SVGPathElement.h
@@ -62,7 +62,7 @@ namespace WebCore {
virtual bool isValid() const { return SVGTests::isValid(); }
float getTotalLength();
FloatPoint getPointAtLength(float distance);
- unsigned long getPathSegAtLength(float distance, ExceptionCode&);
+ unsigned long getPathSegAtLength(float distance);
static PassRefPtr<SVGPathSegClosePath> createSVGPathSegClosePath();
static PassRefPtr<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y);
diff --git a/WebCore/svg/SVGPathElement.idl b/WebCore/svg/SVGPathElement.idl
index 8506225..1c1dca7 100644
--- a/WebCore/svg/SVGPathElement.idl
+++ b/WebCore/svg/SVGPathElement.idl
@@ -37,8 +37,7 @@ module svg {
float getTotalLength();
SVGPoint getPointAtLength(in float distance);
- unsigned long getPathSegAtLength(in float distance)
- raises(DOMException, SVGException);
+ unsigned long getPathSegAtLength(in float distance);
SVGPathSegClosePath createSVGPathSegClosePath();
diff --git a/WebCore/svg/SVGPathParser.cpp b/WebCore/svg/SVGPathParser.cpp
index c729dfb..66bd00f 100644
--- a/WebCore/svg/SVGPathParser.cpp
+++ b/WebCore/svg/SVGPathParser.cpp
@@ -366,6 +366,9 @@ bool SVGPathParser::parsePathDataFromSource(PathParsingMode pathParsingMode)
default:
return false;
}
+ if (!m_consumer->continueConsuming())
+ return true;
+
m_lastCommand = command;
if (!m_source->hasMoreData())
@@ -382,6 +385,8 @@ bool SVGPathParser::parsePathDataFromSource(PathParsingMode pathParsingMode)
&& m_lastCommand != PathSegCurveToQuadraticSmoothAbs
&& m_lastCommand != PathSegCurveToQuadraticSmoothRel)
m_controlPoint = m_currentPoint;
+
+ m_consumer->incrementPathSegmentCount();
}
return false;
diff --git a/WebCore/svg/SVGPathParserFactory.cpp b/WebCore/svg/SVGPathParserFactory.cpp
index cf1a888..b251ec4 100644
--- a/WebCore/svg/SVGPathParserFactory.cpp
+++ b/WebCore/svg/SVGPathParserFactory.cpp
@@ -22,7 +22,8 @@
#if ENABLE(SVG)
#include "SVGPathParserFactory.h"
-#include "StringBuilder.h"
+#include "PathTraversalState.h"
+#include "SVGPathBlender.h"
#include "SVGPathBuilder.h"
#include "SVGPathByteStreamBuilder.h"
#include "SVGPathByteStreamSource.h"
@@ -31,6 +32,8 @@
#include "SVGPathSegListSource.h"
#include "SVGPathStringBuilder.h"
#include "SVGPathStringSource.h"
+#include "SVGPathTraversalStateBuilder.h"
+#include "StringBuilder.h"
namespace WebCore {
@@ -73,6 +76,17 @@ static SVGPathStringBuilder* globalSVGPathStringBuilder()
return s_builder;
}
+static SVGPathTraversalStateBuilder* globalSVGPathTraversalStateBuilder(PathTraversalState& traversalState, float length)
+{
+ static SVGPathTraversalStateBuilder* s_builder = 0;
+ if (!s_builder)
+ s_builder = new SVGPathTraversalStateBuilder;
+
+ s_builder->setCurrentTraversalState(&traversalState);
+ s_builder->setDesiredLength(length);
+ return s_builder;
+}
+
static SVGPathParser* globalSVGPathParser(SVGPathSource* source, SVGPathConsumer* consumer)
{
static SVGPathParser* s_parser = 0;
@@ -84,6 +98,15 @@ static SVGPathParser* globalSVGPathParser(SVGPathSource* source, SVGPathConsumer
return s_parser;
}
+static SVGPathBlender* globalSVGPathBlender()
+{
+ static SVGPathBlender* s_blender = 0;
+ if (!s_blender)
+ s_blender = new SVGPathBlender;
+
+ return s_blender;
+}
+
SVGPathParserFactory* SVGPathParserFactory::self()
{
static SVGPathParserFactory* s_instance = 0;
@@ -224,6 +247,42 @@ bool SVGPathParserFactory::buildSVGPathByteStreamFromString(const String& d, Own
return ok;
}
+bool SVGPathParserFactory::buildAnimatedSVGPathByteStream(SVGPathByteStream* fromStream, SVGPathByteStream* toStream, OwnPtr<SVGPathByteStream>& result, float progress)
+{
+ ASSERT(fromStream);
+ ASSERT(toStream);
+ if (fromStream->isEmpty() || toStream->isEmpty())
+ return false;
+
+ OwnPtr<SVGPathByteStream> stream = SVGPathByteStream::create();
+ SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(stream.get());
+
+ OwnPtr<SVGPathByteStreamSource> fromSource = SVGPathByteStreamSource::create(fromStream);
+ OwnPtr<SVGPathByteStreamSource> toSource = SVGPathByteStreamSource::create(toStream);
+ SVGPathBlender* blender = globalSVGPathBlender();
+ bool ok = blender->blendAnimatedPath(progress, fromSource.get(), toSource.get(), builder);
+ result = stream.release();
+ blender->cleanup();
+ return ok;
+}
+
+bool SVGPathParserFactory::getSVGPathSegAtLengthFromSVGPathSegList(SVGPathSegList* pathSegList, float length, unsigned long& pathSeg)
+{
+ ASSERT(pathSegList);
+ if (!pathSegList->numberOfItems())
+ return false;
+
+ PathTraversalState traversalState(PathTraversalState::TraversalSegmentAtLength);
+ SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, length);
+
+ OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(pathSegList);
+ SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
+ bool ok = parser->parsePathDataFromSource(NormalizedParsing);
+ pathSeg = builder->pathSegmentIndex();
+ parser->cleanup();
+ return ok;
+}
+
}
#endif
diff --git a/WebCore/svg/SVGPathParserFactory.h b/WebCore/svg/SVGPathParserFactory.h
index 37418d4..b8a2dd5 100644
--- a/WebCore/svg/SVGPathParserFactory.h
+++ b/WebCore/svg/SVGPathParserFactory.h
@@ -46,6 +46,10 @@ public:
bool buildSVGPathByteStreamFromString(const String&, OwnPtr<SVGPathByteStream>&, PathParsingMode);
+ bool buildAnimatedSVGPathByteStream(SVGPathByteStream*, SVGPathByteStream*, OwnPtr<SVGPathByteStream>&, float);
+
+ bool getSVGPathSegAtLengthFromSVGPathSegList(SVGPathSegList*, float, unsigned long&);
+
private:
SVGPathParserFactory();
~SVGPathParserFactory();
diff --git a/WebCore/svg/SVGPathSegList.cpp b/WebCore/svg/SVGPathSegList.cpp
index b445d3e..3b86f55 100644
--- a/WebCore/svg/SVGPathSegList.cpp
+++ b/WebCore/svg/SVGPathSegList.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -24,22 +25,6 @@
#if ENABLE(SVG)
#include "SVGPathSegList.h"
-#include "FloatConversion.h"
-#include "FloatPoint.h"
-#include "FloatSize.h"
-#include "Path.h"
-#include "PathTraversalState.h"
-#include "SVGPathSegArc.h"
-#include "SVGPathSegClosePath.h"
-#include "SVGPathSegMoveto.h"
-#include "SVGPathSegLineto.h"
-#include "SVGPathSegLinetoHorizontal.h"
-#include "SVGPathSegLinetoVertical.h"
-#include "SVGPathSegCurvetoCubic.h"
-#include "SVGPathSegCurvetoCubicSmooth.h"
-#include "SVGPathSegCurvetoQuadratic.h"
-#include "SVGPathSegCurvetoQuadraticSmooth.h"
-
namespace WebCore {
SVGPathSegList::SVGPathSegList(const QualifiedName& attributeName)
@@ -51,179 +36,6 @@ SVGPathSegList::~SVGPathSegList()
{
}
-unsigned SVGPathSegList::getPathSegAtLength(double length, ExceptionCode& ec)
-{
- // FIXME : to be useful this will need to support non-normalized SVGPathSegLists
- int len = numberOfItems();
- // FIXME: Eventually this will likely move to a "path applier"-like model, until then PathTraversalState is less useful as we could just use locals
- PathTraversalState traversalState(PathTraversalState::TraversalSegmentAtLength);
- traversalState.m_desiredLength = narrowPrecisionToFloat(length);
- for (int i = 0; i < len; ++i) {
- SVGPathSeg* segment = getItem(i, ec).get();
- if (ec)
- return 0;
- float segmentLength = 0;
- switch (segment->pathSegType()) {
- case PathSegMoveToAbs:
- {
- SVGPathSegMovetoAbs* moveTo = static_cast<SVGPathSegMovetoAbs*>(segment);
- segmentLength = traversalState.moveTo(FloatPoint(moveTo->x(), moveTo->y()));
- break;
- }
- case PathSegLineToAbs:
- {
- SVGPathSegLinetoAbs* lineTo = static_cast<SVGPathSegLinetoAbs*>(segment);
- segmentLength = traversalState.lineTo(FloatPoint(lineTo->x(), lineTo->y()));
- break;
- }
- case PathSegCurveToCubicAbs:
- {
- SVGPathSegCurvetoCubicAbs* curveTo = static_cast<SVGPathSegCurvetoCubicAbs*>(segment);
- segmentLength = traversalState.cubicBezierTo(FloatPoint(curveTo->x1(), curveTo->y1()),
- FloatPoint(curveTo->x2(), curveTo->y2()),
- FloatPoint(curveTo->x(), curveTo->y()));
- break;
- }
- case PathSegClosePath:
- segmentLength = traversalState.closeSubpath();
- break;
- default:
- ASSERT(false); // FIXME: This only works with normalized/processed path data.
- break;
- }
- traversalState.m_totalLength += segmentLength;
- if ((traversalState.m_action == PathTraversalState::TraversalSegmentAtLength)
- && (traversalState.m_totalLength >= traversalState.m_desiredLength)) {
- return traversalState.m_segmentIndex;
- }
- traversalState.m_segmentIndex++;
- }
-
- // The SVG spec is unclear as to what to return when the distance is not on the path.
- // WebKit/Opera/FF all return the last path segment if the distance exceeds the actual path length:
- return traversalState.m_segmentIndex ? traversalState.m_segmentIndex - 1 : 0;
-}
-
-float adjustAnimatedValue(float from, float to, float progress)
-{
- return (to - from) * progress + from;
-}
-
-#define BLENDPATHSEG1(class, attr1) \
- class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress))
-
-#define BLENDPATHSEG2(class, attr1, attr2) \
- class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress))
-
-#define BLENDPATHSEG4(class, attr1, attr2, attr3, attr4) \
- class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress))
-
-#define BLENDPATHSEG6(class, attr1, attr2, attr3, attr4, attr5, attr6) \
- class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr6(), static_cast<class*>(to)->attr6(), progress))
-
-#define BLENDPATHSEG7(class, attr1, attr2, attr3, attr4, attr5, bool1, bool2) \
- class::create(adjustAnimatedValue(static_cast<class*>(from)->attr1(), static_cast<class*>(to)->attr1(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr2(), static_cast<class*>(to)->attr2(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr3(), static_cast<class*>(to)->attr3(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr4(), static_cast<class*>(to)->attr4(), progress), \
- adjustAnimatedValue(static_cast<class*>(from)->attr5(), static_cast<class*>(to)->attr5(), progress), \
- static_cast<bool>(adjustAnimatedValue(static_cast<class*>(from)->bool1(), static_cast<class*>(to)->bool1(), progress)), \
- static_cast<bool>(adjustAnimatedValue(static_cast<class*>(from)->bool2(), static_cast<class*>(to)->bool2(), progress)))
-
-PassRefPtr<SVGPathSegList> SVGPathSegList::createAnimated(const SVGPathSegList* fromList, const SVGPathSegList* toList, float progress)
-{
- unsigned itemCount = fromList->numberOfItems();
- if (!itemCount || itemCount != toList->numberOfItems())
- return 0;
- RefPtr<SVGPathSegList> result = create(fromList->associatedAttributeName());
- ExceptionCode ec = 0;
- for (unsigned n = 0; n < itemCount; ++n) {
- SVGPathSeg* from = fromList->getItem(n, ec).get();
- if (ec)
- return 0;
- SVGPathSeg* to = toList->getItem(n, ec).get();
- if (ec)
- return 0;
- if (from->pathSegType() == PathSegUnknown || from->pathSegType() != to->pathSegType())
- return 0;
- RefPtr<SVGPathSeg> segment = 0;
- switch (static_cast<SVGPathSegType>(from->pathSegType())) {
- case PathSegClosePath:
- segment = SVGPathSegClosePath::create();
- break;
- case PathSegLineToHorizontalAbs:
- segment = BLENDPATHSEG1(SVGPathSegLinetoHorizontalAbs, x);
- break;
- case PathSegLineToHorizontalRel:
- segment = BLENDPATHSEG1(SVGPathSegLinetoHorizontalRel, x);
- break;
- case PathSegLineToVerticalAbs:
- segment = BLENDPATHSEG1(SVGPathSegLinetoVerticalAbs, y);
- break;
- case PathSegLineToVerticalRel:
- segment = BLENDPATHSEG1(SVGPathSegLinetoVerticalRel, y);
- break;
- case PathSegMoveToAbs:
- segment = BLENDPATHSEG2(SVGPathSegMovetoAbs, x, y);
- break;
- case PathSegMoveToRel:
- segment = BLENDPATHSEG2(SVGPathSegMovetoRel, x, y);
- break;
- case PathSegLineToAbs:
- segment = BLENDPATHSEG2(SVGPathSegLinetoAbs, x, y);
- break;
- case PathSegLineToRel:
- segment = BLENDPATHSEG2(SVGPathSegLinetoRel, x, y);
- break;
- case PathSegCurveToCubicAbs:
- segment = BLENDPATHSEG6(SVGPathSegCurvetoCubicAbs, x, y, x1, y1, x2, y2);
- break;
- case PathSegCurveToCubicRel:
- segment = BLENDPATHSEG6(SVGPathSegCurvetoCubicRel, x, y, x1, y1, x2, y2);
- break;
- case PathSegCurveToCubicSmoothAbs:
- segment = BLENDPATHSEG4(SVGPathSegCurvetoCubicSmoothAbs, x, y, x2, y2);
- break;
- case PathSegCurveToCubicSmoothRel:
- segment = BLENDPATHSEG4(SVGPathSegCurvetoCubicSmoothRel, x, y, x2, y2);
- break;
- case PathSegCurveToQuadraticAbs:
- segment = BLENDPATHSEG4(SVGPathSegCurvetoQuadraticAbs, x, y, x1, y1);
- break;
- case PathSegCurveToQuadraticRel:
- segment = BLENDPATHSEG4(SVGPathSegCurvetoQuadraticRel, x, y, x1, y1);
- break;
- case PathSegCurveToQuadraticSmoothAbs:
- segment = BLENDPATHSEG2(SVGPathSegCurvetoQuadraticSmoothAbs, x, y);
- break;
- case PathSegCurveToQuadraticSmoothRel:
- segment = BLENDPATHSEG2(SVGPathSegCurvetoQuadraticSmoothRel, x, y);
- break;
- case PathSegArcAbs:
- segment = BLENDPATHSEG7(SVGPathSegArcAbs, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
- break;
- case PathSegArcRel:
- segment = BLENDPATHSEG7(SVGPathSegArcRel, x, y, r1, r2, angle, largeArcFlag, sweepFlag);
- break;
- case PathSegUnknown:
- ASSERT_NOT_REACHED();
- }
- result->appendItem(segment, ec);
- if (ec)
- return 0;
- }
- return result.release();
-}
-
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathSegList.h b/WebCore/svg/SVGPathSegList.h
index 7e7134f..f27c653 100644
--- a/WebCore/svg/SVGPathSegList.h
+++ b/WebCore/svg/SVGPathSegList.h
@@ -26,23 +26,16 @@
namespace WebCore {
- class Path;
- class SVGElement;
-
- class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > {
- public:
- static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); }
- virtual ~SVGPathSegList();
-
- unsigned getPathSegAtLength(double, ExceptionCode&);
-
- static PassRefPtr<SVGPathSegList> createAnimated(const SVGPathSegList* fromList, const SVGPathSegList* toList, float progress);
-
- private:
- SVGPathSegList(const QualifiedName&);
- };
-
- float adjustAnimatedValue(float from, float to, float progress);
+class SVGElement;
+
+class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > {
+public:
+ static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); }
+ virtual ~SVGPathSegList();
+
+private:
+ SVGPathSegList(const QualifiedName&);
+};
} // namespace WebCore
diff --git a/WebCore/svg/SVGPathSegListBuilder.h b/WebCore/svg/SVGPathSegListBuilder.h
index aa4a782..2fd2667 100644
--- a/WebCore/svg/SVGPathSegListBuilder.h
+++ b/WebCore/svg/SVGPathSegListBuilder.h
@@ -36,6 +36,8 @@ public:
SVGPathSegListBuilder();
void setCurrentSVGPathSegList(SVGPathSegList* pathSegList) { m_pathSegList = pathSegList; }
+ virtual void incrementPathSegmentCount() { }
+ virtual bool continueConsuming() { return true; }
virtual void cleanup() { m_pathSegList = 0; }
private:
diff --git a/WebCore/svg/SVGPathStringBuilder.h b/WebCore/svg/SVGPathStringBuilder.h
index f25f791..ebb8596 100644
--- a/WebCore/svg/SVGPathStringBuilder.h
+++ b/WebCore/svg/SVGPathStringBuilder.h
@@ -32,6 +32,8 @@ public:
SVGPathStringBuilder();
virtual void cleanup() { m_stringBuilder.clear(); }
+ virtual void incrementPathSegmentCount() { }
+ virtual bool continueConsuming() { return true; }
String result() { return m_stringBuilder.toString(ConcatAddingSpacesBetweenIndividualStrings); }
private:
diff --git a/WebCore/svg/SVGPathTraversalStateBuilder.cpp b/WebCore/svg/SVGPathTraversalStateBuilder.cpp
new file mode 100644
index 0000000..a4ef2fb
--- /dev/null
+++ b/WebCore/svg/SVGPathTraversalStateBuilder.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "SVGPathTraversalStateBuilder.h"
+
+namespace WebCore {
+
+SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder()
+ : m_traversalState(0)
+ , m_desiredLength(0)
+{
+}
+
+void SVGPathTraversalStateBuilder::moveTo(const FloatPoint& targetPoint, bool, PathCoordinateMode)
+{
+ ASSERT(m_traversalState);
+ m_traversalState->m_totalLength += m_traversalState->moveTo(targetPoint);
+}
+
+void SVGPathTraversalStateBuilder::lineTo(const FloatPoint& targetPoint, PathCoordinateMode)
+{
+ ASSERT(m_traversalState);
+ m_traversalState->m_totalLength += m_traversalState->lineTo(targetPoint);
+}
+
+void SVGPathTraversalStateBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode)
+{
+ ASSERT(m_traversalState);
+ m_traversalState->m_totalLength += m_traversalState->cubicBezierTo(point1, point2, targetPoint);
+}
+
+void SVGPathTraversalStateBuilder::closePath()
+{
+ ASSERT(m_traversalState);
+ m_traversalState->m_totalLength += m_traversalState->closeSubpath();
+}
+
+void SVGPathTraversalStateBuilder::setDesiredLength(float desiredLength)
+{
+ ASSERT(m_traversalState);
+ m_traversalState->m_desiredLength = desiredLength;
+}
+
+bool SVGPathTraversalStateBuilder::continueConsuming()
+{
+ ASSERT(m_traversalState);
+ ASSERT(m_traversalState->m_action == PathTraversalState::TraversalSegmentAtLength);
+ return m_traversalState->m_totalLength < m_traversalState->m_desiredLength;
+}
+
+void SVGPathTraversalStateBuilder::incrementPathSegmentCount()
+{
+ ASSERT(m_traversalState);
+ ++m_traversalState->m_segmentIndex;
+}
+
+unsigned long SVGPathTraversalStateBuilder::pathSegmentIndex()
+{
+ ASSERT(m_traversalState);
+ return m_traversalState->m_segmentIndex;
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGPathTraversalStateBuilder.h b/WebCore/svg/SVGPathTraversalStateBuilder.h
new file mode 100644
index 0000000..a5f3f79
--- /dev/null
+++ b/WebCore/svg/SVGPathTraversalStateBuilder.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGPathTraversalStateBuilder_h
+#define SVGPathTraversalStateBuilder_h
+
+#if ENABLE(SVG)
+#include "FloatPoint.h"
+#include "PathTraversalState.h"
+#include "SVGPathConsumer.h"
+
+namespace WebCore {
+
+class SVGPathTraversalStateBuilder : public SVGPathConsumer {
+public:
+ SVGPathTraversalStateBuilder();
+
+ unsigned long pathSegmentIndex();
+ void setCurrentTraversalState(PathTraversalState* traversalState) { m_traversalState = traversalState; }
+ void setDesiredLength(float);
+ virtual void incrementPathSegmentCount();
+ virtual bool continueConsuming();
+ virtual void cleanup() { m_traversalState = 0; }
+
+private:
+ // Used in UnalteredParisng/NormalizedParsing modes.
+ virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode);
+ virtual void lineTo(const FloatPoint&, PathCoordinateMode);
+ virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode);
+ virtual void closePath();
+
+private:
+ // Not used for PathTraversalState.
+ virtual void lineToHorizontal(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void lineToVertical(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void curveToCubicSmooth(const FloatPoint&, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void curveToQuadratic(const FloatPoint&, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+ virtual void arcTo(float, float, float, bool, bool, const FloatPoint&, PathCoordinateMode) { ASSERT_NOT_REACHED(); }
+
+ PathTraversalState* m_traversalState;
+ float m_desiredLength;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
+#endif // SVGPathTraversalStateBuilder_h
diff --git a/WebCore/svg/SVGPointList.cpp b/WebCore/svg/SVGPointList.cpp
index 3be16ea..8a3d870 100644
--- a/WebCore/svg/SVGPointList.cpp
+++ b/WebCore/svg/SVGPointList.cpp
@@ -54,6 +54,11 @@ String SVGPointList::valueAsString() const
return result;
}
+float inline adjustAnimatedValue(float from, float to, float progress)
+{
+ return (to - from) * progress + from;
+}
+
PassRefPtr<SVGPointList> SVGPointList::createAnimated(const SVGPointList* fromList, const SVGPointList* toList, float progress)
{
unsigned itemCount = fromList->numberOfItems();
diff --git a/WebCore/svg/SVGURIReference.cpp b/WebCore/svg/SVGURIReference.cpp
index e3a7003..97003e5 100644
--- a/WebCore/svg/SVGURIReference.cpp
+++ b/WebCore/svg/SVGURIReference.cpp
@@ -53,12 +53,11 @@ bool SVGURIReference::isKnownAttribute(const QualifiedName& attrName)
String SVGURIReference::getTarget(const String& url)
{
if (url.startsWith("url(")) { // URI References, ie. fill:url(#target)
- unsigned int start = url.find('#') + 1;
- unsigned int end = url.reverseFind(')');
-
+ size_t start = url.find('#') + 1;
+ size_t end = url.reverseFind(')');
return url.substring(start, end - start);
- } else if (url.find('#') > -1) { // format is #target
- unsigned int start = url.find('#') + 1;
+ } else if (url.find('#') != notFound) { // format is #target
+ size_t start = url.find('#') + 1;
return url.substring(start, url.length() - start);
} else // The url doesn't have any target.
return String();
diff --git a/WebCore/svg/animation/SMILTimeContainer.h b/WebCore/svg/animation/SMILTimeContainer.h
index dde41f1..4664c68 100644
--- a/WebCore/svg/animation/SMILTimeContainer.h
+++ b/WebCore/svg/animation/SMILTimeContainer.h
@@ -30,12 +30,12 @@
#include "PlatformString.h"
#include "SMILTime.h"
-#include "StringHash.h"
#include "Timer.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/svg/animation/SVGSMILElement.cpp b/WebCore/svg/animation/SVGSMILElement.cpp
index 0352b43..99a5189 100644
--- a/WebCore/svg/animation/SVGSMILElement.cpp
+++ b/WebCore/svg/animation/SVGSMILElement.cpp
@@ -219,8 +219,8 @@ SMILTime SVGSMILElement::parseClockValue(const String& data)
double result = 0;
bool ok;
- int doublePointOne = parse.find(':');
- int doublePointTwo = parse.find(':', doublePointOne + 1);
+ size_t doublePointOne = parse.find(':');
+ size_t doublePointTwo = parse.find(':', doublePointOne + 1);
if (doublePointOne == 2 && doublePointTwo == 5 && parse.length() >= 8) {
result += parse.substring(0, 2).toUIntStrict(&ok) * 60 * 60;
if (!ok)
@@ -229,7 +229,7 @@ SMILTime SVGSMILElement::parseClockValue(const String& data)
if (!ok)
return SMILTime::unresolved();
result += parse.substring(6).toDouble(&ok);
- } else if (doublePointOne == 2 && doublePointTwo == -1 && parse.length() >= 5) {
+ } else if (doublePointOne == 2 && doublePointTwo == notFound && parse.length() >= 5) {
result += parse.substring(0, 2).toUIntStrict(&ok) * 60;
if (!ok)
return SMILTime::unresolved();
@@ -253,15 +253,15 @@ bool SVGSMILElement::parseCondition(const String& value, BeginOrEnd beginOrEnd)
double sign = 1.;
bool ok;
- int pos = parseString.find('+');
- if (pos == -1) {
+ size_t pos = parseString.find('+');
+ if (pos == notFound) {
pos = parseString.find('-');
- if (pos != -1)
+ if (pos != notFound)
sign = -1.;
}
String conditionString;
SMILTime offset = 0;
- if (pos == -1)
+ if (pos == notFound)
conditionString = parseString;
else {
conditionString = parseString.left(pos).stripWhiteSpace();
@@ -277,7 +277,7 @@ bool SVGSMILElement::parseCondition(const String& value, BeginOrEnd beginOrEnd)
String baseID;
String nameString;
- if (pos == -1)
+ if (pos == notFound)
nameString = conditionString;
else {
baseID = conditionString.left(pos);
diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp
index 990e41f..6608c9e 100644
--- a/WebCore/svg/graphics/SVGImage.cpp
+++ b/WebCore/svg/graphics/SVGImage.cpp
@@ -221,12 +221,13 @@ NativeImagePtr SVGImage::nativeImageForCurrentFrame()
if (!m_frameCache) {
if (!m_page)
return 0;
- m_frameCache = ImageBuffer::create(size());
- if (!m_frameCache) // failed to allocate image
+ OwnPtr<ImageBuffer> buffer = ImageBuffer::create(size());
+ if (!buffer) // failed to allocate image
return 0;
- draw(m_frameCache->context(), rect(), rect(), DeviceColorSpace, CompositeSourceOver);
+ draw(buffer->context(), rect(), rect(), DeviceColorSpace, CompositeSourceOver);
+ m_frameCache = buffer->copyImage();
}
- return m_frameCache->image()->nativeImageForCurrentFrame();
+ return m_frameCache->nativeImageForCurrentFrame();
}
bool SVGImage::dataChanged(bool allDataReceived)
diff --git a/WebCore/svg/graphics/SVGImage.h b/WebCore/svg/graphics/SVGImage.h
index 1936626..01eae71 100644
--- a/WebCore/svg/graphics/SVGImage.h
+++ b/WebCore/svg/graphics/SVGImage.h
@@ -33,7 +33,6 @@
namespace WebCore {
- class ImageBuffer;
class Page;
class SVGImageChromeClient;
@@ -72,7 +71,7 @@ namespace WebCore {
OwnPtr<SVGImageChromeClient> m_chromeClient;
OwnPtr<Page> m_page;
- OwnPtr<ImageBuffer> m_frameCache;
+ RefPtr<Image> m_frameCache;
};
}
diff --git a/WebCore/svg/graphics/filters/SVGFEMerge.cpp b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
index 649f670..11c7407 100644
--- a/WebCore/svg/graphics/filters/SVGFEMerge.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEMerge.cpp
@@ -79,7 +79,7 @@ void FEMerge::apply(Filter* filter)
for (unsigned i = 0; i < m_mergeInputs.size(); i++) {
FloatRect destRect = calculateDrawingRect(m_mergeInputs[i]->scaledSubRegion());
- filterContext->drawImage(m_mergeInputs[i]->resultImage()->image(), DeviceColorSpace, destRect);
+ filterContext->drawImageBuffer(m_mergeInputs[i]->resultImage(), DeviceColorSpace, destRect);
}
}
diff --git a/WebCore/svg/graphics/filters/SVGFEOffset.cpp b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
index f6c1a3c..e12b8e0 100644
--- a/WebCore/svg/graphics/filters/SVGFEOffset.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEOffset.cpp
@@ -91,7 +91,7 @@ void FEOffset::apply(Filter* filter)
m_in->scaledSubRegion().width(),
m_in->scaledSubRegion().height());
- filterContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, dstRect);
+ filterContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, dstRect);
}
void FEOffset::dump()
diff --git a/WebCore/svg/graphics/filters/SVGFETile.cpp b/WebCore/svg/graphics/filters/SVGFETile.cpp
index fc172ee..56cbc1e 100644
--- a/WebCore/svg/graphics/filters/SVGFETile.cpp
+++ b/WebCore/svg/graphics/filters/SVGFETile.cpp
@@ -72,8 +72,8 @@ void FETile::apply(Filter* filter)
OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size());
GraphicsContext* tileImageContext = tileImage->context();
- tileImageContext->drawImage(m_in->resultImage()->image(), DeviceColorSpace, IntPoint());
- RefPtr<Pattern> pattern = Pattern::create(tileImage->image(), true, true);
+ tileImageContext->drawImageBuffer(m_in->resultImage(), DeviceColorSpace, IntPoint());
+ RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(), true, true);
AffineTransform matrix;
matrix.translate(m_in->scaledSubRegion().x() - scaledSubRegion().x(), m_in->scaledSubRegion().y() - scaledSubRegion().y());
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
index 7bf40ed..399f7fc 100644
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
+++ b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
@@ -181,7 +181,7 @@ inline void FETurbulence::initPaint(PaintingData& paintingData)
gradient[1] /= normalizationFactor;
}
}
- for (int i = s_blockSize - 1; i >= 0; --i) {
+ for (int i = s_blockSize - 1; i > 0; --i) {
int k = paintingData.latticeSelector[i];
int j = paintingData.random() % s_blockSize;
ASSERT(j >= 0);
@@ -311,10 +311,12 @@ unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paint
}
}
- // Clamp result
- turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 255.f), 0.f);
+ // The value of turbulenceFunctionResult comes from ((turbulenceFunctionResult * 255) + 255) / 2 by fractalNoise
+ // and (turbulenceFunctionResult * 255) by turbulence.
if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
- return static_cast<unsigned char>(turbulenceFunctionResult * 127.5f + 127.5f); // It comes form (turbulenceFunctionResult * 255 + 255) / 2
+ turbulenceFunctionResult = turbulenceFunctionResult * 0.5f + 0.5f;
+ // Clamp result
+ turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 1.f), 0.f);
return static_cast<unsigned char>(turbulenceFunctionResult * 255);
}
@@ -328,7 +330,7 @@ void FETurbulence::apply(Filter* filter)
return;
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
- PaintingData paintingData(floorf(fabsf(m_seed)), imageRect.size());
+ PaintingData paintingData(m_seed, imageRect.size());
initPaint(paintingData);
FloatRect filterRegion = filter->filterRegion();
diff --git a/WebCore/svg/graphics/filters/SVGFilterBuilder.h b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
index 3325dac..4ef6ffe 100644
--- a/WebCore/svg/graphics/filters/SVGFilterBuilder.h
+++ b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
@@ -23,12 +23,12 @@
#include "config.h"
#if ENABLE(SVG) && ENABLE(FILTERS)
-#include "AtomicStringHash.h"
#include "FilterEffect.h"
#include "PlatformString.h"
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/websockets/WebSocket.h b/WebCore/websockets/WebSocket.h
index 15508b4..fd3ee56 100644
--- a/WebCore/websockets/WebSocket.h
+++ b/WebCore/websockets/WebSocket.h
@@ -34,7 +34,6 @@
#if ENABLE(WEB_SOCKETS)
#include "ActiveDOMObject.h"
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -43,6 +42,7 @@
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 5859fd7..54be16a 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -41,11 +41,11 @@
#include "ScriptExecutionContext.h"
#include "SocketStreamError.h"
#include "SocketStreamHandle.h"
-#include "StringHash.h"
#include "WebSocketChannelClient.h"
#include "WebSocketHandshake.h"
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
#include <wtf/Deque.h>
#include <wtf/FastMalloc.h>
#include <wtf/HashMap.h>
@@ -61,6 +61,7 @@ WebSocketChannel::WebSocketChannel(ScriptExecutionContext* context, WebSocketCha
, m_resumeTimer(this, &WebSocketChannel::resumeTimerFired)
, m_suspended(false)
, m_closed(false)
+ , m_shouldDiscardReceivedData(false)
, m_unhandledBufferedAmount(0)
{
}
@@ -171,10 +172,14 @@ void WebSocketChannel::didReceiveData(SocketStreamHandle* handle, const char* da
return;
}
if (!m_client) {
+ m_shouldDiscardReceivedData = true;
handle->close();
return;
}
+ if (m_shouldDiscardReceivedData)
+ return;
if (!appendToBuffer(data, len)) {
+ m_shouldDiscardReceivedData = true;
handle->close();
return;
}
@@ -187,6 +192,7 @@ void WebSocketChannel::didFail(SocketStreamHandle* handle, const SocketStreamErr
{
LOG(Network, "WebSocketChannel %p didFail", this);
ASSERT(handle == m_handle || !m_handle);
+ m_shouldDiscardReceivedData = true;
handle->close();
}
@@ -198,23 +204,28 @@ void WebSocketChannel::didCancelAuthenticationChallenge(SocketStreamHandle*, con
{
}
-bool WebSocketChannel::appendToBuffer(const char* data, int len)
+bool WebSocketChannel::appendToBuffer(const char* data, size_t len)
{
+ size_t newBufferSize = m_bufferSize + len;
+ if (newBufferSize < m_bufferSize) {
+ LOG(Network, "WebSocket buffer overflow (%lu+%lu)", static_cast<unsigned long>(m_bufferSize), static_cast<unsigned long>(len));
+ return false;
+ }
char* newBuffer = 0;
- if (tryFastMalloc(m_bufferSize + len).getValue(newBuffer)) {
+ if (tryFastMalloc(newBufferSize).getValue(newBuffer)) {
if (m_buffer)
memcpy(newBuffer, m_buffer, m_bufferSize);
memcpy(newBuffer + m_bufferSize, data, len);
fastFree(m_buffer);
m_buffer = newBuffer;
- m_bufferSize += len;
+ m_bufferSize = newBufferSize;
return true;
}
- m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket frame (at %d bytes) is too long.", m_bufferSize + len), 0, m_handshake.clientOrigin());
+ m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("WebSocket frame (at %lu bytes) is too long.", static_cast<unsigned long>(newBufferSize)), 0, m_handshake.clientOrigin());
return false;
}
-void WebSocketChannel::skipBuffer(int len)
+void WebSocketChannel::skipBuffer(size_t len)
{
ASSERT(len <= m_bufferSize);
m_bufferSize -= len;
@@ -231,6 +242,8 @@ bool WebSocketChannel::processBuffer()
ASSERT(!m_suspended);
ASSERT(m_client);
ASSERT(m_buffer);
+ if (m_shouldDiscardReceivedData)
+ return false;
if (m_handshake.mode() == WebSocketHandshake::Incomplete) {
int headerLength = m_handshake.readServerHandshake(m_buffer, m_bufferSize);
@@ -250,11 +263,12 @@ bool WebSocketChannel::processBuffer()
LOG(Network, "WebSocketChannel %p connected", this);
skipBuffer(headerLength);
m_client->didConnect();
- LOG(Network, "remaining in read buf %ul", m_bufferSize);
+ LOG(Network, "remaining in read buf %lu", static_cast<unsigned long>(m_bufferSize));
return m_buffer;
}
LOG(Network, "WebSocketChannel %p connection failed", this);
skipBuffer(headerLength);
+ m_shouldDiscardReceivedData = true;
if (!m_closed)
m_handle->close();
return false;
@@ -268,27 +282,52 @@ bool WebSocketChannel::processBuffer()
unsigned char frameByte = static_cast<unsigned char>(*p++);
if ((frameByte & 0x80) == 0x80) {
- int length = 0;
+ size_t length = 0;
+ bool errorFrame = false;
while (p < end) {
- if (length > std::numeric_limits<int>::max() / 128) {
- LOG(Network, "frame length overflow %d", length);
- skipBuffer(p + length - m_buffer);
- m_client->didReceiveMessageError();
- if (!m_client)
- return false;
- if (!m_closed)
- m_handle->close();
- return false;
+ if (length > std::numeric_limits<size_t>::max() / 128) {
+ LOG(Network, "frame length overflow %lu", static_cast<unsigned long>(length));
+ errorFrame = true;
+ break;
+ }
+ size_t newLength = length * 128;
+ unsigned char msgByte = static_cast<unsigned char>(*p);
+ unsigned int lengthMsgByte = msgByte & 0x7f;
+ if (newLength > std::numeric_limits<size_t>::max() - lengthMsgByte) {
+ LOG(Network, "frame length overflow %lu+%u", static_cast<unsigned long>(newLength), lengthMsgByte);
+ errorFrame = true;
+ break;
}
- char msgByte = *p;
- length = length * 128 + (msgByte & 0x7f);
+ newLength += lengthMsgByte;
+ if (newLength < length) { // sanity check
+ LOG(Network, "frame length integer wrap %lu->%lu", static_cast<unsigned long>(length), static_cast<unsigned long>(newLength));
+ errorFrame = true;
+ break;
+ }
+ length = newLength;
++p;
if (!(msgByte & 0x80))
break;
}
+ if (p + length < p) {
+ LOG(Network, "frame buffer pointer wrap %p+%lu->%p", p, static_cast<unsigned long>(length), p + length);
+ errorFrame = true;
+ }
+ if (errorFrame) {
+ skipBuffer(m_bufferSize); // Save memory.
+ m_shouldDiscardReceivedData = true;
+ m_client->didReceiveMessageError();
+ if (!m_client)
+ return false;
+ if (!m_closed)
+ m_handle->close();
+ return false;
+ }
+ ASSERT(p + length >= p);
if (p + length < end) {
p += length;
nextFrame = p;
+ ASSERT(nextFrame > m_buffer);
skipBuffer(nextFrame - m_buffer);
m_client->didReceiveMessageError();
return m_buffer;
diff --git a/WebCore/websockets/WebSocketChannel.h b/WebCore/websockets/WebSocketChannel.h
index 893b4c6..43d431a 100644
--- a/WebCore/websockets/WebSocketChannel.h
+++ b/WebCore/websockets/WebSocketChannel.h
@@ -79,8 +79,8 @@ namespace WebCore {
private:
WebSocketChannel(ScriptExecutionContext*, WebSocketChannelClient*, const KURL&, const String& protocol);
- bool appendToBuffer(const char* data, int len);
- void skipBuffer(int len);
+ bool appendToBuffer(const char* data, size_t len);
+ void skipBuffer(size_t len);
bool processBuffer();
void resumeTimerFired(Timer<WebSocketChannel>* timer);
@@ -89,11 +89,12 @@ namespace WebCore {
WebSocketHandshake m_handshake;
RefPtr<SocketStreamHandle> m_handle;
char* m_buffer;
- int m_bufferSize;
+ size_t m_bufferSize;
Timer<WebSocketChannel> m_resumeTimer;
bool m_suspended;
bool m_closed;
+ bool m_shouldDiscardReceivedData;
unsigned long m_unhandledBufferedAmount;
};
diff --git a/WebCore/websockets/WebSocketHandshake.cpp b/WebCore/websockets/WebSocketHandshake.cpp
index 7711604..effbb67 100644
--- a/WebCore/websockets/WebSocketHandshake.cpp
+++ b/WebCore/websockets/WebSocketHandshake.cpp
@@ -34,7 +34,6 @@
#include "WebSocketHandshake.h"
-#include "AtomicString.h"
#include "CharacterNames.h"
#include "Cookie.h"
#include "CookieJar.h"
@@ -51,6 +50,7 @@
#include <wtf/StdLibExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicString.h>
#include <wtf/text/CString.h>
namespace WebCore {
diff --git a/WebCore/websockets/WebSocketHandshakeResponse.cpp b/WebCore/websockets/WebSocketHandshakeResponse.cpp
index 753cecf..2e0dad7 100644
--- a/WebCore/websockets/WebSocketHandshakeResponse.cpp
+++ b/WebCore/websockets/WebSocketHandshakeResponse.cpp
@@ -34,8 +34,8 @@
#include "WebSocketHandshakeResponse.h"
-#include "AtomicString.h"
#include <wtf/Assertions.h>
+#include <wtf/text/AtomicString.h>
using namespace std;
diff --git a/WebCore/wml/WMLInputElement.h b/WebCore/wml/WMLInputElement.h
index fe1ae89..329d869 100644
--- a/WebCore/wml/WMLInputElement.h
+++ b/WebCore/wml/WMLInputElement.h
@@ -47,6 +47,7 @@ public:
virtual bool isIndeterminate() const { return false; }
virtual bool isTextFormControl() const { return true; }
virtual bool isRadioButton() const { return false; }
+ virtual bool isCheckbox() const { return false; }
virtual bool isTextField() const { return true; }
virtual bool isSearchField() const { return false; }
virtual bool isInputTypeHidden() const { return false; }
diff --git a/WebCore/wml/WMLPageState.h b/WebCore/wml/WMLPageState.h
index 614bc94..0ea7cbb 100644
--- a/WebCore/wml/WMLPageState.h
+++ b/WebCore/wml/WMLPageState.h
@@ -24,9 +24,9 @@
#define WMLPageState_h
#if ENABLE(WML)
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/workers/AbstractWorker.h b/WebCore/workers/AbstractWorker.h
index 789dba2..f4cc50b 100644
--- a/WebCore/workers/AbstractWorker.h
+++ b/WebCore/workers/AbstractWorker.h
@@ -34,13 +34,13 @@
#if ENABLE(WORKERS)
#include "ActiveDOMObject.h"
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/workers/DefaultSharedWorkerRepository.h b/WebCore/workers/DefaultSharedWorkerRepository.h
index 2ce4422..21e14a1 100644
--- a/WebCore/workers/DefaultSharedWorkerRepository.h
+++ b/WebCore/workers/DefaultSharedWorkerRepository.h
@@ -34,7 +34,6 @@
#if ENABLE(SHARED_WORKERS)
#include "ExceptionCode.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
@@ -42,6 +41,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Threading.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/workers/Worker.h b/WebCore/workers/Worker.h
index 2470b71..0e673ac 100644
--- a/WebCore/workers/Worker.h
+++ b/WebCore/workers/Worker.h
@@ -31,7 +31,6 @@
#include "AbstractWorker.h"
#include "ActiveDOMObject.h"
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -42,6 +41,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h
index 56b0324..9e9e54f 100644
--- a/WebCore/workers/WorkerContext.h
+++ b/WebCore/workers/WorkerContext.h
@@ -29,7 +29,6 @@
#if ENABLE(WORKERS)
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -40,6 +39,7 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/wscript b/WebCore/wscript
deleted file mode 100644
index 58886aa..0000000
--- a/WebCore/wscript
+++ /dev/null
@@ -1,247 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (C) 2009 Kevin Ollivier 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.
-#
-# WebCore build script for the waf build system
-
-from settings import *
-
-webcore_sources = {}
-
-if build_port == "wx":
- webcore_sources['wx'] = ['platform/KillRingNone.cpp', 'bindings/cpp/WebDOMEventTarget.cpp']
-
- if building_on_win32:
- # make sure platform/wx comes after this so we get the right
- # FontPlatformData.h
- webcore_dirs.extend(['platform/wx/wxcode/win', 'plugins/win'])
- webcore_sources['wx-win'] = [
- 'platform/graphics/win/TransformationMatrixWin.cpp',
- # wxTimer on Windows has a bug that causes it to eat crashes in callbacks
- # so we need to use the Win port's implementation until the wx bug fix is
- # widely available (it was fixed in 2.8.10).
- 'platform/win/SharedTimerWin.cpp',
- 'platform/win/WebCoreInstanceHandle.cpp',
- # Use the Windows plugin architecture
- 'plugins/win/PluginDataWin.cpp',
- 'plugins/win/PluginDatabaseWin.cpp',
- 'plugins/win/PluginMessageThrottlerWin.cpp',
- 'plugins/win/PluginPackageWin.cpp',
- 'plugins/win/PluginViewWin.cpp',
- ]
- elif sys.platform.startswith('darwin'):
- webcore_dirs.append('plugins/mac')
- webcore_dirs.append('platform/wx/wxcode/mac/carbon')
- webcore_dirs.append('platform/mac')
- webcore_dirs.append('platform/text/mac')
- webcore_sources['wx-mac'] = [
- 'platform/mac/PurgeableBufferMac.cpp',
- 'platform/mac/WebCoreNSStringExtras.mm',
- 'platform/mac/WebCoreSystemInterface.mm',
- 'platform/graphics/cg/FloatSizeCG.cpp',
- 'platform/graphics/mac/ComplexTextController.cpp',
- 'platform/graphics/mac/ComplexTextControllerCoreText.cpp',
- 'platform/graphics/mac/ComplexTextControllerATSUI.cpp',
- 'platform/graphics/mac/GlyphPageTreeNodeMac.cpp',
- 'platform/graphics/mac/SimpleFontDataATSUI.mm',
- 'platform/graphics/mac/SimpleFontDataCoreText.cpp',
- 'platform/graphics/wx/FontPlatformDataWxMac.mm',
- 'platform/text/mac/ShapeArabic.c',
- 'platform/wx/wxcode/mac/carbon/fontprops.mm',
- 'plugins/mac/PluginPackageMac.cpp',
- 'plugins/mac/PluginViewMac.mm'
- ]
- else:
- webcore_sources['wx-gtk'] = [
- 'plugins/PluginDataNone.cpp',
- 'plugins/PluginViewNone.cpp',
- 'plugins/PluginPackageNone.cpp'
- ]
- webcore_dirs.append('platform/wx/wxcode/gtk')
-
-import TaskGen
-from TaskGen import taskgen, feature, after
-import Task, ccroot
-
-def generate_webcore_derived_sources():
- # build the derived sources
- derived_sources_dir = os.path.join(webcore_dir, 'DerivedSources')
- wc_dir = webcore_dir
- if building_on_win32:
- wc_dir = get_output('cygpath --unix "%s"' % wc_dir)
- if not os.path.exists(derived_sources_dir):
- os.mkdir(derived_sources_dir)
-
- olddir = os.getcwd()
- os.chdir(derived_sources_dir)
-
- os.system('make -f %s/DerivedSources.make WebCore=%s SOURCE_ROOT=%s all FEATURE_DEFINES="%s"' % (wc_dir, wc_dir, wc_dir, ' '.join(feature_defines)))
- os.chdir(olddir)
-
-def set_options(opt):
- common_set_options(opt)
-
-def configure(conf):
- common_configure(conf)
- generate_webcore_derived_sources()
- if sys.platform.startswith('win'):
- graphics_dir = os.path.join(wk_root, 'WebCore', 'platform', 'graphics')
- # HACK ALERT: MSVC automatically adds the source file's directory as the first entry in the
- # path. Unfortunately, that means when compiling these files we will end up including
- # win/FontPlatformData.h, which breaks wx compilation. So we copy the files to the wx dir.
- for afile in ['UniscribeController.h', 'UniscribeController.cpp', 'GlyphPageTreeNodeCairoWin.cpp']:
- shutil.copy(os.path.join(graphics_dir, 'win', afile), os.path.join(graphics_dir, 'wx'))
-
-def build(bld):
- import Options
-
- import TaskGen
-
- if sys.platform.startswith('darwin'):
- TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cxx']
- TaskGen.task_gen.mappings['.m'] = TaskGen.task_gen.mappings['.cxx']
-
- wk_includes = ['.', '..', 'DerivedSources',
- wk_root,
- os.path.join(wk_root, 'JavaScriptCore'),
- os.path.join(wk_root, 'JavaScriptCore', 'wtf', 'text'),
- os.path.join(wk_root, 'WebCore'),
- os.path.join(wk_root, 'WebKit/wx'),
- 'platform/image-decoders',
- 'platform/win',
- 'platform/wx/wxcode',
- 'workers',
- ]
-
- features = [build_port]
- exclude_patterns = ['*AllInOne.cpp', '*Brew.cpp', '*CFNet.cpp', '*Chromium*.cpp',
- '*Efl.cpp', '*Gtk.cpp', '*Haiku.cpp', '*Mac.cpp', '*None.cpp', '*Qt.cpp', '*Safari.cpp',
- 'test*bindings.*', '*Wince.cpp', "WebDOMCanvas*.cpp", "WebDOMSVG*.cpp"]
- if build_port == 'wx':
- features.append('curl')
- if not building_on_win32:
- exclude_patterns.append('*Win.cpp')
-
- if sys.platform.startswith('darwin'):
- features.append('cf')
- bld.install_files(os.path.join(output_dir, 'WebCore'), 'platform/mac/WebCoreSystemInterface.h')
- else:
- exclude_patterns.append('*CF.cpp')
-
- full_dirs = get_dirs_for_features(webcore_dir, features=features, dirs=webcore_dirs)
-
- jscore_dir = os.path.join(wk_root, 'JavaScriptCore')
- for item in os.listdir(jscore_dir):
- fullpath = os.path.join(jscore_dir, item)
- if os.path.isdir(fullpath) and not item == "os-win32" and not item == 'icu':
- wk_includes.append(fullpath)
-
- wk_includes.append(os.path.join(jscore_dir, 'wtf', 'unicode'))
- wk_includes.append(os.path.join(jscore_dir, 'wtf', 'unicode', 'icu'))
- wk_includes += common_includes + full_dirs
- if sys.platform.startswith('darwin'):
- wk_includes.append(os.path.join(webcore_dir, 'icu'))
-
- cxxflags = []
- if building_on_win32:
- cxxflags.append('/FIWebCorePrefix.h')
- else:
- cxxflags.extend(['-include', 'WebCorePrefix.h'])
-
- webcore = bld.new_task_gen(
- features = 'cc cxx cstaticlib',
- includes = ' '.join(wk_includes),
- source = ' '.join(flattenSources(webcore_sources.values())),
- cxxflags = cxxflags,
- defines = ['WXMAKINGDLL_WEBKIT'],
- target = 'webcore',
- uselib = 'WX ICU XML XSLT CURL SQLITE3 ' + get_config(),
- uselib_local = '',
- install_path = output_dir,
- )
-
- excludes = []
-
- if build_port == 'wx':
- excludes = get_excludes(webcore_dir, exclude_patterns)
- excludes.extend(['UserStyleSheetLoader.cpp', 'RenderMediaControls.cpp'])
-
- # intermediate sources
- excludes.append('CSSValueKeywords.cpp')
- excludes.append('CSSPropertyNames.cpp')
- excludes.append('tokenizer.cpp')
-
- # FIXME: these three require headers that I can't seem to find in trunk.
- # Investigate how to resolve these issues.
- excludes.append('JSAbstractView.cpp')
- excludes.append('JSPositionCallback.cpp')
- excludes.append('JSInspectorController.cpp')
-
- # The bindings generator seems to think these are ref-counted, while they aren't in trunk.
- excludes.append('JSElementTimeControl.cpp')
- excludes.append('JSSVGAnimatedPathData.cpp')
- excludes.append('JSSVGAnimatedPoints.cpp')
- excludes.append('JSSVGExternalResourcesRequired.cpp')
- excludes.append('JSSVGFilterPrimitiveStandardAttributes.cpp')
- excludes.append('JSSVGLocatable.cpp')
- excludes.append('JSSVGStyleTable.cpp')
- excludes.append('JSSVGTests.cpp')
- excludes.append('JSSVGStylable.cpp')
- excludes.append('JSSVGZoomAndPan.cpp')
-
- # These are files that expect methods not in the base C++ class, usually XYZAnimated methods.
- excludes.append('JSSVGFitToViewBox.cpp')
- excludes.append('JSSVGLangSpace.cpp')
- excludes.append('JSSVGTransformable.cpp')
- excludes.append('JSSVGURIReference.cpp')
-
- # These are C++ DOM Bindings that won't compile because they look for things not in trunk.
- excludes.append('WebDOMEventTarget.cpp')
- excludes.append('WebDOMAbstractView.cpp')
- excludes.append('WebDOMBlobBuilder.cpp')
- excludes.append('WebDOMDatabaseCallback.cpp')
- excludes.append('WebDOMEventListenerCustom.cpp')
- excludes.append('WebDOMElementTimeControl.cpp')
- excludes.append('WebDOMImageData.cpp')
- excludes.append('WebDOMInspectorBackend.cpp')
- excludes.append('WebDOMScriptProfile.cpp')
- excludes.append('WebDOMScriptProfileNode.cpp')
- excludes.append('WebDOMSQLStatementCallback.cpp')
- excludes.append('WebDOMSQLTransactionErrorCallback.cpp')
- excludes.append('WebDOMSQLTransactionSyncCallback.cpp')
- excludes.append('WebDOMSQLTransactionCallback.cpp')
- excludes.append('WebNativeEventListener.cpp')
-
- if building_on_win32:
- excludes.append('SharedTimerWx.cpp')
- excludes.append('RenderThemeWin.cpp')
- excludes.append('KeyEventWin.cpp')
-
- if building_on_win32 or sys.platform.startswith('darwin'):
- excludes.append('GlyphMapWx.cpp')
- excludes.append('AuthenticationCF.cpp')
- excludes.append('LoaderRunLoopCF.cpp')
- excludes.append('ResourceErrorCF.cpp')
-
- webcore.find_sources_in_dirs(full_dirs, excludes = excludes, exts=['.c', '.cpp'])
diff --git a/WebCore/xml/XMLHttpRequest.h b/WebCore/xml/XMLHttpRequest.h
index 363fdf8..2947b46 100644
--- a/WebCore/xml/XMLHttpRequest.h
+++ b/WebCore/xml/XMLHttpRequest.h
@@ -21,7 +21,6 @@
#define XMLHttpRequest_h
#include "ActiveDOMObject.h"
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -31,6 +30,7 @@
#include "ThreadableLoaderClient.h"
#include "XMLHttpRequestProgressEventThrottle.h"
#include <wtf/OwnPtr.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/xml/XMLHttpRequestUpload.cpp b/WebCore/xml/XMLHttpRequestUpload.cpp
index 9d0fafc..739082d 100644
--- a/WebCore/xml/XMLHttpRequestUpload.cpp
+++ b/WebCore/xml/XMLHttpRequestUpload.cpp
@@ -26,13 +26,13 @@
#include "config.h"
#include "XMLHttpRequestUpload.h"
-#include "AtomicString.h"
#include "Event.h"
#include "EventException.h"
#include "EventNames.h"
#include "XMLHttpRequest.h"
#include "XMLHttpRequestProgressEvent.h"
#include <wtf/Assertions.h>
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/xml/XMLHttpRequestUpload.h b/WebCore/xml/XMLHttpRequestUpload.h
index 7a605fb..984d86a 100644
--- a/WebCore/xml/XMLHttpRequestUpload.h
+++ b/WebCore/xml/XMLHttpRequestUpload.h
@@ -26,7 +26,6 @@
#ifndef XMLHttpRequestUpload_h
#define XMLHttpRequestUpload_h
-#include "AtomicStringHash.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -36,6 +35,7 @@
#include <wtf/RefPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
+#include <wtf/text/AtomicStringHash.h>
namespace WebCore {
diff --git a/WebCore/xml/XPathExpressionNode.h b/WebCore/xml/XPathExpressionNode.h
index 38070b9..c04d45b 100644
--- a/WebCore/xml/XPathExpressionNode.h
+++ b/WebCore/xml/XPathExpressionNode.h
@@ -29,11 +29,11 @@
#if ENABLE(XPATH)
-#include "StringHash.h"
#include "Node.h"
#include "XPathValue.h"
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
diff --git a/WebCore/xml/XPathFunctions.cpp b/WebCore/xml/XPathFunctions.cpp
index 41bf795..8b4e720 100644
--- a/WebCore/xml/XPathFunctions.cpp
+++ b/WebCore/xml/XPathFunctions.cpp
@@ -477,9 +477,9 @@ Value FunSubstringBefore::evaluate() const
if (s2.isEmpty())
return "";
- int i = s1.find(s2);
+ size_t i = s1.find(s2);
- if (i == -1)
+ if (i == notFound)
return "";
return s1.left(i);
@@ -490,8 +490,8 @@ Value FunSubstringAfter::evaluate() const
String s1 = arg(0)->evaluate().toString();
String s2 = arg(1)->evaluate().toString();
- int i = s1.find(s2);
- if (i == -1)
+ size_t i = s1.find(s2);
+ if (i == notFound)
return "";
return s1.substring(i + s2.length());
@@ -556,11 +556,11 @@ Value FunTranslate::evaluate() const
// FIXME: Building a String a character at a time is quite slow.
for (unsigned i1 = 0; i1 < s1.length(); ++i1) {
UChar ch = s1[i1];
- int i2 = s2.find(ch);
+ size_t i2 = s2.find(ch);
- if (i2 == -1)
+ if (i2 == notFound)
newString += String(&ch, 1);
- else if ((unsigned)i2 < s3.length()) {
+ else if (i2 < s3.length()) {
UChar c2 = s3[i2];
newString += String(&c2, 1);
}
@@ -608,8 +608,8 @@ Value FunLang::evaluate() const
return true;
// Remove suffixes one by one.
- int index = langValue.reverseFind('-');
- if (index == -1)
+ size_t index = langValue.reverseFind('-');
+ if (index == notFound)
break;
langValue = langValue.left(index);
}
diff --git a/WebCore/xml/XPathNamespace.h b/WebCore/xml/XPathNamespace.h
index 996cb9a..c34eeef 100644
--- a/WebCore/xml/XPathNamespace.h
+++ b/WebCore/xml/XPathNamespace.h
@@ -29,8 +29,8 @@
#if ENABLE(XPATH)
-#include "AtomicString.h"
#include "Node.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
diff --git a/WebCore/xml/XPathParser.cpp b/WebCore/xml/XPathParser.cpp
index 5501df1..20e7590 100644
--- a/WebCore/xml/XPathParser.cpp
+++ b/WebCore/xml/XPathParser.cpp
@@ -31,12 +31,12 @@
#if ENABLE(XPATH)
#include "ExceptionCode.h"
-#include "StringHash.h"
#include "XPathEvaluator.h"
#include "XPathException.h"
#include "XPathNSResolver.h"
#include "XPathStep.h"
#include <wtf/StdLibExtras.h>
+#include <wtf/text/StringHash.h>
int xpathyyparse(void*);
@@ -453,8 +453,8 @@ int Parser::lex(void* data)
bool Parser::expandQName(const String& qName, String& localName, String& namespaceURI)
{
- int colon = qName.find(':');
- if (colon >= 0) {
+ size_t colon = qName.find(':');
+ if (colon != notFound) {
if (!m_resolver)
return false;
namespaceURI = m_resolver->lookupNamespaceURI(qName.left(colon));
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index 7e07ee3..6e149a1 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -100,11 +100,11 @@ static inline RefPtr<DocumentFragment> createFragmentFromSource(const String& so
RefPtr<DocumentFragment> fragment = outputDoc->createDocumentFragment();
if (sourceMIMEType == "text/html")
- fragment->parseHTML(sourceString, outputDoc->documentElement());
+ fragment->parseHTML(sourceString, 0);
else if (sourceMIMEType == "text/plain")
- fragment->legacyParserAddChild(Text::create(outputDoc, sourceString));
+ fragment->parserAddChild(Text::create(outputDoc, sourceString));
else {
- bool successfulParse = fragment->parseXML(sourceString, outputDoc->documentElement());
+ bool successfulParse = fragment->parseXML(sourceString, 0);
if (!successfulParse)
return 0;
}
diff --git a/WebCore/xml/XSLTProcessor.h b/WebCore/xml/XSLTProcessor.h
index 9b91017..5be6b17 100644
--- a/WebCore/xml/XSLTProcessor.h
+++ b/WebCore/xml/XSLTProcessor.h
@@ -26,9 +26,9 @@
#if ENABLE(XSLT)
#include "Node.h"
-#include "StringHash.h"
#include "XSLStyleSheet.h"
#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
#if !USE(QXMLQUERY)
#include <libxml/parserInternals.h>
diff --git a/WebKit/CMakeLists.txt b/WebKit/CMakeLists.txt
index 3fee2c6..379c8e4 100644
--- a/WebKit/CMakeLists.txt
+++ b/WebKit/CMakeLists.txt
@@ -66,8 +66,12 @@ ADD_DEFINITIONS(-DBUILDING_WebKit)
INCLUDE_DIRECTORIES(${WebKit_INCLUDE_DIRECTORIES})
ADD_LIBRARY(${WebKit_LIBRARY_NAME} ${WebKit_LIBRARY_TYPE} ${WebKit_SOURCES})
TARGET_LINK_LIBRARIES(${WebKit_LIBRARY_NAME} ${WebKit_LIBRARIES})
-ADD_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} LINK_FLAGS "${WebKit_LINK_FLAGS}")
-SET_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
-INSTALL(TARGETS ${WebKit_LIBRARY_NAME} DESTINATION lib)
+IF (WebKit_LINK_FLAGS)
+ ADD_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} LINK_FLAGS "${WebKit_LINK_FLAGS}")
+ENDIF ()
+IF (SHARED_CORE)
+ SET_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
+ INSTALL(TARGETS ${WebKit_LIBRARY_NAME} DESTINATION lib)
+ENDIF ()
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 92976db..c7858fb 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,54 @@
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * WebKit.xcodeproj/project.pbxproj: Added new files.
+
+2010-08-17 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove developmentRegion from the project file as it shouldn't have been checked in.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2010-08-16 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Build fix after r65366.
+
+ * CMakeLists.txt: Use if (VAR) instead of if (${VAR}) to check if
+ they're empty.
+
+2010-08-14 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: -[WebInspector attach] and detach should work
+ https://bugs.webkit.org/show_bug.cgi?id=43924
+
+ * WebKit.xcodeproj/project.pbxproj: Added WebInspectorFrontend.{h,mm}.
+
+2010-08-14 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [CMake] Set target properties only if available
+ https://bugs.webkit.org/show_bug.cgi?id=43978
+
+ * CMakeLists.txt:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+ Switch String::/UString::ascii() to return a CString.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index bad03b6..b76bd24 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -139,6 +139,8 @@
934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */; };
936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */; };
936A2DEA0FD2D08400D312DB /* WebTextCompletionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */; };
+ 9391F275121B38BD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391F273121B38BD00EBF7E8 /* WebFrameNetworkingContext.h */; };
+ 9391F276121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9391F274121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm */; };
939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; };
939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; };
939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -329,6 +331,8 @@
ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; };
B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */; };
B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = B804176D1217A83100466BAE /* WebInspectorFrontend.h */; };
+ B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */ = {isa = PBXBuildFile; fileRef = B804176E1217A83100466BAE /* WebInspectorFrontend.mm */; };
BC26C69E10B743F400B687ED /* WebSerializedJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC26C69D10B743F400B687ED /* WebSerializedJSValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC26C6A510B7447A00B687ED /* WebSerializedJSValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC26C6A410B7447A00B687ED /* WebSerializedJSValue.mm */; };
BC2E464D0FD8A96800A9D9DE /* WebViewData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E464B0FD8A96800A9D9DE /* WebViewData.h */; };
@@ -596,6 +600,8 @@
934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceInternal.h; sourceTree = "<group>"; };
936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTextCompletionController.mm; sourceTree = "<group>"; };
936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextCompletionController.h; sourceTree = "<group>"; };
+ 9391F273121B38BD00EBF7E8 /* WebFrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameNetworkingContext.h; sourceTree = "<group>"; };
+ 9391F274121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; };
939811320824BF01008DF038 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 1; };
939811330824BF01008DF038 /* WebKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
93AEB17D032C1735008635CE /* WebKitLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitLogging.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -625,6 +631,8 @@
ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebApplicationCache.h; sourceTree = "<group>"; };
B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebApplicationCache.mm; sourceTree = "<group>"; };
+ B804176D1217A83100466BAE /* WebInspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorFrontend.h; sourceTree = "<group>"; };
+ B804176E1217A83100466BAE /* WebInspectorFrontend.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorFrontend.mm; sourceTree = "<group>"; };
BC26C69D10B743F400B687ED /* WebSerializedJSValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedJSValue.h; sourceTree = "<group>"; };
BC26C6A410B7447A00B687ED /* WebSerializedJSValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSerializedJSValue.mm; sourceTree = "<group>"; };
BC2E464B0FD8A96800A9D9DE /* WebViewData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewData.h; sourceTree = "<group>"; };
@@ -871,6 +879,8 @@
5D7BF8120C2A1D90008CE06D /* WebInspector.h */,
5D7BF8130C2A1D90008CE06D /* WebInspector.mm */,
7A8FF0D01075024A00A80A08 /* WebInspectorPrivate.h */,
+ B804176D1217A83100466BAE /* WebInspectorFrontend.h */,
+ B804176E1217A83100466BAE /* WebInspectorFrontend.mm */,
1C68F663095B5FC100C2984E /* WebNodeHighlight.h */,
1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */,
1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */,
@@ -1254,6 +1264,8 @@
4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */,
931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */,
931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */,
+ 9391F273121B38BD00EBF7E8 /* WebFrameNetworkingContext.h */,
+ 9391F274121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm */,
BC7F884910C8775A00D6133D /* WebGeolocationControllerClient.h */,
BC7F884A10C8775A00D6133D /* WebGeolocationControllerClient.mm */,
51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */,
@@ -1575,6 +1587,8 @@
A5DEFC0F11D5343E00885273 /* WebDatabaseQuotaManager.h in Headers */,
A5DEFC1311D5344B00885273 /* WebApplicationCacheQuotaManager.h in Headers */,
A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */,
+ B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */,
+ 9391F275121B38BD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1616,7 +1630,6 @@
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
compatibilityVersion = "Xcode 2.4";
- developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -1937,6 +1950,8 @@
A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */,
A5DEFC1011D5343E00885273 /* WebDatabaseQuotaManager.mm in Sources */,
A5DEFC1411D5344B00885273 /* WebApplicationCacheQuotaManager.mm in Sources */,
+ B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */,
+ 9391F276121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 1486694..0a07733 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,651 @@
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js with generated one.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * WebKit.gyp:
+
+2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65238.
+ http://trac.webkit.org/changeset/65238
+ https://bugs.webkit.org/show_bug.cgi?id=44168
+
+ Check if clobbering chromium bot fixes the layout test
+ failures (Requested by hamaji on #webkit).
+
+ * public/WebFrameClient.h:
+ (WebKit::WebFrameClient::frameDetached):
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+
+2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65595.
+ http://trac.webkit.org/changeset/65595
+ https://bugs.webkit.org/show_bug.cgi?id=44161
+
+ qt build failed (Requested by loislo on #webkit).
+
+ * WebKit.gyp:
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js by generated one.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * WebKit.gyp:
+
+2010-08-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Chromium DevTools: Support runtime property name/value pairs
+ instead of feature names as navigation state.
+ https://bugs.webkit.org/show_bug.cgi?id=44054
+
+ * public/WebDevToolsAgent.h:
+ * public/WebDevToolsAgentClient.h:
+ (WebKit::WebDevToolsAgentClient::runtimePropertyChanged):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::setRuntimeProperty):
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+ * src/WebDevToolsAgentImpl.h:
+
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * WebKit.gyp: Added new files.
+ * src/FrameNetworkingContextImpl.h: Added.
+ Placeholder with tentative code that might be changed when landing
+ the rest of it.
+
+2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65516.
+ http://trac.webkit.org/changeset/65516
+ https://bugs.webkit.org/show_bug.cgi?id=44126
+
+ broke chromium unit tests on mac and linux (Requested by
+ johnny_g on #webkit).
+
+ * WebKit.gyp:
+ * src/WebFrameImpl.cpp:
+ (WebKit::frameContentAsPlainText):
+ * tests/RunAllTests.cpp:
+ (main):
+ * tests/WebFrameTest.cpp: Removed.
+
+2010-08-17 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Made WebFrame not report the text from hidden frames.
+ (some pages contain hidden frames with garbage text that
+ should not be indexed or used to detect the page's language).
+ https://bugs.webkit.org/show_bug.cgi?id=39456
+
+ * WebKit.gyp:
+ * public/WebCString.h:
+ (WebKit::operator<):
+ * public/WebURL.h:
+ (WebKit::operator<):
+ * src/WebCString.cpp:
+ (WebKit::WebCString::compare):
+ * src/WebFrameImpl.cpp:
+ (WebKit::frameContentAsPlainText):
+ * tests/RunAllTests.cpp:
+ (main):
+ * tests/WebFrameTest.cpp: Added.
+
+2010-08-17 Kelly Norton <knorton@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Fixes a crash in addTimelineRecord when InspectorTimelineAgent
+ is enabled through WebDevToolsAgentImpl::setApuEnabled.
+ https://bugs.webkit.org/show_bug.cgi?id=44105
+
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+
+2010-08-17 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: upstream Chromium debugger step tests
+ https://bugs.webkit.org/show_bug.cgi?id=44106
+
+ * src/js/Tests.js:
+
+2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65500.
+ http://trac.webkit.org/changeset/65500
+ https://bugs.webkit.org/show_bug.cgi?id=44108
+
+ Qt bots failed to compile. (Requested by loislo on #webkit).
+
+ * WebKit.gyp:
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js by generated one.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * WebKit.gyp:
+
+2010-08-17 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: upstream Chromium console tests and remove a couple
+ of tests that have already been covered with layout tests.
+ https://bugs.webkit.org/show_bug.cgi?id=44057
+
+ * src/js/Tests.js:
+ (.TestSuite.prototype.testConsoleEval):
+ (.TestSuite.prototype.testConsoleLog):
+ (.TestSuite.prototype.testEvalGlobal):
+
+2010-08-16 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed; attempt to fix Chromium Windows build.
+
+ * public/WebFileUtilities.h:
+
+2010-08-16 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ [chromium] Prepare to rename WebFileSystem interface to WebFileUtilities
+ https://bugs.webkit.org/show_bug.cgi?id=44077
+
+ We are going to have an implementation for HTML5 FileSystem API and
+ it would probably be less confusing to use the name "WebFileSystem"
+ for an WebKit API for the HTML5 API.
+
+ This patch adds WebFileUtilities interface that is meant to replace
+ the existing WebFileSystem.
+
+ * WebKit.gyp:
+ * public/WebFileSystem.h:
+ * public/WebFileUtilities.h: Added.
+ * public/WebKitClient.h:
+ (WebKit::WebKitClient::fileUtilities): Added.
+ * src/ChromiumBridge.cpp:
+ (WebCore::ChromiumBridge::fileExists):
+ (WebCore::ChromiumBridge::deleteFile):
+ (WebCore::ChromiumBridge::deleteEmptyDirectory):
+ (WebCore::ChromiumBridge::getFileSize):
+ (WebCore::ChromiumBridge::getFileModificationTime):
+ (WebCore::ChromiumBridge::directoryName):
+ (WebCore::ChromiumBridge::pathByAppendingComponent):
+ (WebCore::ChromiumBridge::makeAllDirectories):
+ (WebCore::ChromiumBridge::getAbsolutePath):
+ (WebCore::ChromiumBridge::isDirectory):
+ (WebCore::ChromiumBridge::filePathToURL):
+ (WebCore::ChromiumBridge::openFile):
+ (WebCore::ChromiumBridge::closeFile):
+ (WebCore::ChromiumBridge::seekFile):
+ (WebCore::ChromiumBridge::truncateFile):
+ (WebCore::ChromiumBridge::readFromFile):
+ (WebCore::ChromiumBridge::writeToFile):
+
+2010-08-16 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, build fix.
+
+ Don't include TilingDataTest.cpp, since it doesn't
+ compile on mac.
+
+ * WebKit.gyp:
+
+2010-08-16 James Robinson <jamesr@chromium.org>
+
+ Compile fix. Fix up paintsIntoCanvasBuffer impl.
+
+ * src/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):
+
+2010-08-16 Vincent Scheib <scheib@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Canvas2D does not support images larger than system's GPU max texture size
+ https://bugs.webkit.org/show_bug.cgi?id=43864
+
+ Unit tests for TilingData class.
+
+ * WebKit.gyp:
+ * tests/TilingDataTest.cpp: Added.
+ (WebCore::TEST):
+
+2010-08-16 Alex Milowski <alex@milowski.com>
+
+ Reviewed by David Levin.
+
+ Added the ENABLE_MATHML=1 to the feature_defines.
+
+ * features.gypi:
+
+2010-08-16 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Implements IDBKeyPath extractor.
+ https://bugs.webkit.org/show_bug.cgi?id=43276
+
+ Unit-test IDBKeyPathExtractorTest.cpp.
+ LayoutTests will arrive as IndexedDB infrastructure is fleshed out.
+
+
+ * WebKit.gyp:
+ * public/WebIDBKey.h:
+ * public/WebIDBKeyPath.h: Added.
+ (WebKit::WebIDBKeyPath::WebIDBKeyPath):
+ (WebKit::WebIDBKeyPath::~WebIDBKeyPath):
+ * public/WebPrivateOwnPtr.h: Added.
+ (WebKit::WebPrivateOwnPtr::WebPrivateOwnPtr):
+ (WebKit::WebPrivateOwnPtr::~WebPrivateOwnPtr):
+ (WebKit::WebPrivateOwnPtr::reset):
+ (WebKit::WebPrivateOwnPtr::get):
+ (WebKit::WebPrivateOwnPtr::operator->):
+ * src/WebIDBKey.cpp:
+ (WebKit::WebIDBKey::createFromValueAndKeyPath):
+ * src/WebIDBKeyPath.cpp: Added.
+ (WebKit::WebIDBKeyPath::create):
+ (WebKit::WebIDBKeyPath::WebIDBKeyPath):
+ (WebKit::WebIDBKeyPath::parseError):
+ (WebKit::WebIDBKeyPath::assign):
+ (WebKit::WebIDBKeyPath::reset):
+ (WebKit::WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&):
+ * tests/IDBBindingUtilitiesTest.cpp: Added.
+ (WebCore::LocalContext::LocalContext):
+ (WebCore::LocalContext::~LocalContext):
+ (WebCore::checkKeyFromValueAndKeyPathInternal):
+ (WebCore::checkKeyPathNullValue):
+ (WebCore::checkKeyPathStringValue):
+ (WebCore::checkKeyPathNumberValue):
+ (WebCore::TEST):
+
+2010-07-28 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Implement IDBKeyPath parser.
+ https://bugs.webkit.org/show_bug.cgi?id=42976
+
+ IDBKeyPath is an internal class, exposed only for unit tests for now.
+ It'll allow indexed database implementation to traverse a given key path and obtain the corresponding properties
+ from a SerializedScriptValue.
+
+ * WebKit.gyp:
+ * tests/IDBKeyPathTest.cpp: Added.
+ (WebCore::ExpectedToken::ExpectedToken):
+ (WebCore::checkKeyPath):
+ (WebCore::TEST):
+
+2010-08-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: upstream frontend-side WebSocket transport.
+ https://bugs.webkit.org/show_bug.cgi?id=43970
+
+ Chromium already has an alternate WebSocket-based communication channel with
+ the backend. Upstreaming it in this change. We will agree on the URI
+ of the remote service as the protocol matures.
+
+ * src/WebDevToolsFrontendImpl.cpp:
+ (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend):
+ * src/js/DevTools.js:
+ (WebInspector.loaded):
+ (devtools.domContentLoaded):
+
+2010-08-16 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove utility context related code from debugger agent
+ https://bugs.webkit.org/show_bug.cgi?id=44049
+
+ * src/DebuggerAgentManager.cpp:
+ (WebKit::DebuggerAgentManager::onV8DebugMessage):
+ (WebKit::DebuggerAgentManager::pauseScript):
+ * src/DebuggerAgentManager.h:
+
+2010-08-16 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Attempt to fix Chromium's test_shell_tests.
+
+ Port Chromium's WebEntities to HTMLEntityTable
+ https://bugs.webkit.org/show_bug.cgi?id=44036
+
+ * src/WebEntities.cpp:
+ (WebKit::):
+
+2010-08-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Port Chromium's WebEntities to HTMLEntityTable
+ https://bugs.webkit.org/show_bug.cgi?id=44036
+
+ This code is wrong and needs to be removed. However, at least after
+ this patch, it will compile.
+
+ * src/WebEntities.cpp:
+ (WebKit::):
+ (WebKit::WebEntities::WebEntities):
+ * src/WebEntities.h:
+
+2010-08-13 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Support for multiple speech enabled elements in same page.
+ https://bugs.webkit.org/show_bug.cgi?id=43922
+
+ * public/WebSpeechInputController.h: Bubbles up the requestId given by webcore to the embedder.
+ (WebKit::WebSpeechInputController::startRecognition):
+ (WebKit::WebSpeechInputController::cancelRecognition):
+ (WebKit::WebSpeechInputController::stopRecording):
+ * public/WebSpeechInputListener.h: Passes down the requestId given by embedder to webcore.
+ (WebKit::WebSpeechInputListener::didCompleteRecording):
+ (WebKit::WebSpeechInputListener::setRecognitionResult):
+ (WebKit::WebSpeechInputListener::didCompleteRecognition):
+ * src/SpeechInputClientImpl.cpp:
+ (WebKit::SpeechInputClientImpl::setListener):
+ (WebKit::SpeechInputClientImpl::startRecognition):
+ (WebKit::SpeechInputClientImpl::stopRecording):
+ (WebKit::SpeechInputClientImpl::cancelRecognition):
+ (WebKit::SpeechInputClientImpl::didCompleteRecording):
+ (WebKit::SpeechInputClientImpl::didCompleteRecognition):
+ (WebKit::SpeechInputClientImpl::setRecognitionResult):
+ * src/SpeechInputClientImpl.h:
+ * src/WebSpeechInputControllerMockImpl.cpp:
+ (WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl):
+ (WebKit::WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl):
+ (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording):
+ (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition):
+ (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult):
+ (WebKit::WebSpeechInputControllerMockImpl::startRecognition):
+ (WebKit::WebSpeechInputControllerMockImpl::cancelRecognition):
+ (WebKit::WebSpeechInputControllerMockImpl::stopRecording):
+ * src/WebSpeechInputControllerMockImpl.h:
+
+2010-08-12 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: allow interrupting long running JS to execute inspector command
+ https://bugs.webkit.org/show_bug.cgi?id=43900
+
+ * public/WebDevToolsAgent.h:
+ (WebKit::WebDevToolsAgent::MessageDescriptor::~MessageDescriptor):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgent::interruptAndDispatch):
+ (WebKit::WebDevToolsAgent::shouldInterruptForMessage):
+ (WebKit::WebDevToolsAgent::processPendingMessages):
+ * src/WebDevToolsFrontendImpl.cpp:
+ (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+ * src/WebDevToolsFrontendImpl.h:
+ * src/js/DevTools.js:
+
+2010-08-12 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Make the cascade level of "user" styles configurable
+ https://bugs.webkit.org/show_bug.cgi?id=43457
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::addUserStyleSheet):
+
+2010-08-12 John Gregg <johnnyg@google.com>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] Add Notification::detachPresenter to the WebKit API.
+ https://bugs.webkit.org/show_bug.cgi?id=43659
+
+ * public/WebNotification.h:
+ * src/WebNotification.cpp:
+ (WebKit::WebNotification::detachPresenter):
+
+2010-08-11 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add support for BGRA pixel format to GraphicsContext3D.
+ https://bugs.webkit.org/show_bug.cgi?id=43858
+
+ Although this has been standard in desktop GL since 1.2, it's an
+ extension in GL ES 2.0, so a query function is provided to check
+ for support. The DefaultImpl returns false, since it does not yet
+ implement the TexImage2D internalFormat quirks.
+
+ * public/WebGraphicsContext3D.h:
+ (WebKit::WebGraphicsContext3D::supportsBGRA):
+ * src/GraphicsContext3D.cpp:
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::supportsBGRA):
+ * src/WebGraphicsContext3DDefaultImpl.h:
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65181.
+ http://trac.webkit.org/changeset/65181
+ https://bugs.webkit.org/show_bug.cgi?id=43909
+
+ It broke 35 layout tests fail on chromium-win (Requested by
+ hamaji on #webkit).
+
+ * public/WebFrameClient.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65221.
+ http://trac.webkit.org/changeset/65221
+ https://bugs.webkit.org/show_bug.cgi?id=43896
+
+ Broke snow leopard build. (Requested by dave_levin on
+ #webkit).
+
+ * public/WebGraphicsContext3D.h:
+ * src/GraphicsContext3D.cpp:
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ * src/WebGraphicsContext3DDefaultImpl.h:
+
+2010-08-11 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add support for BGRA pixel format to GraphicsContext3D.
+ https://bugs.webkit.org/show_bug.cgi?id=43858
+
+ Although this has been standard in desktop GL since 1.2, it's an
+ extension in GL ES 2.0, so a query function is provided to check
+ for support. The DefaultImpl returns false, since it does not yet
+ implement the TexImage2D internalFormat quirks.
+
+ * public/WebGraphicsContext3D.h:
+ (WebKit::WebGraphicsContext3D::supportsBGRA):
+ * src/GraphicsContext3D.cpp:
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::supportsBGRA):
+ * src/WebGraphicsContext3DDefaultImpl.h:
+
+2010-08-11 James Hawkins <jhawkins@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ [Chromium] Notify the WebFrameClient when the frame is detached from
+ the view. This is used to clear the cached frame in the FormManager.
+ Eventually this will be removed once handling forms is moved into
+ WebCore.
+ https://bugs.webkit.org/show_bug.cgi?id=43648
+
+ * public/WebFrameClient.h:
+ (WebKit::WebFrameClient::frameDetached):
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::detachedFromParent3):
+
+2010-08-11 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Build fix, turn off yet-unbaked DEVICE_ORIENTATION stuff.
+
+ * features.gypi: Turned it off.
+
+2010-08-11 Evan Stade <estade@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] linux chromium sends double clicks too often
+ https://bugs.webkit.org/show_bug.cgi?id=43096
+
+ * WebKit.gyp: add the test
+ * src/gtk/WebInputEventFactory.cpp:
+ (WebKit::WebInputEventFactory::mouseEvent): check the x/y coordinates of the
+ potential double click event
+ * tests/WebInputEventFactoryTestGtk.cpp: Added.
+
+2010-08-11 John Abd-El-Malek <jam@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] Inform a plugin about the zoom level when it's created
+ https://bugs.webkit.org/show_bug.cgi?id=42268
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::createPlugin):
+
+2010-08-11 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Fix Chromium compilation.
+
+ * DEPS:
+
+2010-08-11 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed. Chromium build fix.
+
+ * DEPS: bump up Chromium revision.
+
+2010-08-11 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove InjectDispatch.js
+ https://bugs.webkit.org/show_bug.cgi?id=43835
+
+ * WebKit.grd:
+ * src/js/InjectDispatch.js: Removed.
+
+2010-08-10 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, build fix.
+
+ Chromium build fix for r65107.
+
+ * src/WebAnimationControllerImpl.cpp:
+ (WebKit::WebAnimationControllerImpl::suspendAnimations):
+ (WebKit::WebAnimationControllerImpl::resumeAnimations):
+
+2010-08-10 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Roll forward Chromium DEPS to r55584
+ https://bugs.webkit.org/show_bug.cgi?id=43811
+
+ * DEPS:
+
+2010-08-10 Kavita Kanetkar <kkanetkar@chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: Support appcache status change for Chrome
+ https://bugs.webkit.org/show_bug.cgi?id=43531
+
+ * src/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::notifyDOMApplicationCache):
+
+2010-08-10 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Use Chromium OpenGL bindings rather than GLEW in WebGraphicsContextDefaultImpl
+ https://bugs.webkit.org/show_bug.cgi?id=43754
+
+ Deleted per-platform OpenGL context management code, now
+ abstracted via GLContext. Built and tested in Chromium with
+ --in-process-webgl flag.
+
+ * WebKit.gyp:
+ * src/GraphicsContext3D.cpp:
+ * src/WebGraphicsContext3DDefaultImpl.cpp:
+ (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+ (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+ (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+ (WebKit::WebGraphicsContext3DDefaultImpl::validateAttributes):
+ (WebKit::WebGraphicsContext3DDefaultImpl::makeContextCurrent):
+ (WebKit::WebGraphicsContext3DDefaultImpl::reshape):
+ (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer):
+ (WebKit::WebGraphicsContext3DDefaultImpl::copyTexImage2D):
+ (WebKit::WebGraphicsContext3DDefaultImpl::copyTexSubImage2D):
+ (WebKit::WebGraphicsContext3DDefaultImpl::readPixels):
+ (WebKit::WebGraphicsContext3DDefaultImpl::createBuffer):
+ (WebKit::WebGraphicsContext3DDefaultImpl::deleteBuffer):
+ * src/WebGraphicsContext3DDefaultImpl.h:
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ Another chromium build fix.
+
+ * src/AssertMatchingEnums.cpp:
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Bug 43786 - Move AtomicStringHash from WebCore to WTF
+ Also remove deprecated string headers from WebCore/platform/text.
+
+ * src/WebKit.cpp:
+ * src/WebPageSerializerImpl.h:
+ * src/WebString.cpp:
+
+2010-08-10 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Feature defines are out of sync between features.gypi and downstream feature_overrides.gypi
+ https://bugs.webkit.org/show_bug.cgi?id=43756
+
+ This synchronizes the feature defines to what's currently downstream (at r55468).
+ The difference between the build.webkit.org bots and the chromium bots has
+ caused strange compilation failures lately.
+
+ * features.gypi:
+
2010-08-10 Yury Semikhatsky <yurys@chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index d7afc77..b517e28 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': '54723',
+ 'chromium_rev': '55695',
}
deps = {
diff --git a/WebKit/chromium/WebKit.grd b/WebKit/chromium/WebKit.grd
index 1f80034..92ee008 100644
--- a/WebKit/chromium/WebKit.grd
+++ b/WebKit/chromium/WebKit.grd
@@ -10,7 +10,6 @@
<release seq="1">
<includes>
<include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="src\js\DebuggerScript.js" type="BINDATA"/>
- <include name="IDR_DEVTOOLS_INJECT_DISPATCH_JS" file="src\js\InjectDispatch.js" type="BINDATA"/>
<include name="IDR_DEVTOOLS_INJECT_WEBKIT_JS" file="..\..\WebCore\inspector\front-end\InjectedScript.js" type="BINDATA"/>
</includes>
</release>
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index eb5abbe..d12bee7 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -87,6 +87,7 @@
'msvs_guid': '5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65',
'dependencies': [
'../../WebCore/WebCore.gyp/WebCore.gyp:webcore',
+ '<(chromium_src_dir)/app/app.gyp:app_base', # For GLContext
'<(chromium_src_dir)/skia/skia.gyp:skia',
'<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
],
@@ -157,6 +158,7 @@
'public/WebFileChooserParams.h',
'public/WebFileInfo.h',
'public/WebFileSystem.h',
+ 'public/WebFileUtilities.h',
'public/WebFindOptions.h',
'public/WebFloatPoint.h',
'public/WebFloatRect.h',
@@ -185,6 +187,7 @@
'public/WebIDBKeyRange.h',
'public/WebIDBIndex.h',
'public/WebIDBKey.h',
+ 'public/WebIDBKeyPath.h',
'public/WebIDBObjectStore.h',
'public/WebInputElement.h',
'public/WebInputEvent.h',
@@ -224,6 +227,7 @@
'public/WebPopupMenuInfo.h',
'public/WebPopupType.h',
'public/WebPrivatePtr.h',
+ 'public/WebPrivateOwnPtr.h',
'public/WebRange.h',
'public/WebRect.h',
'public/WebRegularExpression.h',
@@ -314,9 +318,11 @@
'src/EventListenerWrapper.h',
'src/FrameLoaderClientImpl.cpp',
'src/FrameLoaderClientImpl.h',
+ 'src/FrameNetworkingContextImpl.h',
'src/GLES2Context.cpp',
'src/GLES2ContextInternal.cpp',
'src/GLES2ContextInternal.h',
+ 'src/GraphicsContext3D.cpp',
'src/gtk/WebFontInfo.cpp',
'src/gtk/WebFontInfo.h',
'src/gtk/WebInputEventFactory.cpp',
@@ -428,6 +434,7 @@
'src/WebIDBIndexImpl.cpp',
'src/WebIDBIndexImpl.h',
'src/WebIDBKey.cpp',
+ 'src/WebIDBKeyPath.cpp',
'src/WebIDBKeyRange.cpp',
'src/WebIDBObjectStoreImpl.cpp',
'src/WebIDBObjectStoreImpl.h',
@@ -592,18 +599,6 @@
'sources/': [['exclude', '/win/']],
}],
['"ENABLE_3D_CANVAS=1" in feature_defines', {
- # Conditionally compile in GLEW and our GraphicsContext3D implementation.
- 'sources+': [
- 'src/GraphicsContext3D.cpp',
- '<(chromium_src_dir)/third_party/glew/src/glew.c'
- ],
- 'include_dirs+': [
- '<(chromium_src_dir)/third_party/glew/include'
- ],
- 'defines+': [
- 'GLEW_STATIC=1',
- 'GLEW_NO_GLU=1',
- ],
'conditions': [
['OS=="mac"', {
'link_settings': {
@@ -620,7 +615,10 @@
{
'target_name': 'inspector_resources',
'type': 'none',
- 'dependencies': ['devtools_html'],
+ 'dependencies': [
+ 'devtools_html',
+ '../../WebCore/WebCore.gyp/WebCore.gyp:inspector_protocol_sources',
+ ],
'conditions': [
['debug_devtools==0', {
'dependencies': ['concatenated_devtools_js'],
@@ -632,6 +630,7 @@
'files': [
'<@(devtools_files)',
'<@(webinspector_files)',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
],
'conditions': [
['debug_devtools==0', {
@@ -678,10 +677,12 @@
'<@(_input_page)',
'<@(webinspector_files)',
'<@(devtools_files)',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
],
'search_path': [
'../../WebCore/inspector/front-end',
'src/js',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore',
'<(chromium_src_dir)/v8/tools',
],
'outputs': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'],
@@ -713,9 +714,13 @@
],
'sources': [
'tests/DragImageTest.cpp',
+ 'tests/IDBBindingUtilitiesTest.cpp',
+ 'tests/IDBKeyPathTest.cpp',
'tests/KeyboardTest.cpp',
'tests/KURLTest.cpp',
'tests/RunAllTests.cpp',
+ # FIXME: This test is compile failing on mac.
+ # 'tests/TilingDataTest.cpp',
],
'conditions': [
['OS=="win"', {
@@ -732,6 +737,14 @@
'tests/DragImageTest.cpp',
],
}],
+ ['OS=="linux"', {
+ 'sources': [
+ 'tests/WebInputEventFactoryTestGtk.cpp',
+ ],
+ 'include_dirs': [
+ 'public/gtk',
+ ],
+ }],
],
}],
],
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index 9b758f9..e3092b3 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -38,27 +38,28 @@
# WARNING: build/features_override.gypi which is included in a full
# chromium build, overrides this list with its own values. See
# features_override.gypi inline documentation for more details.
- 'feature_defines%': [
+ 'feature_defines': [
'ENABLE_3D_CANVAS=1',
'ENABLE_BLOB=1',
+ 'ENABLE_BLOB_SLICE=1',
'ENABLE_CHANNEL_MESSAGING=1',
'ENABLE_DASHBOARD_SUPPORT=0',
'ENABLE_DATABASE=1',
'ENABLE_DATAGRID=0',
- 'ENABLE_DEVICE_ORIENTATION=1',
+ 'ENABLE_DEVICE_ORIENTATION=0',
'ENABLE_DIRECTORY_UPLOAD=1',
'ENABLE_DOM_STORAGE=1',
'ENABLE_EVENTSOURCE=1',
- 'ENABLE_FILE_WRITER=1',
- 'ENABLE_FILE_SYSTEM=1',
+ 'ENABLE_FILE_READER=1',
'ENABLE_FILTERS=1',
'ENABLE_GEOLOCATION=1',
'ENABLE_ICONDATABASE=0',
- 'ENABLE_IMAGE_RESIZER=0',
'ENABLE_INDEXED_DATABASE=1',
'ENABLE_INPUT_SPEECH=1',
'ENABLE_JAVASCRIPT_DEBUGGER=1',
'ENABLE_JSC_MULTIPLE_THREADS=0',
+ 'ENABLE_LINK_PREFETCH=1',
+ 'ENABLE_MATHML=0',
'ENABLE_METER_TAG=1',
'ENABLE_NOTIFICATIONS=1',
'ENABLE_OFFLINE_WEB_APPLICATIONS=1',
@@ -75,16 +76,24 @@
'ENABLE_SVG_FOREIGN_OBJECT=1',
'ENABLE_SVG_USE=1',
'ENABLE_TOUCH_EVENTS=1',
+ 'ENABLE_V8_SCRIPT_DEBUG_SERVER=1',
'ENABLE_VIDEO=1',
'ENABLE_WEB_SOCKETS=1',
'ENABLE_WEB_TIMING=1',
'ENABLE_WORKERS=1',
- 'ENABLE_XHTMLMP=0',
'ENABLE_XPATH=1',
'ENABLE_XSLT=1',
- 'WTF_USE_ACCELERATED_COMPOSITING=0',
],
-
+
+ 'conditions': [
+ ['OS=="win" or OS=="linux"', {
+ 'feature_defines': [
+ 'WTF_USE_ACCELERATED_COMPOSITING=1',
+ 'ENABLE_3D_RENDERING=1',
+ ],
+ }],
+ ],
+
'use_accelerated_compositing%': 0,
'enable_svg%': 1,
},
diff --git a/WebKit/chromium/public/WebAnimationController.h b/WebKit/chromium/public/WebAnimationController.h
index d727d70..0d3fcf5 100644
--- a/WebKit/chromium/public/WebAnimationController.h
+++ b/WebKit/chromium/public/WebAnimationController.h
@@ -51,6 +51,8 @@ public:
double time) = 0;
WEBKIT_API virtual unsigned numberOfActiveAnimations() const = 0;
+ WEBKIT_API virtual void suspendAnimations() const = 0;
+ WEBKIT_API virtual void resumeAnimations() const = 0;
protected:
~WebAnimationController() { }
};
diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h
index 4fd1cbd..a355a0f 100644
--- a/WebKit/chromium/public/WebDevToolsAgent.h
+++ b/WebKit/chromium/public/WebDevToolsAgent.h
@@ -60,6 +60,7 @@ public:
virtual void inspectElementAt(const WebPoint&) = 0;
virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled) = 0;
+ virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0;
// Exposed for LayoutTestController.
virtual void evaluateInWebInspector(long callId, const WebString& script) = 0;
@@ -73,6 +74,17 @@ public:
// Asynchronously request debugger to pause immediately.
WEBKIT_API static void debuggerPauseScript();
+ class MessageDescriptor {
+ public:
+ virtual ~MessageDescriptor() { }
+ virtual WebDevToolsAgent* agent() = 0;
+ virtual WebString message() = 0;
+ };
+ // Asynchronously request debugger to pause immediately and run the command.
+ WEBKIT_API static void interruptAndDispatch(MessageDescriptor*);
+ WEBKIT_API static bool shouldInterruptForMessage(const WebString&);
+ WEBKIT_API static void processPendingMessages();
+
typedef void (*MessageLoopDispatchHandler)();
// Installs dispatch handle that is going to be called periodically
diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h
index ec013ac..386bd08 100644
--- a/WebKit/chromium/public/WebDevToolsAgentClient.h
+++ b/WebKit/chromium/public/WebDevToolsAgentClient.h
@@ -51,7 +51,7 @@ public:
virtual int hostIdentifier() { return -1; }
// Notifies host upon runtime feature being enabled/disabled.
- virtual void runtimeFeatureStateChanged(const WebString& feature, bool enabled) { }
+ virtual void runtimePropertyChanged(const WebString& name, const WebString& value) { }
virtual WebCString injectedScriptSource() { return WebCString(); }
virtual WebCString debuggerScriptSource() { return WebCString(); }
diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h
index fc6e6dd..a91106e 100644
--- a/WebKit/chromium/public/WebFileSystem.h
+++ b/WebKit/chromium/public/WebFileSystem.h
@@ -31,41 +31,12 @@
#ifndef WebFileSystem_h
#define WebFileSystem_h
-#include "WebCommon.h"
-#include "WebString.h"
-#include "WebURL.h"
+#include "WebFileUtilities.h"
namespace WebKit {
-class WebFileSystem {
-public:
-#ifdef WIN32
- typedef HANDLE FileHandle;
-#else
- typedef int FileHandle;
-#endif
-
- virtual bool fileExists(const WebString& path) { return false; }
- virtual bool deleteFile(const WebString& path) { return false; }
- virtual bool deleteEmptyDirectory(const WebString& path) { return false; }
- virtual bool getFileSize(const WebString& path, long long& result) { return false; }
- virtual bool getFileModificationTime(const WebString& path, double& result) { return false; }
- virtual WebString directoryName(const WebString& path) { return WebString(); }
- virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); }
- virtual bool makeAllDirectories(const WebString& path) { return false; }
- virtual WebString getAbsolutePath(const WebString& path) { return WebString(); }
- virtual bool isDirectory(const WebString& path) { return false; }
- virtual WebURL filePathToURL(const WebString& path) { return WebURL(); }
- virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); }
- // Should set the FileHandle to a invalid value if the file is closed successfully.
- virtual void closeFile(FileHandle&) { }
- virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; }
- virtual bool truncateFile(FileHandle, long long offset) { return false; }
- virtual int readFromFile(FileHandle, char* data, int length) { return 0; }
- virtual int writeToFile(FileHandle, const char* data, int length) { return 0; }
-
-protected:
- ~WebFileSystem() {}
+// FIXME: Clean up this class once the renaming to WebFileUtilities is done.
+class WebFileSystem : public WebFileUtilities {
};
} // namespace WebKit
diff --git a/WebKit/chromium/public/WebFileUtilities.h b/WebKit/chromium/public/WebFileUtilities.h
new file mode 100644
index 0000000..456ba69
--- /dev/null
+++ b/WebKit/chromium/public/WebFileUtilities.h
@@ -0,0 +1,77 @@
+/*
+ * 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 WebFileUtilities_h
+#define WebFileUtilities_h
+
+#include "WebCommon.h"
+#include "WebString.h"
+#include "WebURL.h"
+
+#ifdef WIN32
+typedef void *HANDLE;
+#endif
+
+namespace WebKit {
+
+class WebFileUtilities {
+public:
+#ifdef WIN32
+ typedef HANDLE FileHandle;
+#else
+ typedef int FileHandle;
+#endif
+
+ virtual bool fileExists(const WebString& path) { return false; }
+ virtual bool deleteFile(const WebString& path) { return false; }
+ virtual bool deleteEmptyDirectory(const WebString& path) { return false; }
+ virtual bool getFileSize(const WebString& path, long long& result) { return false; }
+ virtual bool getFileModificationTime(const WebString& path, double& result) { return false; }
+ virtual WebString directoryName(const WebString& path) { return WebString(); }
+ virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); }
+ virtual bool makeAllDirectories(const WebString& path) { return false; }
+ virtual WebString getAbsolutePath(const WebString& path) { return WebString(); }
+ virtual bool isDirectory(const WebString& path) { return false; }
+ virtual WebURL filePathToURL(const WebString& path) { return WebURL(); }
+ virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); }
+ // Should set the FileHandle to a invalid value if the file is closed successfully.
+ virtual void closeFile(FileHandle&) { }
+ virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; }
+ virtual bool truncateFile(FileHandle, long long offset) { return false; }
+ virtual int readFromFile(FileHandle, char* data, int length) { return 0; }
+ virtual int writeToFile(FileHandle, const char* data, int length) { return 0; }
+
+protected:
+ ~WebFileUtilities() {}
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h
index 2b7ee0d..91f0e38 100644
--- a/WebKit/chromium/public/WebFrameClient.h
+++ b/WebKit/chromium/public/WebFrameClient.h
@@ -90,6 +90,12 @@ public:
// General notifications -----------------------------------------------
+ // This frame has been detached from the view.
+ //
+ // FIXME: Do not use this in new code. Currently this is used by code in
+ // Chromium that errantly caches WebKit objects.
+ virtual void frameDetached(WebFrame*) { }
+
// This frame is about to be closed.
virtual void willClose(WebFrame*) { }
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
index 4378afb..4c18076 100644
--- a/WebKit/chromium/public/WebGraphicsContext3D.h
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -129,6 +129,8 @@ public:
// getError in the order they were added.
virtual void synthesizeGLError(unsigned long error) = 0;
+ virtual bool supportsBGRA() = 0;
+
// The entry points below map directly to the OpenGL ES 2.0 API.
// See: http://www.khronos.org/registry/gles/
// and: http://www.khronos.org/opengles/sdk/docs/man/
diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h
index 1cf336d..32caa10 100644
--- a/WebKit/chromium/public/WebIDBKey.h
+++ b/WebKit/chromium/public/WebIDBKey.h
@@ -34,12 +34,16 @@ namespace WebCore { class IDBKey; }
namespace WebKit {
+class WebIDBKeyPath;
+class WebSerializedScriptValue;
+
class WebIDBKey {
public:
~WebIDBKey() { reset(); }
WEBKIT_API static WebIDBKey createNull();
WEBKIT_API static WebIDBKey createInvalid();
+ WEBKIT_API static WebIDBKey createFromValueAndKeyPath(const WebSerializedScriptValue&, const WebIDBKeyPath&);
WebIDBKey(const WebString& string) { assign(string); }
WebIDBKey(int32_t number) { assign(number); }
diff --git a/WebKit/chromium/public/WebIDBKeyPath.h b/WebKit/chromium/public/WebIDBKeyPath.h
new file mode 100644
index 0000000..d08ec63
--- /dev/null
+++ b/WebKit/chromium/public/WebIDBKeyPath.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 WebIDBKeyPath_h
+#define WebIDBKeyPath_h
+
+#include "WebCommon.h"
+#include "WebPrivateOwnPtr.h"
+#include "WebVector.h"
+
+namespace WebCore { struct IDBKeyPathElement; }
+
+namespace WTF { template<typename T, size_t inlineCapacity> class Vector; }
+
+namespace WebKit {
+
+class WebString;
+
+class WebIDBKeyPath {
+public:
+ static WebIDBKeyPath create(const WebString&);
+ WebIDBKeyPath(const WebIDBKeyPath& keyPath) { assign(keyPath); }
+ ~WebIDBKeyPath() { reset(); }
+
+ WEBKIT_API int parseError() const;
+ WEBKIT_API void assign(const WebIDBKeyPath&);
+ WEBKIT_API void reset();
+
+#if WEBKIT_IMPLEMENTATION
+ operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>& () const;
+#endif
+
+private:
+ WebIDBKeyPath();
+
+#if WEBKIT_IMPLEMENTATION
+ WebIDBKeyPath(const WTF::Vector<WebCore::IDBKeyPathElement, 0>&, int parseError);
+#endif
+
+ WebPrivateOwnPtr<WTF::Vector<WebCore::IDBKeyPathElement, 0> > m_private;
+ int m_parseError;
+};
+
+} // namespace WebKit
+
+#endif // WebIDBKeyPath_h
diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h
index 5959a1c..4104175 100644
--- a/WebKit/chromium/public/WebKitClient.h
+++ b/WebKit/chromium/public/WebKitClient.h
@@ -33,6 +33,7 @@
#include "WebCommon.h"
#include "WebData.h"
+#include "WebFileSystem.h"
#include "WebLocalizedString.h"
#include "WebString.h"
#include "WebURL.h"
@@ -49,7 +50,7 @@ class WebApplicationCacheHost;
class WebApplicationCacheHostClient;
class WebClipboard;
class WebCookieJar;
-class WebFileSystem;
+class WebFileUtilities;
class WebGLES2Context;
class WebGraphicsContext3D;
class WebIDBFactory;
@@ -72,8 +73,13 @@ public:
virtual WebMimeRegistry* mimeRegistry() { return 0; }
// Must return non-null.
+ // FIXME: Clean up this one once the renaming to WebFileUtilities is done.
virtual WebFileSystem* fileSystem() { return 0; }
+ // Must return non-null.
+ // FIXME: Clean up this one once the renaming from WebFileSystem is done.
+ virtual WebFileUtilities* fileUtilities() { return fileSystem(); }
+
// May return null if sandbox support is not necessary
virtual WebSandboxSupport* sandboxSupport() { return 0; }
diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h
index f872111..89dff7a 100644
--- a/WebKit/chromium/public/WebNotification.h
+++ b/WebKit/chromium/public/WebNotification.h
@@ -83,6 +83,9 @@ public:
WEBKIT_API WebString replaceId() const;
+ // Called if the presenter goes out of scope before the notification does.
+ WEBKIT_API void detachPresenter();
+
// Called to indicate the notification has been displayed.
WEBKIT_API void dispatchDisplayEvent();
diff --git a/WebKit/chromium/public/WebPrivateOwnPtr.h b/WebKit/chromium/public/WebPrivateOwnPtr.h
new file mode 100644
index 0000000..4bcabcf
--- /dev/null
+++ b/WebKit/chromium/public/WebPrivateOwnPtr.h
@@ -0,0 +1,75 @@
+/*
+ * 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 WebPrivateOwnPtr_h
+#define WebPrivateOwnPtr_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+// This class is an implementation detail of the WebKit API. It exists
+// to help simplify the implementation of WebKit interfaces that merely
+// wrap a pointer to a WebCore class. It's similar to WebPrivatePtr, but it
+// wraps a naked pointer rather than a reference counted.
+// Note: you must call reset(0) on the implementation side in order to delete
+// the WebCore pointer.
+template <typename T>
+class WebPrivateOwnPtr {
+public:
+ WebPrivateOwnPtr() : m_ptr(0) {}
+ ~WebPrivateOwnPtr() { WEBKIT_ASSERT(!m_ptr); }
+
+#if WEBKIT_IMPLEMENTATION
+ explicit WebPrivateOwnPtr(T* ptr)
+ : m_ptr(ptr)
+ {
+ }
+
+ void reset(T* ptr)
+ {
+ delete m_ptr;
+ m_ptr = ptr;
+ }
+
+ T* get() const { return m_ptr; }
+
+ T* operator->() const
+ {
+ WEBKIT_ASSERT(m_ptr);
+ return m_ptr;
+ }
+#endif // WEBKIT_IMPLEMENTATION
+
+private:
+ T* m_ptr;
+
+ WebPrivateOwnPtr(const WebPrivateOwnPtr&);
+ void operator=(const WebPrivateOwnPtr&);
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h
index 3dba5fb..b85fde6 100644
--- a/WebKit/chromium/public/WebSpeechInputController.h
+++ b/WebKit/chromium/public/WebSpeechInputController.h
@@ -41,14 +41,21 @@ 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)
+ {
+ return startRecognition();
+ }
+ // FIXME: Remove this once chromium has picked up this change.
virtual bool startRecognition()
{
- WEBKIT_ASSERT_NOT_REACHED();
- return false;
+ WEBKIT_ASSERT_NOT_REACHED();
+ return false;
}
// Cancels an ongoing recognition and discards any audio recorded so far. No partial
// recognition results are returned to the listener.
+ virtual void cancelRecognition(int) { cancelRecognition(); }
+ // FIXME: Remove this once chromium has picked up this change.
virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); }
// Stops audio recording and performs recognition with the audio recorded until now
@@ -56,6 +63,8 @@ public:
// wants to stop recording audio as soon as they finished speaking. Otherwise, the speech
// recording 'endpointer' should detect silence in the input and stop recording automatically.
// Call startRecognition() to record audio and recognize speech again.
+ virtual void stopRecording(int) { stopRecording(); }
+ // FIXME: Remove this once chromium has picked up this change.
virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); }
protected:
diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h
index f1756af..e779c3a 100644
--- a/WebKit/chromium/public/WebSpeechInputListener.h
+++ b/WebKit/chromium/public/WebSpeechInputListener.h
@@ -47,19 +47,34 @@ 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() = 0;
+ virtual void didCompleteRecording(int) = 0;
+ // FIXME: Remove this once chromium has picked up this change.
+ virtual void didCompleteRecording()
+ {
+ didCompleteRecording(1);
+ }
// 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(const WebString&) = 0;
+ virtual void setRecognitionResult(int, const WebString&) = 0;
+ // FIXME: Remove this once chromium has picked up this change.
+ virtual void setRecognitionResult(const WebString& result)
+ {
+ setRecognitionResult(1, result);
+ }
// 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() = 0;
+ virtual void didCompleteRecognition(int) = 0;
+ // FIXME: Remove this once chromium has picked up this change.
+ virtual void didCompleteRecognition()
+ {
+ didCompleteRecognition(1);
+ }
protected:
~WebSpeechInputListener() { }
diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp
index dfd4754..3bfcfe2 100644
--- a/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -202,6 +202,15 @@ void ApplicationCacheHost::setDOMApplicationCache(DOMApplicationCache* domApplic
void ApplicationCacheHost::notifyDOMApplicationCache(EventID id, int total, int done)
{
+#if ENABLE(INSPECTOR)
+ // If host's frame is main frame and inspector frontend is connected, update appcache status.
+ if (id != PROGRESS_EVENT && m_documentLoader->frame()) {
+ Page* page = m_documentLoader->frame()->page();
+ if (page && page->inspectorController()->applicationCacheAgent() && page->mainFrame() == m_documentLoader->frame())
+ page->inspectorController()->applicationCacheAgent()->updateApplicationCacheStatus(status());
+ }
+#endif
+
if (m_defersEvents) {
// Event dispatching is deferred until document.onload has fired.
m_deferredEvents.append(DeferredEvent(id, total, done));
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index bcd7931..b93d4bb 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -45,7 +45,6 @@
#include "PasteboardPrivate.h"
#include "PlatformCursor.h"
#include "Settings.h"
-#include "StringImpl.h"
#include "TextAffinity.h"
#include "UserContentTypes.h"
#include "UserScriptTypes.h"
@@ -65,6 +64,7 @@
#include "WebTextCaseSensitivity.h"
#include "WebView.h"
#include <wtf/Assertions.h>
+#include <wtf/text/StringImpl.h>
#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \
COMPILE_ASSERT(int(WebKit::webkit_name) == int(WebCore::webcore_name), mismatching_enums)
diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp
index a43109c..5b18e82 100644
--- a/WebKit/chromium/src/ChromiumBridge.cpp
+++ b/WebKit/chromium/src/ChromiumBridge.cpp
@@ -41,7 +41,7 @@
#include "WebCursorInfo.h"
#include "WebData.h"
#include "WebDragData.h"
-#include "WebFileSystem.h"
+#include "WebFileUtilities.h"
#include "WebFrameClient.h"
#include "WebFrameImpl.h"
#include "WebImage.h"
@@ -320,28 +320,28 @@ void ChromiumBridge::prefetchDNS(const String& hostname)
bool ChromiumBridge::fileExists(const String& path)
{
- return webKitClient()->fileSystem()->fileExists(path);
+ return webKitClient()->fileUtilities()->fileExists(path);
}
bool ChromiumBridge::deleteFile(const String& path)
{
- return webKitClient()->fileSystem()->deleteFile(path);
+ return webKitClient()->fileUtilities()->deleteFile(path);
}
bool ChromiumBridge::deleteEmptyDirectory(const String& path)
{
- return webKitClient()->fileSystem()->deleteEmptyDirectory(path);
+ return webKitClient()->fileUtilities()->deleteEmptyDirectory(path);
}
bool ChromiumBridge::getFileSize(const String& path, long long& result)
{
- return webKitClient()->fileSystem()->getFileSize(path, result);
+ return webKitClient()->fileUtilities()->getFileSize(path, result);
}
bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result)
{
double modificationTime;
- if (!webKitClient()->fileSystem()->getFileModificationTime(path, modificationTime))
+ if (!webKitClient()->fileUtilities()->getFileModificationTime(path, modificationTime))
return false;
result = static_cast<time_t>(modificationTime);
return true;
@@ -349,62 +349,62 @@ bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result)
String ChromiumBridge::directoryName(const String& path)
{
- return webKitClient()->fileSystem()->directoryName(path);
+ return webKitClient()->fileUtilities()->directoryName(path);
}
String ChromiumBridge::pathByAppendingComponent(const String& path, const String& component)
{
- return webKitClient()->fileSystem()->pathByAppendingComponent(path, component);
+ return webKitClient()->fileUtilities()->pathByAppendingComponent(path, component);
}
bool ChromiumBridge::makeAllDirectories(const String& path)
{
- return webKitClient()->fileSystem()->makeAllDirectories(path);
+ return webKitClient()->fileUtilities()->makeAllDirectories(path);
}
String ChromiumBridge::getAbsolutePath(const String& path)
{
- return webKitClient()->fileSystem()->getAbsolutePath(path);
+ return webKitClient()->fileUtilities()->getAbsolutePath(path);
}
bool ChromiumBridge::isDirectory(const String& path)
{
- return webKitClient()->fileSystem()->isDirectory(path);
+ return webKitClient()->fileUtilities()->isDirectory(path);
}
KURL ChromiumBridge::filePathToURL(const String& path)
{
- return webKitClient()->fileSystem()->filePathToURL(path);
+ return webKitClient()->fileUtilities()->filePathToURL(path);
}
PlatformFileHandle ChromiumBridge::openFile(const String& path, FileOpenMode mode)
{
- return webKitClient()->fileSystem()->openFile(path, mode);
+ return webKitClient()->fileUtilities()->openFile(path, mode);
}
void ChromiumBridge::closeFile(PlatformFileHandle& handle)
{
- webKitClient()->fileSystem()->closeFile(handle);
+ webKitClient()->fileUtilities()->closeFile(handle);
}
long long ChromiumBridge::seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin)
{
- return webKitClient()->fileSystem()->seekFile(handle, offset, origin);
+ return webKitClient()->fileUtilities()->seekFile(handle, offset, origin);
}
bool ChromiumBridge::truncateFile(PlatformFileHandle handle, long long offset)
{
- return webKitClient()->fileSystem()->truncateFile(handle, offset);
+ return webKitClient()->fileUtilities()->truncateFile(handle, offset);
}
int ChromiumBridge::readFromFile(PlatformFileHandle handle, char* data, int length)
{
- return webKitClient()->fileSystem()->readFromFile(handle, data, length);
+ return webKitClient()->fileUtilities()->readFromFile(handle, data, length);
}
int ChromiumBridge::writeToFile(PlatformFileHandle handle, const char* data, int length)
{
- return webKitClient()->fileSystem()->writeToFile(handle, data, length);
+ return webKitClient()->fileUtilities()->writeToFile(handle, data, length);
}
// Font -----------------------------------------------------------------------
diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp
index 1df7172..dfc186c 100644
--- a/WebKit/chromium/src/DebuggerAgentManager.cpp
+++ b/WebKit/chromium/src/DebuggerAgentManager.cpp
@@ -50,10 +50,6 @@ bool DebuggerAgentManager::s_inHostDispatchHandler = false;
DebuggerAgentManager::DeferrersMap DebuggerAgentManager::s_pageDeferrers;
-bool DebuggerAgentManager::s_inUtilityContext = false;
-
-bool DebuggerAgentManager::s_debugBreakDelayed = false;
-
bool DebuggerAgentManager::s_exposeV8DebuggerProtocol = false;
namespace {
@@ -208,28 +204,20 @@ void DebuggerAgentManager::onV8DebugMessage(const v8::Debug::Message& message)
return;
}
- if (s_inUtilityContext && message.GetEvent() == v8::Break) {
- // This may happen when two tabs are being debugged in the same process.
- // Suppose that first debugger is pauesed on an exception. It will run
- // nested MessageLoop which may process Break request from the second
- // debugger.
- s_debugBreakDelayed = true;
- } else {
- // If the context is from one of the inpected tabs or injected extension
- // scripts it must have hostId in the data field.
- int hostId = WebCore::V8Proxy::contextDebugId(context);
- if (hostId != -1) {
- DebuggerAgentImpl* agent = debuggerAgentForHostId(hostId);
- if (agent) {
- if (agent->autoContinueOnException()
- && message.GetEvent() == v8::Exception) {
- sendContinueCommandToV8();
- return;
- }
-
- agent->debuggerOutput(out);
+ // If the context is from one of the inpected tabs or injected extension
+ // scripts it must have hostId in the data field.
+ int hostId = WebCore::V8Proxy::contextDebugId(context);
+ if (hostId != -1) {
+ DebuggerAgentImpl* agent = debuggerAgentForHostId(hostId);
+ if (agent) {
+ if (agent->autoContinueOnException()
+ && message.GetEvent() == v8::Exception) {
+ sendContinueCommandToV8();
return;
}
+
+ agent->debuggerOutput(out);
+ return;
}
}
@@ -242,10 +230,7 @@ void DebuggerAgentManager::onV8DebugMessage(const v8::Debug::Message& message)
void DebuggerAgentManager::pauseScript()
{
- if (s_inUtilityContext)
- s_debugBreakDelayed = true;
- else
- v8::Debug::DebugBreak();
+ v8::Debug::DebugBreak();
}
void DebuggerAgentManager::executeDebuggerCommand(const WTF::String& command, int callerId)
diff --git a/WebKit/chromium/src/DebuggerAgentManager.h b/WebKit/chromium/src/DebuggerAgentManager.h
index 300cada..66bd714 100644
--- a/WebKit/chromium/src/DebuggerAgentManager.h
+++ b/WebKit/chromium/src/DebuggerAgentManager.h
@@ -80,23 +80,6 @@ public:
static void onNavigate();
- class UtilityContextScope : public Noncopyable {
- public:
- UtilityContextScope()
- {
- ASSERT(!s_inUtilityContext);
- s_inUtilityContext = true;
- }
- ~UtilityContextScope()
- {
- if (s_debugBreakDelayed) {
- v8::Debug::DebugBreak();
- s_debugBreakDelayed = false;
- }
- s_inUtilityContext = false;
- }
- };
-
private:
DebuggerAgentManager();
~DebuggerAgentManager();
@@ -118,8 +101,6 @@ private:
typedef HashMap<WebViewImpl*, WebCore::PageGroupLoadDeferrer*> DeferrersMap;
static DeferrersMap s_pageDeferrers;
- static bool s_inUtilityContext;
- static bool s_debugBreakDelayed;
static bool s_exposeV8DebuggerProtocol;
};
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index b416e35..74186bf 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -37,6 +37,7 @@
#include "FormState.h"
#include "FrameLoader.h"
#include "FrameLoadRequest.h"
+#include "FrameView.h"
#include "HTTPParsers.h"
#include "HistoryItem.h"
#include "HitTestResult.h"
@@ -49,6 +50,7 @@
#include "PlatformString.h"
#include "PluginData.h"
#include "PluginDataChromium.h"
+#include "Settings.h"
#include "StringExtras.h"
#include "WebDataSourceImpl.h"
#include "WebDevToolsAgentPrivate.h"
@@ -246,7 +248,12 @@ void FrameLoaderClientImpl::detachedFromParent3()
// go to a page and then navigate to a new page without getting any asserts
// or crashes.
m_webFrame->frame()->script()->proxy()->clearForClose();
-
+
+ // Alert the client that the frame is being detached. This is the last
+ // chance we have to communicate with the client.
+ if (m_webFrame->client())
+ m_webFrame->client()->frameDetached(m_webFrame);
+
// Stop communicating with the WebFrameClient at this point since we are no
// longer associated with the Page.
m_webFrame->setClient(0);
@@ -1390,6 +1397,14 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
if (!webPlugin->initialize(container.get()))
return 0;
+ if (m_webFrame->frame()->view()->zoomFactor() != 1) {
+ // There's a saved zoom level, so tell the plugin about it since
+ // WebViewImpl::setZoomLevel was called before the plugin was created.
+ webPlugin->setZoomFactor(
+ m_webFrame->frame()->view()->zoomFactor(),
+ m_webFrame->frame()->page()->settings()->zoomMode() == ZoomTextOnly);
+ }
+
// The element might have been removed during plugin initialization!
if (!element->renderer())
return 0;
diff --git a/WebKit/chromium/src/FrameNetworkingContextImpl.h b/WebKit/chromium/src/FrameNetworkingContextImpl.h
new file mode 100644
index 0000000..8670506
--- /dev/null
+++ b/WebKit/chromium/src/FrameNetworkingContextImpl.h
@@ -0,0 +1,43 @@
+/*
+ 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 FrameNetworkingContextImpl_h
+#define FrameNetworkingContextImpl_h
+
+#include "FrameNetworkingContext.h"
+
+namespace WebKit {
+
+class FrameNetworkingContextImpl : public WebCore::FrameNetworkingContext {
+public:
+ static PassRefPtr<FrameNetworkingContextImpl> create(WebCore::Frame* frame)
+ {
+ return adoptRef(new FrameNetworkingContextImpl(frame));
+ }
+
+private:
+ FrameNetworkingContextImpl(WebCore::Frame* frame)
+ : WebCore::FrameNetworkingContext(frame)
+ {
+ }
+};
+
+}
+
+#endif
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index 5b5afef..0f672a3 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -85,9 +85,6 @@ namespace WebCore {
//----------------------------------------------------------------------
// GraphicsContext3DInternal
-// Uncomment this to render to a separate window for debugging
-// #define RENDER_TO_DEBUGGING_WINDOW
-
class GraphicsContext3DInternal {
public:
GraphicsContext3DInternal();
@@ -105,8 +102,7 @@ public:
void reshape(int width, int height);
void paintRenderingResultsToCanvas(CanvasRenderingContext* context);
- void beginPaint(CanvasRenderingContext* context);
- void endPaint();
+ bool paintsIntoCanvasBuffer() const;
void prepareTexture();
@@ -300,6 +296,7 @@ public:
void deleteTexture(unsigned);
void synthesizeGLError(unsigned long error);
+ bool supportsBGRA();
private:
OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
@@ -452,17 +449,10 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon
#endif
}
-void GraphicsContext3DInternal::beginPaint(CanvasRenderingContext* context)
+bool GraphicsContext3DInternal::paintsIntoCanvasBuffer() const
{
// If the gpu compositor is on then skip the readback and software rendering path.
- if (m_webViewImpl->isAcceleratedCompositingActive())
- return;
-
- paintRenderingResultsToCanvas(context);
-}
-
-void GraphicsContext3DInternal::endPaint()
-{
+ return !m_webViewImpl->isAcceleratedCompositingActive();
}
void GraphicsContext3DInternal::reshape(int width, int height)
@@ -910,6 +900,7 @@ DELEGATE_TO_IMPL_1(deleteShader, unsigned)
DELEGATE_TO_IMPL_1(deleteTexture, unsigned)
DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long)
+DELEGATE_TO_IMPL_R(supportsBGRA, bool)
//----------------------------------------------------------------------
// GraphicsContext3D
@@ -1226,8 +1217,11 @@ DELEGATE_TO_INTERNAL_6(vertexAttribPointer, unsigned long, int, int, bool, unsig
DELEGATE_TO_INTERNAL_4(viewport, long, long, unsigned long, unsigned long)
DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, CanvasRenderingContext*)
-DELEGATE_TO_INTERNAL_1(beginPaint, CanvasRenderingContext*)
-DELEGATE_TO_INTERNAL(endPaint)
+
+bool GraphicsContext3D::paintsIntoCanvasBuffer() const
+{
+ return m_internal->paintsIntoCanvasBuffer();
+}
DELEGATE_TO_INTERNAL_R(createBuffer, unsigned)
DELEGATE_TO_INTERNAL_R(createFramebuffer, unsigned)
@@ -1244,6 +1238,7 @@ DELEGATE_TO_INTERNAL_1(deleteShader, unsigned)
DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned)
DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long)
+DELEGATE_TO_INTERNAL_R(supportsBGRA, bool)
bool GraphicsContext3D::isGLES2Compliant() const
{
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 66525e3..9c59bae 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -51,41 +51,45 @@ SpeechInputClientImpl::~SpeechInputClientImpl()
{
}
-bool SpeechInputClientImpl::startRecognition(WebCore::SpeechInputListener* listener)
+void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener)
{
m_listener = listener;
- return m_controller->startRecognition();
}
-void SpeechInputClientImpl::stopRecording()
+bool SpeechInputClientImpl::startRecognition(int requestId)
{
ASSERT(m_listener);
- m_controller->stopRecording();
+ return m_controller->startRecognition(requestId);
}
-void SpeechInputClientImpl::cancelRecognition()
+void SpeechInputClientImpl::stopRecording(int requestId)
{
ASSERT(m_listener);
- m_controller->cancelRecognition();
+ m_controller->stopRecording(requestId);
}
-void SpeechInputClientImpl::didCompleteRecording()
+void SpeechInputClientImpl::cancelRecognition(int requestId)
{
ASSERT(m_listener);
- m_listener->didCompleteRecording();
+ m_controller->cancelRecognition(requestId);
}
-void SpeechInputClientImpl::didCompleteRecognition()
+void SpeechInputClientImpl::didCompleteRecording(int requestId)
{
ASSERT(m_listener);
- m_listener->didCompleteRecognition();
- m_listener = 0;
+ m_listener->didCompleteRecording(requestId);
}
-void SpeechInputClientImpl::setRecognitionResult(const WebString& result)
+void SpeechInputClientImpl::didCompleteRecognition(int requestId)
{
ASSERT(m_listener);
- m_listener->setRecognitionResult(result);
+ m_listener->didCompleteRecognition(requestId);
+}
+
+void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebString& result)
+{
+ ASSERT(m_listener);
+ m_listener->setRecognitionResult(requestId, result);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h
index 5762da8..0ab54c1 100644
--- a/WebKit/chromium/src/SpeechInputClientImpl.h
+++ b/WebKit/chromium/src/SpeechInputClientImpl.h
@@ -53,18 +53,19 @@ public:
virtual ~SpeechInputClientImpl();
// SpeechInputClient methods.
- bool startRecognition(WebCore::SpeechInputListener*);
- void stopRecording();
- void cancelRecognition();
+ void setListener(WebCore::SpeechInputListener*);
+ bool startRecognition(int);
+ void stopRecording(int);
+ void cancelRecognition(int);
// WebSpeechInputListener methods.
- void didCompleteRecording();
- void setRecognitionResult(const WebString&);
- void didCompleteRecognition();
+ void didCompleteRecording(int);
+ void setRecognitionResult(int, const WebString&);
+ void didCompleteRecognition(int);
private:
WebSpeechInputController* m_controller; // To call into the embedder.
- WebCore::SpeechInputListener* m_listener; // Valid when recognition is in progress.
+ WebCore::SpeechInputListener* m_listener;
};
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.cpp b/WebKit/chromium/src/WebAnimationControllerImpl.cpp
index 32a7a61..15df140 100644
--- a/WebKit/chromium/src/WebAnimationControllerImpl.cpp
+++ b/WebKit/chromium/src/WebAnimationControllerImpl.cpp
@@ -87,4 +87,24 @@ unsigned WebAnimationControllerImpl::numberOfActiveAnimations() const
return controller->numberOfActiveAnimations();
}
+void WebAnimationControllerImpl::suspendAnimations() const
+{
+ AnimationController* controller = animationController();
+ if (!controller)
+ return;
+ if (!m_frameImpl->frame())
+ return;
+ controller->suspendAnimations(m_frameImpl->frame()->document());
+}
+
+void WebAnimationControllerImpl::resumeAnimations() const
+{
+ AnimationController* controller = animationController();
+ if (!controller)
+ return;
+ if (!m_frameImpl->frame())
+ return;
+ controller->resumeAnimations(m_frameImpl->frame()->document());
+}
+
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.h b/WebKit/chromium/src/WebAnimationControllerImpl.h
index 66dfe98..62b89f0 100644
--- a/WebKit/chromium/src/WebAnimationControllerImpl.h
+++ b/WebKit/chromium/src/WebAnimationControllerImpl.h
@@ -52,6 +52,8 @@ public:
const WebString& propertyName,
double time);
virtual unsigned numberOfActiveAnimations() const;
+ virtual void suspendAnimations() const;
+ virtual void resumeAnimations() const;
private:
WebFrameImpl* m_frameImpl;
WebCore::AnimationController* animationController() const;
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index 4de5624..f4b1a86 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -36,6 +36,7 @@
#include "InjectedScriptHost.h"
#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
+#include "InspectorValues.h"
#include "Page.h"
#include "PageGroup.h"
#include "PlatformString.h"
@@ -63,7 +64,11 @@
using WebCore::DocumentLoader;
using WebCore::FrameLoader;
using WebCore::InjectedScriptHost;
+using WebCore::InspectorArray;
+using WebCore::InspectorBackendDispatcher;
using WebCore::InspectorController;
+using WebCore::InspectorObject;
+using WebCore::InspectorValue;
using WebCore::Node;
using WebCore::Page;
using WebCore::ResourceError;
@@ -232,7 +237,7 @@ void WebDevToolsAgentImpl::detach()
void WebDevToolsAgentImpl::frontendLoaded()
{
inspectorController()->connectFrontend();
- m_client->runtimeFeatureStateChanged(kFrontendConnectedFeatureName, true);
+ m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, "true");
}
void WebDevToolsAgentImpl::didNavigate()
@@ -263,17 +268,22 @@ void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point)
void WebDevToolsAgentImpl::setRuntimeFeatureEnabled(const WebString& feature, bool enabled)
{
- if (feature == kApuAgentFeatureName)
- setApuAgentEnabled(enabled);
- else if (feature == kTimelineFeatureName)
- setTimelineProfilingEnabled(enabled);
- else if (feature == kResourceTrackingFeatureName) {
+ setRuntimeProperty(feature, enabled ? String("true") : String("false"));
+}
+
+void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebString& value)
+{
+ if (name == kApuAgentFeatureName)
+ setApuAgentEnabled(value == "true");
+ else if (name == kTimelineFeatureName)
+ setTimelineProfilingEnabled(value == "true");
+ else if (name == kResourceTrackingFeatureName) {
InspectorController* ic = inspectorController();
- if (enabled)
+ if (value == "true")
ic->enableResourceTracking(false /* not sticky */, false /* no reload */);
else
ic->disableResourceTracking(false /* not sticky */);
- } else if (feature == kFrontendConnectedFeatureName && enabled && !inspectorController()->hasFrontend())
+ } else if (name == kFrontendConnectedFeatureName && value == "true" && !inspectorController()->hasFrontend())
frontendLoaded();
}
@@ -282,6 +292,8 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
m_apuAgentEnabled = enabled;
InspectorController* ic = inspectorController();
if (enabled) {
+ if (!ic->hasFrontend())
+ frontendLoaded();
m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled();
ic->startTimelineProfiler();
if (!m_resourceTrackingWasEnabled) {
@@ -296,9 +308,9 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
ic->disableResourceTracking(false);
m_resourceTrackingWasEnabled = false;
}
- m_client->runtimeFeatureStateChanged(
+ m_client->runtimePropertyChanged(
kApuAgentFeatureName,
- enabled);
+ enabled ? String("true") : String("false"));
}
WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController()
@@ -412,22 +424,22 @@ bool WebDevToolsAgentImpl::sendMessageToFrontend(const WTF::String& message)
void WebDevToolsAgentImpl::resourceTrackingWasEnabled()
{
- m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, true);
+ m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "true");
}
void WebDevToolsAgentImpl::resourceTrackingWasDisabled()
{
- m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, false);
+ m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "false");
}
void WebDevToolsAgentImpl::timelineProfilerWasStarted()
{
- m_client->runtimeFeatureStateChanged(kTimelineFeatureName, true);
+ m_client->runtimePropertyChanged(kTimelineFeatureName, "true");
}
void WebDevToolsAgentImpl::timelineProfilerWasStopped()
{
- m_client->runtimeFeatureStateChanged(kTimelineFeatureName, false);
+ m_client->runtimePropertyChanged(kTimelineFeatureName, "false");
}
void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script)
@@ -455,6 +467,43 @@ void WebDevToolsAgent::debuggerPauseScript()
DebuggerAgentManager::pauseScript();
}
+void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* d)
+{
+ class DebuggerTask : public WebCore::ScriptDebugServer::Task {
+ public:
+ DebuggerTask(WebDevToolsAgent::MessageDescriptor* descriptor) : m_descriptor(descriptor) { }
+ virtual ~DebuggerTask() { }
+ virtual void run()
+ {
+ if (WebDevToolsAgent* webagent = m_descriptor->agent())
+ webagent->dispatchOnInspectorBackend(m_descriptor->message());
+ }
+ private:
+ OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor;
+ };
+ WebCore::ScriptDebugServer::interruptAndRun(new DebuggerTask(d));
+}
+
+bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message)
+{
+ String commandName;
+ if (!InspectorBackendDispatcher::getCommandName(message, &commandName))
+ return false;
+ return commandName == InspectorBackendDispatcher::pauseCmd
+ || commandName == InspectorBackendDispatcher::setBreakpointCmd
+ || commandName == InspectorBackendDispatcher::removeBreakpointCmd
+ || commandName == InspectorBackendDispatcher::activateBreakpointsCmd
+ || commandName == InspectorBackendDispatcher::deactivateBreakpointsCmd
+ || commandName == InspectorBackendDispatcher::startProfilingCmd
+ || commandName == InspectorBackendDispatcher::stopProfilingCmd
+ || commandName == InspectorBackendDispatcher::getProfileCmd;
+}
+
+void WebDevToolsAgent::processPendingMessages()
+{
+ WebCore::ScriptDebugServer::shared().runPendingTasks();
+}
+
void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler handler)
{
DebuggerAgentManager::setMessageLoopDispatchHandler(handler);
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h
index a0d2647..73b8a1e 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -77,6 +77,7 @@ public:
virtual void inspectElementAt(const WebPoint& point);
virtual void evaluateInWebInspector(long callId, const WebString& script);
virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled);
+ virtual void setRuntimeProperty(const WebString& name, const WebString& value);
virtual void setTimelineProfilingEnabled(bool enable);
virtual void identifierForInitialRequest(unsigned long, WebFrame*, const WebURLRequest&);
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index c1b09c4..905bc6d 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -100,17 +100,6 @@ WebDevToolsFrontendImpl::WebDevToolsFrontendImpl(
// Put each DevTools frontend Page into its own (single page) group so that it's not
// deferred along with the inspected page.
m_webViewImpl->page()->setGroupName(String());
-
- WebFrameImpl* frame = m_webViewImpl->mainFrameImpl();
- v8::HandleScope scope;
- v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame());
-
- // Debugger commands should be sent using special method.
- BoundObject debuggerCommandExecutorObj(frameContext, this, "RemoteDebuggerCommandExecutor");
- debuggerCommandExecutorObj.addProtoFunction(
- "DebuggerPauseScript",
- WebDevToolsFrontendImpl::jsDebuggerPauseScript);
- debuggerCommandExecutorObj.build();
}
WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl()
@@ -123,7 +112,7 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa
v8::HandleScope scope;
v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame());
v8::Context::Scope contextScope(frameContext);
- v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("devtools$$dispatch"));
+ v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("WebInspector_syncDispatch"));
ASSERT(dispatchFunction->IsFunction());
v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction);
Vector< v8::Handle<v8::Value> > args;
@@ -138,11 +127,4 @@ void WebDevToolsFrontendImpl::frontendLoaded()
m_client->sendFrontendLoaded();
}
-v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDebuggerPauseScript(const v8::Arguments& args)
-{
- WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value());
- frontend->m_client->sendDebuggerPauseScript();
- return v8::Undefined();
-}
-
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.h b/WebKit/chromium/src/WebDevToolsFrontendImpl.h
index e4f22fe..bde906f 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.h
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.h
@@ -70,8 +70,6 @@ public:
void frontendLoaded();
private:
- static v8::Handle<v8::Value> jsDebuggerPauseScript(const v8::Arguments& args);
-
WebKit::WebViewImpl* m_webViewImpl;
WebKit::WebDevToolsFrontendClient* m_client;
String m_applicationLocale;
diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp
index 30b619b..2e05d52 100644
--- a/WebKit/chromium/src/WebEntities.cpp
+++ b/WebKit/chromium/src/WebEntities.cpp
@@ -33,6 +33,7 @@
#include <string.h>
+#include "HTMLEntityTable.h"
#include "PlatformString.h"
#include "StringBuilder.h"
#include <wtf/HashMap.h>
@@ -41,59 +42,51 @@
using namespace WebCore;
+namespace WebKit {
+
namespace {
-// Note that this file is also included by LegacyHTMLDocumentParser.cpp so we are getting
-// two copies of the data in memory. We can fix this by changing the script
-// that generated the array to create a static const that is its length, but
-// this is low priority since the data is less than 4K. We use anonymous
-// namespace to prevent name collisions.
-#include "HTMLEntityNames.cpp" // NOLINT
-}
-namespace WebKit {
+void populateMapFromXMLEntities(WTF::HashMap<int, WTF::String>& map)
+{
+ ASSERT(map.isEmpty());
+ map.set(0x003c, "lt");
+ map.set(0x003e, "gt");
+ map.set(0x0026, "amp");
+ map.set(0x0027, "apos");
+ map.set(0x0022, "quot");
+}
-void populateMap(WTF::HashMap<int, WTF::String>& map,
- const Entity* entities,
- size_t entitiesCount,
- bool standardHTML)
+void populateMapFromHTMLEntityTable(WTF::HashMap<int, WTF::String>& map)
{
ASSERT(map.isEmpty());
- const Entity* entity = &entities[0];
- for (size_t i = 0; i < entitiesCount; i++, entity++) {
- int code = entity->code;
- String name = entity->name;
- // For consistency, use the lowe case for entities that have both.
- if (map.contains(code) && map.get(code) == name.lower())
+ const HTMLEntityTableEntry* entry = HTMLEntityTable::firstEntry();
+ const HTMLEntityTableEntry* end = HTMLEntityTable::lastEntry() + 1;
+ for (; entry != end; ++entry) {
+ String entity = entry->entity;
+ int value = entry->value;
+ ASSERT(value && !entity.isEmpty());
+ if (entity[entity.length() - 1] != ';')
+ continue; // We want the canonical version that ends in ;
+ // For consistency, use the lower case for entities that have both.
+ if (map.contains(value) && map.get(value) == entity.lower())
continue;
- // Don't register &percnt;, &nsup; and &supl;.
- if (standardHTML && (code == '%' || code == 0x2285 || code == 0x00b9))
+ // Don't register &percnt;, &nsup; and &supl; for some unknown reason.
+ if (value == '%' || value == 0x2285 || value == 0x00b9)
continue;
- map.set(code, name);
+ map.set(value, entity);
}
- if (standardHTML)
- map.set(static_cast<int>(0x0027), String("#39"));
+ // We add #39 for some unknown reason.
+ map.set(0x0027, String("#39"));
}
-static const Entity xmlBuiltInEntityCodes[] = {
- { "lt", 0x003c },
- { "gt", 0x003e },
- { "amp", 0x0026 },
- { "apos", 0x0027 },
- { "quot", 0x0022 }
-};
+}
WebEntities::WebEntities(bool xmlEntities)
{
if (xmlEntities)
- populateMap(m_entitiesMap,
- xmlBuiltInEntityCodes,
- sizeof(xmlBuiltInEntityCodes) / sizeof(Entity),
- false);
+ populateMapFromXMLEntities(m_entitiesMap);
else
- populateMap(m_entitiesMap,
- wordlist,
- sizeof(wordlist) / sizeof(Entity),
- true);
+ populateMapFromHTMLEntityTable(m_entitiesMap);
}
String WebEntities::entityNameByCode(int code) const
diff --git a/WebKit/chromium/src/WebEntities.h b/WebKit/chromium/src/WebEntities.h
index a01cc5d..f210566 100644
--- a/WebKit/chromium/src/WebEntities.h
+++ b/WebKit/chromium/src/WebEntities.h
@@ -36,6 +36,7 @@
namespace WebKit {
+// FIXME: This class is wrong and needs to be removed.
class WebEntities {
public:
// &apos;, &percnt;, &nsup;, &supl; are not defined by the HTML standards.
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 410ac3b..a863862 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -34,81 +34,16 @@
#include "WebGraphicsContext3DDefaultImpl.h"
+#include "app/gfx/gl/gl_bindings.h"
+#include "app/gfx/gl/gl_context.h"
#include "NotImplemented.h"
+#include <wtf/PassOwnPtr.h>
#include <stdio.h>
#include <string.h>
-#if OS(LINUX)
-#include <dlfcn.h>
-#endif
-
namespace WebKit {
-// Uncomment this to render to a separate window for debugging
-// #define RENDER_TO_DEBUGGING_WINDOW
-
-#if OS(DARWIN)
-#define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
-#endif
-
-bool WebGraphicsContext3DDefaultImpl::s_initializedGLEW = false;
-
-#if OS(LINUX)
-WebGraphicsContext3DDefaultImpl::GLConnection* WebGraphicsContext3DDefaultImpl::s_gl = 0;
-
-WebGraphicsContext3DDefaultImpl::GLConnection* WebGraphicsContext3DDefaultImpl::GLConnection::create()
-{
- Display* dpy = XOpenDisplay(0);
- if (!dpy) {
- printf("GraphicsContext3D: error opening X display\n");
- return 0;
- }
-
- // We use RTLD_GLOBAL semantics so that GLEW initialization works;
- // GLEW expects to be able to open the current process's handle
- // and do dlsym's of GL entry points from there.
- void* libGL = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
- if (!libGL) {
- XCloseDisplay(dpy);
- printf("GraphicsContext3D: error opening libGL.so.1: %s\n", dlerror());
- return 0;
- }
-
- PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) dlsym(libGL, "glXChooseFBConfig");
- PFNGLXCREATENEWCONTEXTPROC createNewContext = (PFNGLXCREATENEWCONTEXTPROC) dlsym(libGL, "glXCreateNewContext");
- PFNGLXCREATEPBUFFERPROC createPbuffer = (PFNGLXCREATEPBUFFERPROC) dlsym(libGL, "glXCreatePbuffer");
- PFNGLXDESTROYPBUFFERPROC destroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) dlsym(libGL, "glXDestroyPbuffer");
- PFNGLXMAKECURRENTPROC makeCurrent = (PFNGLXMAKECURRENTPROC) dlsym(libGL, "glXMakeCurrent");
- PFNGLXDESTROYCONTEXTPROC destroyContext = (PFNGLXDESTROYCONTEXTPROC) dlsym(libGL, "glXDestroyContext");
- PFNGLXGETCURRENTCONTEXTPROC getCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC) dlsym(libGL, "glXGetCurrentContext");
- if (!chooseFBConfig || !createNewContext || !createPbuffer
- || !destroyPbuffer || !makeCurrent || !destroyContext
- || !getCurrentContext) {
- XCloseDisplay(dpy);
- dlclose(libGL);
- printf("GraphicsContext3D: error looking up bootstrapping entry points\n");
- return 0;
- }
- return new GLConnection(dpy,
- libGL,
- chooseFBConfig,
- createNewContext,
- createPbuffer,
- destroyPbuffer,
- makeCurrent,
- destroyContext,
- getCurrentContext);
-}
-
-WebGraphicsContext3DDefaultImpl::GLConnection::~GLConnection()
-{
- XCloseDisplay(m_display);
- dlclose(m_libGL);
-}
-
-#endif // OS(LINUX)
-
WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerState()
: enabled(false)
, buffer(0)
@@ -134,20 +69,6 @@ WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl()
, m_scanline(0)
#endif
, m_boundArrayBuffer(0)
-#if OS(WINDOWS)
- , m_canvasWindow(0)
- , m_canvasDC(0)
- , m_contextObj(0)
-#elif PLATFORM(CG)
- , m_pbuffer(0)
- , m_contextObj(0)
- , m_renderOutput(0)
-#elif OS(LINUX)
- , m_contextObj(0)
- , m_pbuffer(0)
-#else
-#error Must port to your platform
-#endif
{
}
@@ -155,7 +76,7 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
{
if (m_initialized) {
makeContextCurrent();
-#ifndef RENDER_TO_DEBUGGING_WINDOW
+
if (m_attributes.antialias) {
glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer);
if (m_attributes.depth || m_attributes.stencil)
@@ -171,220 +92,19 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
delete[] m_scanline;
#endif
glDeleteFramebuffersEXT(1, &m_fbo);
-#endif // !RENDER_TO_DEBUGGING_WINDOW
-#if OS(WINDOWS)
- wglewMakeCurrent(0, 0);
- wglewDeleteContext(m_contextObj);
- ReleaseDC(m_canvasWindow, m_canvasDC);
- DestroyWindow(m_canvasWindow);
-#elif PLATFORM(CG)
- CGLSetCurrentContext(0);
- CGLDestroyContext(m_contextObj);
- CGLDestroyPBuffer(m_pbuffer);
- if (m_renderOutput)
- delete[] m_renderOutput;
-#elif OS(LINUX)
- s_gl->makeCurrent(0, 0);
- s_gl->destroyContext(m_contextObj);
- s_gl->destroyPbuffer(m_pbuffer);
-#else
-#error Must port to your platform
-#endif
- m_contextObj = 0;
+
+ m_glContext->Destroy();
}
}
bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView)
{
-#if OS(WINDOWS)
- if (!s_initializedGLEW) {
- // Do this only the first time through.
- if (!wglewInit()) {
- printf("WebGraphicsContext3DDefaultImpl: wglewInit failed\n");
- return false;
- }
- }
-
- WNDCLASS wc;
- if (!GetClassInfo(GetModuleHandle(0), L"CANVASGL", &wc)) {
- ZeroMemory(&wc, sizeof(WNDCLASS));
- wc.style = CS_OWNDC;
- wc.hInstance = GetModuleHandle(0);
- wc.lpfnWndProc = DefWindowProc;
- wc.lpszClassName = L"CANVASGL";
-
- if (!RegisterClass(&wc)) {
- printf("WebGraphicsContext3DDefaultImpl: RegisterClass failed\n");
- return false;
- }
- }
-
- m_canvasWindow = CreateWindow(L"CANVASGL", L"CANVASGL",
- WS_CAPTION,
- CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, 0, 0, GetModuleHandle(0), 0);
- if (!m_canvasWindow) {
- printf("WebGraphicsContext3DDefaultImpl: CreateWindow failed\n");
- return false;
- }
-
- // get the device context
- m_canvasDC = GetDC(m_canvasWindow);
- if (!m_canvasDC) {
- printf("WebGraphicsContext3DDefaultImpl: GetDC failed\n");
- return false;
- }
-
- // find default pixel format
- PIXELFORMATDESCRIPTOR pfd;
- ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR));
- pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
- pfd.nVersion = 1;
-#ifdef RENDER_TO_DEBUGGING_WINDOW
- pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
-#else
- pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
-#endif
- int pixelformat = ChoosePixelFormat(m_canvasDC, &pfd);
-
- // set the pixel format for the dc
- if (!SetPixelFormat(m_canvasDC, pixelformat, &pfd)) {
- printf("WebGraphicsContext3DDefaultImpl: SetPixelFormat failed\n");
- return false;
- }
-
- // create rendering context
- m_contextObj = wglewCreateContext(m_canvasDC);
- if (!m_contextObj) {
- printf("WebGraphicsContext3DDefaultImpl: wglCreateContext failed\n");
- return false;
- }
-
- if (!wglewMakeCurrent(m_canvasDC, m_contextObj)) {
- printf("WebGraphicsContext3DDefaultImpl: wglMakeCurrent failed\n");
- return false;
- }
-
-#ifdef RENDER_TO_DEBUGGING_WINDOW
- typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
- PFNWGLSWAPINTERVALEXTPROC setSwapInterval = 0;
- setSwapInterval = (PFNWGLSWAPINTERVALEXTPROC) wglewGetProcAddress("wglSwapIntervalEXT");
- if (setSwapInterval)
- setSwapInterval(1);
-#endif // RENDER_TO_DEBUGGING_WINDOW
-
-#elif PLATFORM(CG)
- // Create a 1x1 pbuffer and associated context to bootstrap things
- CGLPixelFormatAttribute attribs[] = {
- (CGLPixelFormatAttribute) kCGLPFAPBuffer,
- (CGLPixelFormatAttribute) 0
- };
- CGLPixelFormatObj pixelFormat;
- GLint numPixelFormats;
- if (CGLChoosePixelFormat(attribs, &pixelFormat, &numPixelFormats) != kCGLNoError) {
- printf("WebGraphicsContext3DDefaultImpl: error choosing pixel format\n");
- return false;
- }
- if (!pixelFormat) {
- printf("WebGraphicsContext3DDefaultImpl: no pixel format selected\n");
- return false;
- }
- CGLContextObj context;
- CGLError res = CGLCreateContext(pixelFormat, 0, &context);
- CGLDestroyPixelFormat(pixelFormat);
- if (res != kCGLNoError) {
- printf("WebGraphicsContext3DDefaultImpl: error creating context\n");
+ if (!gfx::GLContext::InitializeOneOff())
return false;
- }
- CGLPBufferObj pbuffer;
- if (CGLCreatePBuffer(1, 1, GL_TEXTURE_2D, GL_RGBA, 0, &pbuffer) != kCGLNoError) {
- CGLDestroyContext(context);
- printf("WebGraphicsContext3DDefaultImpl: error creating pbuffer\n");
- return false;
- }
- if (CGLSetPBuffer(context, pbuffer, 0, 0, 0) != kCGLNoError) {
- CGLDestroyContext(context);
- CGLDestroyPBuffer(pbuffer);
- printf("WebGraphicsContext3DDefaultImpl: error attaching pbuffer to context\n");
- return false;
- }
- if (CGLSetCurrentContext(context) != kCGLNoError) {
- CGLDestroyContext(context);
- CGLDestroyPBuffer(pbuffer);
- printf("WebGraphicsContext3DDefaultImpl: error making context current\n");
- return false;
- }
- m_pbuffer = pbuffer;
- m_contextObj = context;
-#elif OS(LINUX)
- if (!s_gl) {
- s_gl = GLConnection::create();
- if (!s_gl)
- return false;
- }
-
- int configAttrs[] = {
- GLX_DRAWABLE_TYPE,
- GLX_PBUFFER_BIT,
- GLX_RENDER_TYPE,
- GLX_RGBA_BIT,
- GLX_DOUBLEBUFFER,
- 0,
- 0
- };
- int nelements = 0;
- GLXFBConfig* config = s_gl->chooseFBConfig(0, configAttrs, &nelements);
- if (!config) {
- printf("WebGraphicsContext3DDefaultImpl: glXChooseFBConfig failed\n");
- return false;
- }
- if (!nelements) {
- printf("WebGraphicsContext3DDefaultImpl: glXChooseFBConfig returned 0 elements\n");
- XFree(config);
- return false;
- }
- GLXContext context = s_gl->createNewContext(config[0], GLX_RGBA_TYPE, 0, True);
- if (!context) {
- printf("WebGraphicsContext3DDefaultImpl: glXCreateNewContext failed\n");
- XFree(config);
- return false;
- }
- int pbufferAttrs[] = {
- GLX_PBUFFER_WIDTH,
- 1,
- GLX_PBUFFER_HEIGHT,
- 1,
- 0
- };
- GLXPbuffer pbuffer = s_gl->createPbuffer(config[0], pbufferAttrs);
- XFree(config);
- if (!pbuffer) {
- printf("WebGraphicsContext3DDefaultImpl: glxCreatePbuffer failed\n");
+
+ m_glContext = WTF::adoptPtr(gfx::GLContext::CreateOffscreenGLContext(0));
+ if (!m_glContext)
return false;
- }
- if (!s_gl->makeCurrent(pbuffer, context)) {
- printf("WebGraphicsContext3DDefaultImpl: glXMakeCurrent failed\n");
- return false;
- }
- m_contextObj = context;
- m_pbuffer = pbuffer;
-#else
-#error Must port to your platform
-#endif
-
- if (!s_initializedGLEW) {
- // Initialize GLEW and check for GL 2.0 support by the drivers.
- GLenum glewInitResult = glewInit();
- if (glewInitResult != GLEW_OK) {
- printf("WebGraphicsContext3DDefaultImpl: GLEW initialization failed\n");
- return false;
- }
- if (!glewIsSupported("GL_VERSION_2_0")) {
- printf("WebGraphicsContext3DDefaultImpl: OpenGL 2.0 not supported\n");
- return false;
- }
- s_initializedGLEW = true;
- }
m_attributes = attributes;
validateAttributes();
@@ -423,22 +143,7 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes()
bool WebGraphicsContext3DDefaultImpl::makeContextCurrent()
{
-#if OS(WINDOWS)
- if (wglewGetCurrentContext() != m_contextObj)
- if (wglewMakeCurrent(m_canvasDC, m_contextObj))
- return true;
-#elif PLATFORM(CG)
- if (CGLGetCurrentContext() != m_contextObj)
- if (CGLSetCurrentContext(m_contextObj) == kCGLNoError)
- return true;
-#elif OS(LINUX)
- if (s_gl->getCurrentContext() != m_contextObj)
- if (s_gl->makeCurrent(m_pbuffer, m_contextObj))
- return true;
-#else
-#error Must port to your platform
-#endif
- return false;
+ return m_glContext->MakeCurrent();
}
int WebGraphicsContext3DDefaultImpl::width()
@@ -500,23 +205,12 @@ static int createTextureObject(GLenum target)
void WebGraphicsContext3DDefaultImpl::reshape(int width, int height)
{
-#ifdef RENDER_TO_DEBUGGING_WINDOW
- SetWindowPos(m_canvasWindow, HWND_TOP, 0, 0, width, height,
- SWP_NOMOVE);
- ShowWindow(m_canvasWindow, SW_SHOW);
-#endif
-
m_cachedWidth = width;
m_cachedHeight = height;
makeContextCurrent();
-#ifndef RENDER_TO_DEBUGGING_WINDOW
-#ifdef USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER
- // GL_TEXTURE_RECTANGLE_ARB is the best supported render target on Mac OS X
- GLenum target = GL_TEXTURE_RECTANGLE_ARB;
-#else
GLenum target = GL_TEXTURE_2D;
-#endif
+
if (!m_texture) {
// Generate the texture object
m_texture = createTextureObject(target);
@@ -658,7 +352,6 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height)
if (mustRestoreFBO)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
-#endif // RENDER_TO_DEBUGGING_WINDOW
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
if (m_scanline) {
@@ -700,9 +393,6 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels,
makeContextCurrent();
-#ifdef RENDER_TO_DEBUGGING_WINDOW
- SwapBuffers(m_canvasDC);
-#else
// Earlier versions of this code used the GPU to flip the
// framebuffer vertically before reading it back for compositing
// via software. This code was quite complicated, used a lot of
@@ -732,13 +422,9 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels,
mustRestorePackAlignment = true;
}
-#if PLATFORM(SKIA)
+ // FIXME: OpenGL ES 2 does not support GL_BGRA so this fails when
+ // using that backend.
glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
-#elif PLATFORM(CG)
- glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
-#else
-#error Must port to your platform
-#endif
if (mustRestorePackAlignment)
glPixelStorei(GL_PACK_ALIGNMENT, packAlignment);
@@ -751,7 +437,6 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels,
flipVertically(pixels, m_cachedWidth, m_cachedHeight);
#endif
-#endif // RENDER_TO_DEBUGGING_WINDOW
return true;
}
@@ -760,6 +445,14 @@ void WebGraphicsContext3DDefaultImpl::synthesizeGLError(unsigned long error)
m_syntheticErrors.add(error);
}
+bool WebGraphicsContext3DDefaultImpl::supportsBGRA()
+{
+ // Supported since OpenGL 1.2. However, glTexImage2D() must be modified
+ // to translate the internalFormat from GL_BGRA to GL_RGBA, since the
+ // former is not accepted by desktop GL. Return false until this is done.
+ return false;
+}
+
// Helper macros to reduce the amount of code.
#define DELEGATE_TO_GL(name, glname) \
@@ -916,38 +609,36 @@ void WebGraphicsContext3DDefaultImpl::copyTexImage2D(unsigned long target, long
long x, long y, unsigned long width, unsigned long height, long border)
{
makeContextCurrent();
-#ifndef RENDER_TO_DEBUGGING_WINDOW
+
if (m_attributes.antialias && 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);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
}
-#endif
+
glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
-#ifndef RENDER_TO_DEBUGGING_WINDOW
+
if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
-#endif
}
void WebGraphicsContext3DDefaultImpl::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset,
long x, long y, unsigned long width, unsigned long height)
{
makeContextCurrent();
-#ifndef RENDER_TO_DEBUGGING_WINDOW
+
if (m_attributes.antialias && 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);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
}
-#endif
+
glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
-#ifndef RENDER_TO_DEBUGGING_WINDOW
+
if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
-#endif
}
DELEGATE_TO_GL_1(cullFace, CullFace, unsigned long)
@@ -1242,11 +933,11 @@ DELEGATE_TO_GL_1R(isBuffer, IsBuffer, WebGLId, bool)
DELEGATE_TO_GL_1R(isEnabled, IsEnabled, unsigned long, bool)
-DELEGATE_TO_GL_1R(isFramebuffer, IsFramebuffer, WebGLId, bool)
+DELEGATE_TO_GL_1R(isFramebuffer, IsFramebufferEXT, WebGLId, bool)
DELEGATE_TO_GL_1R(isProgram, IsProgram, WebGLId, bool)
-DELEGATE_TO_GL_1R(isRenderbuffer, IsRenderbuffer, WebGLId, bool)
+DELEGATE_TO_GL_1R(isRenderbuffer, IsRenderbufferEXT, WebGLId, bool)
DELEGATE_TO_GL_1R(isShader, IsShader, WebGLId, bool)
@@ -1266,7 +957,6 @@ void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long w
// FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
// all previous rendering calls should be done before reading pixels.
glFlush();
-#ifndef RENDER_TO_DEBUGGING_WINDOW
if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) {
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
@@ -1274,12 +964,11 @@ void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long w
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
glFlush();
}
-#endif
+
glReadPixels(x, y, width, height, format, type, pixels);
-#ifndef RENDER_TO_DEBUGGING_WINDOW
+
if (m_attributes.antialias && m_boundFBO == m_multisampleFBO)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
-#endif
}
void WebGraphicsContext3DDefaultImpl::releaseShaderCompiler()
@@ -1431,7 +1120,7 @@ unsigned WebGraphicsContext3DDefaultImpl::createBuffer()
{
makeContextCurrent();
GLuint o;
- glGenBuffers(1, &o);
+ glGenBuffersARB(1, &o);
return o;
}
@@ -1470,7 +1159,7 @@ unsigned WebGraphicsContext3DDefaultImpl::createTexture()
void WebGraphicsContext3DDefaultImpl::deleteBuffer(unsigned buffer)
{
makeContextCurrent();
- glDeleteBuffers(1, &buffer);
+ glDeleteBuffersARB(1, &buffer);
}
void WebGraphicsContext3DDefaultImpl::deleteFramebuffer(unsigned framebuffer)
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 8223a1c..cf5f5b4 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -36,25 +36,14 @@
#include "WebGraphicsContext3D.h"
#include <wtf/ListHashSet.h>
+#include <wtf/OwnPtr.h>
-#if OS(WINDOWS)
-#include <windows.h>
-#endif
-
-#include "GL/glew.h"
-#if OS(WINDOWS)
-#include "GL/wglew.h"
-#endif
-
-#if PLATFORM(CG)
-#include <OpenGL/OpenGL.h>
-#else
+#if !PLATFORM(CG)
#define FLIP_FRAMEBUFFER_VERTICALLY
#endif
-
-#if OS(LINUX)
-#include "GL/glxew.h"
-#endif
+namespace gfx {
+class GLContext;
+}
namespace WebKit {
@@ -88,6 +77,7 @@ public:
virtual void prepareTexture();
virtual void synthesizeGLError(unsigned long error);
+ virtual bool supportsBGRA();
virtual void activeTexture(unsigned long texture);
virtual void attachShader(WebGLId program, WebGLId shader);
@@ -323,103 +313,7 @@ private:
// Errors raised by synthesizeGLError().
ListHashSet<unsigned long> m_syntheticErrors;
- static bool s_initializedGLEW;
-#if OS(WINDOWS)
- HWND m_canvasWindow;
- HDC m_canvasDC;
- HGLRC m_contextObj;
-#elif PLATFORM(CG)
- CGLPBufferObj m_pbuffer;
- CGLContextObj m_contextObj;
- unsigned char* m_renderOutput;
-#elif OS(LINUX)
- GLXContext m_contextObj;
- GLXPbuffer m_pbuffer;
-
- // In order to avoid problems caused by linking against libGL, we
- // dynamically look up all the symbols we need.
- // http://code.google.com/p/chromium/issues/detail?id=16800
- class GLConnection {
- public:
- ~GLConnection();
-
- static GLConnection* create();
-
- GLXFBConfig* chooseFBConfig(int screen, const int *attrib_list, int *nelements)
- {
- return m_glXChooseFBConfig(m_display, screen, attrib_list, nelements);
- }
-
- GLXContext createNewContext(GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
- {
- return m_glXCreateNewContext(m_display, config, renderType, shareList, direct);
- }
-
- GLXPbuffer createPbuffer(GLXFBConfig config, const int *attribList)
- {
- return m_glXCreatePbuffer(m_display, config, attribList);
- }
-
- void destroyPbuffer(GLXPbuffer pbuf)
- {
- m_glXDestroyPbuffer(m_display, pbuf);
- }
-
- Bool makeCurrent(GLXDrawable drawable, GLXContext ctx)
- {
- return m_glXMakeCurrent(m_display, drawable, ctx);
- }
-
- void destroyContext(GLXContext ctx)
- {
- m_glXDestroyContext(m_display, ctx);
- }
-
- GLXContext getCurrentContext()
- {
- return m_glXGetCurrentContext();
- }
-
- private:
- Display* m_display;
- void* m_libGL;
- PFNGLXCHOOSEFBCONFIGPROC m_glXChooseFBConfig;
- PFNGLXCREATENEWCONTEXTPROC m_glXCreateNewContext;
- PFNGLXCREATEPBUFFERPROC m_glXCreatePbuffer;
- PFNGLXDESTROYPBUFFERPROC m_glXDestroyPbuffer;
- typedef Bool (* PFNGLXMAKECURRENTPROC)(Display* dpy, GLXDrawable drawable, GLXContext ctx);
- PFNGLXMAKECURRENTPROC m_glXMakeCurrent;
- typedef void (* PFNGLXDESTROYCONTEXTPROC)(Display* dpy, GLXContext ctx);
- PFNGLXDESTROYCONTEXTPROC m_glXDestroyContext;
- typedef GLXContext (* PFNGLXGETCURRENTCONTEXTPROC)(void);
- PFNGLXGETCURRENTCONTEXTPROC m_glXGetCurrentContext;
-
- GLConnection(Display* display,
- void* libGL,
- PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig,
- PFNGLXCREATENEWCONTEXTPROC createNewContext,
- PFNGLXCREATEPBUFFERPROC createPbuffer,
- PFNGLXDESTROYPBUFFERPROC destroyPbuffer,
- PFNGLXMAKECURRENTPROC makeCurrent,
- PFNGLXDESTROYCONTEXTPROC destroyContext,
- PFNGLXGETCURRENTCONTEXTPROC getCurrentContext)
- : m_libGL(libGL)
- , m_display(display)
- , m_glXChooseFBConfig(chooseFBConfig)
- , m_glXCreateNewContext(createNewContext)
- , m_glXCreatePbuffer(createPbuffer)
- , m_glXDestroyPbuffer(destroyPbuffer)
- , m_glXMakeCurrent(makeCurrent)
- , m_glXDestroyContext(destroyContext)
- , m_glXGetCurrentContext(getCurrentContext)
- {
- }
- };
-
- static GLConnection* s_gl;
-#else
- #error Must port WebGraphicsContext3DDefaultImpl to your platform
-#endif
+ OwnPtr<gfx::GLContext> m_glContext;
};
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebIDBKey.cpp b/WebKit/chromium/src/WebIDBKey.cpp
index 1c4c685..413a9e6 100644
--- a/WebKit/chromium/src/WebIDBKey.cpp
+++ b/WebKit/chromium/src/WebIDBKey.cpp
@@ -30,7 +30,12 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBBindingUtilities.h"
#include "IDBKey.h"
+#include "IDBKeyPath.h"
+#include "SerializedScriptValue.h"
+#include "WebIDBKeyPath.h"
+#include "WebSerializedScriptValue.h"
using namespace WebCore;
@@ -50,6 +55,13 @@ WebIDBKey WebIDBKey::createInvalid()
return key;
}
+WebIDBKey WebIDBKey::createFromValueAndKeyPath(const WebSerializedScriptValue& serializedScriptValue, const WebIDBKeyPath& idbKeyPath)
+{
+ if (serializedScriptValue.isNull())
+ return WebIDBKey::createInvalid();
+ return WebCore::createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath);
+}
+
void WebIDBKey::assign(const WebIDBKey& value)
{
m_private = value.m_private;
diff --git a/WebKit/chromium/src/WebIDBKeyPath.cpp b/WebKit/chromium/src/WebIDBKeyPath.cpp
new file mode 100644
index 0000000..9eb33d6
--- /dev/null
+++ b/WebKit/chromium/src/WebIDBKeyPath.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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 "WebIDBKeyPath.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBKeyPath.h"
+#include "WebString.h"
+#include "WebVector.h"
+#include <wtf/Vector.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebIDBKeyPath WebIDBKeyPath::create(const WebString& keyPath)
+{
+ WTF::Vector<IDBKeyPathElement> idbElements;
+ IDBKeyPathParseError idbError;
+ IDBParseKeyPath(keyPath, idbElements, idbError);
+ return WebIDBKeyPath(idbElements, static_cast<int>(idbError));
+}
+
+WebIDBKeyPath::WebIDBKeyPath(const WTF::Vector<IDBKeyPathElement>& elements, int parseError)
+ : m_private(new WTF::Vector<IDBKeyPathElement>(elements))
+ , m_parseError(parseError)
+{
+}
+
+int WebIDBKeyPath::parseError() const
+{
+ return m_parseError;
+}
+
+void WebIDBKeyPath::assign(const WebIDBKeyPath& keyPath)
+{
+ m_parseError = keyPath.m_parseError;
+ m_private.reset(new WTF::Vector<IDBKeyPathElement>(keyPath));
+}
+
+void WebIDBKeyPath::reset()
+{
+ m_private.reset(0);
+}
+
+WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&() const
+{
+ return *m_private.get();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/src/WebKit.cpp b/WebKit/chromium/src/WebKit.cpp
index 1d717ea..786d573 100644
--- a/WebKit/chromium/src/WebKit.cpp
+++ b/WebKit/chromium/src/WebKit.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "WebKit.h"
-#include "AtomicString.h"
#include "DOMTimer.h"
#include "Logging.h"
#include "Page.h"
@@ -43,6 +42,7 @@
#include <wtf/Assertions.h>
#include <wtf/Threading.h>
+#include <wtf/text/AtomicString.h>
namespace WebKit {
diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp
index 38d91df..6aa8439 100644
--- a/WebKit/chromium/src/WebNotification.cpp
+++ b/WebKit/chromium/src/WebNotification.cpp
@@ -113,6 +113,11 @@ WebString WebNotification::replaceId() const
return m_private->replaceId();
}
+void WebNotification::detachPresenter()
+{
+ m_private->detachPresenter();
+}
+
void WebNotification::dispatchDisplayEvent()
{
RefPtr<Event> event = Event::create("display", false, true);
diff --git a/WebKit/chromium/src/WebPageSerializerImpl.h b/WebKit/chromium/src/WebPageSerializerImpl.h
index 03f0a3b..a7f2fb4 100644
--- a/WebKit/chromium/src/WebPageSerializerImpl.h
+++ b/WebKit/chromium/src/WebPageSerializerImpl.h
@@ -32,10 +32,10 @@
#define WebPageSerializerImpl_h
#include "PlatformString.h"
-#include "StringHash.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#include "StringBuilder.h"
#include "WebEntities.h"
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
index 6b04320..57e3635 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
@@ -46,6 +46,12 @@ WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl(
: m_webcoreMock(new WebCore::SpeechInputClientMock())
, m_listener(listener)
{
+ m_webcoreMock->setListener(this);
+}
+
+WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl()
+{
+ m_webcoreMock->setListener(0);
}
void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result)
@@ -53,34 +59,34 @@ void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString&
m_webcoreMock->setRecognitionResult(result);
}
-void WebSpeechInputControllerMockImpl::didCompleteRecording()
+void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId)
{
- m_listener->didCompleteRecording();
+ m_listener->didCompleteRecording(requestId);
}
-void WebSpeechInputControllerMockImpl::didCompleteRecognition()
+void WebSpeechInputControllerMockImpl::didCompleteRecognition(int requestId)
{
- m_listener->didCompleteRecognition();
+ m_listener->didCompleteRecognition(requestId);
}
-void WebSpeechInputControllerMockImpl::setRecognitionResult(const WTF::String& result)
+void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WTF::String& result)
{
- m_listener->setRecognitionResult(result);
+ m_listener->setRecognitionResult(requestId, result);
}
-bool WebSpeechInputControllerMockImpl::startRecognition()
+bool WebSpeechInputControllerMockImpl::startRecognition(int requestId)
{
- return m_webcoreMock->startRecognition(this);
+ return m_webcoreMock->startRecognition(requestId);
}
-void WebSpeechInputControllerMockImpl::cancelRecognition()
+void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId)
{
- m_webcoreMock->cancelRecognition();
+ m_webcoreMock->cancelRecognition(requestId);
}
-void WebSpeechInputControllerMockImpl::stopRecording()
+void WebSpeechInputControllerMockImpl::stopRecording(int requestId)
{
- m_webcoreMock->stopRecording();
+ m_webcoreMock->stopRecording(requestId);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
index 046abf3..38a15df 100644
--- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
+++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
@@ -47,16 +47,17 @@ class WebSpeechInputControllerMockImpl : public WebCore::SpeechInputListener
, public WebSpeechInputControllerMock {
public:
WebSpeechInputControllerMockImpl(WebSpeechInputListener*);
+ virtual ~WebSpeechInputControllerMockImpl();
// WebCore::SpeechInputListener methods.
- void didCompleteRecording();
- void didCompleteRecognition();
- void setRecognitionResult(const WTF::String& result);
+ void didCompleteRecording(int requestId);
+ void didCompleteRecognition(int requestId);
+ void setRecognitionResult(int requestId, const WTF::String& result);
// WebSpeechInputController methods.
- bool startRecognition();
- void cancelRecognition();
- void stopRecording();
+ bool startRecognition(int requestId);
+ void cancelRecognition(int requestId);
+ void stopRecording(int requestId);
// WebSpeechInputControllerMock methods.
void setMockRecognitionResult(const WebString& result);
diff --git a/WebKit/chromium/src/WebString.cpp b/WebKit/chromium/src/WebString.cpp
index bbbe9ce..a091ef4 100644
--- a/WebKit/chromium/src/WebString.cpp
+++ b/WebKit/chromium/src/WebString.cpp
@@ -31,9 +31,9 @@
#include "config.h"
#include "WebString.h"
-#include "AtomicString.h"
#include "PlatformString.h"
#include <wtf/text/CString.h>
+#include <wtf/text/AtomicString.h>
#include "WebCString.h"
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 8733a2a..62b20d5 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -1949,8 +1949,14 @@ void WebView::addUserStyleSheet(const WebString& sourceCode,
PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::create());
+
+ // FIXME: Current callers always want the level to be "author". It probably makes sense to let
+ // callers specify this though, since in other cases the caller will probably want "user" level.
+ //
+ // FIXME: It would be nice to populate the URL correctly, instead of passing an empty URL.
pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0,
- static_cast<UserContentInjectedFrames>(injectIn));
+ static_cast<UserContentInjectedFrames>(injectIn),
+ UserStyleSheet::AuthorLevel);
}
void WebView::removeAllUserContent()
diff --git a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
index dc46b07..f8a1386 100644
--- a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
+++ b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp
@@ -45,12 +45,15 @@
namespace {
-gint getDoubleClickTime()
+bool countsAsDoubleClick(gint timeDiff, gint xDiff, gint yDiff)
{
static GtkSettings* settings = gtk_settings_get_default();
gint doubleClickTime = 250;
- g_object_get(G_OBJECT(settings), "gtk-double-click-time", &doubleClickTime, NULL);
- return doubleClickTime;
+ gint doubleClickDistance = 5;
+ g_object_get(G_OBJECT(settings),
+ "gtk-double-click-time", &doubleClickTime,
+ "gtk-double-click-distance", &doubleClickDistance, 0);
+ return timeDiff <= doubleClickTime && abs(xDiff) <= doubleClickDistance && abs(yDiff) <= doubleClickDistance;
}
} // namespace
@@ -404,9 +407,13 @@ WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event)
static int numClicks = 0;
static GdkWindow* eventWindow = 0;
static gint lastLeftClickTime = 0;
+ static gint lastLeftClickX = 0;
+ static gint lastLeftClickY = 0;
- gint time_diff = event->time - lastLeftClickTime;
- if (eventWindow == event->window && time_diff < getDoubleClickTime())
+ gint timeDiff = event->time - lastLeftClickTime;
+ gint xDiff = event->x - lastLeftClickX;
+ gint yDiff = event->y - lastLeftClickY;
+ if (eventWindow == event->window && countsAsDoubleClick(timeDiff, xDiff, yDiff))
numClicks++;
else
numClicks = 1;
@@ -414,6 +421,8 @@ WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event)
result.clickCount = numClicks;
eventWindow = event->window;
lastLeftClickTime = event->time;
+ lastLeftClickX = event->x;
+ lastLeftClickY = event->y;
}
result.button = WebMouseEvent::ButtonNone;
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index 895c68b..0fd66c9 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -34,22 +34,6 @@
* DevTools frontend together. It is also responsible for overriding existing
* WebInspector functionality while it is getting upstreamed into WebCore.
*/
-
-/**
- * Dispatches raw message from the host.
- * @param {string} remoteName
- * @prama {string} methodName
- * @param {string} param1, param2, param3 Arguments to dispatch.
- */
-devtools$$dispatch = function(message)
-{
- var args = typeof message === "string" ? JSON.parse(message) : message;
- var methodName = args[0];
- var parameters = args.slice(1);
- WebInspector[methodName].apply(WebInspector, parameters);
-};
-
-
devtools.ToolsAgent = function()
{
this.profilerAgent_ = new devtools.ProfilerAgent();
@@ -75,30 +59,6 @@ devtools.tools = null;
var context = {}; // Used by WebCore's inspector routines.
-(function() {
- WebInspector._paramsObject = {};
-
- var queryParams = window.location.search;
- if (queryParams) {
- var params = queryParams.substring(1).split("&");
- for (var i = 0; i < params.length; ++i) {
- var pair = params[i].split("=");
- WebInspector._paramsObject[pair[0]] = pair[1];
- }
- }
- if ("page" in WebInspector._paramsObject) {
- WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector._paramsObject.page);
- WebInspector.socket.onmessage = function(message) { devtools$$dispatch(message.data); }
- WebInspector.socket.onerror = function(error) { console.err(error); }
- WebInspector.socket.onopen = function() {
- WebInspector.socketOpened = true;
- if (WebInspector.loadedDone)
- WebInspector.doLoadedDone();
- };
- InspectorFrontendHost.sendMessageToBackend = WebInspector.socket.send.bind(WebInspector.socket);
- InspectorFrontendHost.loaded = WebInspector.socket.send.bind(WebInspector.socket, "loaded");
- }
-})();
///////////////////////////////////////////////////////////////////////////////
// Here and below are overrides to existing WebInspector methods only.
// TODO(pfeldman): Patch WebCore and upstream changes.
@@ -114,24 +74,15 @@ WebInspector.loaded = function()
Preferences.profilerAlwaysEnabled = true;
Preferences.canEditScriptSource = true;
Preferences.onlineDetectionEnabled = false;
- if ("page" in WebInspector._paramsObject) {
- WebInspector.loadedDone = true;
- if (WebInspector.socketOpened)
- WebInspector.doLoadedDone();
- return;
- }
- WebInspector.doLoadedDone();
-}
-WebInspector.doLoadedDone = function() {
- oldLoaded.call(this);
+ oldLoaded.call(WebInspector);
}
devtools.domContentLoaded = function()
{
- WebInspector.setAttachedWindow(WebInspector._paramsObject.docked === "true");
- if (WebInspector._paramsObject.toolbar_color && WebInspector._paramsObject.text_color)
- WebInspector.setToolbarColors(WebInspector._paramsObject.toolbar_color, WebInspector._paramsObject.text_color);
+ WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true");
+ if (WebInspector.queryParamsObject.toolbar_color && WebInspector.queryParamsObject.text_color)
+ WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbar_color, WebInspector.queryParamsObject.text_color);
}
document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false);
@@ -243,10 +194,3 @@ WebInspector.resetToolbarColors = function()
if (window.RemoteDebuggerAgent) {
RemoteDebuggerAgent.setContextId = function() {};
}
-
-
-// Support for pause while renderer is busy (is dispatched on IO thread).
-InspectorBackend.pause = function()
-{
- RemoteDebuggerCommandExecutor.DebuggerPauseScript();
-};
diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js
index 764f624..41574b4 100644
--- a/WebKit/chromium/src/js/Tests.js
+++ b/WebKit/chromium/src/js/Tests.js
@@ -1069,25 +1069,6 @@ TestSuite.prototype._checkSourceFrameWhenLoaded = function(expectations, callbac
/**
- * Performs sequence of steps.
- * @param {Array.<Object|Function>} Array [expectations1,action1,expectations2,
- * action2,...,actionN].
- */
-TestSuite.prototype._performSteps = function(actions)
-{
- var test = this;
- var i = 0;
- function doNextAction() {
- if (i > 0)
- actions[i++]();
- if (i < actions.length - 1)
- test._waitForScriptPause(actions[i++], doNextAction);
- }
- doNextAction();
-};
-
-
-/**
* Waits until all the scripts are parsed and asynchronously executes the code
* in the inspected page.
*/
@@ -1128,131 +1109,6 @@ TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callb
/**
- * Waits until all debugger scripts are parsed and executes "a()" in the
- * inspected page.
- */
-TestSuite.prototype._executeFunctionForStepTest = function()
-{
- this._executeCodeWhenScriptsAreParsed("a()", ["debugger_step.html", "debugger_step.js"]);
-};
-
-
-/**
- * Tests step over in the debugger.
- */
-TestSuite.prototype.testStepOver = function()
-{
- this.showPanel("scripts");
- var test = this;
-
- this._executeFunctionForStepTest();
-
- this._performSteps([
- {
- functionsOnStack: ["d","a",""],
- lineNumber: 3,
- lineText: " debugger;"
- },
- function() {
- document.getElementById("scripts-step-over").click();
- },
- {
- functionsOnStack: ["d","a",""],
- lineNumber: 5,
- lineText: " var y = fact(10);"
- },
- function() {
- document.getElementById("scripts-step-over").click();
- },
- {
- functionsOnStack: ["d","a",""],
- lineNumber: 6,
- lineText: " return y;"
- },
- function() {
- test.releaseControl();
- }
- ]);
-
- test.takeControl();
-};
-
-
-/**
- * Tests step out in the debugger.
- */
-TestSuite.prototype.testStepOut = function()
-{
- this.showPanel("scripts");
- var test = this;
-
- this._executeFunctionForStepTest();
-
- this._performSteps([
- {
- functionsOnStack: ["d","a",""],
- lineNumber: 3,
- lineText: " debugger;"
- },
- function() {
- document.getElementById("scripts-step-out").click();
- },
- {
- functionsOnStack: ["a",""],
- lineNumber: 8,
- lineText: " printResult(result);"
- },
- function() {
- test.releaseControl();
- }
- ]);
-
- test.takeControl();
-};
-
-
-/**
- * Tests step in in the debugger.
- */
-TestSuite.prototype.testStepIn = function()
-{
- this.showPanel("scripts");
- var test = this;
-
- this._executeFunctionForStepTest();
-
- this._performSteps([
- {
- functionsOnStack: ["d","a",""],
- lineNumber: 3,
- lineText: " debugger;"
- },
- function() {
- document.getElementById("scripts-step-over").click();
- },
- {
- functionsOnStack: ["d","a",""],
- lineNumber: 5,
- lineText: " var y = fact(10);"
- },
- function() {
- document.getElementById("scripts-step-into").click();
- },
- {
- functionsOnStack: ["fact","d","a",""],
- lineNumber: 10,
- lineText: " var r = 1;"
- },
- function() {
- test.releaseControl();
- }
- ]);
-
- test.takeControl();
-};
-
-
-/**
* Gets a XPathResult matching given xpath.
* @param {string} xpath
* @param {number} resultType
@@ -1503,116 +1359,6 @@ TestSuite.prototype._hookGetPropertiesCallback = function(hook, code)
/**
- * Tests that all elements in prototype chain of an object have expected
- * intrinic proprties(__proto__, constructor, prototype).
- */
-TestSuite.prototype.testDebugIntrinsicProperties = function()
-{
- this.showPanel("scripts");
- var test = this;
-
- this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_intrinsic_properties.html"]);
-
- this._waitForScriptPause(
- {
- functionsOnStack: ["callDebugger", "handleClick", ""],
- lineNumber: 29,
- lineText: " debugger;"
- },
- expandLocalScope);
-
- var localScopeSection = null;
- function expandLocalScope() {
- test._expandScopeSections(function(sections, i) {
- if (i === 0) {
- test.assertTrue(sections[i].object.isLocal, "Scope #0 is not Local.");
- localScopeSection = sections[i];
- return true;
- }
- return false;
- },
- examineLocalScope);
- }
-
- function examineLocalScope() {
- var scopeExpectations = [
- "a", "Child", [
- "__proto__", "Child", [
- "__proto__", "Parent", [
- "__proto__", "Object", null,
- "constructor", "function Parent(n) {", [
- "name", '"Parent"', null,
- "prototype", 'Parent', [
- "parentProtoField", "11", null,
- ]
- ],
- "parentProtoField", "11", null,
- ],
- "constructor", "function Child(n) {", null,
- "childProtoField", "21", null,
- ],
-
- "parentField", "10", null,
- "childField", "20", null,
- ]
- ];
- checkProperty(localScopeSection.propertiesTreeOutline, "<Local Scope>", scopeExpectations);
- }
-
- var propQueue = [];
- var index = 0;
- var expectedFinalIndex = 5;
-
- function expandAndCheckNextProperty() {
- if (index === propQueue.length) {
- test.assertEquals(expectedFinalIndex, index, "Unexpected number of expanded objects.");
- test.releaseControl();
- return;
- }
-
- // Read next property data from the queue.
- var treeElement = propQueue[index].treeElement;
- var path = propQueue[index].path;
- var expectations = propQueue[index].expectations;
- index++;
-
- // Expand the property.
- test._hookGetPropertiesCallback(function() {
- checkProperty(treeElement, path, expectations);
- },
- function() {
- treeElement.expand();
- });
- }
-
- function checkProperty(treeElement, path, expectations) {
- for (var i = 0; i < expectations.length; i += 3) {
- var name = expectations[i];
- var description = expectations[i+1];
- var value = expectations[i+2];
-
- var propertyPath = path + "." + name;
- var propertyTreeElement = test._findChildProperty(treeElement, name, path);
- test.assertTrue(propertyTreeElement, 'Property "' + propertyPath + '" not found.');
- test.assertEquals(description, propertyTreeElement.property.value.description, 'Unexpected "' + propertyPath + '" description.');
- if (value) {
- // Schedule property content check.
- propQueue.push({
- treeElement: propertyTreeElement,
- path: propertyPath,
- expectations: value,
- });
- }
- }
- // Check next property in the queue.
- expandAndCheckNextProperty();
- }
-
- test.takeControl();
-};
-
-
-/**
* Tests "Pause" button will pause debugger when a snippet is evaluated.
*/
TestSuite.prototype.testPauseInEval = function()
@@ -1647,101 +1393,6 @@ TestSuite.createKeyEvent = function(keyIdentifier)
/**
- * Tests console eval.
- */
-TestSuite.prototype.testConsoleEval = function()
-{
- var test = this;
- this.evaluateInConsole_("123",
- function(resultText) {
- test.assertEquals("123", resultText);
- test.releaseControl();
- });
-
- this.takeControl();
-};
-
-
-/**
- * Tests console log.
- */
-TestSuite.prototype.testConsoleLog = function()
-{
- WebInspector.showConsole();
- var messages = WebInspector.console.messages;
- var index = 0;
-
- var test = this;
- var assertNext = function(line, message, opt_class, opt_count, opt_substr) {
- var elem = messages[index++].toMessageElement();
- var clazz = elem.getAttribute("class");
- var expectation = (opt_count || '') + 'console_test_page.html:' + line + message;
- if (opt_substr)
- test.assertContains(elem.textContent, expectation);
- else
- test.assertEquals(expectation, elem.textContent);
- if (opt_class)
- test.assertContains(clazz, "console-" + opt_class);
- };
-
- assertNext("5", "log", "log-level");
- assertNext("7", "debug", "log-level");
- assertNext("9", "info", "log-level");
- assertNext("11", "warn", "warning-level");
- assertNext("13", "error", "error-level");
- assertNext("15", "Message format number 1, 2 and 3.5");
- assertNext("17", "Message format for string");
- assertNext("19", "Object Object");
- assertNext("22", "repeated", "log-level", 5);
- assertNext("26", "count: 1");
- assertNext("26", "count: 2");
- assertNext("29", "group", "group-title");
- index++;
- assertNext("33", "timer:", "log-level", "", true);
- assertNext("35", "1 2 3", "log-level");
- assertNext("37", "HTMLDocument", "log-level");
- assertNext("39", "<html>", "log-level", "", true);
-};
-
-
-/**
- * Tests eval of global objects.
- */
-TestSuite.prototype.testEvalGlobal = function()
-{
- WebInspector.showConsole();
-
- var inputs = ["foo", "foobar"];
- var expectations = ["foo", "fooValue", "foobar", "ReferenceError: foobar is not defined"];
-
- // Do not change code below - simply add inputs and expectations above.
- var initEval = function(input) {
- WebInspector.console.prompt.text = input;
- WebInspector.console.promptElement.dispatchEvent( TestSuite.createKeyEvent("Enter"));
- };
- var test = this;
- var messagesCount = 0;
- var inputIndex = 0;
- this.addSniffer(WebInspector.ConsoleView.prototype, "addMessage",
- function(commandResult) {
- messagesCount++;
- if (messagesCount === expectations.length) {
- var messages = WebInspector.console.messages;
- for (var i = 0; i < expectations; ++i) {
- var elem = messages[i++].toMessageElement();
- test.assertEquals(elem.textContent, expectations[i]);
- }
- test.releaseControl();
- } else if (messagesCount % 2 === 0)
- initEval(inputs[inputIndex++]);
- }, true);
-
- initEval(inputs[inputIndex++]);
- this.takeControl();
-};
-
-
-/**
* Tests the message loop re-entrancy.
*/
TestSuite.prototype.testMessageLoopReentrant = function()
diff --git a/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp
new file mode 100644
index 0000000..1b7f156
--- /dev/null
+++ b/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp
@@ -0,0 +1,165 @@
+/*
+ * 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 "IDBBindingUtilities.h"
+#include "IDBKey.h"
+#include "IDBKeyPath.h"
+#include "SerializedScriptValue.h"
+
+#include <gtest/gtest.h>
+#include <wtf/Vector.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+using namespace WebCore;
+
+namespace {
+
+class LocalContext {
+public:
+ LocalContext()
+ : m_context(v8::Context::New())
+ {
+ m_context->Enter();
+ }
+
+ virtual ~LocalContext()
+ {
+ m_context->Exit();
+ m_context.Dispose();
+ }
+
+private:
+ v8::Locker m_locker;
+ v8::HandleScope m_scope;
+ v8::Persistent<v8::Context> m_context;
+};
+
+PassRefPtr<IDBKey> checkKeyFromValueAndKeyPathInternal(SerializedScriptValue* value, const String& keyPath)
+{
+ Vector<IDBKeyPathElement> idbKeyPath;
+ IDBKeyPathParseError parseError;
+ IDBParseKeyPath(keyPath, idbKeyPath, parseError);
+ EXPECT_EQ(IDBKeyPathParseErrorNone, parseError);
+ return createIDBKeyFromSerializedValueAndKeyPath(value, idbKeyPath);
+}
+
+void checkKeyPathNullValue(SerializedScriptValue* value, const String& keyPath)
+{
+ RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath);
+ ASSERT_FALSE(idbKey.get());
+}
+
+void checkKeyPathStringValue(SerializedScriptValue* value, const String& keyPath, const String& expected)
+{
+ RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath);
+ ASSERT_TRUE(idbKey.get());
+ ASSERT_EQ(IDBKey::StringType, idbKey->type());
+ ASSERT_TRUE(expected == idbKey->string());
+}
+
+void checkKeyPathNumberValue(SerializedScriptValue* value, const String& keyPath, int expected)
+{
+ RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath);
+ ASSERT_TRUE(idbKey.get());
+ ASSERT_EQ(IDBKey::NumberType, idbKey->type());
+ ASSERT_TRUE(expected == idbKey->number());
+}
+
+TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
+{
+ LocalContext v8context;
+ v8::Local<v8::Object> object = v8::Object::New();
+ object->Set(v8::String::New("foo"), v8::String::New("zoo"));
+
+ RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object);
+
+ checkKeyPathStringValue(serializedScriptValue.get(), "foo", "zoo");
+ checkKeyPathNullValue(serializedScriptValue.get(), "bar");
+ checkKeyPathNullValue(serializedScriptValue.get(), "[3]");
+}
+
+TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
+{
+ LocalContext v8context;
+ v8::Local<v8::Object> object = v8::Object::New();
+ object->Set(v8::String::New("foo"), v8::Number::New(456));
+
+ RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object);
+
+ checkKeyPathNumberValue(serializedScriptValue.get(), "foo", 456);
+ checkKeyPathNullValue(serializedScriptValue.get(), "bar");
+ checkKeyPathNullValue(serializedScriptValue.get(), "[3]");
+}
+
+TEST(IDBKeyFromValueAndKeyPathTest, TopLevelArrayElement)
+{
+ LocalContext v8context;
+ v8::Local<v8::Array> array = v8::Array::New();
+ array->Set(3, v8::String::New("zoo"));
+
+ RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(array);
+
+ checkKeyPathStringValue(serializedScriptValue.get(), "[3]", "zoo");
+ checkKeyPathNullValue(serializedScriptValue.get(), "foo");
+ checkKeyPathNullValue(serializedScriptValue.get(), "bar");
+}
+
+TEST(IDBKeyFromValueAndKeyPathTest, SubProperty)
+{
+ LocalContext v8context;
+ v8::Local<v8::Object> object = v8::Object::New();
+ v8::Local<v8::Object> subProperty = v8::Object::New();
+ subProperty->Set(v8::String::New("bar"), v8::String::New("zee"));
+ object->Set(v8::String::New("foo"), subProperty);
+
+ RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object);
+
+ checkKeyPathStringValue(serializedScriptValue.get(), "foo.bar", "zee");
+ checkKeyPathNullValue(serializedScriptValue.get(), "bar");
+ checkKeyPathNullValue(serializedScriptValue.get(), "[3]");
+}
+
+TEST(IDBKeyFromValueAndKeyPathTest, Array2D)
+{
+ LocalContext v8context;
+ v8::Local<v8::Object> object = v8::Object::New();
+ v8::Local<v8::Array> array = v8::Array::New();
+ v8::Local<v8::Array> subArray = v8::Array::New();
+ subArray->Set(7, v8::String::New("zee"));
+ array->Set(3, subArray);
+ object->Set(v8::String::New("foo"), array);
+
+ RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object);
+
+ checkKeyPathStringValue(serializedScriptValue.get(), "foo[3][7]", "zee");
+ checkKeyPathNullValue(serializedScriptValue.get(), "bar");
+ checkKeyPathNullValue(serializedScriptValue.get(), "[4]");
+}
+
+} // namespace
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/tests/IDBKeyPathTest.cpp b/WebKit/chromium/tests/IDBKeyPathTest.cpp
new file mode 100644
index 0000000..ac10f4f
--- /dev/null
+++ b/WebKit/chromium/tests/IDBKeyPathTest.cpp
@@ -0,0 +1,205 @@
+/*
+ * 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 "IDBKeyPath.h"
+
+#include <gtest/gtest.h>
+#include <wtf/Vector.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+using namespace WebCore;
+
+namespace {
+
+IDBKeyPathElement ExpectedToken(const String& identifier, bool isIndexed, int index)
+{
+ IDBKeyPathElement expected;
+ if (isIndexed) {
+ expected.type = IDBKeyPathElement::IsIndexed;
+ expected.index = index;
+ } else {
+ expected.type = IDBKeyPathElement::IsNamed;
+ expected.identifier = identifier;
+ }
+ return expected;
+}
+
+void checkKeyPath(const String& keyPath, const Vector<IDBKeyPathElement>& expected, int parserError)
+{
+
+ IDBKeyPathParseError error;
+ Vector<IDBKeyPathElement> idbKeyPathElements;
+ IDBParseKeyPath(keyPath, idbKeyPathElements, error);
+ ASSERT_EQ(parserError, error);
+ if (error != IDBKeyPathParseErrorNone)
+ return;
+ ASSERT_EQ(expected.size(), idbKeyPathElements.size());
+ for (int i = 0; i < expected.size(); ++i) {
+ ASSERT_TRUE(expected[i].type == idbKeyPathElements[i].type) << i;
+ if (expected[i].type == IDBKeyPathElement::IsIndexed)
+ ASSERT_EQ(expected[i].index, idbKeyPathElements[i].index) << i;
+ else if (expected[i].type == IDBKeyPathElement::IsNamed)
+ ASSERT_TRUE(expected[i].identifier == idbKeyPathElements[i].identifier) << i;
+ else
+ ASSERT_TRUE(false) << "Invalid IDBKeyPathElement type";
+ }
+}
+
+TEST(IDBKeyPathTest, ValidKeyPath0)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("foo.bar.zoo");
+ expected.append(ExpectedToken("foo", false, 0));
+ expected.append(ExpectedToken("bar", false, 0));
+ expected.append(ExpectedToken("zoo", false, 0));
+ checkKeyPath(keyPath, expected, 0);
+}
+
+TEST(IDBKeyPathTest, ValidKeyPath1)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[34][20].foo[2].bar");
+ expected.append(ExpectedToken("a", false, 0));
+ expected.append(ExpectedToken(String(), true, 34));
+ expected.append(ExpectedToken(String(), true, 20));
+ expected.append(ExpectedToken("foo", false, 0));
+ expected.append(ExpectedToken(String(), true, 2));
+ expected.append(ExpectedToken("bar", false, 0));
+ checkKeyPath(keyPath, expected, 0);
+}
+
+TEST(IDBKeyPathTest, ValidKeyPath2)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("foo[ 34 ].Zoo_[00023]\t._c");
+ expected.append(ExpectedToken("foo", false, 0));
+ expected.append(ExpectedToken(String(), true, 34));
+ expected.append(ExpectedToken("Zoo_", false, 0));
+ expected.append(ExpectedToken(String(), true, 23));
+ expected.append(ExpectedToken("_c", false, 0));
+ checkKeyPath(keyPath, expected, 0);
+}
+
+TEST(IDBKeyPathTest, ValidKeyPath3)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("foo[ 34 ]");
+ expected.append(ExpectedToken("foo", false, 0));
+ expected.append(ExpectedToken(String(), true, 34));
+ checkKeyPath(keyPath, expected, 0);
+}
+
+TEST(IDBKeyPathTest, ValidKeyPath4)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("[ 34 ]");
+ expected.append(ExpectedToken(String(), true, 34));
+ checkKeyPath(keyPath, expected, 0);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath2)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[[34]].b[2].c");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 3);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath3)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[[34].b[2].c");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 3);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath5)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[[34.b[2].c");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 3);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath6)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("+a[34].b[2].c");
+ checkKeyPath(keyPath, expected, 1);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath7)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("%a[34].b[2].c");
+ checkKeyPath(keyPath, expected, 1);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath8)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a{[34]}.b[2].c");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 2);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath9)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a..b[2].c");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 5);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath10)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[34]b.foo[2].bar");
+ expected.append(ExpectedToken("a", false, 0));
+ expected.append(ExpectedToken(String(), true, 34));
+ checkKeyPath(keyPath, expected, 4);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath11)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[-1]");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 3);
+}
+
+TEST(IDBKeyPathTest, InvalidKeyPath12)
+{
+ Vector<IDBKeyPathElement> expected;
+ String keyPath("a[9999999999999999999999999999999999]");
+ expected.append(ExpectedToken("a", false, 0));
+ checkKeyPath(keyPath, expected, 3);
+}
+
+} // namespace
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebKit/chromium/tests/TilingDataTest.cpp b/WebKit/chromium/tests/TilingDataTest.cpp
new file mode 100755
index 0000000..463542b
--- /dev/null
+++ b/WebKit/chromium/tests/TilingDataTest.cpp
@@ -0,0 +1,223 @@
+/*
+ * 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 "GLES2Texture.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+TEST(TilingDataTest, numTiles_NoTiling)
+{
+ EXPECT_EQ(1, TilingData(16, 16, 16, false).numTiles());
+ EXPECT_EQ(1, TilingData(16, 15, 15, true).numTiles());
+ EXPECT_EQ(1, TilingData(16, 16, 16, true).numTiles());
+ EXPECT_EQ(1, TilingData(16, 1, 16, false).numTiles());
+ EXPECT_EQ(1, TilingData(15, 15, 15, true).numTiles());
+}
+
+TEST(TilingDataTest, numTiles_TilingNoBorders)
+{
+ EXPECT_EQ(1, TilingData(4, 1, 4, false).numTiles());
+ EXPECT_EQ(1, TilingData(4, 2, 4, false).numTiles());
+ EXPECT_EQ(1, TilingData(4, 3, 4, false).numTiles());
+ EXPECT_EQ(1, TilingData(4, 4, 4, false).numTiles());
+ EXPECT_EQ(2, TilingData(4, 5, 4, false).numTiles());
+ EXPECT_EQ(2, TilingData(4, 6, 4, false).numTiles());
+ EXPECT_EQ(2, TilingData(4, 7, 4, false).numTiles());
+ EXPECT_EQ(2, TilingData(4, 8, 4, false).numTiles());
+ EXPECT_EQ(3, TilingData(4, 9, 4, false).numTiles());
+ EXPECT_EQ(3, TilingData(4, 10, 4, false).numTiles());
+ EXPECT_EQ(3, TilingData(4, 11, 4, false).numTiles());
+
+ EXPECT_EQ(1, TilingData(5, 1, 5, false).numTiles());
+ EXPECT_EQ(1, TilingData(5, 2, 5, false).numTiles());
+ EXPECT_EQ(1, TilingData(5, 3, 5, false).numTiles());
+ EXPECT_EQ(1, TilingData(5, 4, 5, false).numTiles());
+ EXPECT_EQ(1, TilingData(5, 5, 5, false).numTiles());
+ EXPECT_EQ(2, TilingData(5, 6, 5, false).numTiles());
+ EXPECT_EQ(2, TilingData(5, 7, 5, false).numTiles());
+ EXPECT_EQ(2, TilingData(5, 8, 5, false).numTiles());
+ EXPECT_EQ(2, TilingData(5, 9, 5, false).numTiles());
+ EXPECT_EQ(2, TilingData(5, 10, 5, false).numTiles());
+ EXPECT_EQ(3, TilingData(5, 11, 5, false).numTiles());
+
+ EXPECT_EQ(1, TilingData(16, 16, 16, false).numTiles());
+ EXPECT_EQ(1, TilingData(17, 16, 16, false).numTiles());
+ EXPECT_EQ(4, TilingData(15, 16, 16, false).numTiles());
+ EXPECT_EQ(4, TilingData(8, 16, 16, false).numTiles());
+ EXPECT_EQ(6, TilingData(8, 17, 16, false).numTiles());
+}
+
+TEST(TilingDataTest, numTiles_TilingWithBorders)
+{
+ EXPECT_EQ(1, TilingData(3, 1, 3, true).numTiles());
+ EXPECT_EQ(1, TilingData(3, 2, 3, true).numTiles());
+ EXPECT_EQ(1, TilingData(3, 3, 3, true).numTiles());
+ EXPECT_EQ(2, TilingData(3, 4, 3, true).numTiles());
+ EXPECT_EQ(3, TilingData(3, 5, 3, true).numTiles());
+ EXPECT_EQ(4, TilingData(3, 6, 3, true).numTiles());
+ EXPECT_EQ(5, TilingData(3, 7, 3, true).numTiles());
+
+ EXPECT_EQ(1, TilingData(4, 1, 4, true).numTiles());
+ EXPECT_EQ(1, TilingData(4, 2, 4, true).numTiles());
+ EXPECT_EQ(1, TilingData(4, 3, 4, true).numTiles());
+ EXPECT_EQ(1, TilingData(4, 4, 4, true).numTiles());
+ EXPECT_EQ(2, TilingData(4, 5, 4, true).numTiles());
+ EXPECT_EQ(2, TilingData(4, 6, 4, true).numTiles());
+ EXPECT_EQ(3, TilingData(4, 7, 4, true).numTiles());
+ EXPECT_EQ(3, TilingData(4, 8, 4, true).numTiles());
+ EXPECT_EQ(4, TilingData(4, 9, 4, true).numTiles());
+ EXPECT_EQ(4, TilingData(4, 10, 4, true).numTiles());
+ EXPECT_EQ(5, TilingData(4, 11, 4, true).numTiles());
+
+ EXPECT_EQ(1, TilingData(5, 1, 5, true).numTiles());
+ EXPECT_EQ(1, TilingData(5, 2, 5, true).numTiles());
+ EXPECT_EQ(1, TilingData(5, 3, 5, true).numTiles());
+ EXPECT_EQ(1, TilingData(5, 4, 5, true).numTiles());
+ EXPECT_EQ(1, TilingData(5, 5, 5, true).numTiles());
+ EXPECT_EQ(2, TilingData(5, 6, 5, true).numTiles());
+ EXPECT_EQ(2, TilingData(5, 7, 5, true).numTiles());
+ EXPECT_EQ(2, TilingData(5, 8, 5, true).numTiles());
+ EXPECT_EQ(3, TilingData(5, 9, 5, true).numTiles());
+ EXPECT_EQ(3, TilingData(5, 10, 5, true).numTiles());
+ EXPECT_EQ(3, TilingData(5, 11, 5, true).numTiles());
+}
+
+TEST(TilingDataTest, tileXIndexFromSrcCoord)
+{
+ EXPECT_EQ(0, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(3));
+ EXPECT_EQ(1, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(4));
+ EXPECT_EQ(1, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(5));
+ EXPECT_EQ(2, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(6));
+ EXPECT_EQ(2, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(7));
+ EXPECT_EQ(2, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(8));
+ EXPECT_EQ(3, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(9));
+ EXPECT_EQ(3, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(10));
+ EXPECT_EQ(3, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(11));
+
+ EXPECT_EQ(0, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(1));
+ EXPECT_EQ(1, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(2));
+ EXPECT_EQ(2, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(3));
+ EXPECT_EQ(3, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(4));
+ EXPECT_EQ(4, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(5));
+ EXPECT_EQ(5, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(6));
+ EXPECT_EQ(6, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(7));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(8));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(9));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(10));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(11));
+}
+TEST(TilingDataTest, tileYIndexFromSrcCoord)
+{
+ EXPECT_EQ(0, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(0, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(2));
+ EXPECT_EQ(1, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(3));
+ EXPECT_EQ(1, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(4));
+ EXPECT_EQ(1, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(5));
+ EXPECT_EQ(2, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(6));
+ EXPECT_EQ(2, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(7));
+ EXPECT_EQ(2, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(8));
+ EXPECT_EQ(3, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(9));
+ EXPECT_EQ(3, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(10));
+ EXPECT_EQ(3, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(11));
+
+ EXPECT_EQ(0, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(0));
+ EXPECT_EQ(0, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(1));
+ EXPECT_EQ(1, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(2));
+ EXPECT_EQ(2, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(3));
+ EXPECT_EQ(3, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(4));
+ EXPECT_EQ(4, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(5));
+ EXPECT_EQ(5, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(6));
+ EXPECT_EQ(6, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(7));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(8));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(9));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(10));
+ EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(11));
+}
+
+TEST(TilingDataTest, tileSizeX)
+{
+ EXPECT_EQ(5, TilingData(5, 5, 5, false).tileSizeX(0));
+ EXPECT_EQ(5, TilingData(5, 5, 5, true).tileSizeX(0));
+
+ EXPECT_EQ(5, TilingData(5, 6, 6, false).tileSizeX(0));
+ EXPECT_EQ(1, TilingData(5, 6, 6, false).tileSizeX(1));
+ EXPECT_EQ(4, TilingData(5, 6, 6, true).tileSizeX(0));
+ EXPECT_EQ(2, TilingData(5, 6, 6, true).tileSizeX(1));
+
+ EXPECT_EQ(5, TilingData(5, 8, 8, false).tileSizeX(0));
+ EXPECT_EQ(3, TilingData(5, 8, 8, false).tileSizeX(1));
+ EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeX(0));
+ EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeX(1));
+
+ EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeX(0));
+ EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeX(1));
+ EXPECT_EQ(4, TilingData(5, 10, 10, true).tileSizeX(0));
+ EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeX(1));
+ EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeX(2));
+
+ EXPECT_EQ(4, TilingData(5, 11, 11, true).tileSizeX(2));
+ EXPECT_EQ(3, TilingData(5, 12, 12, true).tileSizeX(2));
+}
+TEST(TilingDataTest, tileSizeY)
+{
+ EXPECT_EQ(5, TilingData(5, 5, 5, false).tileSizeY(0));
+ EXPECT_EQ(5, TilingData(5, 5, 5, true).tileSizeY(0));
+
+ EXPECT_EQ(5, TilingData(5, 6, 6, false).tileSizeY(0));
+ EXPECT_EQ(1, TilingData(5, 6, 6, false).tileSizeY(1));
+ EXPECT_EQ(4, TilingData(5, 6, 6, true).tileSizeY(0));
+ EXPECT_EQ(2, TilingData(5, 6, 6, true).tileSizeY(1));
+
+ EXPECT_EQ(5, TilingData(5, 8, 8, false).tileSizeY(0));
+ EXPECT_EQ(3, TilingData(5, 8, 8, false).tileSizeY(1));
+ EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeY(0));
+ EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeY(1));
+
+ EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeY(0));
+ EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeY(1));
+ EXPECT_EQ(4, TilingData(5, 10, 10, true).tileSizeY(0));
+ EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeY(1));
+ EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeY(2));
+
+ EXPECT_EQ(4, TilingData(5, 11, 11, true).tileSizeY(2));
+ EXPECT_EQ(3, TilingData(5, 12, 12, true).tileSizeY(2));
+}
+
+} // namespace
diff --git a/WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp b/WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp
new file mode 100644
index 0000000..7cd4837
--- /dev/null
+++ b/WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp
@@ -0,0 +1,112 @@
+/*
+ * 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 <gdk/gdk.h>
+#include <gtest/gtest.h>
+
+#include "WebInputEvent.h"
+#include "WebInputEventFactory.h"
+
+using WebKit::WebMouseEvent;
+using WebKit::WebInputEventFactory;
+
+namespace {
+
+TEST(WebInputEventFactoryTest, DoubleClick)
+{
+ GdkEventButton firstClick;
+ firstClick.type = GDK_BUTTON_PRESS;
+ firstClick.window = static_cast<GdkWindow*>(GINT_TO_POINTER(1));
+ firstClick.x = firstClick.y = firstClick.x_root = firstClick.y_root = 100;
+ firstClick.state = 0;
+ firstClick.time = 0;
+ firstClick.button = 1;
+
+ // Single click works.
+ WebMouseEvent firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick);
+ EXPECT_EQ(1, firstClickEvent.clickCount);
+
+ // Make sure double click works.
+ GdkEventButton secondClick = firstClick;
+ secondClick.time = firstClick.time + 100;
+ WebMouseEvent secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick);
+ EXPECT_EQ(2, secondClickEvent.clickCount);
+
+ // Reset the click count.
+ firstClick.time += 10000;
+ firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick);
+ EXPECT_EQ(1, firstClickEvent.clickCount);
+
+ // Two clicks with a long gap in between aren't counted as a double click.
+ secondClick = firstClick;
+ secondClick.time = firstClick.time + 1000;
+ secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick);
+ EXPECT_EQ(1, secondClickEvent.clickCount);
+
+ // Reset the click count.
+ firstClick.time += 10000;
+ firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick);
+ EXPECT_EQ(1, firstClickEvent.clickCount);
+
+ // Two clicks far apart (horizontally) aren't counted as a double click.
+ secondClick = firstClick;
+ secondClick.time = firstClick.time + 1;
+ secondClick.x = firstClick.x + 100;
+ secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick);
+ EXPECT_EQ(1, secondClickEvent.clickCount);
+
+ // Reset the click count.
+ firstClick.time += 10000;
+ firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick);
+ EXPECT_EQ(1, firstClickEvent.clickCount);
+
+ // Two clicks far apart (vertically) aren't counted as a double click.
+ secondClick = firstClick;
+ secondClick.time = firstClick.time + 1;
+ secondClick.x = firstClick.y + 100;
+ secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick);
+ EXPECT_EQ(1, secondClickEvent.clickCount);
+
+ // Reset the click count.
+ firstClick.time += 10000;
+ firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick);
+ EXPECT_EQ(1, firstClickEvent.clickCount);
+
+ // Two clicks on different windows aren't a double click.
+ secondClick = firstClick;
+ secondClick.time = firstClick.time + 1;
+ secondClick.window = static_cast<GdkWindow*>(GINT_TO_POINTER(2));
+ secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick);
+ EXPECT_EQ(1, secondClickEvent.clickCount);
+}
+
+} // anonymous namespace
diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt
index f6b96fd..e5fb9ef 100644
--- a/WebKit/efl/CMakeListsEfl.txt
+++ b/WebKit/efl/CMakeListsEfl.txt
@@ -73,10 +73,74 @@ IF (WTF_USE_CURL)
ENDIF ()
FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme)
-GENERATE_EDJ(
+SET(WebKit_THEME ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj)
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${WebKit_THEME}
+ COMMAND ${EDJE_CC_EXECUTABLE} -v -id ${WEBKIT_DIR}/efl/DefaultTheme ${WEBKIT_DIR}/efl/DefaultTheme/default.edc ${WebKit_THEME}
+ DEPENDS
${WEBKIT_DIR}/efl/DefaultTheme/default.edc
- ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj
- "-id;${WEBKIT_DIR}/efl/DefaultTheme"
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_v.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_press_v.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_v.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_press_h.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_h.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_fill_v.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_fill_h.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_h.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_focus_button.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_press.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/icon.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_normal.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_normal_button.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_hover_button.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_press_button.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/decoration/search_decoration.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/field_hovered.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/search_field.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/field_normal.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/field_focused.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/cancel/search_cancel.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_off_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/check.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_on_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_on_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_off_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_off.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_on.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_on.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_off_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_off_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_on_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/radio.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_off.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_on_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_normal.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_press.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/button.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/entry.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/img_normal.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/img_focused.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/img_hovered.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar.edc
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_normal.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_press.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_hover.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_focus.png
+ ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file.edc
+ VERBATIM
)
SET(EWebLauncher_SOURCES
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 0a627e7..de65885 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,140 @@
+2010-08-15 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ [EFL] Enable localStorage of HTML5 for WebKit EFL
+ https://bugs.webkit.org/show_bug.cgi?id=44020
+
+ * ewk/ewk_view.cpp:
+ (_ewk_view_priv_new):
+
+2010-08-11 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Adding new theme for widgets.
+ https://bugs.webkit.org/show_bug.cgi?id=43860
+
+ Original theme was there for a long time. This is a new
+ fresh one.
+
+ * DefaultTheme/default.edc:
+ * DefaultTheme/widget/button/button.edc:
+ * DefaultTheme/widget/button/img_button_focus.png:
+ * DefaultTheme/widget/button/img_button_hover.png:
+ * DefaultTheme/widget/button/img_button_normal.png:
+ * DefaultTheme/widget/button/img_button_press.png:
+ * DefaultTheme/widget/check/check.edc:
+ * DefaultTheme/widget/check/img_check_off.png:
+ * DefaultTheme/widget/check/img_check_off_focus.png:
+ * DefaultTheme/widget/check/img_check_off_hover.png:
+ * DefaultTheme/widget/check/img_check_on.png:
+ * DefaultTheme/widget/check/img_check_on_focus.png:
+ * DefaultTheme/widget/check/img_check_on_hover.png:
+ * DefaultTheme/widget/combo/combo.edc:
+ * DefaultTheme/widget/combo/combo_focus.png:
+ * DefaultTheme/widget/combo/combo_focus_button.png:
+ * DefaultTheme/widget/combo/combo_hover.png:
+ * DefaultTheme/widget/combo/combo_hover_button.png:
+ * DefaultTheme/widget/combo/combo_normal.png:
+ * DefaultTheme/widget/combo/combo_normal_button.png:
+ * DefaultTheme/widget/combo/combo_press.png:
+ * DefaultTheme/widget/combo/combo_press_button.png:
+ * DefaultTheme/widget/combo/icon.png:
+ * DefaultTheme/widget/entry/img_focused.png:
+ * DefaultTheme/widget/entry/img_hovered.png:
+ * DefaultTheme/widget/entry/img_normal.png:
+ * DefaultTheme/widget/file/file_focus.png:
+ * DefaultTheme/widget/file/file_hover.png:
+ * DefaultTheme/widget/file/file_normal.png:
+ * DefaultTheme/widget/file/file_press.png:
+ * DefaultTheme/widget/radio/img_radio_off.png:
+ * DefaultTheme/widget/radio/img_radio_off_focus.png:
+ * DefaultTheme/widget/radio/img_radio_off_hover.png:
+ * DefaultTheme/widget/radio/img_radio_on.png:
+ * DefaultTheme/widget/radio/img_radio_on_focus.png:
+ * DefaultTheme/widget/radio/img_radio_on_hover.png:
+ * DefaultTheme/widget/radio/radio.edc:
+ * DefaultTheme/widget/scrollbar/scrollbar.edc:
+ * DefaultTheme/widget/scrollbar/scrollbar_h.png:
+ * DefaultTheme/widget/scrollbar/scrollbar_hilight.png: Removed.
+ * DefaultTheme/widget/scrollbar/scrollbar_knob_h.png:
+ * DefaultTheme/widget/scrollbar/scrollbar_knob_v.png:
+ * DefaultTheme/widget/scrollbar/scrollbar_v.png:
+ * DefaultTheme/widget/search/cancel/cancel_normal_button2.png:
+ * DefaultTheme/widget/search/decoration/decoration_normal_button.png:
+ * DefaultTheme/widget/search/field/field_focused.png:
+ * DefaultTheme/widget/search/field/field_hovered.png:
+ * DefaultTheme/widget/search/field/field_normal.png:
+ * DefaultTheme/widget/slider/slider.edc:
+ * DefaultTheme/widget/slider/slider_fill_h.png: Added.
+ * DefaultTheme/widget/slider/slider_fill_v.png: Added.
+ * DefaultTheme/widget/slider/slider_h.png:
+ * DefaultTheme/widget/slider/slider_hilight.png: Removed.
+ * DefaultTheme/widget/slider/slider_knob_h.png:
+ * DefaultTheme/widget/slider/slider_knob_press_h.png: Added.
+ * DefaultTheme/widget/slider/slider_knob_press_v.png: Added.
+ * DefaultTheme/widget/slider/slider_knob_v.png:
+ * DefaultTheme/widget/slider/slider_v.png:
+
+2010-08-12 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Making CMake keep track of theme dependencies.
+ https://bugs.webkit.org/show_bug.cgi?id=43862
+
+ Adding theme source files and images as dependencies of the theme.
+
+ * CMakeListsEfl.txt:
+
+2010-08-11 Rafael Antognolli <antognolli@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Add setting for enabling spatial navigation.
+ https://bugs.webkit.org/show_bug.cgi?id=43569
+
+ Adding api for enabling/disabling spatial navigation.
+
+ * ewk/ewk_view.cpp: Both functions below added.
+ (ewk_view_setting_spatial_navigation_get):
+ (ewk_view_setting_spatial_navigation_set):
+ * ewk/ewk_view.h: same as ewk_view.cpp.
+
+2010-08-11 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Reviewed by Antonio Gomes.
+
+ Implementation dispatchDecidePolicyForNavigationAction
+ https://bugs.webkit.org/show_bug.cgi?id=43544
+
+ Add ewk_view_navigation_policy_decision to decide whether url which
+ user clicked will be loaded or not.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction):
+ * ewk/ewk_private.h:
+ * ewk/ewk_view.cpp:
+ (ewk_view_navigation_policy_decision):
+ * ewk/ewk_view.h:
+
+2010-08-10 Ryuan Choi <ryuan.choi@samsung.com>
+
+ Unreviewed build fix.
+
+ [EFL]REGRESSION(65021) need to fix build break
+ https://bugs.webkit.org/show_bug.cgi?id=43767
+
+ Remove AtomicStringWTF and change namespace TextCaseInsensitive.
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_plugin_create):
+ * ewk/ewk_view.cpp:
+ (ewk_view_text_search):
+ (ewk_view_text_matches_mark):
+ (ewk_view_setting_font_cursive_set):
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/efl/DefaultTheme/default.edc b/WebKit/efl/DefaultTheme/default.edc
index 82b6882..e9f55f0 100644
--- a/WebKit/efl/DefaultTheme/default.edc
+++ b/WebKit/efl/DefaultTheme/default.edc
@@ -23,16 +23,16 @@ color_classes {
color_class {
name: "webkit/selection/active";
color: 255 255 255 255; /* foreground */
- color2: 32 0 200 255; /* background */
+ color2: 86 86 209 255; /* background */
}
color_class {
name: "webkit/selection/inactive";
color: 255 255 255 255; /* foreground */
- color2: 128 0 255 128; /* background */
+ color2: 0 0 128 128; /* background */
}
color_class {
name: "webkit/focus_ring";
- color: 26 182 240 255; /* foreground */
+ color: 26 26 226 255; /* foreground */
/* no background, consider transparent */
}
color_class {
diff --git a/WebKit/efl/DefaultTheme/widget/button/button.edc b/WebKit/efl/DefaultTheme/widget/button/button.edc
index 603daa0..78cc72a 100644
--- a/WebKit/efl/DefaultTheme/widget/button/button.edc
+++ b/WebKit/efl/DefaultTheme/widget/button/button.edc
@@ -64,10 +64,10 @@
type: IMAGE;
description {
state: "default" 0.0;
- min: 25 10;
+ min: 25 25;
image {
normal: "widget/button/img_button_normal.png";
- border: 6 6 6 6;
+ border: 6 10 8 10;
}
}
description {
@@ -75,7 +75,7 @@
inherit: "default" 0.0;
image {
normal: "widget/button/img_button_press.png";
- border: 8 8 8 8;
+ border: 6 10 8 10;
}
}
description {
@@ -88,7 +88,7 @@
inherit: "default" 0.0;
image {
normal: "widget/button/img_button_hover.png";
- border: 6 6 6 6;
+ border: 6 10 8 10;
}
}
description {
@@ -96,7 +96,7 @@
inherit: "default" 0.0;
image {
normal: "widget/button/img_button_focus.png";
- border: 6 6 6 6;
+ border: 6 10 8 10;
}
}
}
@@ -109,11 +109,11 @@
color: 0 0 0 0;
rel1 {
relative: 0.0 0.0;
- offset: 10 5;
+ offset: 15 8;
}
rel2 {
relative: 1.0 1.0;
- offset: -11 -6;
+ offset: -16 -11;
}
}
}
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png b/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png
index b9395d3..9e91fe8 100644
--- a/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png b/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png
index 224f966..9e91fe8 100644
--- a/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png b/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png
index b546075..bd9dee9 100644
--- a/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_press.png b/WebKit/efl/DefaultTheme/widget/button/img_button_press.png
index 7434179..b8b5163 100644
--- a/WebKit/efl/DefaultTheme/widget/button/img_button_press.png
+++ b/WebKit/efl/DefaultTheme/widget/button/img_button_press.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/check.edc b/WebKit/efl/DefaultTheme/widget/check/check.edc
index 86490f6..0e09303 100644
--- a/WebKit/efl/DefaultTheme/widget/check/check.edc
+++ b/WebKit/efl/DefaultTheme/widget/check/check.edc
@@ -22,7 +22,7 @@
group {
name: "webkit/widget/checkbox";
- min: 14 14;
+ min: 12 12;
images {
image: "widget/check/img_check_on.png" COMP;
@@ -71,8 +71,8 @@
type: IMAGE;
description {
state: "default" 0.0;
- min: 14 14;
- max: 14 14;
+ min: 12 12;
+ max: 12 12;
image {
normal: "widget/check/img_check_off.png";
}
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off.png
index 4353276..167fa4e 100644
--- a/WebKit/efl/DefaultTheme/widget/check/img_check_off.png
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png
index 3d30818..18bee2a 100644
--- a/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png
index 6f397db..18bee2a 100644
--- a/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on.png
index 65750a7..87d13ed 100644
--- a/WebKit/efl/DefaultTheme/widget/check/img_check_on.png
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png
index 0abf6ee..1f40566 100644
--- a/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png
index 522c238..1f40566 100644
--- a/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo.edc b/WebKit/efl/DefaultTheme/widget/combo/combo.edc
index 9c436cc..d101d60 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo.edc
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo.edc
@@ -104,7 +104,7 @@ group {
min: 36 20;
image {
normal: "widget/combo/combo_normal.png";
- border: 7 7 7 7;
+ border: 15 0 8 11;
}
}
description {
@@ -117,7 +117,7 @@ group {
inherit: "default" 0.0;
image {
normal: "widget/combo/combo_hover.png";
- border: 7 7 7 7;
+ border: 15 0 8 11;
}
}
description {
@@ -125,7 +125,7 @@ group {
inherit: "default" 0.0;
image {
normal: "widget/combo/combo_focus.png";
- border: 7 7 7 7;
+ border: 15 0 8 11;
}
}
description {
@@ -133,7 +133,7 @@ group {
inherit: "default" 0.0;
image {
normal: "widget/combo/combo_press.png";
- border: 7 7 7 7;
+ border: 15 0 8 11;
}
}
}
@@ -165,7 +165,7 @@ group {
rel1.to: "bt_combo_clipper";
image {
normal: "widget/combo/combo_normal_button.png";
- border: 3 5 5 5;
+ border: 1 15 8 10;
}
}
description {
@@ -180,7 +180,7 @@ group {
rel1.to: "bt_combo_clipper";
image {
normal: "widget/combo/combo_hover_button.png";
- border: 3 5 5 5;
+ border: 1 15 8 10;
}
}
description {
@@ -189,7 +189,7 @@ group {
rel1.to: "bt_combo_clipper";
image {
normal: "widget/combo/combo_focus_button.png";
- border: 6 7 7 7;
+ border: 1 15 8 10;
}
}
description {
@@ -198,7 +198,7 @@ group {
rel1.to: "bt_combo_clipper";
image {
normal: "widget/combo/combo_press_button.png";
- border: 6 8 8 8;
+ border: 1 15 8 10;
}
}
}
@@ -210,8 +210,8 @@ group {
clip_to: "bt_combo_clipper";
description {
state: "default" 0.0;
- min: 17 13;
- max: 17 13;
+ min: 12 10;
+ max: 12 10;
color: 255 255 255 150;
rel1 {
to: "bt_combo_clipper";
@@ -247,11 +247,11 @@ group {
color: 0 0 0 0;
rel1 {
to: "combo_clipper";
- offset: 10 5;
+ offset: 15 10;
}
rel2 {
to: "combo_clipper";
- offset: -6 -6;
+ offset: -11 -11;
}
}
}
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png b/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png
index cfdc309..3b1574b 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png
index 9fc2d10..eaf137b 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png b/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png
index 9aaa4ee..3b1574b 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png
index 1f5c6b8..eaf137b 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png b/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png
index 9afe713..fc461a7 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png
index d920d90..1cbcb11 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_press.png b/WebKit/efl/DefaultTheme/widget/combo/combo_press.png
index 4b39c70..97c88c5 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_press.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_press.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png
index da54328..17233af 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/combo/icon.png b/WebKit/efl/DefaultTheme/widget/combo/icon.png
index 5d9fb96..1534c2c 100644
--- a/WebKit/efl/DefaultTheme/widget/combo/icon.png
+++ b/WebKit/efl/DefaultTheme/widget/combo/icon.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_focused.png b/WebKit/efl/DefaultTheme/widget/entry/img_focused.png
index 0069d1e..f4b17a9 100644
--- a/WebKit/efl/DefaultTheme/widget/entry/img_focused.png
+++ b/WebKit/efl/DefaultTheme/widget/entry/img_focused.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png b/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png
index fbd07af..f4b17a9 100644
--- a/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png
+++ b/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_normal.png b/WebKit/efl/DefaultTheme/widget/entry/img_normal.png
index 7c5f1cf..88d53f4 100644
--- a/WebKit/efl/DefaultTheme/widget/entry/img_normal.png
+++ b/WebKit/efl/DefaultTheme/widget/entry/img_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_focus.png b/WebKit/efl/DefaultTheme/widget/file/file_focus.png
index 55f5bb8..cc93b27 100644
--- a/WebKit/efl/DefaultTheme/widget/file/file_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/file/file_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_hover.png b/WebKit/efl/DefaultTheme/widget/file/file_hover.png
index be32454..41285a1 100644
--- a/WebKit/efl/DefaultTheme/widget/file/file_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/file/file_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_normal.png b/WebKit/efl/DefaultTheme/widget/file/file_normal.png
index 794eba6..a6d0653 100644
--- a/WebKit/efl/DefaultTheme/widget/file/file_normal.png
+++ b/WebKit/efl/DefaultTheme/widget/file/file_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/file/file_press.png b/WebKit/efl/DefaultTheme/widget/file/file_press.png
index 4471dc5..f18f8fd 100644
--- a/WebKit/efl/DefaultTheme/widget/file/file_press.png
+++ b/WebKit/efl/DefaultTheme/widget/file/file_press.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png
index e249d8f..cd64cd8 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png
index b25751c..87d31e2 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png
index 9096ef8..87d31e2 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png
index b1f4085..b8d8ecb 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png
index a28d3dd..bf8a970 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png
index 3a3a35e..bf8a970 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png
+++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/radio/radio.edc b/WebKit/efl/DefaultTheme/widget/radio/radio.edc
index 38a6da9..f07b9b2 100644
--- a/WebKit/efl/DefaultTheme/widget/radio/radio.edc
+++ b/WebKit/efl/DefaultTheme/widget/radio/radio.edc
@@ -21,7 +21,7 @@
group {
name: "webkit/widget/radio";
- min: 16 16;
+ min: 12 12;
images {
image: "widget/radio/img_radio_on.png" COMP;
@@ -70,8 +70,8 @@
type: IMAGE;
description {
state: "default" 0.0;
- min: 16 16;
- max: 16 16;
+ min: 12 12;
+ max: 12 12;
image {
normal: "widget/radio/img_radio_off.png";
}
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc
index 4f59784..b4eead0 100644
--- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc
@@ -1,7 +1,5 @@
/*
Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia
- Copyright (C) 2009,2010 ProFUSION embedded systems
- Copyright (C) 2009,2010 Samsung Electronics
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -22,7 +20,7 @@
group {
name: "scrollbar.vertical";
- min: 10 0; /* if > 0, this is the minimum size that will be allocated.
+ min: 0 0; /* if > 0, this is the minimum size that will be allocated.
* If wants to draw on top, just overflow usign edje's rel1/rel2
*/
@@ -85,20 +83,26 @@ group {
description {
min: 10 0;
max: 10 999999;
+ align: 1.0 0.5;
state: "default" 0.0;
color: 255 255 255 0;
}
}
+
part {
name: "rect.clipper";
type: RECT;
description {
state: "default" 0.0;
color: 255 255 255 255;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
}
description {
state: "hidden" 0.0;
- color: 255 255 255 128;
+ color: 255 255 255 64;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
}
}
@@ -109,11 +113,31 @@ group {
clip_to: "rect.clipper";
description {
state: "default" 0.0;
+ min: 1 30;
+ max: 1 999999;
+ align: 0.5 0.5;
image {
normal: "widget/scrollbar/scrollbar_v.png";
- border: 0 0 6 6;
+ border: 0 0 15 15;
+ middle: SOLID;
}
- }
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
+ }
+ }
+
+ part {
+ name: "rect.knobarea";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 0;
+ min: 5 5;
+ max: 5 999999;
+ align: 0.5 0.5;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
+ }
}
part {
@@ -124,15 +148,17 @@ group {
dragable {
x: 0 0 0;
y: 1 1 0;
- confine: "rect.base";
+ confine: "rect.knobarea";
}
description {
state: "default" 0.0;
- min: 10 10;
- max: 10 999999;
+ min: 5 5;
+ max: 5 999999;
+ align: 0.5 0.5;
image {
normal: "widget/scrollbar/scrollbar_knob_v.png";
- border: 0 0 6 6;
+ border: 3 3 3 3;
+ middle: SOLID;
}
}
}
@@ -171,7 +197,7 @@ group {
group {
name: "scrollbar.horizontal";
- min: 0 10; /* if > 0, this is the minimum size that will be allocated.
+ min: 0 0; /* if > 0, this is the minimum size that will be allocated.
* If wants to draw on top, just overflow usign edje's rel1/rel2
*/
@@ -235,19 +261,25 @@ group {
state: "default" 0.0;
min: 0 10;
max: 999999 10;
+ align: 0.5 1.0;
color: 255 255 255 0;
}
}
+
part {
name: "rect.clipper";
type: RECT;
description {
state: "default" 0.0;
color: 255 255 255 255;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
}
description {
state: "hidden" 0.0;
- color: 255 255 255 128;
+ color: 255 255 255 64;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
}
}
@@ -258,13 +290,34 @@ group {
clip_to: "rect.clipper";
description {
state: "default" 0.0;
+ min: 30 1;
+ max: 999999 1;
+ align: 0.5 0.5;
image {
normal: "widget/scrollbar/scrollbar_h.png";
- border: 6 6 0 0;
+ border: 15 15 0 0;
+ middle: SOLID;
}
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
}
}
+
+ part {
+ name: "rect.knobarea";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 0;
+ min: 5 5;
+ max: 999999 5;
+ align: 0.5 0.5;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
+ }
+ }
+
part {
name: "img.knob";
type: IMAGE;
@@ -273,14 +326,16 @@ group {
dragable {
x: 1 1 0;
y: 0 0 0;
- confine: "rect.base";
+ confine: "rect.knobarea";
}
description {
state: "default" 0.0;
- min: 10 10;
+ min: 5 5;
+ max: 999999 5;
image {
normal: "widget/scrollbar/scrollbar_knob_h.png";
- border: 6 6 0 0;
+ border: 3 3 3 3;
+ middle: SOLID;
}
}
}
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png
index 6e55557..6703ea8 100644
--- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png
deleted file mode 100644
index 1116f4e..0000000
--- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png
+++ /dev/null
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png
index bc65102..b64d5ce 100644
--- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png
index db3c685..9aa37ec 100644
--- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png
index 9ebdac2..364be0a 100644
--- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png
+++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png
index 5ab4f5b..3120cfb 100644
--- a/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png
+++ b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png b/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png
index 3ed2219..6e7f418 100644
--- a/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png
+++ b/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png b/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png
index 0069d1e..f4b17a9 100644
--- a/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png
+++ b/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png b/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png
index fbd07af..f4b17a9 100644
--- a/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png
+++ b/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png b/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png
index 7c5f1cf..88d53f4 100644
--- a/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png
+++ b/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider.edc b/WebKit/efl/DefaultTheme/widget/slider/slider.edc
index 6c1f6a5..9e339e5 100644
--- a/WebKit/efl/DefaultTheme/widget/slider/slider.edc
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider.edc
@@ -22,35 +22,65 @@
group {
name: "webkit/widget/slider/vertical";
- min: 10 0; /* if > 0, this is the minimum size that will be allocated.
+ min: 11 0; /* if > 0, this is the minimum size that will be allocated.
* If wants to draw on top, just overflow usign edje's rel1/rel2
*/
+ max: 11 999999;
images {
image: "widget/slider/slider_v.png" COMP;
image: "widget/slider/slider_knob_v.png" COMP;
+ image: "widget/slider/slider_knob_press_v.png" COMP;
+ image: "widget/slider/slider_fill_v.png" COMP;
}
script {
- public message(Msg_Type:type, id, ...) {
- if ((id == 0) && (type == MSG_FLOAT_SET)) {
- new Float:vy, Float:sy;
+ public isEnabled;
+ public isPressed;
+ public isChecked;
+ public isFocused;
+ public isHovered;
- vy = getfarg(2);
- sy = getfarg(3);
+ public show() {
- if (vy >= 0.0) {
- set_drag_size(PART:"img.knob", 1.0, sy);
- set_drag(PART:"img.knob", 0.0, vy);
- }
- }
- }
+ if (get_int(isEnabled) == 1) {
+ set_state(PART:"img.knob", "default", 0.0);
+ if (get_int(isFocused) == 1) {
+ set_state(PART:"img.knob", "pressed", 0.0);
+ if (get_int(isPressed) == 1)
+ set_state(PART:"img.knob", "pressed", 0.0);
+ }
+ else if (get_int(isHovered) == 1) {
+ set_state(PART:"img.knob", "pressed", 0.0);
+ if (get_int(isPressed) == 1)
+ set_state(PART:"img.knob", "pressed", 0.0);
+ }
+ }
+ else
+ set_state(PART:"img.knob", "default", 0.0);
+ }
- public update_drag_pos() {
- new Float:x, Float:y;
- get_drag(PART:"img.knob", x, y);
- send_message(MSG_FLOAT, 1, y);
- }
+ public message(Msg_Type:type, id, ...) {
+ if ((id == 0) && (type == MSG_FLOAT_SET)) {
+ new Float:vy, Float:sy;
+
+ vy = getfarg(2);
+ sy = getfarg(3);
+
+ if (vy >= 0.0) {
+ set_drag_size(PART:"img.knob", 1.0, sy);
+ set_drag(PART:"img.knob", 0.0, vy);
+ run_program(PROGRAM:"show");
+ } else
+ run_program(PROGRAM:"hide");
+ }
+ }
+
+ public update_drag_pos() {
+ new Float:x, Float:y;
+ get_drag(PART:"img.knob", x, y);
+ send_message(MSG_FLOAT, 1, y);
+ }
}
parts {
@@ -58,8 +88,8 @@ group {
name: "rect.base";
type: RECT;
description {
- min: 10 0;
- max: 10 999999;
+ min: 11 29;
+ max: 11 999999;
state: "default" 0.0;
color: 255 255 255 0;
}
@@ -71,6 +101,10 @@ group {
state: "default" 0.0;
color: 255 255 255 255;
}
+ description {
+ state: "hidden" 0.0;
+ color: 255 255 255 128;
+ }
}
part {
@@ -80,9 +114,32 @@ group {
clip_to: "rect.clipper";
description {
state: "default" 0.0;
+ min: 5 29;
+ max: 5 999999;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
image {
normal: "widget/slider/slider_v.png";
- border: 0 0 6 6;
+ border: 0 0 5 5;
+ }
+ }
+ }
+
+ part {
+ name: "img.slider_fill";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "rect.clipper";
+ description {
+ state: "default" 0.0;
+ min: 5 29;
+ max: 5 999999;
+ rel1.to: "img.knob";
+ rel2.to: "rect.base";
+ align: 0.5 0.5;
+ image {
+ normal: "widget/slider/slider_fill_v.png";
+ border: 0 0 5 5;
}
}
}
@@ -94,22 +151,46 @@ group {
clip_to: "rect.clipper";
dragable {
x: 0 0 0;
- y: 1 1 0;
+ y: 1 1 1;
confine: "rect.base";
}
description {
state: "default" 0.0;
- min: 10 10;
- max: 10 999999;
+ min: 11 29;
+ align: 0.5 0.5;
image {
normal: "widget/slider/slider_knob_v.png";
border: 0 0 6 6;
}
}
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "widget/slider/slider_knob_press_v.png";
+ }
}
}
programs {
program {
+ name: "load";
+ signal: "load";
+ action: STATE_SET "hidden" 0.0;
+ target: "rect.clipper";
+ }
+ program {
+ name: "hide";
+ action: STATE_SET "hidden" 0.0;
+ transition: ACCELERATE 0.5;
+ target: "rect.clipper";
+ }
+
+ program {
+ name: "show";
+ action: STATE_SET "default" 0.0;
+ target: "rect.clipper";
+ }
+
+ program {
name: "dragged";
signal: "drag";
source: "img.knob";
@@ -117,41 +198,124 @@ group {
update_drag_pos();
}
}
+
+ program {
+ name: "enabled";
+ signal: "enabled";
+ script {
+ set_int(isEnabled, 1);
+ show();
+ }
+ }
+ program {
+ name: "pressed";
+ signal: "pressed";
+ script {
+ set_int(isPressed, 1);
+ show();
+ }
+ }
+ program {
+ name: "checked";
+ signal: "checked";
+ script {
+ set_int(isChecked, 1);
+ show();
+ }
+ }
+ program {
+ name: "focused";
+ signal: "focused";
+ script {
+ set_int(isFocused, 1);
+ show();
+ }
+ }
+ program {
+ name: "hovered";
+ signal: "hovered";
+ script {
+ set_int(isHovered, 1);
+ show();
+ }
+ }
+ program {
+ name: "reset";
+ signal: "reset";
+ script {
+ set_int(isEnabled, 0);
+ set_int(isPressed, 0);
+ set_int(isChecked, 0);
+ set_int(isFocused, 0);
+ set_int(isHovered, 0);
+ show();
+ }
+ }
}
}
group {
name: "webkit/widget/slider/horizontal";
- min: 0 10; /* if > 0, this is the minimum size that will be allocated.
+ min: 0 11; /* if > 0, this is the minimum size that will be allocated.
* If wants to draw on top, just overflow usign edje's rel1/rel2
*/
+ max: 999999 11;
images {
image: "widget/slider/slider_h.png" COMP;
image: "widget/slider/slider_knob_h.png" COMP;
+ image: "widget/slider/slider_knob_press_h.png" COMP;
+ image: "widget/slider/slider_fill_h.png" COMP;
}
script {
- public message(Msg_Type:type, id, ...) {
- if ((id == 0) && (type == MSG_FLOAT_SET)) {
- new Float:vx, Float:sx;
+ public isEnabled;
+ public isPressed;
+ public isChecked;
+ public isFocused;
+ public isHovered;
- vx = getfarg(2);
- sx = getfarg(3);
+ public show() {
- if (vx >= 0.0) {
- set_drag_size(PART:"img.knob", sx, 1.0);
- set_drag(PART:"img.knob", vx, 0.0);
- }
- }
- }
+ if (get_int(isEnabled) == 1) {
+ set_state(PART:"img.knob", "default", 0.0);
+ if (get_int(isFocused) == 1) {
+ set_state(PART:"img.knob", "pressed", 0.0);
+ if (get_int(isPressed) == 1)
+ set_state(PART:"img.knob", "pressed", 0.0);
+ }
+ else if (get_int(isHovered) == 1) {
+ set_state(PART:"img.knob", "pressed", 0.0);
+ if (get_int(isPressed) == 1)
+ set_state(PART:"img.knob", "pressed", 0.0);
+ }
+ }
+ else
+ set_state(PART:"img.knob", "default", 0.0);
+ }
- public update_drag_pos() {
- new Float:x, Float:y;
- get_drag(PART:"img.knob", x, y);
- send_message(MSG_FLOAT, 1, x);
- }
+ public message(Msg_Type:type, id, ...) {
+ if ((id == 0) && (type == MSG_FLOAT_SET)) {
+ new Float:vx, Float:sx;
+
+ vx = getfarg(2);
+ sx = getfarg(3);
+
+ if (vx >= 0.0) {
+ set_drag_size(PART:"img.knob", sx, 1.0);
+ set_drag(PART:"img.knob", vx, 0.0);
+ run_program(PROGRAM:"show");
+ } else
+ run_program(PROGRAM:"hide");
+ }
+ }
+
+ public update_drag_pos() {
+ new Float:x, Float:y;
+ get_drag(PART:"img.knob", x, y);
+ send_message(MSG_FLOAT, 1, x);
+ }
}
parts {
@@ -160,8 +324,8 @@ group {
type: RECT;
description {
state: "default" 0.0;
- min: 0 10;
- max: 999999 10;
+ min: 29 11;
+ max: 999999 11;
color: 255 255 255 0;
}
}
@@ -172,6 +336,10 @@ group {
state: "default" 0.0;
color: 255 255 255 255;
}
+ description {
+ state: "hidden" 0.0;
+ color: 255 255 255 128;
+ }
}
part {
@@ -181,9 +349,33 @@ group {
clip_to: "rect.clipper";
description {
state: "default" 0.0;
+ min: 29 5;
+ max: 999999 5;
+ rel1.to: "rect.base";
+ rel2.to: "rect.base";
+ align: 0.5 0.5;
image {
normal: "widget/slider/slider_h.png";
- border: 6 6 0 0;
+ border: 5 5 0 0;
+ }
+ }
+ }
+
+ part {
+ name: "img.slider_fill";
+ type: IMAGE;
+ mouse_events: 0;
+ clip_to: "rect.clipper";
+ description {
+ state: "default" 0.0;
+ min: 29 5;
+ max: 999999 5;
+ rel1.to: "rect.base";
+ rel2.to: "img.knob";
+ align: 0.5 0.5;
+ image {
+ normal: "widget/slider/slider_fill_h.png";
+ border: 5 5 0 0;
}
}
}
@@ -200,16 +392,41 @@ group {
}
description {
state: "default" 0.0;
- min: 10 10;
+ min: 29 11;
+ align: 0.5 0.5;
image {
normal: "widget/slider/slider_knob_h.png";
border: 6 6 0 0;
}
}
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "widget/slider/slider_knob_press_h.png";
+ }
}
}
programs {
program {
+ name: "load";
+ signal: "load";
+ action: STATE_SET "hidden" 0.0;
+ target: "rect.clipper";
+ }
+ program {
+ name: "hide";
+ action: STATE_SET "hidden" 0.0;
+ transition: ACCELERATE 0.5;
+ target: "rect.clipper";
+ }
+
+ program {
+ name: "show";
+ action: STATE_SET "default" 0.0;
+ target: "rect.clipper";
+ }
+
+ program {
name: "dragged";
signal: "drag";
source: "img.knob";
@@ -217,5 +434,58 @@ group {
update_drag_pos();
}
}
+
+ program {
+ name: "enabled";
+ signal: "enabled";
+ script {
+ set_int(isEnabled, 1);
+ show();
+ }
+ }
+ program {
+ name: "pressed";
+ signal: "pressed";
+ script {
+ set_int(isPressed, 1);
+ show();
+ }
+ }
+ program {
+ name: "checked";
+ signal: "checked";
+ script {
+ set_int(isChecked, 1);
+ show();
+ }
+ }
+ program {
+ name: "focused";
+ signal: "focused";
+ script {
+ set_int(isFocused, 1);
+ show();
+ }
+ }
+ program {
+ name: "hovered";
+ signal: "hovered";
+ script {
+ set_int(isHovered, 1);
+ show();
+ }
+ }
+ program {
+ name: "reset";
+ signal: "reset";
+ script {
+ set_int(isEnabled, 0);
+ set_int(isPressed, 0);
+ set_int(isChecked, 0);
+ set_int(isFocused, 0);
+ set_int(isHovered, 0);
+ show();
+ }
+ }
}
}
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.png
new file mode 100644
index 0000000..abe9d2c
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.png
new file mode 100644
index 0000000..5184cad
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_h.png
index 6e55557..befd4a0 100644
--- a/WebKit/efl/DefaultTheme/widget/slider/slider_h.png
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png b/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png
deleted file mode 100644
index 1116f4e..0000000
--- a/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png
+++ /dev/null
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png
index bc65102..22454af 100644
--- a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.png
new file mode 100644
index 0000000..1421cd8
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.png
new file mode 100644
index 0000000..293813c
--- /dev/null
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png
index db3c685..051f3c3 100644
--- a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png
Binary files differ
diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_v.png
index 9ebdac2..7243929 100644
--- a/WebKit/efl/DefaultTheme/widget/slider/slider_v.png
+++ b/WebKit/efl/DefaultTheme/widget/slider/slider_v.png
Binary files differ
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 5648ec7..499d6c2 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -354,9 +354,22 @@ void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFu
ASSERT(m_frame);
// if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
// FIXME: do proper check and only reset forms when on PolicyIgnore
- Frame* f = ewk_frame_core_get(m_frame);
- f->loader()->resetMultipleFormSubmissionProtection();
- callPolicyFunction(function, PolicyUse);
+ char* url = strdup(resourceRequest.url().prettyURL().utf8().data());
+ Ewk_Frame_Resource_Request request = { url, 0 };
+ Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request);
+ free(url);
+
+ PolicyAction policy;
+ if (!ret)
+ policy = PolicyIgnore;
+ else {
+ if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted) {
+ Frame* f = ewk_frame_core_get(m_frame);
+ f->loader()->resetMultipleFormSubmissionProtection();
+ }
+ policy = PolicyUse;
+ }
+ callPolicyFunction(function, policy);
}
PassRefPtr<Widget> FrameLoaderClientEfl::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp
index fcf5ed3..296c261 100644
--- a/WebKit/efl/ewk/ewk_frame.cpp
+++ b/WebKit/efl/ewk/ewk_frame.cpp
@@ -1946,7 +1946,7 @@ void ewk_frame_force_layout(Evas_Object* o)
view->forceLayout(true);
}
-WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::StringWTF::String& mimeType, bool loadManually)
+WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually)
{
return 0;
}
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index f69f46c..eaad13c 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -148,6 +148,8 @@ void ewk_frame_force_layout(Evas_Object *o);
WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually);
+Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request);
+
#ifdef __cplusplus
}
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index c030c1c..7a98bac 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -106,6 +106,7 @@ struct _Ewk_View_Private_Data {
Eina_Bool resizable_textareas:1;
Eina_Bool private_browsing:1;
Eina_Bool caret_browsing:1;
+ Eina_Bool spatial_navigation:1;
struct {
float w;
float h;
@@ -557,6 +558,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
priv->page_settings->setStandardFontFamily("sans");
priv->page_settings->setJavaScriptEnabled(true);
priv->page_settings->setPluginsEnabled(true);
+ priv->page_settings->setLocalStorageEnabled(true);
url = priv->page_settings->userStyleSheetLocation();
priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data());
@@ -1318,13 +1320,13 @@ Eina_Bool ewk_view_text_search(const Evas_Object* o, const char* string, Eina_Bo
EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE);
- WebCore::TextCaseSensitivity sensitive;
+ WTF::TextCaseSensitivity sensitive;
WebCore::FindDirection direction;
if (case_sensitive)
- sensitive = WebCore::TextCaseSensitive;
+ sensitive = WTF::TextCaseSensitive;
else
- sensitive = WebCore::TextCaseInsensitive;
+ sensitive = WTF::TextCaseInsensitive;
if (forward)
direction = WebCore::FindDirectionForward;
@@ -1350,12 +1352,12 @@ unsigned int ewk_view_text_matches_mark(Evas_Object* o, const char* string, Eina
EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0);
- WebCore::TextCaseSensitivity sensitive;
+ WTF::TextCaseSensitivity sensitive;
if (case_sensitive)
- sensitive = WebCore::TextCaseSensitive;
+ sensitive = WTF::TextCaseSensitive;
else
- sensitive = WebCore::TextCaseInsensitive;
+ sensitive = WTF::TextCaseInsensitive;
return priv->page->markAllMatchesForText(WTF::String::fromUTF8(string), sensitive, highlight, limit);
}
@@ -2528,7 +2530,7 @@ Eina_Bool ewk_view_setting_font_cursive_set(Evas_Object* o, const char* family)
EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE);
if (eina_stringshare_replace(&priv->settings.font_cursive, family)) {
- WTF::AtomicStringWTF::AtomicString s = WTF::String::fromUTF8(family);
+ WTF::AtomicString s = WTF::String::fromUTF8(family);
priv->page_settings->setCursiveFontFamily(s);
}
return EINA_TRUE;
@@ -2606,6 +2608,25 @@ Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object* o, const char* famil
return EINA_TRUE;
}
+Eina_Bool ewk_view_setting_spatial_navigation_get(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->settings.spatial_navigation;
+}
+
+Eina_Bool ewk_view_setting_spatial_navigation_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);
+ enable = !!enable;
+ if (priv->settings.spatial_navigation != enable) {
+ priv->page_settings->setSpatialNavigationEnabled(enable);
+ priv->settings.spatial_navigation = enable;
+ }
+ return EINA_TRUE;
+}
+
/**
* Similar to evas_object_smart_data_get(), but does type checking.
*
@@ -3980,3 +4001,23 @@ Eina_Bool ewk_view_user_scalable_get(Evas_Object* o)
return priv->settings.zoom_range.user_scalable;
}
+
+/**
+ * @internal
+ * Reports a requeset will be loaded. It's client responsibility to decide if
+ * request would be used. If @return is true, loader will try to load. Else,
+ * Loader ignore action of request.
+ *
+ * @param o View to load
+ * @param request Request which contain url to navigate
+ */
+Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_TRUE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_TRUE);
+
+ if (!sd->api->navigation_policy_decision)
+ return EINA_TRUE;
+
+ return sd->api->navigation_policy_decision(sd, request);
+}
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index 19a3588..8dd6178 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -21,6 +21,7 @@
#ifndef ewk_view_h
#define ewk_view_h
+#include "ewk_frame.h"
#include "ewk_history.h"
#include "ewk_window_features.h"
@@ -133,6 +134,8 @@ struct _Ewk_View_Smart_Class {
uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
+
+ Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request);
};
#define EWK_VIEW_SMART_CLASS_VERSION 1UL /** the version you have to put into the version field in the Ewk_View_Smart_Class structure */
@@ -433,6 +436,9 @@ EAPI Eina_Bool ewk_view_setting_font_serif_set(Evas_Object *o, const char *fa
EAPI const char *ewk_view_setting_font_sans_serif_get(const Evas_Object *o);
EAPI Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object *o, const char *family);
+EAPI Eina_Bool ewk_view_setting_spatial_navigation_get(Evas_Object* o);
+EAPI Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_Bool enable);
+
/* to be used by subclass implementations */
EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o);
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index dbba4a9..79e4a0b 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,230 @@
+2010-08-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] WebBackForwardList's new_with_web_view should not be public
+ https://bugs.webkit.org/show_bug.cgi?id=43802
+
+ Deprecate the constructor. The introspection annotation has been
+ fixed in a previous commit.
+
+ * webkit/webkitwebbackforwardlist.cpp:
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js with generated one.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::openInspectorFrontend):
+
+2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65595.
+ http://trac.webkit.org/changeset/65595
+ https://bugs.webkit.org/show_bug.cgi?id=44161
+
+ qt build failed (Requested by loislo on #webkit).
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::openInspectorFrontend):
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js by generated one.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::openInspectorFrontend):
+
+2010-08-17 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Fix the builds when HAVE_GSETTINGS is defined.
+
+ * webkit/webkitprivate.cpp:
+ (isSchemaAvailable):
+ (inspectorGSettings):
+
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * WebCoreSupport/FrameNetworkingContextGtk.h: Added.
+ Placeholder with tentative code that might be changed when landing
+ the rest of it.
+
+2010-08-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ WebBackForwardList.get_{back|forward}_list_with_limit not introspectable
+ https://bugs.webkit.org/show_bug.cgi?id=43054
+
+ Annotate WebKitWebBackForwardList and the function that is used to fetch it from
+ the WebKitWebView. More will follow.
+
+ * webkit/webkitwebbackforwardlist.cpp: Annotations, and small
+ improvements to the docs.
+ * webkit/webkitwebbackforwardlist.h: Couple empty lines missing.
+ * webkit/webkitwebview.cpp:
+
+2010-08-17 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Clean up WebCore/platform/graphics/gtk/ImageGtk.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=44069
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::openInspectorFrontend): Switched to using the new WEBKITGTK_API_VERSION_STRING define.
+ * webkit/webkitprivate.cpp:
+ (inspectorGSettings): Ditto.
+
+2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65500.
+ http://trac.webkit.org/changeset/65500
+ https://bugs.webkit.org/show_bug.cgi?id=44108
+
+ Qt bots failed to compile. (Requested by loislo on #webkit).
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::openInspectorFrontend):
+
+2010-08-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: replace hand written InspectorBackendStub.js by generated one.
+ https://bugs.webkit.org/show_bug.cgi?id=43791
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorClient::openInspectorFrontend):
+
+2010-08-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] GSettings support adds annoying warnings on systems with older glib versions
+ https://bugs.webkit.org/show_bug.cgi?id=44056
+
+ Use #ifdef instead of #if for HAVE_GSETTINGS to avoid warnings
+ when it is not defined.
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ * webkit/webkitprivate.cpp:
+ (webkit_init):
+ * webkit/webkitprivate.h:
+
+2010-08-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Really add a missing file. I wish I would remember running git add
+ on them after applying a patch =(.
+
+ * org.webkitgtk.gschema.xml.in: Added.
+
+2010-08-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Use GSettings to save/restore Web Inspector settings
+ https://bugs.webkit.org/show_bug.cgi?id=43512
+
+ Use GSettings to save/restore settings used by the Web Inspector.
+ A few helper functions were added to have settings that use
+ boolean values be actual booleans, and also to conform with the
+ GSettings naming requirements for keys.
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::toGSettingName):
+ (WebKit::truthStringFromVariant):
+ (WebKit::variantFromTruthString):
+ (WebKit::InspectorClient::populateSetting):
+ (WebKit::InspectorClient::storeSetting):
+ * org.webkit.gtk.gschema.xml: Added.
+ * webkit/webkitprivate.cpp:
+ (inspectorGSettings):
+ (webkit_init):
+ * webkit/webkitprivate.h:
+
+2010-08-11 Joone Hur <joone@kldp.org>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Last Hangul letter is typed again when a composition is finished with mouse press
+ https://bugs.webkit.org/show_bug.cgi?id=40518
+
+ When a mouse press fires during a IME composition, the current composition character
+ can be entered twice at the previous editing position and a new editing position.
+ Because the IME commit signal is emitted after the mouse press event.
+ This patch allows to prevent the commit signal during a composition when a mouse press fires.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::imContextCommitted):
+ (WebKit::EditorClient::handleInputMethodKeydown): Allow to accept the next composition commit.
+ (WebKit::EditorClient::handleInputMethodMousePress): Added for handling IME when a mouse press fires.
+ (WebKit::EditorClient::EditorClient): Initialize m_preventNextCompositionCommit
+ * WebCoreSupport/EditorClientGtk.h:
+ (WebKit::EditorClient::preventNextCompositionCommit): Added for checking whether skipping a commit.
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_button_press_event): Call handleInputMethodMousePress()
+
+2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ Small improvement to the documentation of the geolocation-policy-decision-requested
+ signal, stating more clearly what is expected from the handler.
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_class_init):
+
+2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Geolocation policy decision object leaking
+ https://bugs.webkit.org/show_bug.cgi?id=43884
+
+ Use GRefPtr on the policy decision object to fix the leak.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::requestGeolocationPermissionForFrame):
+
+2010-08-10 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Gtk specific API.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebframe.cpp:
+ (webkit_web_frame_suspend_animations):
+ (webkit_web_frame_resume_animations):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Bug 43786 - Move AtomicStringHash from WebCore to WTF
+ Also remove deprecated string headers from WebCore/platform/text.
+
+ * gdom/ConvertToGCharPrivate.h:
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index a06d637..185ac16 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -611,12 +611,12 @@ void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocatio
WebKitWebFrame* webFrame = kit(frame);
WebKitWebView* webView = getViewFromFrame(webFrame);
- WebKitGeolocationPolicyDecision* policyDecision = webkit_geolocation_policy_decision_new(webFrame, geolocation);
+ GRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptGRef(webkit_geolocation_policy_decision_new(webFrame, geolocation)));
gboolean isHandled = FALSE;
- g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision, &isHandled);
+ g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision.get(), &isHandled);
if (!isHandled)
- webkit_geolocation_policy_deny(policyDecision);
+ webkit_geolocation_policy_deny(policyDecision.get());
}
void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* frame, WebCore::Geolocation*)
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index cd04782..8a019b4 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -67,6 +67,11 @@ static void imContextCommitted(GtkIMContext* context, const gchar* compositionSt
return;
}
+ // If this signal fires during a mousepress event when we are in the middle
+ // of a composition, skip this 'commit' because the composition is already confirmed.
+ if (client->preventNextCompositionCommit())
+ return;
+
frame->editor()->confirmComposition(String::fromUTF8(compositionString));
client->clearPendingComposition();
}
@@ -670,6 +675,7 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event)
WebKitWebViewPrivate* priv = m_webView->priv;
+ m_preventNextCompositionCommit = false;
// Some IM contexts (e.g. 'simple') will act as if they filter every
// keystroke and just issue a 'commit' signal during handling. In situations
@@ -711,9 +717,32 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event)
m_treatContextCommitAsKeyEvent = false;
}
+void EditorClient::handleInputMethodMousePress()
+{
+ Frame* targetFrame = core(m_webView)->focusController()->focusedOrMainFrame();
+
+ if (!targetFrame || !targetFrame->editor()->canEdit())
+ return;
+
+ WebKitWebViewPrivate* priv = m_webView->priv;
+
+ // When a mouse press fires, the commit signal happens during a composition.
+ // In this case, if the focused node is changed, the commit signal happens in a diffrent node.
+ // Therefore, we need to confirm the current compositon and ignore the next commit signal.
+ GOwnPtr<gchar> newPreedit(0);
+ gtk_im_context_get_preedit_string(priv->imContext, &newPreedit.outPtr(), 0, 0);
+
+ if (g_utf8_strlen(newPreedit.get(), -1)) {
+ targetFrame->editor()->confirmComposition();
+ m_preventNextCompositionCommit = true;
+ gtk_im_context_reset(priv->imContext);
+ }
+}
+
EditorClient::EditorClient(WebKitWebView* webView)
: m_isInRedo(false)
, m_webView(webView)
+ , m_preventNextCompositionCommit(false)
, m_treatContextCommitAsKeyEvent(false)
, m_nativeWidget(gtk_text_view_new())
{
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
index 2688629..3e881fa 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h
@@ -61,6 +61,7 @@ namespace WebKit {
~EditorClient();
WebKitWebView* webView() { return m_webView; }
bool treatContextCommitAsKeyEvent() { return m_treatContextCommitAsKeyEvent; }
+ bool preventNextCompositionCommit() { return m_preventNextCompositionCommit; }
void clearPendingComposition() { m_pendingComposition.set(0); }
bool hasPendingComposition() { return m_pendingComposition; }
void addPendingEditorCommand(const char* command) { m_pendingEditorCommands.append(command); }
@@ -112,6 +113,7 @@ namespace WebKit {
virtual void handleKeyboardEvent(WebCore::KeyboardEvent*);
virtual void handleInputMethodKeydown(WebCore::KeyboardEvent*);
+ virtual void handleInputMethodMousePress();
virtual void textFieldDidBeginEditing(WebCore::Element*);
virtual void textFieldDidEndEditing(WebCore::Element*);
@@ -135,6 +137,7 @@ namespace WebKit {
private:
WebKitWebView* m_webView;
+ bool m_preventNextCompositionCommit;
bool m_treatContextCommitAsKeyEvent;
GOwnPtr<gchar> m_pendingComposition;
Vector<const char*> m_pendingEditorCommands;
diff --git a/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h b/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h
new file mode 100644
index 0000000..8e4c214
--- /dev/null
+++ b/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h
@@ -0,0 +1,45 @@
+/*
+ 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 FrameNetworkingContextGtk_h
+#define FrameNetworkingContextGtk_h
+
+#include "FrameNetworkingContext.h"
+
+namespace WebKit {
+
+class FrameNetworkingContextGtk : public WebCore::FrameNetworkingContext {
+public:
+ static PassRefPtr<FrameNetworkingContextGtk> create(WebCore::Frame* frame)
+ {
+ return adoptRef(new FrameNetworkingContextGtk(frame));
+ }
+
+ WebCore::Frame* coreFrame() const { return frame(); }
+
+private:
+ FrameNetworkingContextGtk(WebCore::Frame* frame)
+ : WebCore::FrameNetworkingContext(frame)
+ {
+ }
+};
+
+}
+
+#endif
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index 1256000..b0dd40e 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Gustavo Noronha Silva
+ * Copyright (C) 2010 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -81,13 +82,13 @@ void InspectorClient::openInspectorFrontend(InspectorController* controller)
GOwnPtr<gchar> inspectorURI;
// Make the Web Inspector work when running tests
- if (g_file_test("WebCore/inspector/front-end/inspector.html", G_FILE_TEST_EXISTS)) {
+ // FixMe: it is not working. It should be not the subdirectory of the current directory, but a subdirectory of $(WEBKITOUTPUTDIR).
+ if (g_file_test("resources/inspector/inspector.html", G_FILE_TEST_EXISTS)) {
GOwnPtr<gchar> currentDirectory(g_get_current_dir());
- GOwnPtr<gchar> fullPath(g_strdup_printf("%s/WebCore/inspector/front-end/inspector.html", currentDirectory.get()));
+ GOwnPtr<gchar> fullPath(g_strdup_printf("%s/resources/inspector/inspector.html", currentDirectory.get()));
inspectorURI.set(g_filename_to_uri(fullPath.get(), NULL, NULL));
} else {
- GOwnPtr<gchar> dataPath(g_strdup_printf(DATA_DIR"/webkitgtk-%.1f/webinspector/inspector.html", WEBKITGTK_API_VERSION));
- inspectorURI.set(g_filename_to_uri(dataPath.get(), NULL, NULL));
+ inspectorURI.set(g_filename_to_uri(DATA_DIR"/webkitgtk-"WEBKITGTK_API_VERSION_STRING"/webinspector/inspector.html", NULL, NULL));
}
webkit_web_view_load_uri(inspectorWebView, inspectorURI.get());
@@ -118,15 +119,116 @@ void InspectorClient::hideHighlight()
gtk_widget_queue_draw(GTK_WIDGET(m_inspectedWebView));
}
+#ifdef HAVE_GSETTINGS
+static String toGSettingName(String inspectorSettingName)
+{
+ if (inspectorSettingName == "resourceTrackingEnabled")
+ return String("resource-tracking-enabled");
+
+ if (inspectorSettingName == "xhrMonitor")
+ return String("xhr-monitor-enabled");
+
+ if (inspectorSettingName == "frontendSettings")
+ return String("frontend-settings");
+
+ if (inspectorSettingName == "debuggerEnabled")
+ return String("debugger-enabled");
+
+ if (inspectorSettingName == "profilerEnabled")
+ return String("profiler-enabled");
+
+ return inspectorSettingName;
+}
+
+static String truthStringFromVariant(GVariant* variant)
+{
+ if (g_variant_get_boolean(variant))
+ return String("true");
+
+ return String("false");
+}
+
+static GVariant* variantFromTruthString(const String& truth)
+{
+ if (truth == "true")
+ return g_variant_new_boolean(TRUE);
+
+ return g_variant_new_boolean(FALSE);
+}
+
+static bool shouldIgnoreSetting(const String& key)
+{
+ // Ignore this setting for now, it doesn't seem to be used for
+ // anything right now.
+ if (key == "lastActivePanel")
+ return true;
+
+ // GSettings considers trying to fetch or set a setting that is
+ // not backed by a schema as programmer error, and aborts the
+ // program's execution. We check here to avoid having an unhandled
+ // setting as a fatal error.
+ if (key == "resourceTrackingEnabled" || key == "xhrMonitor"
+ || key == "frontendSettings" || key == "debuggerEnabled"
+ || key == "profilerEnabled")
+ return false;
+
+ LOG_VERBOSE(NotYetImplemented, "Unknown key ignored: %s", key.ascii().data());
+ return true;
+}
+
void InspectorClient::populateSetting(const String& key, String* value)
{
- notImplemented();
+ if (shouldIgnoreSetting(key))
+ return;
+
+ GSettings* settings = inspectorGSettings();
+ if (!settings)
+ return;
+
+ GRefPtr<GVariant> variant = adoptGRef(g_settings_get_value(settings, toGSettingName(key).utf8().data()));
+
+ if (key == "resourceTrackingEnabled" || key == "xhrMonitor"
+ || key == "debuggerEnabled" || key == "profilerEnabled")
+ *value = truthStringFromVariant(variant.get());
+ else if (key == "frontendSettings")
+ *value = String(g_variant_get_string(variant.get(), 0));
}
void InspectorClient::storeSetting(const String& key, const String& value)
{
+ if (shouldIgnoreSetting(key))
+ return;
+
+ GSettings* settings = inspectorGSettings();
+ if (!settings)
+ return;
+
+ GRefPtr<GVariant> variant(0);
+
+ // Set the key with the appropriate type, and also avoid setting
+ // unknown keys to avoid aborting the execution.
+ if (key == "resourceTrackingEnabled" || key == "xhrMonitor"
+ || key == "debuggerEnabled" || key == "profilerEnabled")
+ variant = adoptGRef(variantFromTruthString(value));
+ else if (key == "frontendSettings")
+ variant = adoptGRef(g_variant_new_string(value.utf8().data()));
+
+ if (!variant)
+ return;
+
+ g_settings_set_value(settings, toGSettingName(key).utf8().data(), variant.get());
+}
+#else
+void InspectorClient::populateSetting(const String&, String*)
+{
+ notImplemented();
+}
+
+void InspectorClient::storeSetting(const String&, const String&)
+{
notImplemented();
}
+#endif // HAVE_GSETTINGS
bool InspectorClient::sendMessageToFrontend(const String& message)
{
diff --git a/WebKit/gtk/gdom/ConvertToGCharPrivate.h b/WebKit/gtk/gdom/ConvertToGCharPrivate.h
index ef42b08..afbed49 100644
--- a/WebKit/gtk/gdom/ConvertToGCharPrivate.h
+++ b/WebKit/gtk/gdom/ConvertToGCharPrivate.h
@@ -20,10 +20,10 @@
#ifndef ConvertToGCharPrivate_h
#define ConvertToGCharPrivate_h
-#include "AtomicString.h"
#include "KURL.h"
#include "PlatformString.h"
#include <wtf/text/CString.h>
+#include <wtf/text/AtomicString.h>
inline gchar* copyAsGchar(WTF::String const& s)
{
diff --git a/WebKit/gtk/org.webkitgtk.gschema.xml.in b/WebKit/gtk/org.webkitgtk.gschema.xml.in
new file mode 100644
index 0000000..17063f4
--- /dev/null
+++ b/WebKit/gtk/org.webkitgtk.gschema.xml.in
@@ -0,0 +1,32 @@
+<schemalist>
+ <schema id="org.webkitgtk-@WEBKITGTK_API_VERSION@" path="/system/webkitgtk/">
+ <child schema="org.webkitgtk-@WEBKITGTK_API_VERSION@.inspector" name="inspector"/>
+ </schema>
+ <schema id="org.webkitgtk-@WEBKITGTK_API_VERSION@.inspector" path="/system/webkitgtk/inspector/">
+ <key name="resource-tracking-enabled" type="b">
+ <default>false</default>
+ <summary>Resource Tracking Enabled</summary>
+ <description>Whether the Resource Tracking panel is always enabled.</description>
+ </key>
+ <key name="xhr-monitor-enabled" type="b">
+ <default>false</default>
+ <summary>XHR Monitor Enabled</summary>
+ <description>Whether the XHR monitor is always enabled.</description>
+ </key>
+ <key name="debugger-enabled" type="b">
+ <default>false</default>
+ <summary>Debugger Enabled</summary>
+ <description>Whether the debugger is always enabled.</description>
+ </key>
+ <key name="profiler-enabled" type="b">
+ <default>false</default>
+ <summary>Profiler Enabled</summary>
+ <description>Whether the profiler is always enabled.</description>
+ </key>
+ <key name="frontend-settings" type="s">
+ <default>''</default>
+ <summary>Misc Inspector Frontend Settings</summary>
+ <description>Miscelaneous Settings managed by the Inspector Frontend</description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index 41de76e..91b2904 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -44,6 +44,7 @@
#include "WebKitDOMBinding.h"
#include "webkitnetworkresponse.h"
#include "webkitsoupauthdialog.h"
+#include "webkitversion.h"
#include <libintl.h>
#include <runtime/InitializeThreading.h>
#include <stdlib.h>
@@ -214,6 +215,45 @@ static void closeIconDatabaseOnExit()
iconDatabase()->close();
}
+#ifdef HAVE_GSETTINGS
+static bool isSchemaAvailable(const char* schemaID)
+{
+ const char* const* availableSchemas = g_settings_list_schemas();
+ char* const* iter = const_cast<char* const*>(availableSchemas);
+
+ while (*iter) {
+ if (g_str_equal(schemaID, *iter))
+ return true;
+ iter++;
+ }
+
+ return false;
+}
+
+GSettings* inspectorGSettings()
+{
+ static GSettings* settings = 0;
+
+ if (settings)
+ return settings;
+
+ const gchar* schemaID = "org.webkitgtk-"WEBKITGTK_API_VERSION_STRING".inspector";
+
+ // Unfortunately GSettings will abort the process execution if the
+ // schema is not installed, which is the case for when running
+ // tests, or even the introspection dump at build time, so check
+ // if we have the schema before trying to initialize it.
+ if (!isSchemaAvailable(schemaID)) {
+ g_warning("GSettings schema not found - settings will not be used or saved.");
+ return 0;
+ }
+
+ settings = g_settings_new(schemaID);
+
+ return settings;
+}
+#endif
+
void webkit_init()
{
static bool isInitialized = false;
@@ -238,6 +278,12 @@ void webkit_init()
// FIXME: Expose this with an API and/or calculate based on available resources
webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER);
+#ifdef HAVE_GSETTINGS
+ // Initialize settings variables here to make sure this happens in
+ // the main thread.
+ inspectorGSettings();
+#endif
+
#if ENABLE(DATABASE)
gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
webkit_set_web_database_directory_path(databaseDirectory);
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index aa19bec..a5508a4 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -120,6 +120,10 @@ namespace WebKit {
extern "C" {
void webkit_init();
+#ifdef HAVE_GSETTINGS
+ GSettings* inspectorGSettings();
+#endif
+
#define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
#define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
@@ -347,6 +351,12 @@ extern "C" {
webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
WEBKIT_API void
+ webkit_web_frame_suspend_animations(WebKitWebFrame* frame);
+
+ WEBKIT_API void
+ webkit_web_frame_resume_animations(WebKitWebFrame* frame);
+
+ WEBKIT_API void
webkit_web_frame_clear_main_frame_name(WebKitWebFrame* frame);
WEBKIT_API AtkObject*
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index 70fdea5..4789de9 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -96,12 +96,15 @@ static void webkit_web_back_forward_list_init(WebKitWebBackForwardList* webBackF
}
/**
- * webkit_web_back_forward_list_new_with_web_view:
+ * webkit_web_back_forward_list_new_with_web_view: (skip)
* @web_view: the back forward list's #WebKitWebView
*
* Creates an instance of the back forward list with a controlling #WebKitWebView
*
* Return value: a #WebKitWebBackForwardList
+ *
+ * Deprecated: 1.3.4: Instances of #WebKitWebBackForwardList are
+ * created and owned by #WebKitWebView instances only.
*/
WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitWebView* webView)
{
@@ -151,11 +154,11 @@ void webkit_web_back_forward_list_go_back(WebKitWebBackForwardList* webBackForwa
/**
* webkit_web_back_forward_list_contains_item:
* @web_back_forward_list: a #WebKitWebBackForwardList
- * @history_item: the #WebKitWebHistoryItem to check
+ * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to check
*
* Checks if @web_history_item is in the back forward list
*
- * Return: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't
+ * Return value: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't
*/
gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem)
{
@@ -174,7 +177,7 @@ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* we
/**
* webkit_web_back_forward_list_go_to_item:
* @web_back_forward_list: a #WebKitWebBackForwardList
- * @history_item: the #WebKitWebHistoryItem to go to
+ * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to go to
*
* Go to the specified @web_history_item in the back forward list
*/
@@ -197,7 +200,7 @@ void webkit_web_back_forward_list_go_to_item(WebKitWebBackForwardList* webBackFo
*
* Returns a list of items that succeed the current item, limited by @limit
*
- * Return value: a #GList of items succeeding the current item, limited by @limit
+ * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items succeeding the current item, limited by @limit
*/
GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit)
{
@@ -227,7 +230,7 @@ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackFor
*
* Returns a list of items that precede the current item, limited by @limit
*
- * Return value: a #GList of items preceding the current item, limited by @limit
+ * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items preceding the current item, limited by @limit
*/
GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit)
{
@@ -256,7 +259,7 @@ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwar
*
* Returns the item that precedes the current item
*
- * Return value: the #WebKitWebHistoryItem preceding the current item
+ * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem preceding the current item
*/
WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackForwardList* webBackForwardList)
{
@@ -279,7 +282,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackFo
*
* Returns a NULL value if the back forward list is empty
*
- * Return value: a #WebKitWebHistoryItem
+ * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem
*/
WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBackForwardList* webBackForwardList)
{
@@ -302,7 +305,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBac
*
* Returns a NULL value if there nothing that succeeds the current item
*
- * Return value: a #WebKitWebHistoryItem
+ * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem
*/
WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBackForwardList* webBackForwardList)
{
@@ -324,7 +327,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBac
*
* Returns the item at a given index relative to the current item.
*
- * Return value: the #WebKitWebHistoryItem located at the specified index relative to the current item
+ * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem located at the specified index relative to the current item
*/
WebKitWebHistoryItem* webkit_web_back_forward_list_get_nth_item(WebKitWebBackForwardList* webBackForwardList, gint index)
{
@@ -417,7 +420,7 @@ void webkit_web_back_forward_list_set_limit(WebKitWebBackForwardList* webBackFor
/**
* webkit_web_back_forward_list_add_item:
* @web_back_forward_list: a #WebKitWebBackForwardList
- * @history_item: the #WebKitWebHistoryItem to add
+ * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to add
*
* Adds the item to the #WebKitWebBackForwardList.
*
@@ -440,7 +443,7 @@ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForw
/**
* webkit_web_back_forward_list_clear:
- * @webBackForwardList: a #WebKitWebBackForwardList
+ * @web_back_forward_list: the #WebKitWebBackForwardList to be cleared
*
* Clears the @webBackForwardList by removing all its elements. Note that not even
* the current page is kept in list when cleared so you would have to add it later.
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.h b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
index 2cffc68..15ddc94 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.h
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.h
@@ -107,9 +107,11 @@ webkit_web_back_forward_list_get_limit (WebKitWebBackForwardLi
WEBKIT_API void
webkit_web_back_forward_list_set_limit (WebKitWebBackForwardList *web_back_forward_list,
gint limit);
+
WEBKIT_API void
webkit_web_back_forward_list_add_item (WebKitWebBackForwardList *web_back_forward_list,
WebKitWebHistoryItem *history_item);
+
WEBKIT_API void
webkit_web_back_forward_list_clear (WebKitWebBackForwardList *web_back_forward_list);
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 5e82d57..88f0bb7 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -1053,6 +1053,32 @@ unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame)
return controller->numberOfActiveAnimations();
}
+void webkit_web_frame_suspend_animations(WebKitWebFrame* frame)
+{
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(coreFrame->document());
+}
+
+void webkit_web_frame_resume_animations(WebKitWebFrame* frame)
+{
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(coreFrame->document());
+}
+
gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame)
{
Frame* coreFrame = core(frame);
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 58d91ea..64b7dcc 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -665,8 +665,9 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu
if (!frame->view())
return FALSE;
-
gboolean result = frame->eventHandler()->handleMousePressEvent(platformEvent);
+ // Handle the IM context when a mouse press fires
+ static_cast<WebKit::EditorClient*>(core(webView)->editorClient())->handleInputMethodMousePress();
#if PLATFORM(X11)
/* Copy selection to the X11 selection clipboard */
@@ -2395,10 +2396,12 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
* @frame: the frame that requests permission
* @policy_decision: a WebKitGeolocationPolicyDecision
*
- * When a @frame wants to get its geolocation permission.
- * The receiver must reply with a boolean wether it handled or not the
- * request. If the request is not handled, default behaviour is to deny
- * geolocation.
+ * This signal is emitted when a @frame wants to obtain the user's
+ * location. The decision can be made asynchronously, but you must
+ * call g_object_ref() the @policy_decision, and return %TRUE if
+ * you are going to handle the request. To actually make the
+ * decision you need to call webkit_geolocation_policy_allow() or
+ * webkit_geolocation_policy_deny() on @policy_decision.
*
* Since: 1.1.23
*/
@@ -3299,9 +3302,10 @@ void webkit_web_view_set_maintains_back_forward_list(WebKitWebView* webView, gbo
* webkit_web_view_get_back_forward_list:
* @web_view: a #WebKitWebView
*
- * Returns a #WebKitWebBackForwardList
+ * Obtains the #WebKitBackForwardList associated with the given #WebKitWebView. The
+ * #WebKitWebBackForwardList is owned by the #WebKitWebView.
*
- * Return value: the #WebKitWebBackForwardList
+ * Return value: (transfer none): the #WebKitWebBackForwardList
*/
WebKitWebBackForwardList* webkit_web_view_get_back_forward_list(WebKitWebView* webView)
{
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 269110f..1381fee 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,191 @@
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * WebCoreSupport/WebFrameNetworkingContext.h: Added.
+ Placeholder with tentative code that might be changed when landing
+ the rest of it.
+ * WebCoreSupport/WebFrameNetworkingContext.mm: Added.
+ Empty placeholder for now.
+
+2010-08-17 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Navigating back/forward during a modal dialog causes a crash when the modal dialog is dismissed.
+ <rdar://problem/8313579> and https://bugs.webkit.org/show_bug.cgi?id=44131
+
+ * WebView/WebView.mm:
+ (-[WebView canGoBack]): Return false if loads are deferred.
+ (-[WebView canGoForward]): Ditto.
+
+2010-08-14 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: -[WebInspector attach] and detach should work
+ https://bugs.webkit.org/show_bug.cgi?id=43924
+
+ For actions that relate only to the Web Inspector's Frontend
+ window (actions on the InspectorFrontendClient) the new Obj-C
+ wrapper class WebInspectorFrontend can be used. For now, this
+ is just attach and detach.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (WebInspectorClient::openInspectorFrontend): setup and attach the WebInspectorFrontend to the WebInspector.
+ * WebInspector/WebInspector.h:
+ * WebInspector/WebInspector.mm:
+ (-[WebInspector dealloc]):
+ (-[WebInspector attach:]): delegate to the frontend.
+ (-[WebInspector detach:]): delegate to the frontend.
+ (-[WebInspector setFrontend:]):
+ * WebInspector/WebInspectorFrontend.h: Added.
+ * WebInspector/WebInspectorFrontend.mm: Added.
+ (-[WebInspectorFrontend initWithFrontendClient:]):
+ (-[WebInspectorFrontend attach]):
+ (-[WebInspectorFrontend detach]):
+ * WebInspector/WebInspectorPrivate.h:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+ Switch String::/UString::ascii() to return a CString.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::methodsNamed):
+ (WebKit::ProxyInstance::fieldNamed):
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::enumerate):
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65295.
+ http://trac.webkit.org/changeset/65295
+ https://bugs.webkit.org/show_bug.cgi?id=43950
+
+ It broke 4 sputnik tests (Requested by Ossy on #webkit).
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::enumerate):
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::enumerate):
+
+2010-08-12 Jeremy Orlow <jorlow@chromium.org>
+
+ Revert for now
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-08-10 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Some settings are linked to the PageGroup not the Page. Create a new class for those.
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ Change WebView to use the new GroupSettings class rather than Settings for the
+ settings that moved. This is sub-optimal since the settings aren't really
+ per-view, but we can't really change the API at this point.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-08-11 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamps by Darin Adler & Sam Weinig.
+
+ Bug 43867 - Some UString cleanup
+
+ Change JSC::UString data(), size(), and from(), to characters(), length(), and number() to match WTF::String.
+ Move string concatenation methods to a new header to simplify down UString.h. Remove is8Bit().
+
+ * WebView/WebScriptDebugger.mm:
+ (toNSString):
+
+2010-08-10 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43806, add ability to paginate screen content.
+
+ Add SPI for entering and exiting screen pagination mode. This is similar to printing mode but it can be done for on-screen
+ content.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _web_setPrintingModeRecursive]):
+ (-[WebHTMLView _web_clearPrintingModeRecursive]):
+ (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]):
+ (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]):
+ (-[WebHTMLView _endPrintMode]):
+ (-[WebHTMLView _isInScreenPaginationMode]):
+ (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]):
+ (-[WebHTMLView _endScreenPaginationMode]):
+ (-[WebHTMLView reapplyStyles]):
+ (-[WebHTMLView _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:paginateScreenContent:]):
+ (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]):
+ (-[WebHTMLView setPageWidthForPrinting:]):
+ * WebView/WebHTMLViewPrivate.h:
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Build fix (update more includes)
+
+ * Plugins/Hosted/NetscapePluginHostManager.h:
+
+2010-08-10 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Mac specific API. Plumbs suspendAnimations/resumeAnimations down to WebCore.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _suspendAnimations]):
+ (-[WebFrame _resumeAnimations]):
+ * WebView/WebFramePrivate.h:
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig
+
+ Bug 43817 - Remove UString::Rep
+ UString::Rep has for a long time been replaced by UStringImpl (Rep
+ remaining as a typedef). UStringImpl has since been removed too
+ (unified with StringImpl). Remove Rep, rename rep() to impl() and
+ m_rep to m_impl. Also add impl() method to Identifier, and rename
+ its UString member from _ustring to m_string.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::methodsNamed):
+ (WebKit::ProxyInstance::fieldNamed):
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
index b88f1a4..2645c55 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
@@ -29,9 +29,9 @@
#define NetscapePluginHostManager_h
#import <WebCore/PlatformString.h>
-#import <WebCore/StringHash.h>
#import <wtf/HashMap.h>
#import <wtf/PassRefPtr.h>
+#import <wtf/text/StringHash.h>
@class WebHostedNetscapePluginView;
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 8354c06..cb1d958 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -1238,7 +1238,7 @@ bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultDat
RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]);
for (unsigned i = 0; i < propertyNames.size(); i++) {
- uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().data()));
+ uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().utf8().data()));
[array.get() addObject:[NSNumber numberWithLongLong:methodName]];
}
diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
index b3799ca..306d2e5 100644
--- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
+++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm
@@ -329,7 +329,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
return MethodList();
// If we already have an entry in the map, use it.
- MethodMap::iterator existingMapEntry = m_methods.find(identifier.ustring().rep());
+ MethodMap::iterator existingMapEntry = m_methods.find(identifier.impl());
if (existingMapEntry != m_methods.end()) {
MethodList methodList;
if (existingMapEntry->second)
@@ -337,7 +337,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
return methodList;
}
- uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
+ uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii().data()));
uint32_t requestID = m_instanceProxy->nextRequestID();
if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(),
@@ -353,7 +353,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
return MethodList();
// Add a new entry to the map unless an entry was added while we were in waitForReply.
- pair<MethodMap::iterator, bool> mapAddResult = m_methods.add(identifier.ustring().rep(), 0);
+ pair<MethodMap::iterator, bool> mapAddResult = m_methods.add(identifier.impl(), 0);
if (mapAddResult.second && reply->m_result)
mapAddResult.first->second = new ProxyMethod(methodName);
@@ -369,11 +369,11 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier)
return 0;
// If we already have an entry in the map, use it.
- FieldMap::iterator existingMapEntry = m_fields.find(identifier.ustring().rep());
+ FieldMap::iterator existingMapEntry = m_fields.find(identifier.impl());
if (existingMapEntry != m_fields.end())
return existingMapEntry->second;
- uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
+ uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii().data()));
uint32_t requestID = m_instanceProxy->nextRequestID();
if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(),
@@ -389,7 +389,7 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier)
return 0;
// Add a new entry to the map unless an entry was added while we were in waitForReply.
- pair<FieldMap::iterator, bool> mapAddResult = m_fields.add(identifier.ustring().rep(), 0);
+ pair<FieldMap::iterator, bool> mapAddResult = m_fields.add(identifier.impl(), 0);
if (mapAddResult.second && reply->m_result)
mapAddResult.first->second = new ProxyField(propertyName);
return mapAddResult.first->second;
diff --git a/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h
new file mode 100644
index 0000000..de89024
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h
@@ -0,0 +1,39 @@
+/*
+ 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.
+*/
+
+#import <WebCore/FrameNetworkingContext.h>
+
+class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
+public:
+ static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame* frame)
+ {
+ return adoptRef(new WebFrameNetworkingContext(frame));
+ }
+
+private:
+ WebFrameNetworkingContext(WebCore::Frame* frame)
+ : WebCore::FrameNetworkingContext(frame)
+ {
+ }
+
+ virtual bool needsSiteSpecificQuirks() const;
+ virtual bool localFileContentSniffingEnabled() const;
+ virtual WebCore::SchedulePairHashSet* scheduledRunLoopPairs() const;
+ virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const;
+};
diff --git a/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm
new file mode 100644
index 0000000..941cfaa
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm
@@ -0,0 +1,21 @@
+/*
+ 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.
+*/
+
+// Checking this file in empty to get the build system work out of the way.
+// Will put the code in here later.
diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index d59109e..7cae8fc 100644
--- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -33,6 +33,8 @@
#import "WebFrameInternal.h"
#import "WebFrameView.h"
#import "WebInspector.h"
+#import "WebInspectorPrivate.h"
+#import "WebInspectorFrontend.h"
#import "WebLocalizableStrings.h"
#import "WebNodeHighlight.h"
#import "WebUIDelegate.h"
@@ -98,8 +100,12 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon
{
RetainPtr<WebInspectorWindowController> windowController(AdoptNS, [[WebInspectorWindowController alloc] initWithInspectedWebView:m_webView]);
[windowController.get() setInspectorClient:this];
+
m_frontendPage = core([windowController.get() webView]);
- m_frontendPage->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage));
+ WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage);
+ m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient);
+
+ [[m_webView inspector] setFrontend:[[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient]];
}
void WebInspectorClient::highlight(Node* node)
diff --git a/WebKit/mac/WebInspector/WebInspector.h b/WebKit/mac/WebInspector/WebInspector.h
index fa13c8d..ed78ed7 100644
--- a/WebKit/mac/WebInspector/WebInspector.h
+++ b/WebKit/mac/WebInspector/WebInspector.h
@@ -29,10 +29,12 @@
#import <Foundation/NSObject.h>
@class WebView;
+@class WebInspectorFrontend;
@interface WebInspector : NSObject
{
WebView *_webView;
+ WebInspectorFrontend *_frontend;
}
- (id)initWithWebView:(WebView *)webView;
- (void)webViewClosed;
diff --git a/WebKit/mac/WebInspector/WebInspector.mm b/WebKit/mac/WebInspector/WebInspector.mm
index 9b17459..f109e15 100644
--- a/WebKit/mac/WebInspector/WebInspector.mm
+++ b/WebKit/mac/WebInspector/WebInspector.mm
@@ -30,6 +30,7 @@
#import "WebFrameInternal.h"
#import "WebInspectorPrivate.h"
+#import "WebInspectorFrontend.h"
#include <WebCore/Document.h>
#include <WebCore/Frame.h>
@@ -47,6 +48,12 @@ using namespace WebCore;
return self;
}
+- (void)dealloc
+{
+ [_frontend release];
+ [super dealloc];
+}
+
- (void)webViewClosed
{
_webView = nil;
@@ -175,10 +182,12 @@ using namespace WebCore;
- (void)attach:(id)sender
{
+ [_frontend attach];
}
- (void)detach:(id)sender
{
+ [_frontend detach];
}
- (void)evaluateInFrontend:(id)sender callId:(long)callId script:(NSString *)script
@@ -186,6 +195,12 @@ using namespace WebCore;
if (Page* page = core(_webView))
page->inspectorController()->evaluateForTestInFrontend(callId, script);
}
+
+- (void)setFrontend:(WebInspectorFrontend *)frontend
+{
+ [_frontend release];
+ _frontend = [frontend retain];
+}
@end
@implementation WebInspector (Obsolete)
diff --git a/WebCore/html/canvas/CanvasNumberArray.idl b/WebKit/mac/WebInspector/WebInspectorFrontend.h
index 036d4ee..93bed84 100644
--- a/WebCore/html/canvas/CanvasNumberArray.idl
+++ b/WebKit/mac/WebInspector/WebInspectorFrontend.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * 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
@@ -10,10 +10,10 @@
* 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
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -23,11 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module html {
- interface [
- Conditional=3D_CANVAS,
- HasCustomIndexGetter
- ] CanvasNumberArray {
- readonly attribute unsigned long length;
- };
+class WebInspectorFrontendClient;
+
+@interface WebInspectorFrontend : NSObject {
+@private
+ WebInspectorFrontendClient *m_frontendClient;
}
+- (id)initWithFrontendClient:(WebInspectorFrontendClient *)frontendClient;
+- (void)attach;
+- (void)detach;
+@end
diff --git a/WebCore/html/canvas/CanvasNumberArray.cpp b/WebKit/mac/WebInspector/WebInspectorFrontend.mm
index 6cbdfff..91caa64 100644
--- a/WebCore/html/canvas/CanvasNumberArray.cpp
+++ b/WebKit/mac/WebInspector/WebInspectorFrontend.mm
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * 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
@@ -10,10 +10,10 @@
* 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
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -23,25 +23,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
+#import "WebInspectorFrontend.h"
-#if ENABLE(3D_CANVAS)
+#import "WebInspectorClient.h"
-#include "CanvasNumberArray.h"
-#include "PlatformString.h"
+@implementation WebInspectorFrontend
-namespace WebCore {
-
-PassRefPtr<CanvasNumberArray> CanvasNumberArray::create(unsigned length)
+- (id)initWithFrontendClient:(WebInspectorFrontendClient *)frontendClient;
{
- return adoptRef(new CanvasNumberArray(length));
+ if (!(self = [super init]))
+ return nil;
+
+ m_frontendClient = frontendClient;
+ return self;
}
-CanvasNumberArray::CanvasNumberArray(unsigned length)
- : m_data(length)
+- (void)attach
{
+ m_frontendClient->attachWindow();
}
+- (void)detach
+{
+ m_frontendClient->detachWindow();
}
-#endif // ENABLE(3D_CANVAS)
+@end
diff --git a/WebKit/mac/WebInspector/WebInspectorPrivate.h b/WebKit/mac/WebInspector/WebInspectorPrivate.h
index d18f804..df1e286 100644
--- a/WebKit/mac/WebInspector/WebInspectorPrivate.h
+++ b/WebKit/mac/WebInspector/WebInspectorPrivate.h
@@ -30,6 +30,9 @@
#import <WebKit/WebInspector.h>
+@class WebInspectorFrontend;
+
@interface WebInspector (WebPrivate)
- (void)evaluateInFrontend:(id)sender callId:(long)callId script:(NSString *)script;
+- (void)setFrontend:(WebInspectorFrontend *)frontend;
@end
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index b71d501..82df7bc 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1193,6 +1193,32 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return controller->numberOfActiveAnimations();
}
+- (void) _suspendAnimations
+{
+ Frame* frame = core(self);
+ if (!frame)
+ return;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(frame->document());
+}
+
+- (void) _resumeAnimations
+{
+ Frame* frame = core(self);
+ if (!frame)
+ return;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(frame->document());
+}
+
- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
{
if (_private->coreFrame->selection()->isNone() || !fragment)
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 0bda966..3556ad8 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -113,6 +113,10 @@ typedef enum {
// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
- (unsigned) _numberOfActiveAnimations;
+// Suspend and resume animations (includes both CSS transitions and CSS animations).
+- (void) _suspendAnimations;
+- (void) _resumeAnimations;
+
- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index 0e559b4..77df9d1 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -399,7 +399,7 @@ static CachedResourceClient* promisedDataClient()
#endif
@interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick.
-- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize;
+- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent;
@end
@class NSTextInputContext;
@@ -445,6 +445,7 @@ struct WebHTMLViewInterpretKeyEventsParameters {
BOOL ignoringMouseDraggedEvents;
BOOL printing;
BOOL avoidingPrintOrphan;
+ BOOL paginateScreenContent;
BOOL observingMouseMovedNotifications;
BOOL observingSuperviewNotifications;
BOOL observingWindowNotifications;
@@ -1041,7 +1042,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
- (void)_web_setPrintingModeRecursive
{
- [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
+ [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
#ifndef NDEBUG
_private->enumeratingSubviews = YES;
@@ -1053,7 +1054,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
unsigned count = [descendantWebHTMLViews count];
for (unsigned i = 0; i < count; ++i)
- [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
+ [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
[descendantWebHTMLViews release];
@@ -1064,7 +1065,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
- (void)_web_clearPrintingModeRecursive
{
- [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
+ [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
#ifndef NDEBUG
_private->enumeratingSubviews = YES;
@@ -1076,7 +1077,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
unsigned count = [descendantWebHTMLViews count];
for (unsigned i = 0; i < count; ++i)
- [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
+ [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
[descendantWebHTMLViews release];
@@ -1087,7 +1088,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
- (void)_web_setPrintingModeRecursiveAndAdjustViewSize
{
- [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES];
+ [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]];
#ifndef NDEBUG
_private->enumeratingSubviews = YES;
@@ -1099,7 +1100,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
unsigned count = [descendantWebHTMLViews count];
for (unsigned i = 0; i < count; ++i)
- [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES];
+ [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]];
[descendantWebHTMLViews release];
@@ -2248,14 +2249,46 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
minLayoutHeight = shrinkToFit ? pageHeight * _WebHTMLViewPrintingMinimumShrinkFactor : pageHeight;
maxLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMaximumShrinkFactor : pageWidth;
}
- [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES];
+ [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]];
return YES;
}
- (void)_endPrintMode
{
- [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES];
+ [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]];
+}
+
+- (BOOL)_isInScreenPaginationMode
+{
+ return _private->paginateScreenContent;
+}
+
+- (BOOL)_beginScreenPaginationModeWithPageSize:(CGSize)pageSize shrinkToFit:(BOOL)shrinkToFit
+{
+ Frame* frame = core([self _frame]);
+ if (!frame)
+ return NO;
+
+ CGFloat minLayoutWidth = 0;
+ CGFloat minLayoutHeight = 0;
+ CGFloat maxLayoutWidth = 0;
+
+ // If we are a frameset just print with the layout we have on the screen. Otherwise do a relayout
+ // according to the page width.
+ if (!frame->document() || !frame->document()->isFrameSet()) {
+ minLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.width;
+ minLayoutHeight = shrinkToFit ? pageSize.height * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.height;
+ maxLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMaximumShrinkFactor : pageSize.width;
+ }
+ [self _setPrinting:[self _isInPrintMode] minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:YES];
+
+ return YES;
+}
+
+- (void)_endScreenPaginationMode
+{
+ [self _setPrinting:[self _isInPrintMode] minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:NO];
}
- (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit
@@ -3092,8 +3125,10 @@ WEBCORE_COMMAND(yankAndSelect)
if (Frame* coreFrame = core([self _frame])) {
if (FrameView* coreView = coreFrame->view())
coreView->setMediaType(_private->printing ? "print" : "screen");
- if (Document* document = coreFrame->document())
+ if (Document* document = coreFrame->document()) {
+ document->setPaginatedForScreen(_private->paginateScreenContent);
document->setPrinting(_private->printing);
+ }
coreFrame->reapplyStyles();
}
@@ -3823,8 +3858,11 @@ static BOOL isInPasswordField(Frame* coreFrame)
// Does setNeedsDisplay:NO as a side effect when printing is ending.
// pageWidth != 0 implies we will relayout to a new width
-- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize
+- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent
{
+ if (printing == _private->printing && paginateScreenContent == _private->paginateScreenContent)
+ return;
+
WebFrame *frame = [self _frame];
NSArray *subframes = [frame childFrames];
unsigned n = [subframes count];
@@ -3833,23 +3871,22 @@ static BOOL isInPasswordField(Frame* coreFrame)
WebFrame *subframe = [subframes objectAtIndex:i];
WebFrameView *frameView = [subframe frameView];
if ([[subframe _dataSource] _isDocumentHTML]) {
- [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize];
+ [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize paginateScreenContent:paginateScreenContent];
}
}
- if (printing || _private->printing) {
- [_private->pageRects release];
- _private->pageRects = nil;
- _private->printing = printing;
- if (!printing)
- _private->avoidingPrintOrphan = NO;
- [self setNeedsToApplyStyles:YES];
- [self setNeedsLayout:YES];
- [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize];
- if (!printing) {
- // Can't do this when starting printing or nested printing won't work, see 3491427.
- [self setNeedsDisplay:NO];
- }
+ [_private->pageRects release];
+ _private->pageRects = nil;
+ _private->printing = printing;
+ _private->paginateScreenContent = paginateScreenContent;
+ if (!printing && !paginateScreenContent)
+ _private->avoidingPrintOrphan = NO;
+ [self setNeedsToApplyStyles:YES];
+ [self setNeedsLayout:YES];
+ [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize];
+ if (!printing) {
+ // Can't do this when starting printing or nested printing won't work, see 3491427.
+ [self setNeedsDisplay:NO];
}
}
@@ -3866,7 +3903,7 @@ static BOOL isInPasswordField(Frame* coreFrame)
// If the WebHTMLView itself is what we're printing, then we will never have to do this.
BOOL wasInPrintingMode = _private->printing;
if (!wasInPrintingMode)
- [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
+ [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
*newBottom = [self _adjustedBottomOfPageWithTop:oldTop bottom:oldBottom limit:bottomLimit];
@@ -3877,7 +3914,7 @@ static BOOL isInPasswordField(Frame* coreFrame)
[self performSelector:@selector(_delayedEndPrintMode:) withObject:currenPrintOperation afterDelay:0];
else
// not sure if this is actually ever invoked, it probably shouldn't be
- [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
+ [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
}
}
@@ -3907,8 +3944,8 @@ static BOOL isInPasswordField(Frame* coreFrame)
// This is used for Carbon printing. At some point we might want to make this public API.
- (void)setPageWidthForPrinting:(float)pageWidth
{
- [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO];
- [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES];
+ [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]];
+ [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]];
}
- (void)_endPrintModeAndRestoreWindowAutodisplay
diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h
index c2ca3fe..e1d15dc 100644
--- a/WebKit/mac/WebView/WebHTMLViewPrivate.h
+++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h
@@ -138,6 +138,10 @@ extern const float _WebHTMLViewPrintingMaximumShrinkFactor;
- (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit;
- (void)_endPrintMode;
+- (BOOL)_isInScreenPaginationMode;
+- (BOOL)_beginScreenPaginationModeWithPageSize:(CGSize)pageSize shrinkToFit:(BOOL)shrinkToFit;
+- (void)_endScreenPaginationMode;
+
- (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard;
@end
diff --git a/WebKit/mac/WebView/WebScriptDebugger.mm b/WebKit/mac/WebView/WebScriptDebugger.mm
index c5e0ac8..f67b46f 100644
--- a/WebKit/mac/WebView/WebScriptDebugger.mm
+++ b/WebKit/mac/WebView/WebScriptDebugger.mm
@@ -54,7 +54,7 @@ NSString *toNSString(const UString& s)
{
if (s.isEmpty())
return nil;
- return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.size()];
+ return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.characters()) length:s.length()];
}
static NSString *toNSString(const SourceCode& s)
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index aefd56b..d6faeca 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -3908,7 +3908,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag)
- (BOOL)canGoBack
{
- if (!_private->page)
+ if (!_private->page || _private->page->defersLoading())
return NO;
return !!_private->page->backForwardList()->backItem();
@@ -3916,7 +3916,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag)
- (BOOL)canGoForward
{
- if (!_private->page)
+ if (!_private->page || _private->page->defersLoading())
return NO;
return !!_private->page->backForwardList()->forwardItem();
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 47ab82a..7f66d98 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -67,7 +67,9 @@ public:
void _q_contentsSizeChanged(const QSize&);
void _q_scaleChanged();
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
void _q_updateMicroFocus();
+#endif
void _q_pageDestroyed();
QGraphicsWebView* q;
@@ -100,9 +102,9 @@ void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success)
emit q->loadFinished(success);
}
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
void QGraphicsWebViewPrivate::_q_updateMicroFocus()
{
-#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
// Ideally, this should be handled by a common call to an updateMicroFocus function
// in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578.
QList<QGraphicsView*> views = q->scene()->views();
@@ -111,8 +113,8 @@ void QGraphicsWebViewPrivate::_q_updateMicroFocus()
if (ic)
ic->update();
}
-#endif
}
+#endif
void QGraphicsWebViewPrivate::_q_pageDestroyed()
{
@@ -488,10 +490,12 @@ void QGraphicsWebView::setPage(QWebPage* page)
this, SIGNAL(statusBarMessage(QString)));
connect(d->page, SIGNAL(linkClicked(QUrl)),
this, SIGNAL(linkClicked(QUrl)));
- connect(d->page, SIGNAL(microFocusChanged()),
- this, SLOT(_q_updateMicroFocus()));
connect(d->page, SIGNAL(destroyed()),
this, SLOT(_q_pageDestroyed()));
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
+ connect(d->page, SIGNAL(microFocusChanged()),
+ this, SLOT(_q_updateMicroFocus()));
+#endif
}
/*!
diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h
index 8650984..77f0359 100644
--- a/WebKit/qt/Api/qgraphicswebview.h
+++ b/WebKit/qt/Api/qgraphicswebview.h
@@ -146,7 +146,9 @@ protected:
private:
Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
Q_PRIVATE_SLOT(d, void _q_updateMicroFocus())
+#endif
Q_PRIVATE_SLOT(d, void _q_pageDestroyed())
// we don't want to change the moc based on USE() macro, so this function is here
// but will be empty if ACCLERATED_COMPOSITING is disabled
diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp
index d2cdf79..ce2f283 100644
--- a/WebKit/qt/Api/qwebelement.cpp
+++ b/WebKit/qt/Api/qwebelement.cpp
@@ -970,7 +970,7 @@ void QWebElement::appendInside(const QString &markup)
return;
HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element);
- RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup);
+ RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup);
ExceptionCode exception = 0;
m_element->appendChild(fragment, exception);
@@ -1016,7 +1016,7 @@ void QWebElement::prependInside(const QString &markup)
return;
HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element);
- RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup);
+ RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup);
ExceptionCode exception = 0;
@@ -1068,7 +1068,7 @@ void QWebElement::prependOutside(const QString &markup)
return;
HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element);
- RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup);
+ RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup);
ExceptionCode exception = 0;
m_element->parent()->insertBefore(fragment, m_element, exception);
@@ -1118,7 +1118,7 @@ void QWebElement::appendOutside(const QString &markup)
return;
HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element);
- RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup);
+ RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup);
ExceptionCode exception = 0;
if (!m_element->nextSibling())
@@ -1263,7 +1263,7 @@ void QWebElement::encloseContentsWith(const QString &markup)
return;
HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element);
- RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup);
+ RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup);
if (!fragment || !fragment->firstChild())
return;
@@ -1338,7 +1338,7 @@ void QWebElement::encloseWith(const QString &markup)
return;
HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element);
- RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup);
+ RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup);
if (!fragment || !fragment->firstChild())
return;
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 4f2845f..25e8fb3 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,133 @@
+2010-08-17 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] [Symbian] Consistently use Q_OS_SYMBIAN to guard all Symbian platform dependencies
+ https://bugs.webkit.org/show_bug.cgi?id=44124
+
+ Q_WS_S60 is not defined for Symbian^4 devices as Q_WS_S60 used to guard
+ Avkon UI framework dependencies. Use Q_OS_SYMBIAN everywhere to mark
+ Symbian dependencies.
+
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ (WebCore::QtFallbackWebPopup::populate):
+
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * WebCoreSupport/FrameNetworkingContextQt.cpp: Added.
+ Empty placeholder for now.
+ * WebCoreSupport/FrameNetworkingContextQt.h: Added.
+ Placeholder with tentative code that might be changed when landing
+ the rest of it.
+
+2010-08-17 Hui Huang <hui.2.huang@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Fix ARM5 compiling error in FrameLoaderClientQt.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=43927
+
+ In the Symbian build chain QT_USE_FAST_OPERATOR_PLUS is defined,
+ which means that the '+' will automatically be performed as the
+ QStringBuilder '%'. Create a QString explicitly to make sure that
+ toLocal8bit() member is available that the qPrintable Macro uses.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2010-08-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Implement ChromeClient's windowToScreen() and screenToWindow()
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+
+2010-08-14 Adam Barth <abarth@webkit.org>
+
+ Propagate name change to Qt.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::appendInside):
+ (QWebElement::prependInside):
+ (QWebElement::prependOutside):
+ (QWebElement::appendOutside):
+ (QWebElement::encloseContentsWith):
+ (QWebElement::encloseWith):
+
+2010-08-12 Jeremy Orlow <jorlow@chromium.org>
+
+ Revert for now
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2010-08-11 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Some settings are linked to the PageGroup not the Page. Create a new class for those.
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ Change WebSettings to use the new GroupSettings class rather than Settings for the
+ settings that moved. This is sub-optimal since the settings aren't really
+ per-view, but I don't see how we can change the API at this point.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2010-08-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Update the Symbian def files
+
+ Re-freeze with various QGraphicsWebView and DRT updates.
+ The uppper part of the diff is just whitespace, so
+ diff -w will show the real diff.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-08-10 Anders Bakken <agbakken@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Don't connect to microFocusChanged() if _q_updateMicroFocus is a noop.
+ https://bugs.webkit.org/show_bug.cgi?id=40580
+
+ _q_updateMicroFocus() is a noop unless this ifdef evaluates to true:
+ #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
+
+ In such cases there's no need to carry the overhead of the extra
+ signal/slot connection.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::_q_updateMicroFocus):
+ (QGraphicsWebView::setPage):
+
+2010-08-10 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Qt specific API. Missing symbian symbol defines in:
+
+ WebKit/qt/symbian/bwins/QtWebKitu.def
+ WebKit/qt/symbian/eabi/QtWebKitu.def
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::suspendAnimations):
+ (DumpRenderTreeSupportQt::resumeAnimations):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 0b77ea6..87ed19d 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -410,14 +410,31 @@ void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect,
IntRect ChromeClientQt::windowToScreen(const IntRect& rect) const
{
- notImplemented();
- return rect;
+ QWebPageClient* pageClient = platformPageClient();
+ if (!pageClient)
+ return rect;
+
+ QWidget* ownerWidget = pageClient->ownerWidget();
+ if (!ownerWidget)
+ return rect;
+
+ QRect screenRect(rect);
+ screenRect.translate(ownerWidget->mapToGlobal(QPoint(0, 0)));
+
+ return screenRect;
}
IntPoint ChromeClientQt::screenToWindow(const IntPoint& point) const
{
- notImplemented();
- return point;
+ QWebPageClient* pageClient = platformPageClient();
+ if (!pageClient)
+ return point;
+
+ QWidget* ownerWidget = pageClient->ownerWidget();
+ if (!ownerWidget)
+ return point;
+
+ return ownerWidget->mapFromGlobal(point);
}
PlatformPageClient ChromeClientQt::platformPageClient() const
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index ddc9d7a..b6c3d51 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -262,6 +262,32 @@ int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame)
return controller->numberOfActiveAnimations();
}
+void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame)
+{
+ Frame* coreFrame = QWebFramePrivate::core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(coreFrame->document());
+}
+
+void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame)
+{
+ Frame* coreFrame = QWebFramePrivate::core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(coreFrame->document());
+}
+
void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame)
{
Frame* coreFrame = QWebFramePrivate::core(frame);
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 3a92158..2069114 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -79,6 +79,8 @@ public:
static void clearFrameName(QWebFrame* frame);
static void overwritePluginDirectories();
static int numberOfActiveAnimations(QWebFrame*);
+ static void suspendAnimations(QWebFrame*);
+ static void resumeAnimations(QWebFrame*);
static int numberOfPages(QWebFrame* frame, float width, float height);
static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height);
static bool hasDocumentElement(QWebFrame* frame);
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index cf76dae..1dd9f21 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1121,7 +1121,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun
printf("Policy delegate: attempt to load %s with navigation type '%s'%s\n",
qPrintable(drtDescriptionSuitableForTestResult(request.url())), navigationTypeToString(action.type()),
- (node) ? qPrintable(" originating from " + drtDescriptionSuitableForTestResult(node, 0)) : "");
+ (node) ? qPrintable(QString(" originating from " + drtDescriptionSuitableForTestResult(node, 0))) : "");
if (policyDelegatePermissive)
result = PolicyUse;
diff --git a/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp
new file mode 100644
index 0000000..941cfaa
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp
@@ -0,0 +1,21 @@
+/*
+ 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.
+*/
+
+// Checking this file in empty to get the build system work out of the way.
+// Will put the code in here later.
diff --git a/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h
new file mode 100644
index 0000000..461023e
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h
@@ -0,0 +1,43 @@
+/*
+ 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 FrameNetworkingContextQt_h
+#define FrameNetworkingContextQt_h
+
+#include "FrameNetworkingContext.h"
+
+namespace WebCore {
+
+class FrameNetworkingContextQt : public FrameNetworkingContext {
+public:
+ static PassRefPtr<FrameNetworkingContextQt> create(Frame*, QObject* originatingObject, QNetworkAccessManager*);
+
+private:
+ FrameNetworkingContextQt(Frame*, QObject* originatingObject, QNetworkAccessManager*);
+
+ virtual QObject* originatingObject() const;
+ virtual QNetworkAccessManager* networkAccessManager() const;
+
+ QObject* m_originatingObject;
+ QNetworkAccessManager* m_networkAccessManager;
+};
+
+}
+
+#endif // FrameNetworkingContextQt_h
diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index 21678c7..3b53476 100644
--- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -215,7 +215,7 @@ void QtFallbackWebPopup::populate(const QWebSelectData& data)
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model());
Q_ASSERT(model);
-#if !defined(Q_WS_S60)
+#if !defined(Q_OS_SYMBIAN)
m_combo->setFont(font());
#endif
diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def
index 548add1..9c3e152 100644
--- a/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -742,39 +742,39 @@ EXPORTS
_ZN23DumpRenderTreeSupportQt22javaScriptObjectsCountEv @ 741 NONAME
_ZN23DumpRenderTreeSupportQt23setCaretBrowsingEnabledEP8QWebPageb @ 742 NONAME
_ZN23DumpRenderTreeSupportQt24executeCoreCommandByNameEP8QWebPageRK7QStringS4_ @ 743 NONAME
- _ZN23DumpRenderTreeSupportQt21dumpSetAcceptsEditingEb @744 NONAME
- _ZN23DumpRenderTreeSupportQt22resumeActiveDOMObjectsEP9QWebFrame @745 NONAME
- _ZN23DumpRenderTreeSupportQt23suspendActiveDOMObjectsEP9QWebFrame @746 NONAME
- _ZN23DumpRenderTreeSupportQt24numberOfActiveAnimationsEP9QWebFrame @747 NONAME
- _ZN23DumpRenderTreeSupportQt24pageNumberForElementByIdEP9QWebFrameRK7QStringff @748 NONAME
- _ZN23DumpRenderTreeSupportQt25dumpResourceLoadCallbacksEb @749 NONAME
- _ZN23DumpRenderTreeSupportQt25pauseTransitionOfPropertyEP9QWebFrameRK7QStringdS4_ @750 NONAME
- _ZN23DumpRenderTreeSupportQt25setFrameFlatteningEnabledEP8QWebPageb @751 NONAME
- _ZN23DumpRenderTreeSupportQt25webInspectorExecuteScriptEP8QWebPagelRK7QString @752 NONAME
- _ZN23DumpRenderTreeSupportQt25whiteListAccessFromOriginERK7QStringS2_S2_b @753 NONAME
- _ZN23DumpRenderTreeSupportQt26counterValueForElementByIdEP9QWebFrameRK7QString @754 NONAME
- _ZN23DumpRenderTreeSupportQt26firstRectForCharacterRangeEP8QWebPageii @755 NONAME
- _ZN23DumpRenderTreeSupportQt26overwritePluginDirectoriesEv @756 NONAME
- _ZN23DumpRenderTreeSupportQt27resetOriginAccessWhiteListsEv @757 NONAME
- _ZN23DumpRenderTreeSupportQt27setSmartInsertDeleteEnabledEP8QWebPageb @758 NONAME
- _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @759 NONAME
- _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @760 NONAME
- _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @761 NONAME
- _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME
- _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @763 NONAME
- _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @764 NONAME
- _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @765 NONAME
- _ZN23DumpRenderTreeSupportQt33computedStyleIncludingVisitedInfoERK11QWebElement @766 NONAME
- _ZN23DumpRenderTreeSupportQt34setSelectTrailingWhitespaceEnabledEP8QWebPageb @767 NONAME
- _ZN23DumpRenderTreeSupportQt39elementDoesAutoCompleteForElementWithIdEP9QWebFrameRK7QString @768 NONAME
- _ZN23DumpRenderTreeSupportQt39setWillSendRequestReturnsNullOnRedirectEb @769 NONAME
- _ZN23DumpRenderTreeSupportQt40garbageCollectorCollectOnAlternateThreadEb @770 NONAME
- _ZN23DumpRenderTreeSupportQt40setDomainRelaxationForbiddenForURLSchemeEbRK7QString @771 NONAME
+ _ZN23DumpRenderTreeSupportQt21dumpSetAcceptsEditingEb @ 744 NONAME
+ _ZN23DumpRenderTreeSupportQt22resumeActiveDOMObjectsEP9QWebFrame @ 745 NONAME
+ _ZN23DumpRenderTreeSupportQt23suspendActiveDOMObjectsEP9QWebFrame @ 746 NONAME
+ _ZN23DumpRenderTreeSupportQt24numberOfActiveAnimationsEP9QWebFrame @ 747 NONAME
+ _ZN23DumpRenderTreeSupportQt24pageNumberForElementByIdEP9QWebFrameRK7QStringff @ 748 NONAME
+ _ZN23DumpRenderTreeSupportQt25dumpResourceLoadCallbacksEb @ 749 NONAME
+ _ZN23DumpRenderTreeSupportQt25pauseTransitionOfPropertyEP9QWebFrameRK7QStringdS4_ @ 750 NONAME
+ _ZN23DumpRenderTreeSupportQt25setFrameFlatteningEnabledEP8QWebPageb @ 751 NONAME
+ _ZN23DumpRenderTreeSupportQt25webInspectorExecuteScriptEP8QWebPagelRK7QString @ 752 NONAME
+ _ZN23DumpRenderTreeSupportQt25whiteListAccessFromOriginERK7QStringS2_S2_b @ 753 NONAME
+ _ZN23DumpRenderTreeSupportQt26counterValueForElementByIdEP9QWebFrameRK7QString @ 754 NONAME
+ _ZN23DumpRenderTreeSupportQt26firstRectForCharacterRangeEP8QWebPageii @ 755 NONAME
+ _ZN23DumpRenderTreeSupportQt26overwritePluginDirectoriesEv @ 756 NONAME
+ _ZN23DumpRenderTreeSupportQt27resetOriginAccessWhiteListsEv @ 757 NONAME
+ _ZN23DumpRenderTreeSupportQt27setSmartInsertDeleteEnabledEP8QWebPageb @ 758 NONAME
+ _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @ 759 NONAME
+ _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @ 760 NONAME
+ _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @ 761 NONAME
+ _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @ 762 NONAME
+ _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @ 763 NONAME
+ _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @ 764 NONAME
+ _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @ 765 NONAME
+ _ZN23DumpRenderTreeSupportQt33computedStyleIncludingVisitedInfoERK11QWebElement @ 766 NONAME
+ _ZN23DumpRenderTreeSupportQt34setSelectTrailingWhitespaceEnabledEP8QWebPageb @ 767 NONAME
+ _ZN23DumpRenderTreeSupportQt39elementDoesAutoCompleteForElementWithIdEP9QWebFrameRK7QString @ 768 NONAME
+ _ZN23DumpRenderTreeSupportQt39setWillSendRequestReturnsNullOnRedirectEb @ 769 NONAME
+ _ZN23DumpRenderTreeSupportQt40garbageCollectorCollectOnAlternateThreadEb @ 770 NONAME
+ _ZN23DumpRenderTreeSupportQt40setDomainRelaxationForbiddenForURLSchemeEbRK7QString @ 771 NONAME
_ZN23DumpRenderTreeSupportQt18setEditingBehaviorEP8QWebPageRK7QString @ 772 NONAME
- _ZN23DumpRenderTreeSupportQt24setNotificationsReceiverEP7QObject @ 773 NONAME
- _ZN23DumpRenderTreeSupportQt26allowNotificationForOriginERK7QString @ 774 NONAME
- _ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME
- _ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME
+ _ZN23DumpRenderTreeSupportQt24setNotificationsReceiverEP7QObject @ 773 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt26allowNotificationForOriginERK7QString @ 774 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME ABSENT
+ _ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME ABSENT
_ZN23DumpRenderTreeSupportQt31removeWhiteListAccessFromOriginERK7QStringS2_S2_b @ 777 NONAME
_ZN23DumpRenderTreeSupportQt11shouldCloseEP9QWebFrame @ 778 NONAME
_ZN23DumpRenderTreeSupportQt12isTargetItemERK15QWebHistoryItem @ 779 NONAME
@@ -799,3 +799,17 @@ EXPORTS
_ZN8QWebPage23allowGeolocationRequestEP9QWebFrame @ 798 NONAME
_ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME
_ZNK15QWebScriptWorld5worldEv @ 800 NONAME
+ _ZN16QGraphicsWebView13setDeviceSizeERK5QSize @ 801 NONAME
+ _ZN23DumpRenderTreeSupportQt12pagePropertyEP9QWebFrameRK7QStringi @ 802 NONAME
+ _ZN23DumpRenderTreeSupportQt16isPageBoxVisibleEP9QWebFramei @ 803 NONAME
+ _ZN23DumpRenderTreeSupportQt16resumeAnimationsEP9QWebFrame @ 804 NONAME
+ _ZN23DumpRenderTreeSupportQt17addUserStyleSheetEP8QWebPageRK7QString @ 805 NONAME
+ _ZN23DumpRenderTreeSupportQt17suspendAnimationsEP9QWebFrame @ 806 NONAME
+ _ZN23DumpRenderTreeSupportQt26pageSizeAndMarginsInPixelsEP9QWebFrameiiiiiii @ 807 NONAME
+ _ZN23DumpRenderTreeSupportQt28setDeferMainResourceDataLoadEb @ 808 NONAME
+ _ZN8QWebPage17setUserPermissionEP9QWebFrameNS_16PermissionDomainENS_16PermissionPolicyE @ 809 NONAME
+ _ZN8QWebPage23checkPermissionFromUserEP9QWebFrameNS_16PermissionDomainERNS_16PermissionPolicyE @ 810 NONAME
+ _ZN8QWebPage25requestPermissionFromUserEP9QWebFrameNS_16PermissionDomainE @ 811 NONAME
+ _ZN8QWebPage27cancelRequestsForPermissionEP9QWebFrameNS_16PermissionDomainE @ 812 NONAME
+ _ZNK16QGraphicsWebView10deviceSizeEv @ 813 NONAME
+
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index acfeab7..cd0f234 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,76 @@
+2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Preparation: Just add the files to the build system.
+
+ * WebCoreSupport/WebFrameNetworkingContext.cpp: Added.
+ Empty placeholder for now.
+ * WebCoreSupport/WebFrameNetworkingContext.h: Added.
+ Placeholder with tentative code that might be changed when landing
+ the rest of it.
+ * WebKit.vcproj/WebKit.vcproj: Added new files.
+
+2010-08-17 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Navigating back/forward during a modal dialog causes a crash when the modal dialog is dismissed.
+ <rdar://problem/8313579> and https://bugs.webkit.org/show_bug.cgi?id=44131
+
+ * WebView.cpp:
+ (WebView::canGoBack): Return false if loads are deferred.
+ (WebView::canGoForward): Ditto.
+
+2010-08-16 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed; build fix attempt for Windows.
+
+ * DefaultDownloadDelegate.cpp:
+
+2010-08-12 Jeremy Orlow <jorlow@chromium.org>
+
+ Revert for now
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ * WebView.cpp:
+ (WebView::initWithFrame):
+
+2010-08-12 Jeremy Orlow <jorlow@chromium.org>
+
+ Build fix. Matches solutions in qt and mac ports for
+ https://bugs.webkit.org/show_bug.cgi?id=43794
+
+ * WebView.cpp:
+ (WebView::initWithFrame):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Build fix (update more includes)
+
+ * WebKitDLL.h:
+ * WebLocalizableStrings.cpp:
+ * WebNotificationCenter.cpp:
+ * WebPreferences.cpp:
+
+2010-08-10 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Win specific API
+
+ * Interfaces/IWebFramePrivate.idl:
+ * WebFrame.cpp:
+ (WebFrame::suspendAnimations):
+ (WebFrame::resumeAnimations):
+ * WebFrame.h:
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/win/DefaultDownloadDelegate.cpp b/WebKit/win/DefaultDownloadDelegate.cpp
index cf443b5..29da6a4 100644
--- a/WebKit/win/DefaultDownloadDelegate.cpp
+++ b/WebKit/win/DefaultDownloadDelegate.cpp
@@ -30,6 +30,7 @@
#include "WebKit.h"
#include "WebKitLogging.h"
#include "WebMutableURLRequest.h"
+#include <wtf/text/CString.h>
#include <shlobj.h>
#include <tchar.h>
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index b04edfe..cf25204 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -90,6 +90,8 @@ interface IWebFramePrivate : IUnknown
HRESULT pauseAnimation([in] BSTR animationName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning);
HRESULT pauseTransition([in] BSTR propertyName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* transitionWasRunning);
HRESULT numberOfActiveAnimations([out, retval] UINT* number);
+ HRESULT suspendAnimations();
+ HRESULT resumeAnimations();
HRESULT isDisplayingStandaloneImage([out, retval] BOOL* result);
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index 8938501..d25cdfe 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -20,7 +20,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
cpp_quote("/*")
diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
new file mode 100644
index 0000000..941cfaa
--- /dev/null
+++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
@@ -0,0 +1,21 @@
+/*
+ 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.
+*/
+
+// Checking this file in empty to get the build system work out of the way.
+// Will put the code in here later.
diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h
new file mode 100644
index 0000000..7fd55d5
--- /dev/null
+++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h
@@ -0,0 +1,42 @@
+/*
+ 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 WebFrameNetworkingContext_h
+#define WebFrameNetworkingContext_h
+
+#include <WebCore/FrameNetworkingContext.h>
+
+class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext {
+public:
+ static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame*, const WTF::String& userAgent);
+
+private:
+ WebFrameNetworkingContext(WebCore::Frame* frame, const WTF::String& userAgent)
+ : WebCore::FrameNetworkingContext(frame)
+ , m_userAgent(userAgent)
+ {
+ }
+
+ virtual WTF::String userAgent() const;
+ virtual WTF::String referrer() const;
+
+ WTF::String m_userAgent;
+};
+
+#endif // WebFrameNetworkingContext_h
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index f07821f..500a643 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1297,6 +1297,34 @@ HRESULT WebFrame::numberOfActiveAnimations(UINT* number)
return S_OK;
}
+HRESULT WebFrame::suspendAnimations()
+{
+ Frame* frame = core(this);
+ if (!frame)
+ return E_FAIL;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return E_FAIL;
+
+ controller->suspendAnimations(frame->document());
+ return S_OK;
+}
+
+HRESULT WebFrame::resumeAnimations()
+{
+ Frame* frame = core(this);
+ if (!frame)
+ return E_FAIL;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return E_FAIL;
+
+ controller->resumeAnimations(frame->document());
+ return S_OK;
+}
+
HRESULT WebFrame::isDisplayingStandaloneImage(BOOL* result)
{
if (!result)
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 6f8b56a..24a7e2b 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -258,6 +258,8 @@ public:
virtual HRESULT STDMETHODCALLTYPE pauseTransition(BSTR propertyName, IDOMNode*, double secondsFromNow, BOOL* transitionWasRunning);
virtual HRESULT STDMETHODCALLTYPE pauseSVGAnimation(BSTR elementId, IDOMNode*, double secondsFromNow, BOOL* animationWasRunning);
virtual HRESULT STDMETHODCALLTYPE numberOfActiveAnimations(UINT*);
+ virtual HRESULT STDMETHODCALLTYPE suspendAnimations();
+ virtual HRESULT STDMETHODCALLTYPE resumeAnimations();
virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*);
diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index 85e8ee1..822e13c 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -1296,6 +1296,14 @@
>
</File>
<File
+ RelativePath="..\WebCoreSupport\WebFrameNetworkingContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebCoreSupport\WebFrameNetworkingContext.h"
+ >
+ </File>
+ <File
RelativePath="..\WebCoreSupport\WebGeolocationControllerClient.cpp"
>
</File>
diff --git a/WebKit/win/WebKitDLL.h b/WebKit/win/WebKitDLL.h
index c31bc2d..8ba5b8e 100644
--- a/WebKit/win/WebKitDLL.h
+++ b/WebKit/win/WebKitDLL.h
@@ -33,8 +33,8 @@
#include <winsock2.h>
#include <windows.h>
#include <wtf/HashCountedSet.h>
+#include <wtf/text/StringHash.h>
#include <WebCore/PlatformString.h>
-#include <WebCore/StringHash.h>
#ifdef WEBKIT_EXPORTS
#define WEBKIT_API __declspec(dllexport)
diff --git a/WebKit/win/WebLocalizableStrings.cpp b/WebKit/win/WebLocalizableStrings.cpp
index ab2db5d..da6b221 100644
--- a/WebKit/win/WebLocalizableStrings.cpp
+++ b/WebKit/win/WebLocalizableStrings.cpp
@@ -30,8 +30,8 @@
#pragma warning(push, 0)
#include <WebCore/PlatformString.h>
-#include <WebCore/StringHash.h>
#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
#pragma warning(pop)
#include <wtf/Assertions.h>
diff --git a/WebKit/win/WebNotificationCenter.cpp b/WebKit/win/WebNotificationCenter.cpp
index 919f499..6c22224 100644
--- a/WebKit/win/WebNotificationCenter.cpp
+++ b/WebKit/win/WebNotificationCenter.cpp
@@ -31,10 +31,10 @@
#pragma warning(push, 0)
#include <WebCore/COMPtr.h>
#include <WebCore/PlatformString.h>
-#include <WebCore/StringHash.h>
#include <wtf/HashMap.h>
#include <wtf/HashTraits.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
#pragma warning(pop)
#include <tchar.h>
#include <utility>
diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp
index 25cfbda..255b68e 100644
--- a/WebKit/win/WebPreferences.cpp
+++ b/WebKit/win/WebPreferences.cpp
@@ -32,10 +32,10 @@
#include "WebNotificationCenter.h"
#include "WebPreferenceKeysPrivate.h"
+#include <wtf/text/StringHash.h>
#include <WebCore/FileSystem.h>
#include <WebCore/Font.h>
#include <WebCore/PlatformString.h>
-#include <WebCore/StringHash.h>
#include <WebCore/WKCACFLayerRenderer.h>
#include "WebLocalizableStrings.h"
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index c307c02..6d610a1 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -3694,7 +3694,7 @@ HRESULT STDMETHODCALLTYPE WebView::canGoBack(
/* [in] */ IUnknown* /*sender*/,
/* [retval][out] */ BOOL* result)
{
- *result = !!m_page->backForwardList()->backItem();
+ *result = !!(m_page->backForwardList()->backItem() && !m_page->defersLoading());
return S_OK;
}
@@ -3709,7 +3709,7 @@ HRESULT STDMETHODCALLTYPE WebView::canGoForward(
/* [in] */ IUnknown* /*sender*/,
/* [retval][out] */ BOOL* result)
{
- *result = !!m_page->backForwardList()->forwardItem();
+ *result = !!(m_page->backForwardList()->forwardItem() && !m_page->defersLoading());
return S_OK;
}
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index b66bf69..342edea 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,66 @@
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, do not build WebCore as a convenience library as this leads to
+ errors in the Win build w/export symbols and causes problems with DOM bindings
+ debugging in gdb.
+
+ * WebKitDefines.h:
+ * bindings/python/wscript:
+
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxMSW build fix. Don't build the Python DOM bindings until we get the export issues
+ sorted out.
+
+ * bindings/python/webview.i:
+
+2010-08-13 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * WebFrame.cpp:
+ (wxWebFrame::RunScript):
+
+2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65295.
+ http://trac.webkit.org/changeset/65295
+ https://bugs.webkit.org/show_bug.cgi?id=43950
+
+ It broke 4 sputnik tests (Requested by Ossy on #webkit).
+
+ * WebFrame.cpp:
+ (wxWebFrame::RunScript):
+
+2010-08-12 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig
+
+ Unify UString::UTF8String() & String::utf8() methods,
+ remove UString::cost() & make atArrayIndex a free function.
+
+ * WebFrame.cpp:
+ (wxWebFrame::RunScript):
+
+2010-08-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix. WebCore::String -> WTF::String fixes.
+
+ * WebEdit.cpp:
+ (wxWebEditCommand::SetNodeAttribute):
+
+2010-08-10 Gavin Barraclough <barraclough@apple.com>
+
+ Rubber stamped by Sam Weinig.
+
+ Bug 43786 - Move AtomicStringHash from WebCore to WTF
+ Also remove deprecated string headers from WebCore/platform/text.
+
+ * WebEdit.cpp:
+
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/wx/WebEdit.cpp b/WebKit/wx/WebEdit.cpp
index 22ad193..503e2ed 100644
--- a/WebKit/wx/WebEdit.cpp
+++ b/WebKit/wx/WebEdit.cpp
@@ -3,7 +3,6 @@
#include "config.h"
#include "WebEdit.h"
-#include "AtomicString.h"
#include "CompositeEditCommand.h"
#include "Document.h"
#include "Frame.h"
@@ -13,6 +12,7 @@
#include "WebFrame.h"
#include "WebDOMElement.h"
+#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -55,7 +55,7 @@ wxWebEditCommand::~wxWebEditCommand()
void wxWebEditCommand::SetNodeAttribute(WebDOMElement* element, const wxString& name, const wxString& value)
{
if (m_impl)
- m_impl->setElementAttribute(element->impl(), WebCore::QualifiedName(WebCore::nullAtom, WTF::String(name), WebCore::nullAtom), WTF::String(value));
+ m_impl->setElementAttribute(element->impl(), WebCore::QualifiedName(WTF::nullAtom, WTF::String(name), WTF::nullAtom), WTF::String(value));
}
void wxWebEditCommand::Apply()
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index 182004b..f9be56f 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -233,7 +233,7 @@ wxString wxWebFrame::RunScript(const wxString& javascript)
if (jsEnabled) {
JSC::JSValue result = controller->executeScript(javascript, true).jsValue();
if (result)
- returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).UTF8String().data(), wxConvUTF8);
+ returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).utf8().data(), wxConvUTF8);
}
}
}
diff --git a/WebKit/wx/WebKitDefines.h b/WebKit/wx/WebKitDefines.h
index 67ad868..66e4216 100644
--- a/WebKit/wx/WebKitDefines.h
+++ b/WebKit/wx/WebKitDefines.h
@@ -34,7 +34,7 @@
#define WXDLLIMPEXP_WEBKIT __attribute__ ((visibility("default")))
#elif defined(WXMAKINGDLL_WEBKIT)
#define WXDLLIMPEXP_WEBKIT WXEXPORT
-#elif defined(WXUSINGDLL_WEBKIT)
+#else
#define WXDLLIMPEXP_WEBKIT WXIMPORT
#endif
diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i
index 58961c0..8e3c808 100644
--- a/WebKit/wx/bindings/python/webview.i
+++ b/WebKit/wx/bindings/python/webview.i
@@ -50,6 +50,7 @@
#include "WebDOMObject.h"
#include "WebDOMRange.h"
+#ifndef __WXMSW__
PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn)
{
//static wxPyTypeInfoHashMap* typeInfoCache = NULL;
@@ -86,6 +87,7 @@ PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn)
return Py_None;
}
+#endif
%}
//---------------------------------------------------------------------------
@@ -93,8 +95,12 @@ PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn)
%import core.i
%import windows.i
+#ifndef __WXMSW__
%typemap(out) WebDOMNode* { $result = createDOMNodeSubtype($1, (bool)$owner); }
%typemap(out) WebDOMElement* { $result = createDOMNodeSubtype($1, (bool)$owner); }
+%typemap(out) WebDOMNode { $result = createDOMNodeSubtype(&$1, (bool)$owner); }
+%typemap(out) WebDOMElement { $result = createDOMNodeSubtype(&$1, (bool)$owner); }
+#endif
MAKE_CONST_WXSTRING(WebViewNameStr);
@@ -104,6 +110,7 @@ MustHaveApp(wxWebView);
%include WebKitDefines.h
+#ifndef __WXMSW__
%include WebDOMObject.h
%include WebDOMNode.h
@@ -112,6 +119,7 @@ MustHaveApp(wxWebView);
%include WebDOMElement.h
%include WebDOMNodeList.h
%include WebDOMRange.h
+#endif
%include WebBrowserShell.h
%include WebDOMSelection.h
diff --git a/WebKit/wx/bindings/python/wscript b/WebKit/wx/bindings/python/wscript
index 617a839..cd07836 100644
--- a/WebKit/wx/bindings/python/wscript
+++ b/WebKit/wx/bindings/python/wscript
@@ -53,15 +53,6 @@ def wxpy_swig_include():
return fullpath
return ''
-
-def set_options(opt):
- common_set_options(opt)
-
-def configure(conf):
- if Options.options.wxpython:
- common_configure(conf)
- conf.check_tool('swig', tooldir='.')
- conf.check_swig_version('1.3.29')
def build(bld):
if Options.options.wxpython:
@@ -94,9 +85,9 @@ def build(bld):
swig_flags = ' '.join(wx_swig_args),
defines = defines,
target = '_webview',
- uselib = 'WX CURL ICU XSLT XML SQLITE3 WXWEBKIT ' + get_config(),
+ uselib = 'WX CURL ICU XSLT XML SQLITE3 ' + get_config(),
libpath = [output_dir],
- uselib_local = '',
+ uselib_local = 'wxwebkit',
install_path = output_dir
)
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index eda05f1..49d770d 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -8,6 +8,7 @@
{ "name": "apple-xserve-4", "platform": "mac-snowleopard" },
{ "name": "apple-xserve-5", "platform": "mac-snowleopard" },
{ "name": "apple-xserve-6", "platform": "mac-snowleopard" },
+ { "name": "apple-xserve-7", "platform": "mac-snowleopard" },
{ "name": "apple-pixel-1", "platform": "mac-leopard" },
@@ -66,7 +67,7 @@
},
{ "name": "SnowLeopard Intel Release (Build)", "type": "Build", "builddir": "snowleopard-intel-release",
"platform": "mac-snowleopard", "configuration": "release", "architectures": ["x86_64"],
- "triggers": ["snowleopard-intel-release-tests"],
+ "triggers": ["snowleopard-intel-release-tests", "snowleopard-intel-release-tests-wk2"],
"slavenames": ["apple-xserve-4", "test-slave"]
},
{ "name": "SnowLeopard Intel Release (Tests)", "type": "Test", "builddir": "snowleopard-intel-release-tests",
@@ -77,6 +78,10 @@
"platform": "mac-snowleopard", "configuration": "debug", "architectures": ["x86_64"],
"slavenames": ["apple-macpro-1", "apple-macpro-3", "test-slave"]
},
+ { "name": "SnowLeopard Intel Release (WebKit2 Tests)", "type": "TestWebKit2", "builddir": "snowleopard-intel-release-tests-wk2",
+ "platform": "mac-snowleopard", "configuration": "release", "architectures": ["x86_64"],
+ "slavenames": ["apple-xserve-7", "test-slave"]
+ },
{
"name": "Windows Release (Build)", "type": "Build", "builddir": "win-release",
"platform": "win", "configuration": "release", "architectures": ["i386"],
@@ -205,6 +210,9 @@
{ "type": "Triggerable", "name": "snowleopard-intel-release-tests",
"builderNames": ["SnowLeopard Intel Release (Tests)"]
},
+ { "type": "Triggerable", "name": "snowleopard-intel-release-tests-wk2",
+ "builderNames": ["SnowLeopard Intel Release (WebKit2 Tests)"]
+ },
{ "type": "Triggerable", "name": "win-release-tests",
"builderNames": ["Windows Release (Tests)"]
},
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index 5ff4681..acedbd2 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -247,6 +247,9 @@ class RunWebKitTests(shell.Test):
class NewRunWebKitTests(RunWebKitTests):
command = ["python", "./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results",
"--verbose", "--results-directory", "layout-test-results",
+ "--builder-name", WithProperties("%(buildername)s"),
+ "--build-number", WithProperties("%(buildnumber)s"),
+ "--test-results-server", "test-results.appspot.com",
WithProperties("--%(configuration)s"), "--use-drt"]
@@ -306,6 +309,12 @@ class RunWebKitLeakTests(RunWebKitTests):
return RunWebKitTests.start(self)
+class RunWebKit2Tests(RunWebKitTests):
+ def start(self):
+ self.setCommand(self.command + ["--webkit-test-runner"])
+ return RunWebKitTests.start(self)
+
+
class ArchiveTestResults(shell.ShellCommand):
command = ["python", "./WebKitTools/BuildSlaveSupport/test-result-archive",
WithProperties("--platform=%(platform)s"), WithProperties("--%(configuration)s"), "archive"]
@@ -405,6 +414,8 @@ class BuildAndTestLeaksFactory(BuildAndTestFactory):
class NewBuildAndTestFactory(BuildAndTestFactory):
TestClass = NewRunWebKitTests
+class TestWebKit2Factory(TestFactory):
+ TestClass = RunWebKit2Tests
def loadBuilderConfig(c):
# FIXME: These file handles are leaked.
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index e911169..324c32d 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,875 @@
+2010-08-18 Adam Roben <aroben@apple.com>
+
+ Fix hang when saving crash logs on Windows
+
+ * Scripts/old-run-webkit-tests:
+ (setUpWindowsCrashLogSaving):
+ (END):
+ Pass -s to regtool so it will write the Auto value as a string instead
+ of as a number. This was causing a "do you want to debug?" dialog to
+ appear.
+
+2010-08-17 Victor Wang <victorw@chromium.org>
+
+ Unreviewed. Fixed chromium incremental test json upload.
+ Quote builder name and test results server in url.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+
+2010-08-17 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] [Symbian] Consistently use Q_OS_SYMBIAN to guard all Symbian platform dependencies
+ https://bugs.webkit.org/show_bug.cgi?id=44124
+
+ Q_WS_S60 is not defined for Symbian^4 devices as Q_WS_S60 used to guard
+ Avkon UI framework dependencies. Use Q_OS_SYMBIAN everywhere to mark
+ Symbian dependencies.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::open):
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ (LauncherWindow::toggleFullScreenMode):
+ (LauncherWindow::showFPS):
+ (LauncherWindow::updateFPS):
+ * QtTestBrowser/launcherwindow.h:
+ (WindowOptions::WindowOptions):
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::buildUI):
+
+2010-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ new-run-webkit-tests: remove --show-sources option
+
+ --show-sources is pretty much obsolete with --trace everything, so
+ I'm removing it.
+
+ Also rename a couple of methods in the TestTextDiff class to make their
+ intended visibility (private) more obvious.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44143
+
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ remove --fuzzy-image-diff in new-run-webkit-tests (it doesn't work)
+
+ This code bit-rotted at some point more than a year ago, and nobody seems
+ to miss it. old-run-webkit-tests has a --tolerance flag that new-run-webkit-tests
+ should support instead, making this flag unnecessary anyway.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44141
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py: Removed.
+
+2010-08-17 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Update json results generator to have incremental json including
+ results for tests that pass in current run but failed before.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44119
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-08-17 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ fix test-webkitpy, add easy way to find a checkout root
+
+ test-webkitpy currently doesn't work right if run from someplace other
+ than the checkout root, and it spews a bunch of debug logging because
+ the deduplicate_tests tests contaminates the test environment.
+
+ This patch cleans up the deduplicate_tests unit tests, and creates
+ two new methods in scm.py: find_checkout_root() and default_scm(),
+ both of which use a single algorithm for guessing what checkout root
+ to use if you aren't explicitly told one from a path.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44001
+
+ * Scripts/deduplicate-tests:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+ * Scripts/webkitpy/tool/main.py:
+
+2010-08-17 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Add support to the test results server for downloading json that
+ contains test list only.
+
+ This is for json results generator to generate incremental json
+ results so that it includes results not only for tests failed in
+ current run, but also tests failed before.
+
+ Also set the results type to "N" (no data) instead of "P" (pass)
+ if test results cannot be found in incremental json file.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44117
+
+ * TestResultServer/handlers/testfilehandler.py:
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
+
+2010-08-17 Adam Roben <aroben@apple.com>
+
+ Use the right path style
+
+ * Scripts/old-run-webkit-tests:
+
+2010-08-17 Adam Roben <aroben@apple.com>
+
+ Fix typo
+
+ * Scripts/old-run-webkit-tests:
+
+2010-08-17 Adam Roben <aroben@apple.com>
+
+ Don't hang when running run-webkit-tests as a non-Administrator on
+ Vista/7
+
+ * Scripts/old-run-webkit-tests:
+ (setUpWindowsCrashLogSaving): Use regtool to set NTSD as the
+ post-mortem debugger, rather than using NTSD itself. The latter waits
+ for user input when it fails to set the registry values; the former
+ does not.
+
+2010-08-17 Adam Roben <aroben@apple.com>
+
+ Teach run-webkit-tests, DumpRenderTree, and WebKitTestRunner how to
+ save crash logs on Windows
+
+ The crash logs are saved to /tmp/layout-test-results and have names
+ like CrashLog_02bc_2010-08-17_14-36-20-108.txt.
+
+ Unfortunately, crashes in the WebKit2 web process are recorded as
+ time-outs by run-webkit-tests. Fixing this is covered by
+ <http://webkit.org/b/44121>.
+
+ Fixes <http://webkit.org/b/37859> <rdar://problem/7883560>
+ DumpRenderTree should save a stack trace and/or dump file when it
+ crashes
+
+ Reviewed by Sam Weinig.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (exceptionFilter):
+ (main):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::exceptionFilter):
+ (WTR::TestController::platformInitialize):
+ These changes set up an exception filter that prints #CRASHED to
+ stderr, then lets the exception propagate normally. This allows
+ run-webkit-tests to detect when we've crashed even when a post-mortem
+ debugger attaches to the process.
+
+ * Scripts/old-run-webkit-tests:
+ (top level): Declared some variables used by the crash-log-saving
+ code.
+ (openDumpTool): Copy _NT_SYMBOL_PATH into the clean environment so
+ that the post-mortem debugger has access to it.
+ (toCygwinPath): Added. This is the opposite of toWindowsPath.
+ (readFromDumpToolWithTimer): If the dump tool prints #CRASHED to
+ stderr, consider it a crash.
+ (setUpWindowsCrashLogSaving): Added. Saves the current post-mortem
+ debugger, then sets ntsd as the post-mortem debugger. ntsd is
+ configured to save a crash log and then quit automatically.
+ (END): Added. Restores the previous post-mortem debugger when the
+ script exits.
+
+2010-08-17 Victor Wang <victorw@chromium.org>
+
+ Reviewed by ojan@chromium.org.
+
+ Update test results server:
+ 1. Normalize test results and times after merging (prune tests where
+ all runs pass or do not have data, truncate all test items to max
+ number of builds)
+ 2. times should be int not string.
+ 3. when inserting a new test item, should keep old data regardless
+ whether or not they have same item type with new one.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43861
+
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
+
+2010-08-16 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Add WebKit2 Mac tester to buildbot.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2010-08-16 Paul Sawaya <psawaya@apple.com>
+
+ Reviewed by Chris Marrin.
+
+ Added shader validation via ANGLE
+ https://bugs.webkit.org/show_bug.cgi?id=42405
+
+ Added ANGLE to webkit build
+
+ * Scripts/build-webkit:
+
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, do not build WebCore as a convenience library as this leads to
+ errors in the Win build w/export symbols and causes problems with DOM bindings
+ debugging in gdb.
+
+ * DumpRenderTree/wscript:
+ * Scripts/build-webkit:
+ * wx/browser/wscript:
+ * wx/build/settings.py:
+ * wx/build/waf_extensions.py:
+
+2010-08-16 Dan Bernstein <mitz@apple.com>
+
+ Build fix.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage): Initialize the contentsSizeChanged member.
+ (WTR::TestController::initialize): Ditto.
+
+2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Handle content size change in WebKit2
+ Re-landing after fix.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43198
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]): Initialize WKPageUICallback::contetsSizeChanged to 0.
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create): Initialize WKPageUICallback::contetsSizeChanged to 0.
+
+2010-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r65419.
+ http://trac.webkit.org/changeset/65419
+ https://bugs.webkit.org/show_bug.cgi?id=44053
+
+ Broke the Windows build (Requested by bbandix on #webkit).
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+
+2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Handle content size change in WebKit2
+
+ https://bugs.webkit.org/show_bug.cgi?id=43198
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]): Initialize WKPageUICallback::contetsSizeChanged to 0.
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create): Initialize WKPageUICallback::contetsSizeChanged to 0.
+
+2010-08-16 Ariya Hidayat <ariya@sencha.com>
+
+ Add my new email address to committers.py.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-08-16 Zoltan Horvath <zoltan@webkit.org>
+
+ Add my old e-mail addresses to committers.py.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-08-15 Jon Honeycutt <jhoneycutt@apple.com>
+
+ WebEditorClient::didBeginEditing is never called in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42939
+
+ Reviewed by Sam Weinig.
+
+ * WebKitTestRunner/PlatformWebView.h:
+ Declare focus().
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues):
+ Focus the PlatformWebView.
+
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::focus):
+ Stubbed.
+
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::focus):
+ Focus the view.
+
+2010-08-15 Jon Honeycutt <jhoneycutt@apple.com>
+
+ run-webkit-tests should not strip editing callbacks when using
+ WebKitTestRunner on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=44000
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/old-run-webkit-tests:
+ Leave $stripEditingCallbacks undefined until we look for command-line
+ arguments. If using WebKit2, set it to 0 if not explicity set on the
+ command line. Later, set it to isCygwin() to match old behavior if it is
+ not yet defined.
+
+2010-08-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, remove define always set to the correct value by wtf/Platform.h.
+
+ * wx/build/settings.py:
+
+2010-08-14 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [GTK] autogen.sh not executed if build-webkit options change
+ https://bugs.webkit.org/show_bug.cgi?id=42266
+
+ Rerun autogen.sh in situations where the arguments to build-webkit have
+ changed since the previous build. This will fix some issues on the bots
+ where the build does not notice changes to default build-webkit arguments.
+
+ * Scripts/webkitdirs.pm: Add special logic for detecting changes to build-webkit arguments.
+
+2010-08-14 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Another fix to support python 2.3.
+
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
+
+ * Scripts/webkitpy/thirdparty/simplejson/decoder.py:
+ - It looks like our simplejson is version 1.7.3 which
+ should be python 2.3 compatible. But someone modified
+ our copy slightly from the original source.
+ I've removed the relative import in hopes this fixes
+ the problem.
+
+2010-08-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Build fix only.
+
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
+
+ * Scripts/create-html-entity-table:
+ - Hack sys.path to avoid executing 2.5 dependent python
+ on systems (like chromium-win and Tiger) which do not have 2.5 python.
+
+2010-08-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename some concepts in HTML entity search to be more self-documenting
+ https://bugs.webkit.org/show_bug.cgi?id=44004
+
+ Reflect name change in generator script.
+
+ * Scripts/create-html-entity-table:
+
+2010-08-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
+
+ A script for generating the C++ state data structure describing all the
+ entities from a JSON description.
+
+ * Scripts/create-html-entity-table: Added.
+
+2010-08-13 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Rewrite new-run-webkit-test's wait_for_threads_to_finish loop to
+ check for exceptions on all threads, not just the first thread.
+
+ This change also changes the logging behavior for wedged threads
+ to only dump the stacks of threads that are actually wedged.
+
+ Refactor the thread classes in the dump_render_tree_thread module
+ to make the contract between TestRunner and TestShellThread clearer.
+
+ Added a bunch of unit tests.
+ https://bugs.webkit.org/show_bug.cgi?id=38561
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-08-13 Kenichi Ishibashi <bashi@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Add test_expectations.txt syntax checker to check-webkit-style.
+ https://bugs.webkit.org/show_bug.cgi?id=43899
+
+ Just utilizing layout_tests/layout_package/test_expectations.py for checking
+ the syntax of test_expectations.txt.
+ This change also moves tab checking class from style/checkers/text.py to
+ style/checkers/common.py for sharing code.
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checkers/common.py:
+ * Scripts/webkitpy/style/checkers/common_unittest.py:
+ * Scripts/webkitpy/style/checkers/test_expectations.py: Added.
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Added.
+ * Scripts/webkitpy/style/checkers/text.py:
+ * Scripts/webkitpy/style_references.py:
+
+2010-08-12 Jon Honeycutt <jhoneycutt@apple.com>
+
+ WebKitTestRunner does not correctly resize WebView for W3C SVG tests
+ https://bugs.webkit.org/show_bug.cgi?id=43945
+
+ Reviewed by Sam Weinig.
+
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::sizeWebViewForCurrentTest):
+ Allow for a Windows-style path.
+
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::resizeTo):
+ Call SetWindowPos to resize the view window.
+
+2010-08-12 David Levin <levin@chromium.org>
+
+ Build break fix.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues): Removed usage
+ of a variable that doesn't exist in the class.
+
+2010-08-12 Jon Honeycutt <jhoneycutt@apple.com>
+
+ WebKitTestRunner needs to run tests without using native controls
+ https://bugs.webkit.org/show_bug.cgi?id=43772
+
+ Reviewed by Sam Weinig.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ Call platformInitializeContext().
+
+ * WebKitTestRunner/TestController.h:
+ Declare platformInitializeContext().
+
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::platformInitializeContext):
+ Stubbed.
+
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::platformInitializeContext):
+ Call WKContextSetShouldPaintNativeControls() to disable native control
+ drawing.
+
+2010-08-12 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ WebKitTestRunner should be more aggressive about ensuring consistent state between tests
+ https://bugs.webkit.org/show_bug.cgi?id=43653
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle):
+ (WTR::InjectedBundle::didReceiveMessage):
+ (WTR::InjectedBundle::beginTesting):
+ (WTR::InjectedBundle::done):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::isTestRunning):
+ (WTR::InjectedBundle::):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::stopLoading):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::dump):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
+ (WTR::InjectedBundlePage::willAddMessageToConsole):
+ (WTR::InjectedBundlePage::willSetStatusbarText):
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ (WTR::InjectedBundlePage::didBeginEditing):
+ (WTR::InjectedBundlePage::didEndEditing):
+ (WTR::InjectedBundlePage::didChange):
+ (WTR::InjectedBundlePage::didChangeSelection):
+ Don't do any work if we are not currently running a test.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/StringFunctions.h:
+ (WTR::toCF):
+ Add conversion function for WKURLRef -> CFURLRef
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::TestController):
+ (WTR::TestController::initialize):
+ (WTR::TestController::resetStateToConsistentValues):
+ (WTR::TestController::runTest):
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke):
+ * WebKitTestRunner/TestInvocation.h:
+ Move resetting code to TestController.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::runUntil):
+ * WebKitTestRunner/mac/TestInvocationMac.mm: Removed.
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::runUntil):
+ * WebKitTestRunner/win/TestInvocationWin.cpp: Removed.
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj:
+ Move runUntil to TestController.
+
+2010-08-12 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-08-12 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Merge pretty printers for gdb.
+ https://bugs.webkit.org/show_bug.cgi?id=43850
+
+ We need to update webcore.py because basic string classes have moved to WTF from WebCore.
+ It is good timing to merge webcore.py and wtf.py and name it 'webkit.py'.
+ webcore.py is left for backward compatibility.
+
+ * gdb/webcore.py:
+ * gdb/webkit.py: Added.
+ * gdb/wtf.py: Removed.
+
+2010-08-11 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] add google-chrome layout test result directories
+ https://bugs.webkit.org/show_bug.cgi?id=43889
+
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+
+2010-08-11 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Disable accelerated compositing
+ https://bugs.webkit.org/show_bug.cgi?id=43894
+
+ Disable accelerated compositing because DRT is not ready for
+ it. This change fixes hundreds of test crashes on Windows and
+ Linux.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
+
+2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Unreviewed. Adding my Collabora personality to the list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-08-11 Martin Robinson <mrobinson@igalia.com>
+
+ Adding myself as a reviewer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-08-11 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Darin Adler.
+
+ Perl warnings when running commit-log-editor
+ https://bugs.webkit.org/show_bug.cgi?id=43856
+
+ Fixes Perl warnings introduced by the patch for Bug #40548.
+
+ Perl doesn't have symbolic names for True/False. Instead, we
+ should use boolean values. Moreover, the variable installedEditorApplication
+ is not be used and should be renamed builtEditorApplication so that it
+ uses the existing machinery to set the commit log editor application.
+
+ * Scripts/commit-log-editor:
+
+2010-08-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Trying waiting for httpd lock in the EWS
+ https://bugs.webkit.org/show_bug.cgi?id=43833
+
+ If this works, we can probably run the tests on the mac-ews, which
+ would be very exciting. :)
+
+ * Scripts/webkitpy/tool/steps/runtests.py:
+
+2010-08-11 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Check in a script to list redundant test outputs.
+ https://bugs.webkit.org/show_bug.cgi?id=37630
+
+ If e.g. platform/mac-leopard is missing an expected test output, we
+ fall back on platform/mac. This means it's possible to grow redundant
+ test outputs, where we have the same expected data in both a platform
+ directory and another platform it falls back on.
+ (original patch by Evan Marting <evan@chromium.org> https://bugs.webkit.org/attachment.cgi?id=53398)
+
+ * Scripts/deduplicate-tests: Added.
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py: Added.
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py: Added.
+
+2010-08-11 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] QtTestBrowser: after switching between QWebView and QGraphicsWebView, rotation actions get broken
+ https://bugs.webkit.org/show_bug.cgi?id=43853
+
+ LauncherWindow::createChrome is connecting menu itens to WebViewGraphicsBased's slots directly.
+ It behaviors badly when user launches the QtTestBrowser in QWebView mode, since then switching to
+ QGraphicsWebView mode, createChrome is not called again, and menu items end up not getting connected
+ to slots at all.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
+ (LauncherWindow::animatedFlip):
+ (LauncherWindow::animatedYFlip):
+ * QtTestBrowser/launcherwindow.h:
+
+2010-08-11 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtTestBrowser: switching between QWebView and QGraphicsWebView modes is broken
+ https://bugs.webkit.org/show_bug.cgi?id=43851
+
+ All window options data (including the bool holding if the view is either QWebView or
+ QGraphicsWebView based) is stored in m_windowOptions, a class member of LauncherWindow.
+ When toggle the view from QWebView to QGraphicsWebView based (and vice-versa), we were
+ not updating LauncherWindow::WindowOptions::m_useGraphicsView bit, and then things were
+ getting broken.
+
+ Patch addresses this issue.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
+ (LauncherWindow::toggleWebView):
+ (LauncherWindow::toggleAcceleratedCompositing):
+
+2010-08-10 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] QtTestBrowser: lazy instantiate "YRotation" state machine and related objects
+ https://bugs.webkit.org/show_bug.cgi?id=43831
+
+ Only instantiate QStateMachine and friends associated to the YRotation action on demand.
+
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::animatedYFlip):
+
+2010-08-11 Darin Adler <darin@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Improved editor options for prepare-ChangeLog and commit-log-editor
+ https://bugs.webkit.org/show_bug.cgi?id=40548
+
+ * Scripts/commit-log-editor: Split editor strings on spaces so EDITOR
+ values like "xed --launch --wait" work properly.
+
+ * Scripts/prepare-ChangeLog: Added a new CHANGE_LOG_EDITOR so we can
+ use a command line tool with the $openChangeLogs feature.
+
+2010-08-11 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: remove InjectDispatch.js
+ https://bugs.webkit.org/show_bug.cgi?id=43835
+
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+
+2010-08-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch should refuse to run under Win32 Python
+ https://bugs.webkit.org/show_bug.cgi?id=40962
+
+ Given that there are lots of places in webkit-patch's code that
+ assume unix-style filenames (forward slashes), webkit-patch fails
+ with weird file-not-found errors when run under a native windows
+ Python. It would be nice if we just trapped this and errored out
+ at the beginning, rather than producing unpredictable errors.
+
+ * Scripts/webkit-patch:
+
+2010-08-10 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, build fix.
+
+ Chromium build fix for r65107.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+
+2010-08-10 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] http/tests/media/video-cookie.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=42240
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies): create the
+ SoupCookieJar if it does not exist. Otherwise the accept policy
+ won't be set.
+
+2010-08-10 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Adds suspendAnimations() and resumeAnimations() to LayoutTestController.
+ Calls functions with the same names on AnimationController for the
+ mainFrame.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (suspendAnimationsCallback):
+ (resumeAnimationsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+
+2010-08-10 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ [Chromium/DRT] Enable saving layout test results.
+ https://bugs.webkit.org/show_bug.cgi?id=43796
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added more
+ parameters to the new-run-webkit-tests, including the name
+ of the test results server.
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ More chromium build fix.
+
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ (MockSpellCheck::spellCheckWord):
+ (MockSpellCheck::initializeIfNeeded):
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (NotificationPresenter::grantPermission):
+ (NotificationPresenter::show):
+ (NotificationPresenter::checkPermission):
+
+2010-08-10 Jian Li <jianli@chromium.org>
+
+ Chromium build fix.
+
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+
+2010-08-10 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ Update test results server merge logic so the aggregated
+ results and times are updated for tests that are
+ in aggragated json but not in incremental json.
+
+ Also update unittest to test this case.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43769
+
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
+
2010-08-09 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Ariya Hidayat.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 52b539c..700b44c 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -1545,6 +1545,20 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec
return JSValueMakeNumber(context, controller->numberOfActiveAnimations());
}
+static JSValueRef suspendAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->suspendAnimations();
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef resumeAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->resumeAnimations();
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -1850,6 +1864,8 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "suspendAnimations", suspendAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "resumeAnimations", resumeAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageSizeAndMarginsInPixels", pageSizeAndMarginsInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index f76870b..2bab542 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -251,6 +251,8 @@ public:
bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
bool sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId);
unsigned numberOfActiveAnimations() const;
+ void suspendAnimations() const;
+ void resumeAnimations() const;
void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
index b05fe21..4736676 100644
--- a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
@@ -84,11 +84,6 @@ WebCString DRTDevToolsAgent::injectedScriptSource()
return webkit_support::GetDevToolsInjectedScriptSource();
}
-WebCString DRTDevToolsAgent::injectedScriptDispatcherSource()
-{
- return webkit_support::GetDevToolsInjectedScriptDispatcherSource();
-}
-
WebCString DRTDevToolsAgent::debuggerScriptSource()
{
return webkit_support::GetDevToolsDebuggerScriptSource();
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h
index df52866..899a23f 100644
--- a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h
@@ -62,7 +62,6 @@ public:
virtual void forceRepaint();
virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, bool enabled);
virtual WebKit::WebCString injectedScriptSource();
- virtual WebKit::WebCString injectedScriptDispatcherSource();
virtual WebKit::WebCString debuggerScriptSource();
void asyncCall(const DRTDevToolsCallArgs&);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index e82a65e..beae21e 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -117,6 +117,8 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
+ bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
+ bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
@@ -838,6 +840,32 @@ int LayoutTestController::numberOfActiveAnimations()
return controller->numberOfActiveAnimations();
}
+void LayoutTestController::suspendAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations();
+}
+
+void LayoutTestController::resumeAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations();
+}
+
void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
{
result->set(false);
@@ -875,6 +903,18 @@ void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppV
result->set(numberOfActiveAnimations());
}
+void LayoutTestController::suspendAnimations(const CppArgumentList&, CppVariant* result)
+{
+ suspendAnimations();
+ result->setNull();
+}
+
+void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result)
+{
+ resumeAnimations();
+ result->setNull();
+}
+
void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
{
m_shell->webView()->settings()->setLoadsImagesAutomatically(false);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index fb91544..352e89f 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -207,6 +207,8 @@ public:
void pauseTransitionAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*);
void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
+ void suspendAnimations(const CppArgumentList&, CppVariant*);
+ void resumeAnimations(const CppArgumentList&, CppVariant*);
void disableImageLoading(const CppArgumentList&, CppVariant*);
@@ -395,6 +397,8 @@ private:
bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId);
bool elementDoesAutoCompleteForElementWithId(const WebKit::WebString&);
int numberOfActiveAnimations();
+ void suspendAnimations();
+ void resumeAnimations();
// Used for test timeouts.
ScopedRunnableMethodFactory<LayoutTestController> m_timeoutFactory;
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
index fe70cab..0bf3802 100644
--- a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
@@ -31,11 +31,12 @@
#include "config.h"
#include "MockSpellCheck.h"
-#include "public/WebString.h"
#include <wtf/ASCIICType.h>
#include <wtf/Assertions.h>
+#include <wtf/text/WTFString.h>
+
+#include "public/WebString.h"
-using namespace WebCore;
using namespace WebKit;
MockSpellCheck::MockSpellCheck()
@@ -59,7 +60,7 @@ bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset
// Convert to a String because we store String instances in
// m_misspelledWords and WebString has no find().
- const String stringText(text.data(), text.length());
+ const WTF::String stringText(text.data(), text.length());
// Extract the first possible English word from the given string.
// The given string may include non-ASCII characters or numbers. So, we
@@ -82,7 +83,7 @@ bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset
// extracted word if this word is a known misspelled word.
// (See the comment in MockSpellCheck::initializeIfNeeded() why we use a
// misspelled-word table.)
- String word = stringText.substring(wordOffset, wordLength);
+ WTF::String word = stringText.substring(wordOffset, wordLength);
if (!m_misspelledWords.contains(word))
return true;
@@ -137,7 +138,7 @@ bool MockSpellCheck::initializeIfNeeded()
m_misspelledWords.clear();
for (size_t i = 0; i < arraysize(misspelledWords); ++i)
- m_misspelledWords.add(String::fromUTF8(misspelledWords[i]), false);
+ m_misspelledWords.add(WTF::String::fromUTF8(misspelledWords[i]), false);
// Mark as initialized to prevent this object from being initialized twice
// or more.
diff --git a/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp
index 86903be..95353a7 100644
--- a/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp
@@ -31,36 +31,37 @@
#include "config.h"
#include "NotificationPresenter.h"
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
#include "googleurl/src/gurl.h"
#include "public/WebNotification.h"
#include "public/WebNotificationPermissionCallback.h"
#include "public/WebSecurityOrigin.h"
#include "public/WebString.h"
#include "public/WebURL.h"
-#include <wtf/text/CString.h>
-using namespace WebCore;
using namespace WebKit;
void NotificationPresenter::grantPermission(const WebString& origin)
{
// Make sure it's in the form of an origin.
GURL url(origin);
- m_allowedOrigins.add(String(url.GetOrigin().spec().c_str()));
+ m_allowedOrigins.add(WTF::String(url.GetOrigin().spec().c_str()));
}
// The output from all these methods matches what DumpRenderTree produces.
bool NotificationPresenter::show(const WebNotification& notification)
{
if (!notification.replaceId().isEmpty()) {
- String replaceId(notification.replaceId().data(), notification.replaceId().length());
+ WTF::String replaceId(notification.replaceId().data(), notification.replaceId().length());
if (m_replacements.find(replaceId) != m_replacements.end())
printf("REPLACING NOTIFICATION %s\n",
m_replacements.find(replaceId)->second.utf8().data());
WebString identifier = notification.isHTML() ?
notification.url().spec().utf16() : notification.title();
- m_replacements.set(replaceId, String(identifier.data(), identifier.length()));
+ m_replacements.set(replaceId, WTF::String(identifier.data(), identifier.length()));
}
if (notification.isHTML()) {
@@ -103,7 +104,7 @@ void NotificationPresenter::objectDestroyed(const WebKit::WebNotification& notif
WebNotificationPresenter::Permission NotificationPresenter::checkPermission(const WebURL& url)
{
// Check with the layout test controller
- String origin = String(static_cast<GURL>(url).GetOrigin().spec().c_str());
+ WTF::String origin = WTF::String(static_cast<GURL>(url).GetOrigin().spec().c_str());
bool allowed = m_allowedOrigins.find(origin) != m_allowedOrigins.end();
return allowed ? WebNotificationPresenter::PermissionAllowed
: WebNotificationPresenter::PermissionDenied;
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
index 64c20b0..7ea36e1 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -225,6 +225,8 @@ void TestShell::resetWebSettings(WebView& webView)
#else
settings->setEditingBehavior(WebSettings::EditingBehaviorWin);
#endif
+ // FIXME: crbug.com/51879
+ settings->setAcceleratedCompositingEnabled(false);
}
void TestShell::runFileTest(const TestParams& params)
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index b0c1cba..db44a60 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -52,6 +52,8 @@ bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name,
bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
bool webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
+void webkit_web_frame_suspend_animations(WebKitWebFrame* frame);
+void webkit_web_frame_resume_animations(WebKitWebFrame* frame);
void webkit_application_cache_set_maximum_size(unsigned long long size);
unsigned int webkit_worker_thread_count(void);
void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains);
@@ -250,6 +252,15 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
SoupSession* session = webkit_get_default_session();
SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
+ /* If the jar was not created - we create it on demand, i.e, just
+ in case we have HTTP requests - then we must create it here in
+ order to set the proper accept policy */
+ if (!jar) {
+ jar = soup_cookie_jar_new();
+ soup_session_add_feature(session, SOUP_SESSION_FEATURE(jar));
+ g_object_unref(jar);
+ }
+
SoupCookieJarAcceptPolicy policy;
if (alwaysAcceptCookies)
@@ -620,6 +631,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return webkit_web_frame_number_of_active_animations(mainFrame);
}
+void LayoutTestController::suspendAnimations() const
+{
+ webkit_web_frame_suspend_animations(mainFrame);
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ webkit_web_frame_resume_animations(mainFrame);
+}
+
void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
{
gchar* name = JSStringCopyUTF8CString(key);
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index c0eb722..a85ac2e 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -631,6 +631,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return [mainFrame _numberOfActiveAnimations];
}
+void LayoutTestController::suspendAnimations() const
+{
+ return [mainFrame _suspendAnimations];
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ return [mainFrame _resumeAnimations];
+}
+
void LayoutTestController::waitForPolicyDelegate()
{
setWaitToDump(true);
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index c6c39b5..4a57d1d 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -571,7 +571,7 @@ void DumpRenderTree::open(const QUrl& url)
m_page->event(&ev);
QWebSettings::clearMemoryCaches();
-#if !(defined(Q_WS_S60) && QT_VERSION <= QT_VERSION_CHECK(4, 6, 2))
+#if !(defined(Q_OS_SYMBIAN) && QT_VERSION <= QT_VERSION_CHECK(4, 6, 2))
QFontDatabase::removeAllApplicationFonts();
#endif
#if defined(Q_WS_X11)
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index e682fd0..74baf37 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -484,6 +484,20 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
}
+void LayoutTestController::suspendAnimations() const
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ Q_ASSERT(frame);
+ DumpRenderTreeSupportQt::suspendAnimations(frame);
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ Q_ASSERT(frame);
+ DumpRenderTreeSupportQt::resumeAnimations(frame);
+}
+
void LayoutTestController::disableImageLoading()
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index f9986b1..207e093 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -167,6 +167,8 @@ public slots:
bool elementDoesAutoCompleteForElementWithId(const QString& elementId);
unsigned numberOfActiveAnimations() const;
+ void suspendAnimations() const;
+ void resumeAnimations() const;
void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index a1b72e1..67e5d4b 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -1232,8 +1232,17 @@ RetainPtr<CFURLCacheRef> sharedCFURLCache()
}
#endif
+static LONG WINAPI exceptionFilter(EXCEPTION_POINTERS*)
+{
+ fputs("#CRASHED\n", stderr);
+ fflush(stderr);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
int main(int argc, char* argv[])
{
+ ::SetUnhandledExceptionFilter(exceptionFilter);
+
leakChecking = false;
_setmode(1, _O_BINARY);
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 31bc6ce..1ff88e5 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1060,6 +1060,24 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return number;
}
+void LayoutTestController::suspendAnimations() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return;
+
+ framePrivate->suspendAnimations();
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return;
+
+ framePrivate->resumeAnimations();
+}
+
static _bstr_t bstrT(JSStringRef jsString)
{
// The false parameter tells the _bstr_t constructor to adopt the BSTR we pass it.
diff --git a/WebKitTools/DumpRenderTree/wscript b/WebKitTools/DumpRenderTree/wscript
index 75d208f..4aaedb4 100644
--- a/WebKitTools/DumpRenderTree/wscript
+++ b/WebKitTools/DumpRenderTree/wscript
@@ -58,8 +58,8 @@ def build(bld):
includes = ' '.join(include_paths),
source = sources,
target = 'DumpRenderTree',
- uselib = 'JSCORE ICU WXWEBKIT WX ' + get_config(),
+ uselib = 'ICU WX ' + get_config(),
libpath = [output_dir],
- uselib_local = '',
+ uselib_local = 'jscore wxwebkit',
install_path = output_dir)
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index 7c80ff2..9fee1e3 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -264,6 +264,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return 0;
}
+void LayoutTestController::suspendAnimations() const
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ // FIXME: implement
+}
+
unsigned LayoutTestController::workerThreadCount() const
{
// FIXME: implement
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index 9a987d2..9842448 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -411,7 +411,8 @@ static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKSt
closePage,
runJavaScriptAlert,
runJavaScriptConfirm,
- runJavaScriptPrompt
+ runJavaScriptPrompt,
+ 0 /* contentsSizeChanged */
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
index 49e46bf..ee67a08 100644
--- a/WebKitTools/MiniBrowser/win/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -83,7 +83,8 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
createNewPage,
showPage,
closePage,
- runJavaScriptAlert
+ runJavaScriptAlert,
+ 0 /* contentsSizeChanged */
};
WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
}
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
index 095a984..9b7aa0d 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -65,7 +65,7 @@ void LauncherWindow::init()
QSplitter* splitter = new QSplitter(Qt::Vertical, this);
setCentralWidget(splitter);
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
setWindowState(Qt::WindowMaximized);
#else
setWindowState(Qt::WindowNoState);
@@ -218,7 +218,7 @@ void LauncherWindow::createChrome()
QMenu* toolsMenu = menuBar()->addMenu("&Develop");
QMenu* graphicsViewMenu = toolsMenu->addMenu("QGraphicsView");
- QAction* toggleGraphicsView = graphicsViewMenu->addAction("Toggle use of QGraphicsView", this, SLOT(initializeView()));
+ QAction* toggleGraphicsView = graphicsViewMenu->addAction("Toggle use of QGraphicsView", this, SLOT(toggleWebView(bool)));
toggleGraphicsView->setCheckable(true);
toggleGraphicsView->setChecked(isGraphicsBased());
@@ -339,16 +339,12 @@ void LauncherWindow::createChrome()
QAction* flipAnimated = graphicsViewMenu->addAction("Animated Flip");
flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
flipAnimated->setEnabled(isGraphicsBased());
+ connect(flipAnimated, SIGNAL(triggered()), SLOT(animatedFlip()));
QAction* flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
flipYAnimated->setEnabled(isGraphicsBased());
-
- if (isGraphicsBased()) {
- WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
- connect(flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
- connect(flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
- }
+ connect(flipYAnimated, SIGNAL(triggered()), SLOT(animatedYFlip()));
QAction* cloneWindow = graphicsViewMenu->addAction("Clone Window", this, SLOT(cloneWindow()));
cloneWindow->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
@@ -669,6 +665,12 @@ void LauncherWindow::setTouchMocking(bool on)
#endif
}
+void LauncherWindow::toggleWebView(bool graphicsBased)
+{
+ m_windowOptions.useGraphicsView = graphicsBased;
+ initializeView();
+}
+
void LauncherWindow::toggleAcceleratedCompositing(bool toggle)
{
m_windowOptions.useCompositing = toggle;
@@ -692,6 +694,15 @@ void LauncherWindow::toggleWebGL(bool toggle)
page()->settings()->setAttribute(QWebSettings::WebGLEnabled, toggle);
}
+void LauncherWindow::animatedFlip()
+{
+ qobject_cast<WebViewGraphicsBased*>(m_view)->animatedFlip();
+}
+
+void LauncherWindow::animatedYFlip()
+{
+ qobject_cast<WebViewGraphicsBased*>(m_view)->animatedYFlip();
+}
void LauncherWindow::toggleSpatialNavigation(bool b)
{
page()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, b);
@@ -702,7 +713,7 @@ void LauncherWindow::toggleFullScreenMode(bool enable)
if (enable)
setWindowState(Qt::WindowFullScreen);
else {
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
setWindowState(Qt::WindowMaximized);
#else
setWindowState(Qt::WindowNoState);
@@ -760,7 +771,7 @@ void LauncherWindow::showFPS(bool enable)
view->setFrameRateMeasurementEnabled(enable);
if (!enable) {
-#if defined(Q_WS_MAEMO_5) && defined(Q_WS_S60)
+#if defined(Q_WS_MAEMO_5) && defined(Q_OS_SYMBIAN)
setWindowTitle("");
#else
statusBar()->clearMessage();
@@ -819,7 +830,7 @@ void LauncherWindow::updateFPS(int fps)
{
QString fpsStatusText = QString("Current FPS: %1").arg(fps);
-#if defined(Q_WS_MAEMO_5) && defined(Q_WS_S60)
+#if defined(Q_WS_MAEMO_5) && defined(Q_OS_SYMBIAN)
setWindowTitle(fpsStatusText);
#else
statusBar()->showMessage(fpsStatusText);
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.h b/WebKitTools/QtTestBrowser/launcherwindow.h
index 9319d24..65f390d 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.h
+++ b/WebKitTools/QtTestBrowser/launcherwindow.h
@@ -82,7 +82,7 @@ public:
, useCompositing(true)
, useTiledBackingStore(false)
, useWebGL(false)
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_S60)
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
, useFrameFlattening(true)
#else
, useFrameFlattening(false)
@@ -151,6 +151,7 @@ protected slots:
void initializeView();
void setTouchMocking(bool on);
+ void toggleWebView(bool graphicsBased);
void toggleAcceleratedCompositing(bool toggle);
void toggleTiledBackingStore(bool toggle);
void toggleResizesToContents(bool toggle);
@@ -166,6 +167,8 @@ protected slots:
#endif
void changeViewportUpdateMode(int mode);
+ void animatedFlip();
+ void animatedYFlip();
void selectElements();
void showFPS(bool enable);
void showUserAgentDialog();
diff --git a/WebKitTools/QtTestBrowser/mainwindow.cpp b/WebKitTools/QtTestBrowser/mainwindow.cpp
index abb608f..1a9aa5f 100644
--- a/WebKitTools/QtTestBrowser/mainwindow.cpp
+++ b/WebKitTools/QtTestBrowser/mainwindow.cpp
@@ -48,7 +48,7 @@ MainWindow::MainWindow(const QString& url)
void MainWindow::buildUI()
{
QToolBar* bar = addToolBar("Navigation");
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
bar->setIconSize(QSize(16, 16));
#endif
QAction* reloadAction = page()->action(QWebPage::Reload);
@@ -65,7 +65,7 @@ void MainWindow::buildUI()
QCompleter* completer = new QCompleter(this);
urlEdit->setCompleter(completer);
completer->setModel(&urlModel);
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
addToolBarBreak();
addToolBar("Location")->addWidget(urlEdit);
#else
diff --git a/WebKitTools/QtTestBrowser/webview.cpp b/WebKitTools/QtTestBrowser/webview.cpp
index c8eecd6..bc8fad1 100644
--- a/WebKitTools/QtTestBrowser/webview.cpp
+++ b/WebKitTools/QtTestBrowser/webview.cpp
@@ -42,6 +42,7 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
, m_numPaintsSinceLastMeasure(0)
, m_measureFps(false)
, m_resizesToContents(false)
+ , m_machine(0)
{
setScene(new QGraphicsScene(this));
scene()->addItem(m_item);
@@ -50,30 +51,6 @@ WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QStateMachine* machine = new QStateMachine(this);
- QState* s0 = new QState(machine);
- s0->assignProperty(this, "yRotation", 0);
-
- QState* s1 = new QState(machine);
- s1->assignProperty(this, "yRotation", 90);
-
- QAbstractTransition* t1 = s0->addTransition(this, SIGNAL(yFlipRequest()), s1);
- QPropertyAnimation* yRotationAnim = new QPropertyAnimation(this, "yRotation", this);
- yRotationAnim->setDuration(1000);
- t1->addAnimation(yRotationAnim);
-
- QState* s2 = new QState(machine);
- s2->assignProperty(this, "yRotation", -90);
- s1->addTransition(s1, SIGNAL(propertiesAssigned()), s2);
-
- QAbstractTransition* t2 = s2->addTransition(s0);
- t2->addAnimation(yRotationAnim);
-
- machine->setInitialState(s0);
- machine->start();
-#endif
-
m_updateTimer = new QTimer(this);
m_updateTimer->setInterval(1000);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateFrameRate()));
@@ -193,7 +170,39 @@ void WebViewGraphicsBased::animatedFlip()
void WebViewGraphicsBased::animatedYFlip()
{
- emit yFlipRequest();
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ if (!m_machine) {
+ m_machine = new QStateMachine(this);
+
+ QState* s0 = new QState(m_machine);
+ s0->assignProperty(this, "yRotation", 0);
+
+ QState* s1 = new QState(m_machine);
+ s1->assignProperty(this, "yRotation", 90);
+
+ QAbstractTransition* t1 = s0->addTransition(s1);
+ QPropertyAnimation* yRotationAnim = new QPropertyAnimation(this, "yRotation", this);
+ t1->addAnimation(yRotationAnim);
+
+ QState* s2 = new QState(m_machine);
+ s2->assignProperty(this, "yRotation", -90);
+ s1->addTransition(s1, SIGNAL(propertiesAssigned()), s2);
+
+ QState* s3 = new QState(m_machine);
+ s3->assignProperty(this, "yRotation", 0);
+
+ QAbstractTransition* t2 = s2->addTransition(s3);
+ t2->addAnimation(yRotationAnim);
+
+ QFinalState* final = new QFinalState(m_machine);
+ s3->addTransition(s3, SIGNAL(propertiesAssigned()), final);
+
+ m_machine->setInitialState(s0);
+ yRotationAnim->setDuration(1000);
+ }
+
+ m_machine->start();
+#endif
}
void WebViewGraphicsBased::paintEvent(QPaintEvent* event)
diff --git a/WebKitTools/QtTestBrowser/webview.h b/WebKitTools/QtTestBrowser/webview.h
index 5e7c0c3..d0e1e57 100644
--- a/WebKitTools/QtTestBrowser/webview.h
+++ b/WebKitTools/QtTestBrowser/webview.h
@@ -41,6 +41,8 @@
#include <QGraphicsWidget>
#include <QTime>
+class QStateMachine;
+
class WebViewTraditional : public QWebView {
Q_OBJECT
@@ -110,7 +112,6 @@ public slots:
void contentsSizeChanged(const QSize&);
signals:
- void yFlipRequest();
void currentFPSUpdated(int fps);
private:
@@ -123,6 +124,7 @@ private:
bool m_measureFps;
qreal m_yRotation;
bool m_resizesToContents;
+ QStateMachine* m_machine;
FpsTimer m_fpsTimer;
};
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index 3b8dd9c..acd7736 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -341,6 +341,9 @@ if (isGtk()) {
# Apple builds JavaScriptGlue, and only on the Mac.
splice @projects, 1, 0, "JavaScriptGlue";
+ # ANGLE must come before WebCore
+ splice @projects, 0, 0, "ANGLE";
+
# WebKit2 is only supported in SnowLeopard and later at present.
push @projects, ("WebKit2", "WebKitTools/MiniBrowser") if osXVersion()->{"minor"} >= 6;
@@ -404,9 +407,13 @@ if (isInspectorFrontend()) {
if (isWx()) {
downloadWafIfNeeded();
- push @projects, 'WebKitTools/DumpRenderTree';
- push @projects, 'WebKitTools/wx/browser';
- push @projects, 'WebKit/wx/bindings/python';
+ @options = ();
+ if (defined($makeArgs)) {
+ @options = split(/ /, $makeArgs);
+ }
+ @projects = ();
+ my $result = buildWafProject('.', $clean, @options);
+ exit exitStatus($result) if exitStatus($result);
}
if (isChromium()) {
@@ -439,16 +446,6 @@ for my $dir (@projects) {
if ($dir eq "WebKit") {
$result = buildVisualStudioProject("win/WebKit.vcproj/WebKit.sln", $clean);
}
- } elsif (isWx()) {
- @options = ();
- if (defined($makeArgs)) {
- @options = split(/ /, $makeArgs);
- }
- if ($dir eq "WebKit" && isWx()) {
- chdir 'wx' or die;
- }
-
- $result = buildWafProject($dir, $clean, @options);
}
if (exitStatus($result)) {
diff --git a/WebKitTools/Scripts/commit-log-editor b/WebKitTools/Scripts/commit-log-editor
index a642731..1be0fd0 100755
--- a/WebKitTools/Scripts/commit-log-editor
+++ b/WebKitTools/Scripts/commit-log-editor
@@ -62,26 +62,40 @@ if (!$log) {
my $baseDir = baseProductDir();
my $editor = $ENV{SVN_LOG_EDITOR};
-if (!$editor || isCommitLogEditor($editor)) {
- $editor = $ENV{CVS_LOG_EDITOR};
-}
-if (!$editor || isCommitLogEditor($editor)) {
+$editor = $ENV{CVS_LOG_EDITOR} if !$editor;
+$editor = "" if isCommitLogEditor($editor);
+
+my $splitEditor = 1;
+if (!$editor) {
my $builtEditorApplication = "$baseDir/Release/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
- $editor = $builtEditorApplication if -x $builtEditorApplication;
+ if (-x $builtEditorApplication) {
+ $editor = $builtEditorApplication;
+ $splitEditor = 0;
+ }
}
-if (!$editor || isCommitLogEditor($editor)) {
+if (!$editor) {
my $builtEditorApplication = "$baseDir/Debug/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
- $editor = $builtEditorApplication if -x $builtEditorApplication;
-}
-if (!$editor || isCommitLogEditor($editor)) {
- my $installedEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
- $editor = $installedEditorApplication if -x $installedEditorApplication;
+ if (-x $builtEditorApplication) {
+ $editor = $builtEditorApplication;
+ $splitEditor = 0;
+ }
}
-if (!$editor || isCommitLogEditor($editor)) {
- $editor = $ENV{EDITOR};
+if (!$editor) {
+ my $builtEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
+ if (-x $builtEditorApplication) {
+ $editor = $builtEditorApplication;
+ $splitEditor = 0;
+ }
}
-if (!$editor || isCommitLogEditor($editor)) {
- $editor = "/usr/bin/vi";
+
+$editor = $ENV{EDITOR} if !$editor;
+$editor = "/usr/bin/vi" if !$editor;
+
+my @editor;
+if ($splitEditor) {
+ @editor = split ' ', $editor;
+} else {
+ @editor = ($editor);
}
my $inChangesToBeCommitted = !isGit();
@@ -124,9 +138,8 @@ if ($regenerateLog && $existingLog && scalar(@changeLogs) > 0) {
$keepExistingLog = 0 if ($key eq "r");
}
-# Don't change anything if there's already a log message
-# (as can happen with git-commit --amend)
-exec $editor, @ARGV if $existingLog && $keepExistingLog;
+# Don't change anything if there's already a log message (as can happen with git-commit --amend).
+exec (@editor, @ARGV) if $existingLog && $keepExistingLog;
my $topLevel = determineVCSRoot();
@@ -248,7 +261,7 @@ if (isGit() && scalar keys %changeLogSort == 0) {
print NEWLOG $logContents;
close NEWLOG;
-system $editor, "$log.edit";
+system (@editor, "$log.edit");
open NEWLOG, "$log.edit" or exit;
my $foundComment = 0;
diff --git a/WebKitTools/Scripts/create-html-entity-table b/WebKitTools/Scripts/create-html-entity-table
new file mode 100755
index 0000000..46c8c52
--- /dev/null
+++ b/WebKitTools/Scripts/create-html-entity-table
@@ -0,0 +1,183 @@
+#!/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.
+
+import os.path
+import string
+import sys
+
+# Hack sys.path to avoid executing webkitpy __init__.py code which may
+# use Python 2.5 features. This code needs to run on Python 2.3 in order
+# to support Mac OS X Tiger.
+scripts_directory = sys.path[0]
+sys.path.append("%s/webkitpy/thirdparty" % scripts_directory)
+
+import simplejson
+
+
+def convert_entity_to_cpp_name(entity):
+ postfix = "EntityName"
+ if entity[-1] == ";":
+ return "%sSemicolon%s" % (entity[:-1], postfix)
+ return "%s%s" % (entity, postfix)
+
+
+def convert_entity_to_uchar_array(entity):
+ return "{'%s'}" % "', '".join(entity)
+
+
+def convert_value_to_int(value):
+ assert(value[0] == "U")
+ assert(value[1] == "+")
+ return "0x" + value[2:]
+
+
+def offset_table_entry(offset):
+ return " &staticEntityTable[%s]," % offset
+
+
+program_name = os.path.basename(__file__)
+if len(sys.argv) < 4 or sys.argv[1] != "-o":
+ print >> sys.stderr, "Usage: %s -o OUTPUT_FILE INPUT_FILE" % program_name
+ exit(1)
+
+output_path = sys.argv[2]
+input_path = sys.argv[3]
+
+html_entity_names_file = open(input_path)
+entries = simplejson.load(html_entity_names_file)
+html_entity_names_file.close()
+
+entries = sorted(entries, key=lambda entry: entry['entity'])
+entity_count = len(entries)
+
+output_file = open(output_path, "w")
+
+print >> output_file, """/*
+ * 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. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// THIS FILE IS GENERATED BY WebKitTools/Scripts/create-html-entity-table
+// DO NOT EDIT (unless you are a ninja)!
+
+#include "config.h"
+#include "HTMLEntityTable.h"
+
+namespace WebCore {
+
+namespace {
+"""
+
+for entry in entries:
+ print >> output_file, "const UChar %sEntityName[] = %s;" % (
+ convert_entity_to_cpp_name(entry["entity"]),
+ convert_entity_to_uchar_array(entry["entity"]))
+
+print >> output_file, """
+HTMLEntityTableEntry staticEntityTable[%s] = {""" % entity_count
+
+index = {}
+offset = 0
+for entry in entries:
+ letter = entry["entity"][0]
+ if not index.get(letter):
+ index[letter] = offset
+ print >> output_file, ' { %sEntityName, %s, %s },' % (
+ convert_entity_to_cpp_name(entry["entity"]),
+ len(entry["entity"]),
+ convert_value_to_int(entry["value"]))
+ offset += 1
+
+print >> output_file, """};
+"""
+
+print >> output_file, "const HTMLEntityTableEntry* uppercaseOffset[] = {"
+for letter in string.uppercase:
+ print >> output_file, offset_table_entry(index[letter])
+print >> output_file, offset_table_entry(index['a'])
+print >> output_file, """};
+
+const HTMLEntityTableEntry* lowercaseOffset[] = {"""
+for letter in string.lowercase:
+ print >> output_file, offset_table_entry(index[letter])
+print >> output_file, offset_table_entry(entity_count)
+print >> output_file, """};
+
+}
+
+const HTMLEntityTableEntry* HTMLEntityTable::firstEntryStartingWith(UChar c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return uppercaseOffset[c - 'A'];
+ if (c >= 'a' && c <= 'z')
+ return lowercaseOffset[c - 'a'];
+ return 0;
+}
+
+const HTMLEntityTableEntry* HTMLEntityTable::lastEntryStartingWith(UChar c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return uppercaseOffset[c - 'A' + 1] - 1;
+ if (c >= 'a' && c <= 'z')
+ return lowercaseOffset[c - 'a' + 1] - 1;
+ return 0;
+}
+
+const HTMLEntityTableEntry* HTMLEntityTable::firstEntry()
+{
+ return &staticEntityTable[0];
+}
+
+const HTMLEntityTableEntry* HTMLEntityTable::lastEntry()
+{
+ return &staticEntityTable[%s - 1];
+}
+
+}
+""" % entity_count
diff --git a/WebKitTools/Scripts/deduplicate-tests b/WebKitTools/Scripts/deduplicate-tests
new file mode 100644
index 0000000..f0afe13
--- /dev/null
+++ b/WebKitTools/Scripts/deduplicate-tests
@@ -0,0 +1,84 @@
+#!/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:
+#
+# 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.
+
+"""deduplicate-tests -- print test results duplicated between platforms.
+
+If platform/mac-leopard is missing an expected test output, we fall back on
+platform/mac. This means it's possible to grow redundant test outputs,
+where we have the same expected data in both a platform directory and another
+platform it falls back on.
+
+This command dumps out all such files. You can use it like this:
+ deduplicate-tests --verbose # print out the duplicated files
+ deduplicate-tests | xargs git rm # delete them
+"""
+
+
+import optparse
+import webkitpy.common.system.logutils as logutils
+import webkitpy.layout_tests.deduplicate_tests as deduplicate_tests
+
+
+def parse_args():
+ """Provides a default set of command line args.
+
+ Returns a tuple of options, args from optparse"""
+
+ configuration_options = [
+ optparse.make_option("-v", "--verbose", dest="verbose",
+ action="store_true", default=False,
+ help="Verbose output."),
+ optparse.make_option("-g", "--glob", dest="glob_pattern",
+ default="*-expected*",
+ help="Specify the glob to filter the files, defaults to *-expected*."),
+ ]
+
+ option_list = (configuration_options)
+ option_parser = optparse.OptionParser(option_list=option_list)
+
+ options, _ = option_parser.parse_args()
+
+ return options
+
+
+def run(options):
+ logutils.configure_logging()
+ if options.verbose:
+ format = ("* %(test)s\n"
+ "\tredundantly on %(platform)s and %(fallback)s\n"
+ "\tconsider deleting %(path)s")
+ else:
+ format = "%(path)s"
+
+ for dupe in deduplicate_tests.deduplicate(options.glob_pattern):
+ print(format % dupe)
+
+
+def main():
+ options = parse_args()
+ run(options)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests
index 97ef3dc..68aa6ed 100755
--- a/WebKitTools/Scripts/old-run-webkit-tests
+++ b/WebKitTools/Scripts/old-run-webkit-tests
@@ -105,12 +105,14 @@ sub readSkippedFiles($);
sub recordActualResultsAndDiff($$);
sub sampleDumpTool();
sub setFileHandleNonBlocking(*$);
+sub setUpWindowsCrashLogSaving();
sub slowestcmp($$);
sub splitpath($);
sub stopRunningTestsEarlyIfNeeded();
sub stripExtension($);
sub stripMetrics($$);
sub testCrashedOrTimedOut($$$$$);
+sub toCygwinPath($);
sub toURL($);
sub toWindowsPath($);
sub validateSkippedArg($$;$);
@@ -149,7 +151,7 @@ my $root;
my $runSample = 1;
my $shouldCheckLeaks = 0;
my $showHelp = 0;
-my $stripEditingCallbacks = isCygwin();
+my $stripEditingCallbacks;
my $testHTTP = 1;
my $testWebSocket = 1;
my $testMedia = 1;
@@ -184,6 +186,12 @@ my $prettyDiffTag = "pretty-diff";
my $diffsTag = "diffs";
my $errorTag = "stderr";
+# These are defined here instead of closer to where they are used so that they
+# will always be accessible from the END block that uses them, even if the user
+# presses Ctrl-C before Perl has finished evaluating this whole file.
+my $windowsPostMortemDebuggerKey = "/HKLM/SOFTWARE/Microsoft/Windows NT/CurrentVersion/AeDebug";
+my %previousWindowsPostMortemDebuggerValues;
+
my $realPlatform;
my @macPlatforms = ("mac-tiger", "mac-leopard", "mac-snowleopard", "mac");
@@ -355,11 +363,13 @@ if ($useWebKitTestRunner) {
$realPlatform = $platform;
$platform = "mac-wk2";
} elsif (isAppleWinWebKit()) {
+ $stripEditingCallbacks = 0 unless defined $stripEditingCallbacks;
$realPlatform = $platform;
$platform = "win-wk2";
}
}
+$stripEditingCallbacks = isCygwin() unless defined $stripEditingCallbacks;
my $ignoreSkipped = $treatSkipped eq "ignore";
my $skippedOnly = $treatSkipped eq "only";
@@ -380,6 +390,8 @@ $testMedia = 0 if $shouldCheckLeaks && isTiger();
# Generating remote links causes a lot of unnecessary spew on GTK build bot
$useRemoteLinksToTests = 0 if isGtk();
+setUpWindowsCrashLogSaving() if isCygwin();
+
setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
my $productDir = productDir();
$productDir .= "/bin" if isQt();
@@ -1397,6 +1409,7 @@ sub openDumpTool()
} elsif (isCygwin()) {
$CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'};
$CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'};
+ $CLEAN_ENV{_NT_SYMBOL_PATH} = $ENV{_NT_SYMBOL_PATH};
setPathForRunningWebKitApp(\%CLEAN_ENV);
}
@@ -1719,6 +1732,14 @@ sub convertPathUsingCygpath($$)
return $convertedPath;
}
+sub toCygwinPath($)
+{
+ my ($path) = @_;
+ return unless isCygwin();
+
+ return convertPathUsingCygpath($path, "-u");
+}
+
sub toWindowsPath($)
{
my ($path) = @_;
@@ -2069,6 +2090,10 @@ sub readFromDumpToolWithTimer(**)
}
}
if (defined($lineError)) {
+ if ($lineError =~ /#CRASHED/) {
+ $status = "crashed";
+ last;
+ }
if ($lineError =~ /#EOF/) {
$haveSeenEofError = 1;
} else {
@@ -2345,3 +2370,47 @@ sub stopRunningTestsEarlyIfNeeded()
return 0;
}
+
+sub setUpWindowsCrashLogSaving()
+{
+ return unless isCygwin();
+
+ unless (defined $ENV{_NT_SYMBOL_PATH}) {
+ print "The _NT_SYMBOL_PATH environment variable is not set. Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
+ return;
+ }
+
+ my $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{PROGRAMFILES}), "Debugging Tools for Windows (x86)", "ntsd.exe");
+ unless (-f $ntsdPath) {
+ $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{SYSTEMROOT}), "system32", "ntsd.exe");
+ unless (-f $ntsdPath) {
+ print STDERR "Can't find ntsd.exe. Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
+ return;
+ }
+ }
+
+ my %values = (
+ Debugger => '"' . toWindowsPath($ntsdPath) . '" -p %ld -e %ld -g -lines -c ".logopen /t \"' . toWindowsPath($testResultsDirectory) . '\CrashLog.txt\";!analyze -vv;~*kpn;q"',
+ Auto => 1
+ );
+
+ foreach my $value (keys %values) {
+ chomp($previousWindowsPostMortemDebuggerValues{$value} = `regtool get "$windowsPostMortemDebuggerKey/$value"`);
+ my $result = system "regtool", "set", "-s", "$windowsPostMortemDebuggerKey/$value", $values{$value};
+ next unless $result;
+
+ print "Failed to set \"$windowsPostMortemDebuggerKey/$value\". Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
+ return;
+ }
+
+ print "Crash logs will be saved to $testResultsDirectory.\n";
+}
+
+END {
+ return unless isCygwin();
+
+ foreach my $value (keys %previousWindowsPostMortemDebuggerValues) {
+ my $result = system "regtool", "set", "-s", "$windowsPostMortemDebuggerKey/$value", $previousWindowsPostMortemDebuggerValues{$value};
+ !$result or print "Failed to restore \"$windowsPostMortemDebuggerKey/$value\" to its previous value \"$previousWindowsPostMortemDebuggerValues{$value}\"\n.";
+ }
+}
diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index 1488939..45aca1b 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -433,11 +433,16 @@ if ($spewDiff && @changed_files) {
# Open ChangeLogs.
if ($openChangeLogs && @logs) {
print STDERR " Opening the edited ChangeLog files.\n";
- my $editor = $ENV{"CHANGE_LOG_EDIT_APPLICATION"};
+ my $editor = $ENV{CHANGE_LOG_EDITOR};
if ($editor) {
- system "open", "-a", $editor, @logs;
+ system ((split ' ', $editor), @logs);
} else {
- system "open", "-e", @logs;
+ $editor = $ENV{CHANGE_LOG_EDIT_APPLICATION};
+ if ($editor) {
+ system "open", "-a", $editor, @logs;
+ } else {
+ system "open", "-e", @logs;
+ }
}
}
diff --git a/WebKitTools/Scripts/webkit-patch b/WebKitTools/Scripts/webkit-patch
index 8300b9f..007f919 100755
--- a/WebKitTools/Scripts/webkit-patch
+++ b/WebKitTools/Scripts/webkit-patch
@@ -38,6 +38,7 @@ import sys
from webkitpy.common.system.logutils import configure_logging
import webkitpy.python24.versioning as versioning
+_log = logging.getLogger("webkit-patch")
def main():
# This is a hack to let us enable DEBUG logging as early as possible.
@@ -50,6 +51,11 @@ def main():
configure_logging(logging_level=logging_level)
versioning.check_version()
+
+ if sys.platform == "win32":
+ _log.fatal("webkit-patch is only supported under Cygwin Python, "
+ "not Win32 Python")
+ sys.exit(1)
# Import webkit-patch code only after version-checking so that
# script doesn't error out before having a chance to report the
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index 028d63d..6530244 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -1302,6 +1302,21 @@ sub autotoolsFlag($$)
return $prefix . '-' . $feature;
}
+sub autogenArgumentsHaveChanged($@)
+{
+ my ($filename, @currentArguments) = @_;
+
+ if (! -e $filename) {
+ return 1;
+ }
+
+ open(AUTOTOOLS_ARGUMENTS, $filename);
+ chomp(my $previousArguments = <AUTOTOOLS_ARGUMENTS>);
+ close(AUTOTOOLS_ARGUMENTS);
+
+ return $previousArguments ne join(" ", @currentArguments);
+}
+
sub buildAutotoolsProject($@)
{
my ($clean, @buildParams) = @_;
@@ -1357,8 +1372,16 @@ sub buildAutotoolsProject($@)
# If GNUmakefile exists, don't run autogen.sh. The makefile should be
# smart enough to track autotools dependencies and re-run autogen.sh
# when build files change.
+ my $autogenArgumentsFile = "previous-autogen-arguments.txt";
my $result;
- if (! -e "GNUmakefile") {
+ if (!(-e "GNUmakefile") or autogenArgumentsHaveChanged($autogenArgumentsFile, @buildArgs)) {
+
+ # Write autogen.sh arguments to a file so that we can detect
+ # when they change and automatically re-run it.
+ open(AUTOTOOLS_ARGUMENTS, ">$autogenArgumentsFile");
+ print AUTOTOOLS_ARGUMENTS join(" ", @buildArgs);
+ close(AUTOTOOLS_ARGUMENTS);
+
print "Calling configure in " . $dir . "\n\n";
print "Installation prefix directory: $prefix\n" if(defined($prefix));
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
index 569558a..5a6c48c 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
@@ -38,6 +38,40 @@ from webkitpy.common.system.executive import Executive, run_command, ScriptError
from webkitpy.common.system.deprecated_logging import error, log
+def find_checkout_root():
+ """Returns the current checkout root (as determined by default_scm().
+
+ Returns the absolute path to the top of the WebKit checkout, or None
+ if it cannot be determined.
+
+ """
+ scm_system = default_scm()
+ if scm_system:
+ return scm_system.checkout_root
+ return None
+
+
+def default_scm():
+ """Return the default SCM object as determined by the CWD and running code.
+
+ Returns the default SCM object for the current working directory; if the
+ CWD is not in a checkout, then we attempt to figure out if the SCM module
+ itself is part of a checkout, and return that one. If neither is part of
+ a checkout, None is returned.
+
+ """
+ cwd = os.getcwd()
+ scm_system = detect_scm_system(cwd)
+ if not scm_system:
+ script_directory = os.path.abspath(sys.path[0])
+ scm_system = detect_scm_system(script_directory)
+ if scm_system:
+ log("The current directory (%s) is not a WebKit checkout, using %s" % (cwd, scm_system.checkout_root))
+ else:
+ error("FATAL: Failed to determine the SCM system for either %s or %s" % (cwd, script_directory))
+ return scm_system
+
+
def detect_scm_system(path):
absolute_path = os.path.abspath(path)
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
index 852f838..87d5539 100644
--- a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
@@ -36,6 +36,7 @@ import os
import os.path
import re
import stat
+import sys
import subprocess
import tempfile
import unittest
@@ -44,10 +45,11 @@ import shutil
from datetime import date
from webkitpy.common.checkout.api import Checkout
-from webkitpy.common.checkout.scm import detect_scm_system, SCM, SVN, CheckoutNeedsUpdate, commit_error_handler, AuthenticationError, AmbiguousCommitError
+from webkitpy.common.checkout.scm import detect_scm_system, SCM, SVN, CheckoutNeedsUpdate, commit_error_handler, AuthenticationError, AmbiguousCommitError, find_checkout_root, default_scm
from webkitpy.common.config.committers import Committer # FIXME: This should not be needed
from webkitpy.common.net.bugzilla import Attachment # FIXME: This should not be needed
from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.common.system.outputcapture import OutputCapture
# Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
# Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
@@ -174,6 +176,57 @@ class SVNTestRepository:
# Change back to a valid directory so that later calls to os.getcwd() do not fail.
os.chdir(detect_scm_system(os.path.dirname(__file__)).checkout_root)
+
+class StandaloneFunctionsTest(unittest.TestCase):
+ """This class tests any standalone/top-level functions in the package."""
+ def setUp(self):
+ self.orig_cwd = os.path.abspath(os.getcwd())
+ self.orig_abspath = os.path.abspath
+
+ # We capture but ignore the output from stderr to reduce unwanted
+ # logging.
+ self.output = OutputCapture()
+ self.output.capture_output()
+
+ def tearDown(self):
+ os.chdir(self.orig_cwd)
+ os.path.abspath = self.orig_abspath
+ self.output.restore_output()
+
+ def test_find_checkout_root(self):
+ # Test from inside the tree.
+ os.chdir(sys.path[0])
+ dir = find_checkout_root()
+ self.assertNotEqual(dir, None)
+ self.assertTrue(os.path.exists(dir))
+
+ # Test from outside the tree.
+ os.chdir(os.path.expanduser("~"))
+ dir = find_checkout_root()
+ self.assertNotEqual(dir, None)
+ self.assertTrue(os.path.exists(dir))
+
+ # Mock out abspath() to test being not in a checkout at all.
+ os.path.abspath = lambda x: "/"
+ self.assertRaises(SystemExit, find_checkout_root)
+ os.path.abspath = self.orig_abspath
+
+ def test_default_scm(self):
+ # Test from inside the tree.
+ os.chdir(sys.path[0])
+ scm = default_scm()
+ self.assertNotEqual(scm, None)
+
+ # Test from outside the tree.
+ os.chdir(os.path.expanduser("~"))
+ dir = find_checkout_root()
+ self.assertNotEqual(dir, None)
+
+ # Mock out abspath() to test being not in a checkout at all.
+ os.path.abspath = lambda x: "/"
+ self.assertRaises(SystemExit, default_scm)
+ os.path.abspath = self.orig_abspath
+
# For testing the SCM baseclass directly.
class SCMClassTests(unittest.TestCase):
def setUp(self):
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index 5ebf18a..7543d69 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -139,6 +139,7 @@ committers_unable_to_review = [
Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
Committer("Levi Weintraub", "lweintraub@apple.com"),
+ Committer("Lucas De Marchi", ["lucas.demarchi@profusion.mobi", "demarchi@webkit.org"], "demarchi"),
Committer("Luiz Agostini", ["luiz@webkit.org", "luiz.agostini@openbossa.org"], "lca"),
Committer("Mads Ager", "ager@chromium.org"),
Committer("Marcus Voltis Bulach", "bulach@chromium.org"),
@@ -146,7 +147,6 @@ committers_unable_to_review = [
Committer("Matt Perry", "mpcomplete@chromium.org"),
Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]),
Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"], "maxime.simon"),
- Committer("Martin Robinson", ["mrobinson@igalia.com", "mrobinson@webkit.org", "martin.james.robinson@gmail.com"], "mrobinson"),
Committer("Michelangelo De Simone", "michelangelo@webkit.org", "michelangelo"),
Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
Committer("Mike Fenton", ["mifenton@rim.com", "mike.fenton@torchmobile.com"], "mfenton"),
@@ -179,7 +179,7 @@ committers_unable_to_review = [
Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"),
Committer("Zhenyao Mo", "zmo@google.com", "zhenyao"),
Committer("Zoltan Herczeg", "zherczeg@webkit.org", "zherczeg"),
- Committer("Zoltan Horvath", "zoltan@webkit.org", "zoltan"),
+ Committer("Zoltan Horvath", ["zoltan@webkit.org", "hzoltan@inf.u-szeged.hu", "horvath.zoltan.6@stud.u-szeged.hu"], "zoltan"),
]
@@ -200,7 +200,7 @@ reviewers_list = [
Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"], "andersca"),
Reviewer("Antonio Gomes", "tonikitoo@webkit.org", "tonikitoo"),
Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com"], "anttik"),
- Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@webkit.org"], "ariya"),
+ Reviewer("Ariya Hidayat", ["ariya@sencha.com", "ariya.hidayat@gmail.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"]),
@@ -225,7 +225,7 @@ reviewers_list = [
Reviewer("Gavin Barraclough", "barraclough@apple.com", "gbarra"),
Reviewer("Geoffrey Garen", "ggaren@apple.com", "ggaren"),
Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]),
- Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org"], "kov"),
+ Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org", "gustavo.noronha@collabora.co.uk"], "kov"),
Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"], "zecke"),
Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"], "janm"),
Reviewer("Jeremy Orlow", "jorlow@chromium.org", "jorlow"),
@@ -244,6 +244,7 @@ reviewers_list = [
Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com", "lgombos"),
Reviewer("Maciej Stachowiak", "mjs@apple.com", "othermaciej"),
Reviewer("Mark Rowe", "mrowe@apple.com", "bdash"),
+ Reviewer("Martin Robinson", ["mrobinson@igalia.com", "mrobinson@webkit.org", "martin.james.robinson@gmail.com"], "mrobinson"),
Reviewer("Nate Chapin", "japhet@chromium.org", "japhet"),
Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org"], "wildfox"),
Reviewer("Ojan Vafai", "ojan@chromium.org", "ojan"),
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
new file mode 100644
index 0000000..bb63f5e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
@@ -0,0 +1,167 @@
+#!/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:
+#
+# 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.
+
+"""deduplicate_tests -- lists duplicated between platforms.
+
+If platform/mac-leopard is missing an expected test output, we fall back on
+platform/mac. This means it's possible to grow redundant test outputs,
+where we have the same expected data in both a platform directory and another
+platform it falls back on.
+"""
+
+import collections
+import fnmatch
+import os
+import subprocess
+import sys
+import re
+import webkitpy.common.system.executive as executive
+import webkitpy.common.system.logutils as logutils
+import webkitpy.layout_tests.port.factory as port_factory
+
+_log = logutils.get_logger(__file__)
+
+_BASE_PLATFORM = 'base'
+
+
+def port_fallbacks():
+ """Get the port fallback information.
+ Returns:
+ A dictionary mapping platform name to a list of other platforms to fall
+ back on. All platforms fall back on 'base'.
+ """
+ fallbacks = {_BASE_PLATFORM: []}
+ for port_name in os.listdir(os.path.join('LayoutTests', 'platform')):
+ try:
+ platforms = port_factory.get(port_name).baseline_search_path()
+ except NotImplementedError:
+ _log.error("'%s' lacks baseline_search_path(), please fix." % port_name)
+ fallbacks[port_name] = [_BASE_PLATFORM]
+ continue
+ fallbacks[port_name] = [os.path.basename(p) for p in platforms][1:]
+ fallbacks[port_name].append(_BASE_PLATFORM)
+ return fallbacks
+
+
+def parse_git_output(git_output, glob_pattern):
+ """Parses the output of git ls-tree and filters based on glob_pattern.
+ Args:
+ git_output: result of git ls-tree -r HEAD LayoutTests.
+ glob_pattern: a pattern to filter the files.
+ Returns:
+ A dictionary mapping (test name, hash of content) => [paths]
+ """
+ hashes = collections.defaultdict(set)
+ for line in git_output.split('\n'):
+ if not line:
+ break
+ attrs, path = line.strip().split('\t')
+ if not fnmatch.fnmatch(path, glob_pattern):
+ continue
+ path = path[len('LayoutTests/'):]
+ match = re.match(r'^(platform/.*?/)?(.*)', path)
+ test = match.group(2)
+ _, _, hash = attrs.split(' ')
+ hashes[(test, hash)].add(path)
+ return hashes
+
+
+def cluster_file_hashes(glob_pattern):
+ """Get the hashes of all the test expectations in the tree.
+ We cheat and use git's hashes.
+ Args:
+ glob_pattern: a pattern to filter the files.
+ Returns:
+ A dictionary mapping (test name, hash of content) => [paths]
+ """
+
+ # A map of file hash => set of all files with that hash.
+ hashes = collections.defaultdict(set)
+
+ # Fill in the map.
+ cmd = ('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests')
+ try:
+ git_output = executive.Executive().run_command(cmd)
+ except OSError, e:
+ if e.errno == 2: # No such file or directory.
+ _log.error("Error: 'No such file' when running git.")
+ _log.error("This script requires git.")
+ sys.exit(1)
+ raise e
+ return parse_git_output(git_output, glob_pattern)
+
+
+def extract_platforms(paths):
+ """Extracts the platforms from a list of paths matching ^platform/(.*?)/.
+ Args:
+ paths: a list of paths.
+ Returns:
+ A dictionary containing all platforms from paths.
+ """
+ platforms = {}
+ for path in paths:
+ match = re.match(r'^platform/(.*?)/', path)
+ if match:
+ platform = match.group(1)
+ else:
+ platform = _BASE_PLATFORM
+ platforms[platform] = path
+ return platforms
+
+
+def find_dups(hashes, port_fallbacks):
+ """Yields info about redundant test expectations.
+ Args:
+ hashes: a list of hashes as returned by cluster_file_hashes.
+ port_fallbacks: a list of fallback information as returned by get_port_fallbacks.
+ Returns:
+ a tuple containing (test, platform, fallback, platforms)
+ """
+ for (test, hash), cluster in hashes.items():
+ if len(cluster) < 2:
+ continue # Common case: only one file with that hash.
+
+ # Compute the list of platforms we have this particular hash for.
+ platforms = extract_platforms(cluster)
+ if len(platforms) == 1:
+ continue
+
+ # See if any of the platforms are redundant with each other.
+ for platform in platforms.keys():
+ for fallback in port_fallbacks[platform]:
+ if fallback in platforms.keys():
+ yield test, platform, fallback, platforms[platform]
+
+
+def deduplicate(glob_pattern):
+ """Traverses LayoutTests and returns information about duplicated files.
+ Args:
+ glob pattern to filter the files in LayoutTests.
+ Returns:
+ a dictionary containing test, path, platform and fallback.
+ """
+ fallbacks = port_fallbacks()
+ hashes = cluster_file_hashes(glob_pattern)
+ return [{'test': test, 'path': path, 'platform': platform, 'fallback': fallback}
+ for test, platform, fallback, path in find_dups(hashes, fallbacks)]
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
new file mode 100644
index 0000000..66dda32
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
@@ -0,0 +1,147 @@
+#!/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:
+#
+# 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.
+
+"""Unit tests for deduplicate_tests.py."""
+
+import deduplicate_tests
+import os
+import unittest
+import webkitpy.common.checkout.scm as scm
+
+
+class MockExecutive(object):
+ last_run_command = []
+ response = ''
+
+ class Executive(object):
+ def run_command(self,
+ args,
+ cwd=None,
+ input=None,
+ error_handler=None,
+ return_exit_code=False,
+ return_stderr=True,
+ decode_output=True):
+ MockExecutive.last_run_command += [args]
+ return MockExecutive.response
+
+
+class ListDuplicatesTest(unittest.TestCase):
+ def setUp(self):
+ MockExecutive.last_run_command = []
+ MockExecutive.response = ''
+ deduplicate_tests.executive = MockExecutive
+ self._original_cwd = os.getcwd()
+ checkout_root = scm.find_checkout_root()
+ self.assertNotEqual(checkout_root, None)
+ os.chdir(checkout_root)
+
+ def tearDown(self):
+ os.chdir(self._original_cwd)
+
+ def test_parse_git_output(self):
+ git_output = (
+ '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
+ '100644 blob a004548d107ecc4e1ea08019daf0a14e8634a1ff\tLayoutTests/platform/chromium/foo-expected.txt\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/animage.png\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/animage.png\n'
+ '100644 blob 4303df5389ca87cae83dd3236b8dd84e16606517\tLayoutTests/platform/mac/foo-expected.txt\n')
+ hashes = deduplicate_tests.parse_git_output(git_output, '*')
+ expected = {('mac/foo-expected.txt', '5053240b3353f6eb39f7cb00259785f16d121df2'): set(['mac/foo-expected.txt']),
+ ('animage.png', 'abcdebc762e3aec5df03b5c04485b2cb3b65ffb1'): set(['platform/chromium-linux/animage.png', 'platform/chromium-win/animage.png']),
+ ('foo-expected.txt', '4303df5389ca87cae83dd3236b8dd84e16606517'): set(['platform/mac/foo-expected.txt']),
+ ('foo-expected.txt', 'd6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1'): set(['platform/chromium-linux/foo-expected.txt', 'platform/chromium-win/foo-expected.txt']),
+ ('foo-expected.txt', 'a004548d107ecc4e1ea08019daf0a14e8634a1ff'): set(['platform/chromium/foo-expected.txt'])}
+ self.assertEquals(expected, hashes)
+
+ hashes = deduplicate_tests.parse_git_output(git_output, '*.png')
+ expected = {('animage.png', 'abcdebc762e3aec5df03b5c04485b2cb3b65ffb1'): set(['platform/chromium-linux/animage.png', 'platform/chromium-win/animage.png'])}
+ self.assertEquals(expected, hashes)
+
+ def test_extract_platforms(self):
+ self.assertEquals({'foo': 'platform/foo/bar',
+ 'zoo': 'platform/zoo/com'},
+ deduplicate_tests.extract_platforms(['platform/foo/bar', 'platform/zoo/com']))
+ self.assertEquals({'foo': 'platform/foo/bar',
+ deduplicate_tests._BASE_PLATFORM: 'what/'},
+ deduplicate_tests.extract_platforms(['platform/foo/bar', 'what/']))
+
+ def test_unique(self):
+ MockExecutive.response = (
+ '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
+ '100644 blob a004548d107ecc4e1ea08019daf0a14e8634a1ff\tLayoutTests/platform/chromium/foo-expected.txt\n'
+ '100644 blob abcd0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/foo-expected.txt\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/foo-expected.txt\n'
+ '100644 blob 4303df5389ca87cae83dd3236b8dd84e16606517\tLayoutTests/platform/mac/foo-expected.txt\n')
+ result = deduplicate_tests.deduplicate('*')
+ self.assertEquals(1, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(0, len(result))
+
+ def test_duplicates(self):
+ MockExecutive.response = (
+ '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
+ '100644 blob a004548d107ecc4e1ea08019daf0a14e8634a1ff\tLayoutTests/platform/chromium/foo-expected.txt\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/animage.png\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/animage.png\n'
+ '100644 blob 4303df5389ca87cae83dd3236b8dd84e16606517\tLayoutTests/platform/mac/foo-expected.txt\n')
+
+ result = deduplicate_tests.deduplicate('*')
+ self.assertEquals(1, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(2, len(result))
+ self.assertEquals({'test': 'animage.png',
+ 'path': 'platform/chromium-linux/animage.png',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[0])
+ self.assertEquals({'test': 'foo-expected.txt',
+ 'path': 'platform/chromium-linux/foo-expected.txt',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[1])
+
+ result = deduplicate_tests.deduplicate('*.txt')
+ self.assertEquals(2, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(1, len(result))
+ self.assertEquals({'test': 'foo-expected.txt',
+ 'path': 'platform/chromium-linux/foo-expected.txt',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[0])
+
+ result = deduplicate_tests.deduplicate('*.png')
+ self.assertEquals(3, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(1, len(result))
+ self.assertEquals({'test': 'animage.png',
+ 'path': 'platform/chromium-linux/animage.png',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[0])
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 6364511..6343400 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
@@ -54,9 +54,9 @@ _log = logging.getLogger("webkitpy.layout_tests.layout_package."
"dump_render_tree_thread")
-def process_output(port, test_info, test_types, test_args, configuration,
- output_dir, crash, timeout, test_run_time, actual_checksum,
- output, error):
+def _process_output(port, test_info, test_types, test_args, configuration,
+ output_dir, crash, timeout, test_run_time, actual_checksum,
+ output, error):
"""Receives the output from a DumpRenderTree process, subjects it to a
number of tests, and returns a list of failure types the test produced.
@@ -118,6 +118,21 @@ def process_output(port, test_info, test_types, test_args, configuration,
total_time_for_all_diffs, time_for_diffs)
+def _pad_timeout(timeout):
+ """Returns a safe multiple of the per-test timeout value to use
+ to detect hung test threads.
+
+ """
+ # When we're running one test per DumpRenderTree process, we can
+ # enforce a hard timeout. The DumpRenderTree watchdog uses 2.5x
+ # the timeout; we want to be larger than that.
+ return timeout * 3
+
+
+def _milliseconds_to_seconds(msecs):
+ return float(msecs) / 1000.0
+
+
class TestResult(object):
def __init__(self, filename, failures, test_run_time,
@@ -162,7 +177,7 @@ class SingleTestThread(threading.Thread):
driver.run_test(test_info.uri.strip(), test_info.timeout,
test_info.image_hash())
end = time.time()
- self._test_result = process_output(self._port,
+ self._test_result = _process_output(self._port,
test_info, self._test_types, self._test_args,
self._configuration, self._output_dir, crash, timeout, end - start,
actual_checksum, output, error)
@@ -172,8 +187,42 @@ class SingleTestThread(threading.Thread):
return self._test_result
-class TestShellThread(threading.Thread):
+class WatchableThread(threading.Thread):
+ """This class abstracts an interface used by
+ run_webkit_tests.TestRunner._wait_for_threads_to_finish for thread
+ management."""
+ def __init__(self):
+ threading.Thread.__init__(self)
+ self._canceled = False
+ self._exception_info = None
+ self._next_timeout = None
+ self._thread_id = None
+
+ def cancel(self):
+ """Set a flag telling this thread to quit."""
+ self._canceled = True
+
+ def clear_next_timeout(self):
+ """Mark a flag telling this thread to stop setting timeouts."""
+ self._timeout = 0
+
+ def exception_info(self):
+ """If run() terminated on an uncaught exception, return it here
+ ((type, value, traceback) tuple).
+ Returns None if run() terminated normally. Meant to be called after
+ joining this thread."""
+ return self._exception_info
+
+ def id(self):
+ """Return a thread identifier."""
+ return self._thread_id
+
+ def next_timeout(self):
+ """Return the time the test is supposed to finish by."""
+ return self._next_timeout
+
+class TestShellThread(WatchableThread):
def __init__(self, port, filename_list_queue, result_queue,
test_types, test_args, image_path, shell_args, options):
"""Initialize all the local state for this DumpRenderTree thread.
@@ -192,7 +241,7 @@ class TestShellThread(threading.Thread):
command-line options should match those expected by
run_webkit_tests; they are typically passed via the
run_webkit_tests.TestRunner class."""
- threading.Thread.__init__(self)
+ WatchableThread.__init__(self)
self._port = port
self._filename_list_queue = filename_list_queue
self._result_queue = result_queue
@@ -203,8 +252,6 @@ class TestShellThread(threading.Thread):
self._image_path = image_path
self._shell_args = shell_args
self._options = options
- self._canceled = False
- self._exception_info = None
self._directory_timing_stats = {}
self._test_results = []
self._num_tests = 0
@@ -231,17 +278,6 @@ class TestShellThread(threading.Thread):
"""
return self._test_results
- def cancel(self):
- """Set a flag telling this thread to quit."""
- self._canceled = True
-
- def get_exception_info(self):
- """If run() terminated on an uncaught exception, return it here
- ((type, value, traceback) tuple).
- Returns None if run() terminated normally. Meant to be called after
- joining this thread."""
- return self._exception_info
-
def get_total_time(self):
return max(self._stop_time - self._start_time, 0.0)
@@ -251,6 +287,7 @@ class TestShellThread(threading.Thread):
def run(self):
"""Delegate main work to a helper method and watch for uncaught
exceptions."""
+ self._thread_id = thread.get_ident()
self._start_time = time.time()
self._num_tests = 0
try:
@@ -384,10 +421,10 @@ class TestShellThread(threading.Thread):
worker.start()
- # When we're running one test per DumpRenderTree process, we can
- # enforce a hard timeout. The DumpRenderTree watchdog uses 2.5x
- # the timeout; we want to be larger than that.
- worker.join(int(test_info.timeout) * 3.0 / 1000.0)
+ thread_timeout = _milliseconds_to_seconds(
+ _pad_timeout(test_info.timeout))
+ thread._next_timeout = time.time() + thread_timeout
+ worker.join(thread_timeout)
if worker.isAlive():
# If join() returned with the thread still running, the
# DumpRenderTree is completely hung and there's nothing
@@ -433,11 +470,16 @@ class TestShellThread(threading.Thread):
not self._options.pixel_tests)):
image_hash = ""
start = time.time()
+
+ thread_timeout = _milliseconds_to_seconds(
+ _pad_timeout(test_info.timeout))
+ self._next_timeout = start + thread_timeout
+
crash, timeout, actual_checksum, output, error = \
self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
end = time.time()
- result = process_output(self._port, test_info, self._test_types,
+ result = _process_output(self._port, test_info, self._test_types,
self._test_args, self._options.configuration,
self._options.results_directory, crash,
timeout, end - start, actual_checksum,
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 6c36c93..c6c3066 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
@@ -57,7 +57,7 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
def __init__(self, port, builder_name, build_name, build_number,
results_file_base_path, builder_base_url,
test_timings, expectations, result_summary, all_tests,
- generate_incremental_results=False):
+ generate_incremental_results=False, test_results_server=None):
"""Modifies the results.json file. Grabs it off the archive directory
if it is not found locally.
@@ -68,7 +68,7 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
super(JSONLayoutResultsGenerator, self).__init__(
builder_name, build_name, build_number, results_file_base_path,
builder_base_url, {}, port.test_repository_paths(),
- generate_incremental_results)
+ generate_incremental_results, test_results_server)
self._port = port
self._expectations = expectations
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index e746bc0..15eceee 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -84,10 +84,14 @@ class JSONResultsGeneratorBase(object):
RESULTS_FILENAME = "results.json"
INCREMENTAL_RESULTS_FILENAME = "incremental_results.json"
+ URL_FOR_TEST_LIST_JSON = \
+ "http://%s/testfile?builder=%s&name=%s&testlistjson=1"
+
def __init__(self, builder_name, build_name, build_number,
results_file_base_path, builder_base_url,
test_results_map, svn_repositories=None,
- generate_incremental_results=False):
+ generate_incremental_results=False,
+ test_results_server=None):
"""Modifies the results.json file. Grabs it off the archive directory
if it is not found locally.
@@ -103,6 +107,9 @@ class JSONResultsGeneratorBase(object):
svn_repositories: A (json_field_name, svn_path) pair for SVN
repositories that tests rely on. The SVN revision will be
included in the JSON with the given json_field_name.
+ generate_incremental_results: If true, generate incremental json file
+ from current run results.
+ test_results_server: server that hosts test results json.
"""
self._builder_name = builder_name
self._build_name = build_name
@@ -121,6 +128,8 @@ class JSONResultsGeneratorBase(object):
if not self._svn_repositories:
self._svn_repositories = {}
+ self._test_results_server = test_results_server
+
self._json = None
self._archived_results = None
@@ -144,25 +153,24 @@ class JSONResultsGeneratorBase(object):
def get_json(self, incremental=False):
"""Gets the results for the results.json file."""
- if incremental:
- results_json = {}
- else:
+ results_json = {}
+ if not incremental:
if self._json:
return self._json
- if not self._archived_results:
- self._archived_results, error = \
- self._get_archived_json_results()
- if error:
- # If there was an error don't write a results.json
- # file at all as it would lose all the information on the
- # bot.
- _log.error("Archive directory is inaccessible. Not "
- "modifying or clobbering the results.json "
- "file: " + str(error))
- return None
+ if self._archived_results:
+ results_json = self._archived_results
- results_json = self._archived_results
+ if not results_json:
+ results_json, error = self._get_archived_json_results(incremental)
+ if error:
+ # If there was an error don't write a results.json
+ # file at all as it would lose all the information on the
+ # bot.
+ _log.error("Archive directory is inaccessible. Not "
+ "modifying or clobbering the results.json "
+ "file: " + str(error))
+ return None
builder_name = self._builder_name
if results_json and builder_name not in results_json:
@@ -186,7 +194,7 @@ class JSONResultsGeneratorBase(object):
all_failing_tests = self._get_failed_test_names()
all_failing_tests.update(tests.iterkeys())
for test in all_failing_tests:
- self._insert_test_time_and_result(test, tests)
+ self._insert_test_time_and_result(test, tests, incremental)
return results_json
@@ -253,24 +261,40 @@ class JSONResultsGeneratorBase(object):
return ""
return ""
- def _get_archived_json_results(self):
+ def _get_archived_json_results(self, for_incremental=False):
"""Reads old results JSON file if it exists.
Returns (archived_results, error) tuple where error is None if results
were successfully read.
+
+ if for_incremental is True, download JSON file that only contains test
+ name list from test-results server. This is for generating incremental
+ JSON so the file generated has info for tests that failed before but
+ pass or are skipped from current run.
"""
results_json = {}
old_results = None
error = None
- if os.path.exists(self._results_file_path):
+ if os.path.exists(self._results_file_path) and not for_incremental:
with codecs.open(self._results_file_path, "r", "utf-8") as file:
old_results = file.read()
- elif self._builder_base_url:
- # Check if we have the archived JSON file on the buildbot server.
- results_file_url = (self._builder_base_url +
- self._build_name + "/" + self.RESULTS_FILENAME)
- _log.error("Local results.json file does not exist. Grabbing "
- "it off the archive at " + results_file_url)
+ elif self._builder_base_url or for_incremental:
+ if for_incremental:
+ if not self._test_results_server:
+ # starting from fresh if no test results server specified.
+ return {}, None
+
+ results_file_url = (self.URL_FOR_TEST_LIST_JSON %
+ (urllib2.quote(self._test_results_server),
+ urllib2.quote(self._builder_name),
+ self.RESULTS_FILENAME))
+ else:
+ # Check if we have the archived JSON file on the buildbot
+ # server.
+ results_file_url = (self._builder_base_url +
+ self._build_name + "/" + self.RESULTS_FILENAME)
+ _log.error("Local results.json file does not exist. Grabbing "
+ "it off the archive at " + results_file_url)
try:
results_file = urllib2.urlopen(results_file_url)
@@ -387,7 +411,7 @@ class JSONResultsGeneratorBase(object):
int(time.time()),
self.TIME)
- def _insert_test_time_and_result(self, test_name, tests):
+ def _insert_test_time_and_result(self, test_name, tests, incremental=False):
""" Insert a test item with its results to the given tests dictionary.
Args:
@@ -401,9 +425,20 @@ class JSONResultsGeneratorBase(object):
tests[test_name] = self._create_results_and_times_json()
thisTest = tests[test_name]
- self._insert_item_run_length_encoded(result, thisTest[self.RESULTS])
- self._insert_item_run_length_encoded(time, thisTest[self.TIMES])
- self._normalize_results_json(thisTest, test_name, tests)
+ if self.RESULTS in thisTest:
+ self._insert_item_run_length_encoded(result, thisTest[self.RESULTS])
+ else:
+ thisTest[self.RESULTS] = [[1, result]]
+
+ if self.TIMES in thisTest:
+ self._insert_item_run_length_encoded(time, thisTest[self.TIMES])
+ else:
+ thisTest[self.TIMES] = [[1, time]]
+
+ # Don't normalize the incremental results json because we need results
+ # for tests that pass or have no data from current run.
+ if not incremental:
+ self._normalize_results_json(thisTest, test_name, tests)
def _convert_json_to_current_version(self, results_json):
"""If the JSON does not match the current version, converts it to the
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
index f838a7b..81cdc9b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
@@ -123,12 +123,6 @@ def print_options():
help="show detailed help on controlling print output"),
optparse.make_option("-v", "--verbose", action="store_true",
default=False, help="include debug-level logging"),
-
- # FIXME: we should remove this; it's pretty much obsolete with the
- # --print trace-everything option.
- optparse.make_option("--sources", action="store_true",
- help=("show expected result file path for each test "
- "(implies --verbose)")),
]
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 38223dd..e154932 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -460,6 +460,9 @@ class TestExpectationsFile:
return ExpectationsJsonEncoder(separators=(',', ':')).encode(
self._all_expectations)
+ def get_non_fatal_errors(self):
+ return self._non_fatal_errors
+
def contains(self, test):
return test in self._test_to_expectations
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 60bdbca..3be9240 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
@@ -250,15 +250,6 @@ class FailureImageHashMismatch(FailureWithType):
return "Image mismatch"
-class FailureFuzzyFailure(FailureWithType):
- """Image hashes didn't match."""
- OUT_FILENAMES = ["-actual.png", "-expected.png"]
-
- @staticmethod
- def message():
- return "Fuzzy image match also failed"
-
-
class FailureImageHashIncorrect(FailureWithType):
"""Actual result hash is incorrect."""
# Chrome doesn't know to display a .checksum file as text, so don't bother
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 8072bc0..e9a81e7 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -69,9 +69,9 @@ class ChromiumWinPort(chromium.ChromiumPort):
def baseline_search_path(self):
port_names = []
- if self._name == 'chromium-win-xp':
+ if self._name.endswith('-win-xp'):
port_names.append("chromium-win-xp")
- if self._name in ('chromium-win-xp', 'chromium-win-vista'):
+ if self._name.endswith('-win-xp') or self._name.endswith('-win-vista'):
port_names.append("chromium-win-vista")
# FIXME: This may need to include mac-snowleopard like win.py.
port_names.extend(["chromium-win", "chromium", "win", "mac"])
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
index 95b90da..258bf33 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -83,5 +83,8 @@ def get(port_name=None, options=None):
elif port_to_use.startswith('chromium-win'):
import chromium_win
return chromium_win.ChromiumWinPort(port_name, options)
+ elif port_to_use.startswith('google-chrome'):
+ import google_chrome
+ return google_chrome.GetGoogleChromePort(port_name, options)
raise NotImplementedError('unsupported port: %s' % port_to_use)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
new file mode 100644
index 0000000..1ea053b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+def GetGoogleChromePort(port_name, options):
+ """Some tests have slightly different results when compiled as Google
+ Chrome vs Chromium. In those cases, we prepend an additional directory to
+ to the baseline paths."""
+ if port_name == 'google-chrome-linux32':
+ import chromium_linux
+
+ class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort):
+ def baseline_search_path(self):
+ paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(self._name))
+ return paths
+ return GoogleChromeLinux32Port(port_name, options)
+ elif port_name == 'google-chrome-linux64':
+ import chromium_linux
+
+ class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort):
+ def baseline_search_path(self):
+ paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(self._name))
+ return paths
+ return GoogleChromeLinux64Port(port_name, options)
+ elif port_name.startswith('google-chrome-mac'):
+ import chromium_mac
+
+ class GoogleChromeMacPort(chromium_mac.ChromiumMacPort):
+ def baseline_search_path(self):
+ paths = chromium_mac.ChromiumMacPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(
+ 'google-chrome-mac'))
+ return paths
+ return GoogleChromeMacPort(port_name, options)
+ elif port_name.startswith('google-chrome-win'):
+ import chromium_win
+
+ class GoogleChromeWinPort(chromium_win.ChromiumWinPort):
+ def baseline_search_path(self):
+ paths = chromium_win.ChromiumWinPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(
+ 'google-chrome-win'))
+ return paths
+ return GoogleChromeWinPort(port_name, options)
+ raise NotImplementedError('unsupported port: %s' % port_name)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
new file mode 100644
index 0000000..a2d7056
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+import google_chrome
+
+
+class GetGoogleChromePortTest(unittest.TestCase):
+ def test_get_google_chrome_port(self):
+ test_ports = ('google-chrome-linux32', 'google-chrome-linux64',
+ 'google-chrome-mac', 'google-chrome-win')
+ for port in test_ports:
+ self._verify_baseline_path(port, port)
+
+ self._verify_baseline_path('google-chrome-mac', 'google-chrome-mac-leopard')
+ self._verify_baseline_path('google-chrome-win', 'google-chrome-win-xp')
+ self._verify_baseline_path('google-chrome-win', 'google-chrome-win-vista')
+
+ def _verify_baseline_path(self, expected_path, port_name):
+ port = google_chrome.GetGoogleChromePort(port_name, None)
+ path = port.baseline_search_path()[0]
+ self.assertEqual(expected_path, os.path.split(path)[1])
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index 6eef54e..9c9ab0a 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -124,6 +124,9 @@ class TestPort(base.Port):
def test_platform_names(self):
return self.test_base_platform_names()
+ def test_platform_name_to_name(self, test_platform_name):
+ return test_platform_name
+
def version():
return ''
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 fa4df9b..92f1032 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
@@ -59,7 +59,6 @@ import webbrowser
import zipfile
from webkitpy.common.system.executive import run_command, ScriptError
-from webkitpy.common.checkout.scm import detect_scm_system
import webkitpy.common.checkout.scm as scm
import port
@@ -240,7 +239,7 @@ class Rebaseliner(object):
self._platform,
False,
False)
- self._scm = detect_scm_system(os.getcwd())
+ self._scm = scm.default_scm()
def run(self, backup):
"""Run rebaseline process."""
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 fa03238..121b64e 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
@@ -84,5 +84,19 @@ class TestGetHostPortObject(unittest.TestCase):
port.get = old_get
+class TestRebaseliner(unittest.TestCase):
+
+ def test_noop(self):
+ # this method tests that was can at least instantiate an object, even
+ # if there is nothing to do.
+ options = MockOptions()
+ host_port_obj = port.get('test', options)
+ target_options = options
+ target_port_obj = port.get('test', target_options)
+ platform = 'test'
+ rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(
+ host_port_obj, target_port_obj, platform, options)
+ self.assertNotEqual(rebaseliner, None)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 490ac3c..b26bc6c 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -53,6 +53,7 @@ import logging
import math
import optparse
import os
+import pdb
import platform
import Queue
import random
@@ -70,7 +71,6 @@ from layout_package import test_expectations
from layout_package import test_failures
from layout_package import test_files
from layout_package import test_results_uploader
-from test_types import fuzzy_image_diff
from test_types import image_diff
from test_types import text_diff
from test_types import test_type_base
@@ -578,8 +578,6 @@ class TestRunner:
test_args.new_baseline = self._options.new_baseline
test_args.reset_results = self._options.reset_results
- test_args.show_sources = self._options.sources
-
if self._options.startup_dialog:
shell_args.append('--testshell-startup-dialog')
@@ -629,35 +627,12 @@ class TestRunner:
"""Returns whether we should run all the tests in the main thread."""
return int(self._options.child_processes) == 1
- def _dump_thread_states(self):
- for thread_id, stack in sys._current_frames().items():
- # FIXME: Python 2.6 has thread.ident which we could
- # use to map from thread_id back to thread.name
- print "\n# Thread: %d" % thread_id
- for filename, lineno, name, line in traceback.extract_stack(stack):
- print 'File: "%s", line %d, in %s' % (filename, lineno, name)
- if line:
- print " %s" % (line.strip())
-
- def _dump_thread_states_if_necessary(self):
- # HACK: Dump thread states every minute to figure out what's
- # hanging on the bots.
- if not self._options.verbose:
- return
- dump_threads_every = 60 # Dump every minute
- if not self._last_thread_dump:
- self._last_thread_dump = time.time()
- time_since_last_dump = time.time() - self._last_thread_dump
- if time_since_last_dump > dump_threads_every:
- self._dump_thread_states()
- self._last_thread_dump = time.time()
-
def _run_tests(self, file_list, result_summary):
"""Runs the tests in the file_list.
- Return: A tuple (failures, thread_timings, test_timings,
+ Return: A tuple (keyboard_interrupted, thread_timings, test_timings,
individual_test_timings)
- failures is a map from test to list of failure types
+ keyboard_interrupted is whether someone typed Ctrl^C
thread_timings is a list of dicts with the total runtime
of each thread with 'name', 'num_tests', 'total_time' properties
test_timings is a list of timings for each sharded subdirectory
@@ -676,44 +651,55 @@ class TestRunner:
result_summary)
self._printer.print_update("Starting testing ...")
- # Wait for the threads to finish and collect test failures.
- failures = {}
- test_timings = {}
- individual_test_timings = []
- thread_timings = []
+ keyboard_interrupted = self._wait_for_threads_to_finish(threads,
+ result_summary)
+ (thread_timings, test_timings, individual_test_timings) = \
+ self._collect_timing_info(threads)
+
+ return (keyboard_interrupted, thread_timings, test_timings,
+ individual_test_timings)
+
+ def _wait_for_threads_to_finish(self, threads, result_summary):
keyboard_interrupted = False
try:
# Loop through all the threads waiting for them to finish.
- for thread in threads:
- # FIXME: We'll end up waiting on the first thread the whole
- # time. That means we won't notice exceptions on other
- # threads until the first one exits.
- # We should instead while True: in the outer loop
- # and then loop through threads joining and checking
- # isAlive and get_exception_info. Exiting on any exception.
- while thread.isAlive():
- # Wake the main thread every 0.1 seconds so we
- # can call update_summary in a timely fashion.
- thread.join(0.1)
- # HACK: Used for debugging threads on the bots.
- self._dump_thread_states_if_necessary()
- self.update_summary(result_summary)
+ some_thread_is_alive = True
+ while some_thread_is_alive:
+ some_thread_is_alive = False
+ t = time.time()
+ for thread in threads:
+ exception_info = thread.exception_info()
+ if exception_info is not None:
+ # Re-raise the thread's exception here to make it
+ # clear that testing was aborted. Otherwise,
+ # the tests that did not run would be assumed
+ # to have passed.
+ raise (exception_info[0], exception_info[1],
+ exception_info[2])
+
+ if thread.isAlive():
+ some_thread_is_alive = True
+ next_timeout = thread.next_timeout()
+ if (next_timeout and t > next_timeout):
+ _log_wedged_thread(thread)
+ thread.clear_next_timeout()
+
+ self.update_summary(result_summary)
+
+ if some_thread_is_alive:
+ time.sleep(0.1)
except KeyboardInterrupt:
keyboard_interrupted = True
for thread in threads:
thread.cancel()
- if not keyboard_interrupted:
- for thread in threads:
- # Check whether a thread died before normal completion.
- exception_info = thread.get_exception_info()
- if exception_info is not None:
- # Re-raise the thread's exception here to make it clear
- # something went wrong. Otherwise, the tests that did not
- # run would be assumed to have passed.
- raise (exception_info[0], exception_info[1],
- exception_info[2])
+ return keyboard_interrupted
+
+ def _collect_timing_info(self, threads):
+ test_timings = {}
+ individual_test_timings = []
+ thread_timings = []
for thread in threads:
thread_timings.append({'name': thread.getName(),
@@ -721,8 +707,8 @@ class TestRunner:
'total_time': thread.get_total_time()})
test_timings.update(thread.get_directory_timing_stats())
individual_test_timings.extend(thread.get_test_results())
- return (keyboard_interrupted, thread_timings, test_timings,
- individual_test_timings)
+
+ return (thread_timings, test_timings, individual_test_timings)
def needs_http(self):
"""Returns whether the test runner needs an HTTP server."""
@@ -890,7 +876,8 @@ class TestRunner:
self._options.build_number, self._options.results_directory,
BUILDER_BASE_URL, individual_test_timings,
self._expectations, result_summary, self._test_files_list,
- not self._options.upload_full_results)
+ not self._options.upload_full_results,
+ self._options.test_results_server)
_log.debug("Finished writing JSON files.")
@@ -1440,8 +1427,6 @@ def run(port_obj, options, args, regular_output=sys.stderr,
test_runner.add_test_type(text_diff.TestTextDiff)
if options.pixel_tests:
test_runner.add_test_type(image_diff.ImageDiff)
- if options.fuzzy_pixel_tests:
- test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff)
num_unexpected_results = test_runner.run(result_summary)
@@ -1524,9 +1509,6 @@ 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"),
- optparse.make_option("--fuzzy-pixel-tests", action="store_true",
- default=False,
- help="Also use fuzzy matching to compare pixel test outputs."),
# old-run-webkit-tests allows a specific tolerance: --tolerance t
# Ignore image differences less than this percentage (default: 0.1)
optparse.make_option("--results-directory",
@@ -1674,12 +1656,38 @@ def parse_args(args=None):
option_parser = optparse.OptionParser(option_list=option_list)
options, args = option_parser.parse_args(args)
- if options.sources:
- options.verbose = True
return options, args
+def _find_thread_stack(id):
+ """Returns a stack object that can be used to dump a stack trace for
+ the given thread id (or None if the id is not found)."""
+ for thread_id, stack in sys._current_frames().items():
+ if thread_id == id:
+ return stack
+ return None
+
+
+def _log_stack(stack):
+ """Log a stack trace to log.error()."""
+ for filename, lineno, name, line in traceback.extract_stack(stack):
+ _log.error('File: "%s", line %d, in %s' % (filename, lineno, name))
+ if line:
+ _log.error(' %s' % line.strip())
+
+
+def _log_wedged_thread(thread):
+ """Log information about the given thread state."""
+ id = thread.id()
+ stack = _find_thread_stack(id)
+ assert(stack is not None)
+ _log.error("")
+ _log.error("thread %s (%d) is wedged" % (thread.getName(), id))
+ _log_stack(stack)
+ _log.error("")
+
+
def main():
options, args = parse_args()
port_obj = port.get(options.platform, options)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index 1c751d6..e1b3746 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -30,13 +30,20 @@
"""Unit tests for run_webkit_tests."""
import codecs
+import logging
import os
+import pdb
+import Queue
import sys
+import thread
+import time
+import threading
import unittest
from webkitpy.common import array_stream
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.thirdparty.mock import Mock
@@ -92,6 +99,7 @@ class MainTest(unittest.TestCase):
self.assertEqual(buildbot_output.get(), [])
+
def _mocked_open(original_open, file_list):
def _wrapper(name, mode, encoding):
if name.find("-expected.") != -1 and mode == "w":
@@ -191,5 +199,110 @@ class DryrunTest(unittest.TestCase):
'fast/html']))
+class TestThread(dump_render_tree_thread.WatchableThread):
+ def __init__(self, started_queue, stopping_queue):
+ dump_render_tree_thread.WatchableThread.__init__(self)
+ self._started_queue = started_queue
+ self._stopping_queue = stopping_queue
+ self._timeout = False
+ self._timeout_queue = Queue.Queue()
+
+ def run(self):
+ self._thread_id = thread.get_ident()
+ try:
+ self._started_queue.put('')
+ msg = self._stopping_queue.get()
+ if msg == 'KeyboardInterrupt':
+ raise KeyboardInterrupt
+ elif msg == 'Exception':
+ raise ValueError()
+ elif msg == 'Timeout':
+ self._timeout = True
+ self._timeout_queue.get()
+ except:
+ self._exception_info = sys.exc_info()
+
+ def next_timeout(self):
+ if self._timeout:
+ self._timeout_queue.put('done')
+ return time.time() - 10
+ return time.time()
+
+
+class TestHandler(logging.Handler):
+ def __init__(self, astream):
+ logging.Handler.__init__(self)
+ self._stream = astream
+
+ def emit(self, record):
+ self._stream.write(self.format(record))
+
+
+class WaitForThreadsToFinishTest(unittest.TestCase):
+ class MockTestRunner(run_webkit_tests.TestRunner):
+ def __init__(self):
+ pass
+
+ def __del__(self):
+ pass
+
+ def update_summary(self, result_summary):
+ pass
+
+ def run_one_thread(self, msg):
+ runner = self.MockTestRunner()
+ starting_queue = Queue.Queue()
+ stopping_queue = Queue.Queue()
+ child_thread = TestThread(starting_queue, stopping_queue)
+ child_thread.start()
+ started_msg = starting_queue.get()
+ stopping_queue.put(msg)
+ threads = [child_thread]
+ return runner._wait_for_threads_to_finish(threads, None)
+
+ def test_basic(self):
+ interrupted = self.run_one_thread('')
+ self.assertFalse(interrupted)
+
+ def test_interrupt(self):
+ interrupted = self.run_one_thread('KeyboardInterrupt')
+ self.assertTrue(interrupted)
+
+ def test_timeout(self):
+ interrupted = self.run_one_thread('Timeout')
+ self.assertFalse(interrupted)
+
+ def test_exception(self):
+ self.assertRaises(ValueError, self.run_one_thread, 'Exception')
+
+
+class StandaloneFunctionsTest(unittest.TestCase):
+ def test_log_wedged_thread(self):
+ logger = run_webkit_tests._log
+ astream = array_stream.ArrayStream()
+ handler = TestHandler(astream)
+ logger.addHandler(handler)
+
+ starting_queue = Queue.Queue()
+ stopping_queue = Queue.Queue()
+ child_thread = TestThread(starting_queue, stopping_queue)
+ child_thread.start()
+ msg = starting_queue.get()
+
+ run_webkit_tests._log_wedged_thread(child_thread)
+ stopping_queue.put('')
+ child_thread.join(timeout=1.0)
+
+ self.assertFalse(astream.empty())
+ self.assertFalse(child_thread.isAlive())
+
+ def test_find_thread_stack(self):
+ id, stack = sys._current_frames().items()[0]
+ found_stack = run_webkit_tests._find_thread_stack(id)
+ self.assertNotEqual(found_stack, None)
+
+ found_stack = run_webkit_tests._find_thread_stack(0)
+ self.assertEqual(found_stack, None)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
deleted file mode 100644
index 64dfb20..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/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.
-
-"""Compares the image output of a test to the expected image output using
-fuzzy matching.
-"""
-
-import errno
-import logging
-import os
-import shutil
-
-from webkitpy.layout_tests.layout_package import test_failures
-from webkitpy.layout_tests.test_types import test_type_base
-
-_log = logging.getLogger("webkitpy.layout_tests.test_types.fuzzy_image_diff")
-
-
-class FuzzyImageDiff(test_type_base.TestTypeBase):
-
- def compare_output(self, filename, output, test_args, configuration):
- """Implementation of CompareOutput that checks the output image and
- checksum against the expected files from the LayoutTest directory.
- """
- failures = []
-
- # If we didn't produce a hash file, this test must be text-only.
- if test_args.hash is None:
- return failures
-
- expected_png_file = self._port.expected_filename(filename, '.png')
-
- if test_args.show_sources:
- _log.debug('Using %s' % expected_png_file)
-
- # Also report a missing expected PNG file.
- if not os.path.isfile(expected_png_file):
- failures.append(test_failures.FailureMissingImage(self))
-
- # Run the fuzzymatcher
- r = self._port.fuzzy_diff(test_args.png_path, expected_png_file)
- if r != 0:
- failures.append(test_failures.FailureFuzzyFailure(self))
-
- return failures
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
index 65f8f3a..c9f4107 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
@@ -136,7 +136,7 @@ class ImageDiff(test_type_base.TestTypeBase):
# If we're generating a new baseline, we pass.
if test_args.new_baseline or test_args.reset_results:
self._save_baseline_files(filename, test_args.png_path,
- test_args.hash, test_args.new_baseline)
+ test_args.hash, test_args.new_baseline)
return failures
# Compare hashes.
@@ -144,10 +144,6 @@ class ImageDiff(test_type_base.TestTypeBase):
'.checksum')
expected_png_file = self._port.expected_filename(filename, '.png')
- if test_args.show_sources:
- _log.debug('Using %s' % expected_hash_file)
- _log.debug('Using %s' % expected_png_file)
-
# FIXME: We repeat this pattern often, we should share code.
try:
with codecs.open(expected_hash_file, "r", "ascii") as file:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
index 8db2e3d..dd44642 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
@@ -58,9 +58,6 @@ class TestArguments(object):
# Whether to use wdiff to generate by-word diffs.
wdiff = False
- # Whether to report the locations of the expected result files used.
- show_sources = False
-
# Python bug workaround. See the wdiff code in WriteOutputFiles for an
# explanation.
_wdiff_available = True
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 18f74b8..d06ec8d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
@@ -48,25 +48,22 @@ _log = logging.getLogger("webkitpy.layout_tests.test_types.text_diff")
class TestTextDiff(test_type_base.TestTypeBase):
- def get_normalized_output_text(self, output):
+ def _get_normalized_output_text(self, output):
# Some tests produce "\r\n" explicitly. Our system (Python/Cygwin)
# helpfully changes the "\n" to "\r\n", resulting in "\r\r\n".
norm = output.replace("\r\r\n", "\r\n").strip("\r\n").replace(
"\r\n", "\n")
return norm + "\n"
- def get_normalized_expected_text(self, filename, show_sources):
+ def _get_normalized_expected_text(self, filename):
"""Given the filename of the test, read the expected output from a file
and normalize the text. Returns a string with the expected text, or ''
if the expected output file was not found."""
# Read the port-specific expected text.
expected_filename = self._port.expected_filename(filename, '.txt')
- if show_sources:
- _log.debug('Using %s' % expected_filename)
+ return self._get_normalized_text(expected_filename)
- return self.get_normalized_text(expected_filename)
-
- def get_normalized_text(self, filename):
+ def _get_normalized_text(self, filename):
# FIXME: We repeat this pattern often, we should share code.
try:
# NOTE: -expected.txt files are ALWAYS utf-8. However,
@@ -94,13 +91,12 @@ class TestTextDiff(test_type_base.TestTypeBase):
# we do not ever decode it inside run-webkit-tests. For some tests
# DumpRenderTree may not output utf-8 text (e.g. webarchives).
self._save_baseline_data(filename, output, ".txt", encoding=None,
- generate_new_baseline=test_args.new_baseline)
+ generate_new_baseline=test_args.new_baseline)
return failures
# Normalize text to diff
- output = self.get_normalized_output_text(output)
- expected = self.get_normalized_expected_text(filename,
- test_args.show_sources)
+ output = self._get_normalized_output_text(output)
+ expected = self._get_normalized_expected_text(filename)
# Write output files for new tests, too.
if port.compare_text(output, expected):
@@ -127,5 +123,5 @@ class TestTextDiff(test_type_base.TestTypeBase):
False otherwise.
"""
- return port.compare_text(self.get_normalized_text(file1),
- self.get_normalized_text(file2))
+ return port.compare_text(self._get_normalized_text(file1),
+ self._get_normalized_text(file2))
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index e3c56c5..ee33003 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -38,6 +38,7 @@ from checkers.common import categories as CommonCategories
from checkers.common import CarriageReturnChecker
from checkers.cpp import CppChecker
from checkers.python import PythonChecker
+from checkers.test_expectations import TestExpectationsChecker
from checkers.text import TextChecker
from error_handlers import DefaultStyleErrorHandler
from filter import FilterConfiguration
@@ -234,6 +235,7 @@ def _all_categories():
"""Return the set of all categories used by check-webkit-style."""
# Take the union across all checkers.
categories = CommonCategories.union(CppChecker.categories)
+ categories = categories.union(TestExpectationsChecker.categories)
# FIXME: Consider adding all of the pep8 categories. Since they
# are not too meaningful for documentation purposes, for
@@ -399,10 +401,15 @@ class CheckerDispatcher(object):
# Since "LayoutTests" is in _SKIPPED_FILES_WITHOUT_WARNING, make
# an exception to prevent files like "LayoutTests/ChangeLog" and
# "LayoutTests/ChangeLog-2009-06-16" from being skipped.
+ # Files like 'test_expectations.txt' and 'drt_expectations.txt'
+ # are also should not be skipped.
#
# FIXME: Figure out a good way to avoid having to add special logic
# for this special case.
- if os.path.basename(file_path).startswith('ChangeLog'):
+ basename = os.path.basename(file_path)
+ if basename.startswith('ChangeLog'):
+ return False
+ elif basename == 'test_expectations.txt' or basename == 'drt_expectations.txt':
return False
for skipped_file in _SKIPPED_FILES_WITHOUT_WARNING:
if file_path.find(skipped_file) >= 0:
@@ -442,7 +449,11 @@ class CheckerDispatcher(object):
elif file_type == FileType.PYTHON:
checker = PythonChecker(file_path, handle_style_error)
elif file_type == FileType.TEXT:
- checker = TextChecker(file_path, handle_style_error)
+ basename = os.path.basename(file_path)
+ if basename == 'test_expectations.txt' or basename == 'drt_expectations.txt':
+ checker = TestExpectationsChecker(file_path, handle_style_error)
+ else:
+ checker = TextChecker(file_path, handle_style_error)
else:
raise ValueError('Invalid file type "%(file_type)s": the only valid file types '
"are %(NONE)s, %(CPP)s, and %(TEXT)s."
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/common.py b/WebKitTools/Scripts/webkitpy/style/checkers/common.py
index a2d933f..76aa956 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/common.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/common.py
@@ -30,7 +30,7 @@
# into a shared location and refactoring appropriately.
categories = set([
"whitespace/carriage_return",
-])
+ "whitespace/tab"])
class CarriageReturnChecker(object):
@@ -55,3 +55,20 @@ class CarriageReturnChecker(object):
lines[line_number] = lines[line_number].rstrip("\r")
return lines
+
+
+class TabChecker(object):
+
+ """Supports checking for and handling tabs."""
+
+ def __init__(self, file_path, handle_style_error):
+ self.file_path = file_path
+ self.handle_style_error = handle_style_error
+
+ def check(self, lines):
+ # FIXME: share with cpp_style.
+ for line_number, line in enumerate(lines):
+ if "\t" in line:
+ self.handle_style_error(line_number + 1,
+ "whitespace/tab", 5,
+ "Line contains tab character.")
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py
index b67b7b0..1fe1263 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py
@@ -25,7 +25,7 @@
import unittest
from common import CarriageReturnChecker
-
+from common import TabChecker
# FIXME: The unit tests for the cpp, text, and common checkers should
# share supporting test code. This can include, for example, the
@@ -92,3 +92,33 @@ class CarriageReturnCheckerTest(unittest.TestCase):
self.assert_carriage_return(["line1", "line2\r", "line3\r"],
["line1", "line2", "line3"],
[2, 3])
+
+
+class TabCheckerTest(unittest.TestCase):
+
+ """Tests for TabChecker."""
+
+ def assert_tab(self, input_lines, error_lines):
+ """Assert when the given lines contain tabs."""
+ self._error_lines = []
+
+ def style_error_handler(line_number, category, confidence, message):
+ self.assertEqual(category, 'whitespace/tab')
+ self.assertEqual(confidence, 5)
+ self.assertEqual(message, 'Line contains tab character.')
+ self._error_lines.append(line_number)
+
+ checker = TabChecker('', style_error_handler)
+ checker.check(input_lines)
+ self.assertEquals(self._error_lines, error_lines)
+
+ def test_notab(self):
+ self.assert_tab([''], [])
+ self.assert_tab(['foo', 'bar'], [])
+
+ def test_tab(self):
+ self.assert_tab(['\tfoo'], [1])
+ self.assert_tab(['line1', '\tline2', 'line3\t'], [2, 3])
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
new file mode 100644
index 0000000..ddc3983
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
@@ -0,0 +1,124 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * 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.
+
+"""Checks WebKit style for test_expectations files."""
+
+import logging
+import os
+import re
+import sys
+
+from common import TabChecker
+from webkitpy.style_references import port
+from webkitpy.style_references import test_expectations
+
+_log = logging.getLogger("webkitpy.style.checkers.test_expectations")
+
+
+class ChromiumOptions(object):
+ """A mock object for creating chromium port object.
+
+ port.get() requires an options object which has 'chromium' attribute to create
+ chromium port object for each platform. This class mocks such object.
+ """
+ def __init__(self):
+ self.chromium = True
+ self.use_drt = True
+
+
+class TestExpectationsChecker(object):
+ """Processes test_expectations.txt lines for validating the syntax."""
+
+ categories = set(['test/expectations'])
+
+ def __init__(self, file_path, handle_style_error):
+ self._file_path = file_path
+ self._handle_style_error = handle_style_error
+ self._tab_checker = TabChecker(file_path, handle_style_error)
+ self._output_regex = re.compile('Line:(?P<line>\d+)\s*(?P<message>.+)')
+ # Determining the port of this expectations.
+ try:
+ port_name = self._file_path.split(os.sep)[-2]
+ if port_name == "chromium":
+ options = ChromiumOptions()
+ self._port_obj = port.get(port_name=None, options=options)
+ else:
+ self._port_obj = port.get(port_name=port_name)
+ except:
+ # Using 'test' port when we couldn't determine the port for this
+ # expectations.
+ _log.warn("Could not determine the port for %s. "
+ "Using 'test' port, but platform-specific expectations "
+ "will fail the check." % self._file_path)
+ self._port_obj = port.get('test')
+ self._port_to_check = self._port_obj.test_platform_name()
+ # Suppress error messages of test_expectations module since they will be
+ # reported later.
+ log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "test_expectations")
+ log.setLevel(logging.CRITICAL)
+
+ def _handle_error_message(self, lineno, message, confidence):
+ pass
+
+ def check_test_expectations(self, expectations_str, tests=None, overrides=None):
+ errors = []
+ expectations = None
+ try:
+ expectations = test_expectations.TestExpectationsFile(
+ port=self._port_obj, expectations=expectations_str, full_test_list=tests,
+ test_platform_name=self._port_to_check, is_debug_mode=False,
+ is_lint_mode=True, suppress_errors=False, tests_are_present=True,
+ overrides=overrides)
+ except SyntaxError, error:
+ errors = str(error).splitlines()
+
+ for error in errors:
+ matched = self._output_regex.match(error)
+ if matched:
+ lineno, message = matched.group('line', 'message')
+ self._handle_style_error(int(lineno), 'test/expectations', 5, message)
+
+ if expectations:
+ for error in expectations.get_non_fatal_errors():
+ matched = self._output_regex.match(error)
+ if matched:
+ lineno, message = matched.group('line', 'message')
+ self._handle_style_error(int(lineno), 'test/expectations', 2, message)
+
+ def check_tabs(self, lines):
+ self._tab_checker.check(lines)
+
+ def check(self, lines):
+ overrides = self._port_obj.test_expectations_overrides()
+ expectations = '\n'.join(lines)
+ self.check_test_expectations(expectations_str=expectations,
+ tests=None,
+ overrides=overrides)
+ # Warn tabs in lines as well
+ self.check_tabs(lines)
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
new file mode 100644
index 0000000..aa219b2
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -0,0 +1,172 @@
+#!/usr/bin/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.
+
+"""Unit tests for test_expectations.py."""
+
+import os
+import sys
+import unittest
+
+# We need following workaround hack to run this unit tests in stand-alone.
+try:
+ d = os.path.dirname(__file__)
+except NameError:
+ d = os.path.dirname(sys.argv[0])
+sys.path.append(os.path.abspath(os.path.join(d, '../../../')))
+
+from test_expectations import TestExpectationsChecker
+from webkitpy.style_references import port
+from webkitpy.style_references import test_expectations as test_expectations_style
+
+
+class ErrorCollector(object):
+ """An error handler class for unit tests."""
+
+ def __init__(self):
+ self._errors = []
+
+ def __call__(self, lineno, category, confidence, message):
+ self._errors.append('%s [%s] [%d]' % (message, category, confidence))
+
+ def get_errors(self):
+ return ''.join(self._errors)
+
+ def reset_errors(self):
+ self._errors = []
+
+
+class TestExpectationsTestCase(unittest.TestCase):
+ """TestCase for test_expectations.py"""
+
+ def setUp(self):
+ self._error_collector = ErrorCollector()
+ port_obj = port.get('test')
+ self._test_file = os.path.join(port_obj.layout_tests_dir(), 'misc/passing.html')
+
+ def process_expectations(self, expectations, overrides=None):
+ self._checker = TestExpectationsChecker()
+
+ def assert_lines_lint(self, lines, expected):
+ self._error_collector.reset_errors()
+ checker = TestExpectationsChecker('test/test_expectations.txt',
+ self._error_collector)
+ checker.check_test_expectations(expectations_str='\n'.join(lines),
+ tests=[self._test_file],
+ overrides=None)
+ checker.check_tabs(lines)
+ self.assertEqual(expected, self._error_collector.get_errors())
+
+ def test_valid_expectations(self):
+ self.assert_lines_lint(
+ ["misc/passing.html = PASS"],
+ "")
+ self.assert_lines_lint(
+ ["misc/passing.html = FAIL PASS"],
+ "")
+ self.assert_lines_lint(
+ ["misc/passing.html = CRASH TIMEOUT FAIL PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 TEST : misc/passing.html = PASS FAIL"],
+ "")
+ self.assert_lines_lint(
+ ["SKIP BUG1234 : misc/passing.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 DEBUG : misc/passing.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 DEBUG SKIP : misc/passing.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 TEST DEBUG SKIP : misc/passing.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 DEBUG TEST : misc/passing.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["SLOW DEFER BUG1234 : misc/passing.html = PASS"],
+ "")
+ self.assert_lines_lint(
+ ["WONTFIX SKIP : misc/passing.html = TIMEOUT"],
+ "")
+
+ def test_valid_modifiers(self):
+ self.assert_lines_lint(
+ ["INVALID-MODIFIER : misc/passing.html = PASS"],
+ "Invalid modifier for test: invalid-modifier "
+ "misc/passing.html [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["SKIP : misc/passing.html = PASS"],
+ "Test lacks BUG modifier. "
+ "misc/passing.html [test/expectations] [2]")
+ self.assert_lines_lint(
+ ["WONTFIX DEFER : misc/passing.html = PASS"],
+ "Test cannot be both DEFER and WONTFIX. "
+ "misc/passing.html [test/expectations] [5]")
+
+ def test_expectation_errors(self):
+ self.assert_lines_lint(
+ ["missing expectations"],
+ "Missing expectations. ['missing expectations'] [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["SLOW : misc/passing.html = TIMEOUT"],
+ "A test can not be both slow and timeout. "
+ "If it times out indefinitely, then it should be just timeout. "
+ "misc/passing.html [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["does/not/exist.html = FAIL"],
+ "Path does not exist. does/not/exist.html [test/expectations] [2]")
+
+ def test_parse_expectations(self):
+ self.assert_lines_lint(
+ ["misc/passing.html = PASS"],
+ "")
+ self.assert_lines_lint(
+ ["misc/passing.html = UNSUPPORTED"],
+ "Unsupported expectation: unsupported "
+ "misc/passing.html [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["misc/passing.html = PASS UNSUPPORTED"],
+ "Unsupported expectation: unsupported "
+ "misc/passing.html [test/expectations] [5]")
+
+ def test_already_seen_test(self):
+ self.assert_lines_lint(
+ ["misc/passing.html = PASS",
+ "misc/passing.html = TIMEOUT"],
+ "Duplicate expectation. %s [test/expectations] [5]" % self._test_file)
+
+ def test_tab(self):
+ self.assert_lines_lint(
+ ["\tmisc/passing.html = PASS"],
+ "Line contains tab character. [whitespace/tab] [5]")
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/text.py b/WebKitTools/Scripts/webkitpy/style/checkers/text.py
index 0d03938..1147658 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/text.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/text.py
@@ -29,6 +29,7 @@
"""Checks WebKit style for text files."""
+from common import TabChecker
class TextChecker(object):
@@ -37,16 +38,10 @@ class TextChecker(object):
def __init__(self, file_path, handle_style_error):
self.file_path = file_path
self.handle_style_error = handle_style_error
+ self._tab_checker = TabChecker(file_path, handle_style_error)
def check(self, lines):
- lines = (["// adjust line numbers to make the first line 1."] + lines)
-
- # FIXME: share with cpp_style.
- for line_number, line in enumerate(lines):
- if "\t" in line:
- self.handle_style_error(line_number,
- "whitespace/tab", 5,
- "Line contains tab character.")
+ self._tab_checker.check(lines)
# FIXME: Remove this function (requires refactoring unit tests).
diff --git a/WebKitTools/Scripts/webkitpy/style_references.py b/WebKitTools/Scripts/webkitpy/style_references.py
index a42b69d..34f3bff 100644
--- a/WebKitTools/Scripts/webkitpy/style_references.py
+++ b/WebKitTools/Scripts/webkitpy/style_references.py
@@ -45,6 +45,8 @@ from webkitpy.common.system.logtesting import LogTesting
from webkitpy.common.system.logtesting import TestLogStream
from webkitpy.common.system.logutils import configure_logging
from webkitpy.common.checkout.scm import detect_scm_system
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests.layout_package import test_expectations
from webkitpy.thirdparty.autoinstalled import pep8
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
index b887b58..63f70cb 100644
--- a/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
@@ -3,7 +3,7 @@ Implementation of JSONDecoder
"""
import re
-from .scanner import Scanner, pattern
+from scanner import Scanner, pattern
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
index 1f43145..0dd5017 100755
--- a/WebKitTools/Scripts/webkitpy/tool/main.py
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -33,7 +33,7 @@ import os
import threading
from webkitpy.common.checkout.api import Checkout
-from webkitpy.common.checkout.scm import detect_scm_system
+from webkitpy.common.checkout.scm import default_scm
from webkitpy.common.net.bugzilla import Bugzilla
from webkitpy.common.net.buildbot import BuildBot
from webkitpy.common.net.rietveld import Rietveld
@@ -79,18 +79,8 @@ class WebKitPatch(MultiCommandTool):
def scm(self):
# Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
- original_cwd = os.path.abspath(".")
if not self._scm:
- self._scm = detect_scm_system(original_cwd)
-
- if not self._scm:
- script_directory = os.path.abspath(sys.path[0])
- self._scm = detect_scm_system(script_directory)
- if self._scm:
- log("The current directory (%s) is not a WebKit checkout, using %s" % (original_cwd, self._scm.checkout_root))
- else:
- error("FATAL: Failed to determine the SCM system for either %s or %s" % (original_cwd, script_directory))
-
+ self._scm = default_scm()
return self._scm
def checkout(self):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
index 22b9452..0f57439 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
@@ -57,6 +57,7 @@ class RunTests(AbstractStep):
if self._options.non_interactive:
args.append("--no-launch-safari")
args.append("--exit-after-n-failures=1")
+ args.append("--wait-for-httpd")
# FIXME: Hack to work around https://bugs.webkit.org/show_bug.cgi?id=38912
# when running the commit-queue on a mac leopard machine since compositing
# does not work reliably on Leopard due to various graphics driver/system bugs.
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
index 766801b..f4c955d 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
@@ -77,6 +77,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', '--ignore-tests', 'compositing', '--quiet']
+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', '--quiet']
"""
OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
diff --git a/WebKitTools/TestResultServer/handlers/testfilehandler.py b/WebKitTools/TestResultServer/handlers/testfilehandler.py
index 97953e7..4d1320f 100644
--- a/WebKitTools/TestResultServer/handlers/testfilehandler.py
+++ b/WebKitTools/TestResultServer/handlers/testfilehandler.py
@@ -43,6 +43,7 @@ PARAM_NAME = "name"
PARAM_KEY = "key"
PARAM_TEST_TYPE = "testtype"
PARAM_INCREMENTAL = "incremental"
+PARAM_TEST_LIST_JSON = "testlistjson"
class DeleteFile(webapp.RequestHandler):
@@ -109,16 +110,31 @@ class GetFile(webapp.RequestHandler):
if not files:
logging.info("File not found, builder: %s, test_type: %s, name: %s.",
builder, test_type, name)
- return
+ return None
+
+ return files[0].data
+
+ def _get_test_list_json(self, builder, test_type):
+ """Return json file with test name list only, do not include test
+ results and other non-test-data .
- self.response.headers["Content-Type"] = "text/plain; charset=utf-8"
- self.response.out.write(files[0].data)
+ Args:
+ builder: builder name.
+ test_type: type of test results.
+ """
+
+ json = self._get_file_content(builder, test_type, "results.json")
+ if not json:
+ return None
+
+ return JsonResults.get_test_list(builder, json)
def get(self):
builder = self.request.get(PARAM_BUILDER)
test_type = self.request.get(PARAM_TEST_TYPE)
name = self.request.get(PARAM_NAME)
dir = self.request.get(PARAM_DIR)
+ test_list_json = self.request.get(PARAM_TEST_LIST_JSON)
logging.debug(
"Getting files, builder: %s, test_type: %s, name: %s.",
@@ -129,8 +145,15 @@ class GetFile(webapp.RequestHandler):
# file content.
if dir or not builder or not name:
return self._get_file_list(builder, test_type, name)
+
+ if name == "results.json" and test_list_json:
+ json = self._get_test_list_json(builder, test_type)
else:
- return self._get_file_content(builder, test_type, name)
+ json = self._get_file_content(builder, test_type, name)
+
+ if json:
+ self.response.headers["Content-Type"] = "text/plain; charset=utf-8"
+ self.response.out.write(json)
class Upload(webapp.RequestHandler):
diff --git a/WebKitTools/TestResultServer/model/jsonresults.py b/WebKitTools/TestResultServer/model/jsonresults.py
index d86fbcd..e5eb7f7 100755
--- a/WebKitTools/TestResultServer/model/jsonresults.py
+++ b/WebKitTools/TestResultServer/model/jsonresults.py
@@ -40,8 +40,11 @@ JSON_RESULTS_BUILD_NUMBERS = "buildNumbers"
JSON_RESULTS_TESTS = "tests"
JSON_RESULTS_RESULTS = "results"
JSON_RESULTS_TIMES = "times"
+JSON_RESULTS_PASS = "P"
+JSON_RESULTS_NO_DATA = "N"
+JSON_RESULTS_MIN_TIME = 1
JSON_RESULTS_VERSION = 3
-JSON_RESULTS_MAX_BUILDS = 750
+JSON_RESULTS_MAX_BUILDS = 1500
class JsonResults(object):
@@ -171,8 +174,6 @@ class JsonResults(object):
# Merge this build into aggreagated results.
cls._merge_one_build(aggregated_json, incremental_json, index)
- logging.debug("Merged build %s, merged json: %s.",
- build_number, aggregated_json)
return True
@@ -210,18 +211,26 @@ class JsonResults(object):
incremental_json: incremental json object.
"""
- for test_name in incremental_json:
- incremental_test = incremental_json[test_name]
+ all_tests = (set(aggregated_json.iterkeys()) |
+ set(incremental_json.iterkeys()))
+ for test_name in all_tests:
if test_name in aggregated_json:
aggregated_test = aggregated_json[test_name]
+ if test_name in incremental_json:
+ incremental_test = incremental_json[test_name]
+ results = incremental_test[JSON_RESULTS_RESULTS]
+ times = incremental_test[JSON_RESULTS_TIMES]
+ else:
+ results = [[1, JSON_RESULTS_NO_DATA]]
+ times = [[1, 0]]
+
cls._insert_item_run_length_encoded(
- incremental_test[JSON_RESULTS_RESULTS],
- aggregated_test[JSON_RESULTS_RESULTS])
+ results, aggregated_test[JSON_RESULTS_RESULTS])
cls._insert_item_run_length_encoded(
- incremental_test[JSON_RESULTS_TIMES],
- aggregated_test[JSON_RESULTS_TIMES])
+ times, aggregated_test[JSON_RESULTS_TIMES])
+ cls._normalize_results_json(test_name, aggregated_json)
else:
- aggregated_json[test_name] = incremental_test
+ aggregated_json[test_name] = incremental_json[test_name]
@classmethod
def _insert_item_run_length_encoded(cls, incremental_item, aggregated_item):
@@ -238,17 +247,69 @@ class JsonResults(object):
aggregated_item[0][0] = min(
aggregated_item[0][0] + item[0], JSON_RESULTS_MAX_BUILDS)
else:
- # The test item values need to be summed from continuous runs.
- # If there is an older item (not most recent one) whose value is
- # same as the one to insert, then we should remove the old item
- # from aggregated list.
- for i in reversed(range(1, len(aggregated_item))):
- if item[1] == aggregated_item[i][1]:
- aggregated_item.pop(i)
-
aggregated_item.insert(0, item)
@classmethod
+ def _normalize_results_json(cls, test_name, aggregated_json):
+ """ Prune tests where all runs pass or tests that no longer exist and
+ truncate all results to JSON_RESULTS_MAX_BUILDS.
+
+ Args:
+ test_name: Name of the test.
+ aggregated_json: The JSON object with all the test results for
+ this builder.
+ """
+
+ aggregated_test = aggregated_json[test_name]
+ aggregated_test[JSON_RESULTS_RESULTS] = \
+ cls._remove_items_over_max_number_of_builds(
+ aggregated_test[JSON_RESULTS_RESULTS])
+ aggregated_test[JSON_RESULTS_TIMES] = \
+ cls._remove_items_over_max_number_of_builds(
+ aggregated_test[JSON_RESULTS_TIMES])
+
+ is_all_pass = cls._is_results_all_of_type(
+ aggregated_test[JSON_RESULTS_RESULTS], JSON_RESULTS_PASS)
+ is_all_no_data = cls._is_results_all_of_type(
+ aggregated_test[JSON_RESULTS_RESULTS], JSON_RESULTS_NO_DATA)
+
+ max_time = max(
+ [time[1] for time in aggregated_test[JSON_RESULTS_TIMES]])
+ # Remove all passes/no-data from the results to reduce noise and
+ # filesize. If a test passes every run, but
+ # takes >= JSON_RESULTS_MIN_TIME to run, don't throw away the data.
+ if (is_all_no_data or
+ (is_all_pass and max_time < JSON_RESULTS_MIN_TIME)):
+ del aggregated_json[test_name]
+
+ @classmethod
+ def _remove_items_over_max_number_of_builds(cls, encoded_list):
+ """Removes items from the run-length encoded list after the final
+ item that exceeds the max number of builds to track.
+
+ Args:
+ encoded_results: run-length encoded results. An array of arrays, e.g.
+ [[3,'A'],[1,'Q']] encodes AAAQ.
+ """
+ num_builds = 0
+ index = 0
+ for result in encoded_list:
+ num_builds = num_builds + result[0]
+ index = index + 1
+ if num_builds > JSON_RESULTS_MAX_BUILDS:
+ return encoded_list[:index]
+
+ return encoded_list
+
+ @classmethod
+ def _is_results_all_of_type(cls, results, type):
+ """Returns whether all the results are of the given type
+ (e.g. all passes).
+ """
+
+ return len(results) == 1 and results[0][1] == type
+
+ @classmethod
def _check_json(cls, builder, json):
"""Check whether the given json is valid.
@@ -363,3 +424,33 @@ class JsonResults(object):
return None
return file
+
+ @classmethod
+ def get_test_list(cls, builder, json_file_data):
+ """Get list of test names from aggregated json file data.
+
+ Args:
+ json_file_data: json file data that has all test-data and
+ non-test-data.
+
+ Returns:
+ json file with test name list only. The json format is the same
+ as the one saved in datastore, but all non-test-data and test detail
+ results are removed.
+ """
+
+ logging.debug("Loading test results json...")
+ json = cls._load_json(json_file_data)
+ if not json:
+ return None
+
+ logging.debug("Checking test results json...")
+ if not cls._check_json(builder, json):
+ return None
+
+ test_list_json = {}
+ tests = json[builder][JSON_RESULTS_TESTS]
+ test_list_json[builder] = {
+ "tests": dict.fromkeys(tests, {})}
+
+ return cls._generate_file_data(test_list_json)
diff --git a/WebKitTools/TestResultServer/model/jsonresults_unittest.py b/WebKitTools/TestResultServer/model/jsonresults_unittest.py
index fd646c8..15b659b 100755
--- a/WebKitTools/TestResultServer/model/jsonresults_unittest.py
+++ b/WebKitTools/TestResultServer/model/jsonresults_unittest.py
@@ -26,6 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import jsonresults
import unittest
from jsonresults import JsonResults
@@ -65,6 +66,9 @@ JSON_RESULTS_TESTS_TEMPLATE = (
JSON_RESULTS_PREFIX = "ADD_RESULTS("
JSON_RESULTS_SUFFIX = ");"
+JSON_RESULTS_TEST_LIST_TEMPLATE = (
+ '{"Webkit":{"tests":{[TESTDATA_TESTS]}}}')
+
class JsonResultsTest(unittest.TestCase):
def setUp(self):
@@ -122,12 +126,27 @@ class JsonResultsTest(unittest.TestCase):
else:
self.assertFalse(merged_results)
+ def _test_get_test_list(self, input_data, expected_data):
+ input_results = self._make_test_json(input_data)
+
+ json_tests = []
+ for test in expected_data:
+ json_tests.append("\"" + test + "\":{}")
+
+ expected_results = JSON_RESULTS_PREFIX + \
+ JSON_RESULTS_TEST_LIST_TEMPLATE.replace(
+ "[TESTDATA_TESTS]", ",".join(json_tests)) + \
+ JSON_RESULTS_SUFFIX
+
+ actual_results = JsonResults.get_test_list(self._builder, input_results)
+ self.assertEquals(actual_results, expected_results)
+
def test(self):
# Empty incremental results json.
# Nothing to merge.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
None,
# Expect no merge happens.
@@ -137,7 +156,7 @@ class JsonResultsTest(unittest.TestCase):
# Nothing to merge.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
([], []),
# Expected no merge happens.
@@ -149,9 +168,9 @@ class JsonResultsTest(unittest.TestCase):
# Aggregated results
None,
# Incremental results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Expected results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]))
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]))
# Single test for single run.
# Incremental results has the latest build and same test results for
@@ -160,11 +179,11 @@ class JsonResultsTest(unittest.TestCase):
# of runs for "P" (200 + 1) to get merged results.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
- (["3"], [["001.html", "[1,\"P\"]", "[1,\"0\"]"]]),
+ (["3"], [["001.html", "[1,\"F\"]", "[1,0]"]]),
# Expected results
- (["3", "2", "1"], [["001.html", "[201,\"P\"]", "[201,\"0\"]"]]))
+ (["3", "2", "1"], [["001.html", "[201,\"F\"]", "[201,0]"]]))
# Single test for single run.
# Incremental results has the latest build but different test results
@@ -172,72 +191,68 @@ class JsonResultsTest(unittest.TestCase):
# Insert the incremental results at the first place.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
- (["3"], [["001.html", "[1, \"I\"]", "[1,\"1\"]"]]),
+ (["3"], [["001.html", "[1, \"I\"]", "[1,1]"]]),
# Expected results
- (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"P\"]", "[1,\"1\"],[200,\"0\"]"]]))
+ (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"F\"]", "[1,1],[200,0]"]]))
# Single test for single run.
# Incremental results has the latest build but different test results
# for that run.
- # The test "results" and "times" need to be continuous, so the old
- # [10,"I"] result should be dropped because a new result of same type [1,"I"]
- # is inserted in front of [200,"P"].
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"],[10,\"I\"]", "[200,\"0\"],[10,\"1\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"],[10,\"I\"]", "[200,0],[10,1]"]]),
# Incremental results
- (["3"], [["001.html", "[1,\"I\"]", "[1,\"1\"]"]]),
+ (["3"], [["001.html", "[1,\"I\"]", "[1,1]"]]),
# Expected results
- (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"P\"]", "[1,\"1\"],[200,\"0\"]"]]))
+ (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"F\"],[10,\"I\"]", "[1,1],[200,0],[10,1]"]]))
# Multiple tests for single run.
# All tests have incremental updates.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[100,\"I\"]", "[100,\"1\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[100,\"I\"]", "[100,1]"]]),
# Incremental results
- (["3"], [["001.html", "[1,\"P\"]", "[1,\"0\"]"], ["002.html", "[1,\"I\"]", "[1,\"1\"]"]]),
+ (["3"], [["001.html", "[1,\"F\"]", "[1,0]"], ["002.html", "[1,\"I\"]", "[1,1]"]]),
# Expected results
- (["3", "2", "1"], [["001.html", "[201,\"P\"]", "[201,\"0\"]"], ["002.html", "[101,\"I\"]", "[101,\"1\"]"]]))
+ (["3", "2", "1"], [["001.html", "[201,\"F\"]", "[201,0]"], ["002.html", "[101,\"I\"]", "[101,1]"]]))
# Multiple tests for single run.
- # Not all tests have update.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[100,\"I\"]", "[100,\"1\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[100,\"I\"]", "[100,1]"]]),
# Incremental results
- (["3"], [["002.html", "[1,\"I\"]", "[1,\"1\"]"]]),
+ (["3"], [["002.html", "[1,\"I\"]", "[1,1]"]]),
# Expected results
- (["3", "2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[101,\"I\"]", "[101,\"1\"]"]]))
+ (["3", "2", "1"], [["001.html", "[1,\"N\"],[200,\"F\"]", "[201,0]"], ["002.html", "[101,\"I\"]", "[101,1]"]]))
# Single test for multiple runs.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
- (["4", "3"], [["001.html", "[2, \"I\"]", "[2,\"2\"]"]]),
+ (["4", "3"], [["001.html", "[2, \"I\"]", "[2,2]"]]),
# Expected results
- (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"P\"]", "[2,\"2\"],[200,\"0\"]"]]))
+ (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"F\"]", "[2,2],[200,0]"]]))
# Multiple tests for multiple runs.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"], ["002.html", "[10,\"Z\"]", "[10,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[10,\"Z\"]", "[10,0]"]]),
# Incremental results
- (["4", "3"], [["001.html", "[2, \"I\"]", "[2,\"2\"]"], ["002.html", "[1,\"C\"]", "[1,\"1\"]"]]),
+ (["4", "3"], [["001.html", "[2, \"I\"]", "[2,2]"], ["002.html", "[1,\"C\"]", "[1,1]"]]),
# Expected results
- (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"P\"]", "[2,\"2\"],[200,\"0\"]"], ["002.html", "[1,\"C\"],[10,\"Z\"]", "[1,\"1\"],[10,\"0\"]"]]))
+ (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"F\"]", "[2,2],[200,0]"], ["002.html", "[1,\"C\"],[10,\"Z\"]", "[1,1],[10,0]"]]))
# Test the build in incremental results is older than the most recent
# build in aggregated results.
# The incremental results should be dropped and no merge happens.
self._test_merge(
# Aggregated results
- (["3", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["3", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
- (["2"], [["001.html", "[1, \"P\"]", "[1,\"0\"]"]]),
+ (["2"], [["001.html", "[1, \"F\"]", "[1,0]"]]),
# Expected no merge happens.
None)
@@ -246,11 +261,57 @@ class JsonResultsTest(unittest.TestCase):
# The incremental results should be dropped and no merge happens.
self._test_merge(
# Aggregated results
- (["2", "1"], [["001.html", "[200,\"P\"]", "[200,\"0\"]"]]),
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
# Incremental results
- (["3", "2"], [["001.html", "[2, \"P\"]", "[2,\"0\"]"]]),
+ (["3", "2"], [["001.html", "[2, \"F\"]", "[2,0]"]]),
# Expected no merge happens.
None)
+ # Remove test where there is no data in all runs.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"N\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"N\"]", "[1,0]"], ["002.html", "[1,\"P\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]]))
+
+ # Remove test where all run pass and max running time < 1 seconds
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"P\"]", "[1,0]"], ["002.html", "[1,\"P\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]]))
+
+ # Do not remove test where all run pass but max running time >= 1 seconds
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"P\"]", "[1,1]"], ["002.html", "[1,\"P\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[201,\"P\"]", "[1,1],[200,0]"], ["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]]))
+
+ # Remove items from test results and times that exceeds the max number
+ # of builds to track.
+ max_builds = str(jsonresults.JSON_RESULTS_MAX_BUILDS)
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[" + max_builds + ",\"F\"],[1,\"I\"]", "[" + max_builds + ",0],[1,1]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"T\"]", "[1,1]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[1,\"T\"],[" + max_builds + ",\"F\"]", "[1,1],[" + max_builds + ",0]"]]))
+
+ # Get test name list only. Don't include non-test-list data and
+ # of test result details.
+ self._test_get_test_list(
+ # Input results
+ (["3", "2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Expected results
+ ["001.html", "002.html"])
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 02dfeb1..b2aa836 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -49,6 +49,7 @@ InjectedBundle& InjectedBundle::shared()
InjectedBundle::InjectedBundle()
: m_bundle(0)
, m_mainPage(0)
+ , m_state(Idle)
{
}
@@ -84,17 +85,6 @@ void InjectedBundle::initialize(WKBundleRef bundle)
WKBundleActivateMacFontAscentHack(m_bundle);
}
-void InjectedBundle::done()
-{
- WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithCFString(CFSTR("Done")));
-
- std::string output = m_outputStream.str();
- RetainPtr<CFStringRef> outputCFString(AdoptCF, CFStringCreateWithCString(0, output.c_str(), kCFStringEncodingUTF8));
- WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithCFString(outputCFString.get()));
-
- WKBundlePostMessage(m_bundle, doneMessageName.get(), doneMessageBody.get());
-}
-
void InjectedBundle::didCreatePage(WKBundlePageRef page)
{
// FIXME: we really need the main page ref to be sent over from the ui process
@@ -121,7 +111,7 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag
WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithCFString(CFSTR("BeginTest")));
WKBundlePostMessage(m_bundle, ackMessageName.get(), ackMessageBody.get());
- reset();
+ beginTesting();
return;
}
@@ -130,8 +120,10 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag
WKBundlePostMessage(m_bundle, errorMessageName.get(), errorMessageBody.get());
}
-void InjectedBundle::reset()
+void InjectedBundle::beginTesting()
{
+ m_state = Testing;
+
m_outputStream.str("");
m_layoutTestController = LayoutTestController::create();
@@ -144,6 +136,21 @@ void InjectedBundle::reset()
m_mainPage->reset();
}
+void InjectedBundle::done()
+{
+ m_mainPage->stopLoading();
+
+ WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithCFString(CFSTR("Done")));
+
+ std::string output = m_outputStream.str();
+ RetainPtr<CFStringRef> outputCFString(AdoptCF, CFStringCreateWithCString(0, output.c_str(), kCFStringEncodingUTF8));
+ WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithCFString(outputCFString.get()));
+
+ WKBundlePostMessage(m_bundle, doneMessageName.get(), doneMessageBody.get());
+
+ m_state = Idle;
+}
+
void InjectedBundle::closeOtherPages()
{
Vector<WKBundlePageRef> pages;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index ba021b1..d094f42 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -61,6 +61,8 @@ public:
void done();
std::ostringstream& os() { return m_outputStream; }
+ bool isTestRunning() { return m_state == Testing; }
+
private:
InjectedBundle();
~InjectedBundle();
@@ -73,7 +75,7 @@ private:
void willDestroyPage(WKBundlePageRef page);
void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
- void reset();
+ void beginTesting();
WKBundleRef m_bundle;
HashMap<WKBundlePageRef, InjectedBundlePage*> m_otherPages;
@@ -84,6 +86,12 @@ private:
RefPtr<EventSendingController> m_eventSendingController;
std::ostringstream m_outputStream;
+
+ enum State {
+ Idle,
+ Testing
+ };
+ State m_state;
};
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index 40a098e..424f7ab 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -147,6 +147,12 @@ InjectedBundlePage::~InjectedBundlePage()
{
}
+void InjectedBundlePage::stopLoading()
+{
+ WKBundlePageStopLoading(m_page);
+ m_isLoading = false;
+}
+
void InjectedBundlePage::reset()
{
WKBundlePageClearMainFrameName(m_page);
@@ -235,6 +241,9 @@ void InjectedBundlePage::didRunInsecureContentForFrame(WKBundlePageRef page, WKB
void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (frame == WKBundlePageGetMainFrame(m_page))
m_isLoading = true;
}
@@ -331,6 +340,8 @@ void InjectedBundlePage::dumpAllFramesText()
void InjectedBundlePage::dump()
{
+ ASSERT(InjectedBundle::shared().isTestRunning());
+
InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdog();
switch (InjectedBundle::shared().layoutTestController()->whatToDump()) {
@@ -357,6 +368,9 @@ void InjectedBundlePage::dump()
void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (!WKBundleFrameIsMainFrame(frame))
return;
@@ -373,6 +387,9 @@ void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame)
void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (!WKBundleFrameIsMainFrame(frame))
return;
@@ -386,6 +403,9 @@ void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame)
void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (!InjectedBundle::shared().layoutTestController()->shouldDumpTitleChanges())
return;
@@ -394,6 +414,9 @@ void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFram
void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, JSGlobalContextRef context, JSObjectRef window)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
JSValueRef exception = 0;
InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
@@ -414,6 +437,9 @@ void InjectedBundlePage::didChangeLocationWithinPageForFrame(WKBundleFrameRef fr
void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
unsigned pendingFrameUnloadEvents = WKBundleFrameGetPendingUnloadCount(frame);
if (pendingFrameUnloadEvents)
InjectedBundle::shared().os() << frame << " - has " << pendingFrameUnloadEvents << " onunload handler(s)\n";
@@ -460,12 +486,18 @@ void InjectedBundlePage::willRunJavaScriptPrompt(WKBundlePageRef page, WKStringR
void InjectedBundlePage::willAddMessageToConsole(WKStringRef message, uint32_t lineNumber)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
// FIXME: Strip file: urls.
InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << message << "\n";
}
void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks())
return;
@@ -474,11 +506,17 @@ void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
void InjectedBundlePage::willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
InjectedBundle::shared().os() << "ALERT: " << message << "\n";
}
void InjectedBundlePage::willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
InjectedBundle::shared().os() << "CONFIRM: " << message << "\n";
}
@@ -546,6 +584,9 @@ void InjectedBundlePage::didChangeSelection(WKBundlePageRef page, WKStringRef no
bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeRef range)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << range << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
@@ -553,6 +594,9 @@ bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeRef range)
bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << range << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
@@ -560,6 +604,9 @@ bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range)
bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
static const char* insertactionstring[] = {
"WebViewInsertActionTyped",
"WebViewInsertActionPasted",
@@ -573,6 +620,9 @@ bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef
bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
static const char *insertactionstring[] = {
"WebViewInsertActionTyped",
"WebViewInsertActionPasted",
@@ -586,6 +636,9 @@ bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef ran
bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeRef range)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << range << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
@@ -593,6 +646,9 @@ bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeRef range)
bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
static const char *affinitystring[] = {
"NSSelectionAffinityUpstream",
"NSSelectionAffinityDownstream"
@@ -609,6 +665,9 @@ bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, W
bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << range << "\n";
return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
@@ -616,27 +675,38 @@ bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style,
void InjectedBundlePage::didBeginEditing(WKStringRef notificationName)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidBeginEditing:" << notificationName << "\n";
}
void InjectedBundlePage::didEndEditing(WKStringRef notificationName)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidEndEditing:" << notificationName << "\n";
}
void InjectedBundlePage::didChange(WKStringRef notificationName)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChange:" << notificationName << "\n";
}
void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChangeSelection:" << notificationName << "\n";
}
-
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index 8909883..3f63bf3 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -38,6 +38,7 @@ public:
WKBundlePageRef page() const { return m_page; }
void dump();
+ void stopLoading();
bool isLoading() { return m_isLoading; }
void reset();
diff --git a/WebKitTools/WebKitTestRunner/PlatformWebView.h b/WebKitTools/WebKitTestRunner/PlatformWebView.h
index 6fc4509..29c63ae 100644
--- a/WebKitTools/WebKitTestRunner/PlatformWebView.h
+++ b/WebKitTools/WebKitTestRunner/PlatformWebView.h
@@ -51,6 +51,7 @@ public:
WKPageRef page();
PlatformWKView platformView() { return m_view; }
void resizeTo(unsigned width, unsigned height);
+ void focus();
private:
PlatformWKView m_view;
diff --git a/WebKitTools/WebKitTestRunner/StringFunctions.h b/WebKitTools/WebKitTestRunner/StringFunctions.h
index 4f8fe93..8195606 100644
--- a/WebKitTools/WebKitTestRunner/StringFunctions.h
+++ b/WebKitTools/WebKitTestRunner/StringFunctions.h
@@ -52,6 +52,16 @@ inline RetainPtr<CFStringRef> toCF(WKStringRef string)
return RetainPtr<CFStringRef>(AdoptCF, WKStringCopyCFString(0, string));
}
+inline RetainPtr<CFURLRef> toCF(WKURLRef url)
+{
+ return RetainPtr<CFURLRef>(AdoptCF, WKURLCopyCFURL(0, url));
+}
+
+inline RetainPtr<CFURLRef> toCF(const WKRetainPtr<WKURLRef>& url)
+{
+ return toCF(url.get());
+}
+
inline WKRetainPtr<WKStringRef> toWK(JSStringRef string)
{
return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithCFString(toCF(string).get()));
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 93857a7..c8a78d5 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -26,8 +26,10 @@
#include "TestController.h"
#include "PlatformWebView.h"
+#include "StringFunctions.h"
#include "TestInvocation.h"
#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKPreferencesPrivate.h>
#include <wtf/PassOwnPtr.h>
namespace WTR {
@@ -45,6 +47,8 @@ TestController::TestController(int argc, const char* argv[])
, m_verbose(false)
, m_printSeparators(false)
, m_usingServerMode(false)
+ , m_state(Initial)
+ , m_doneResetting(false)
{
initialize(argc, argv);
controller = this;
@@ -78,6 +82,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, const void*)
closeOtherPage,
0,
0,
+ 0,
0
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -119,6 +124,7 @@ void TestController::initialize(int argc, const char* argv[])
initializeTestPluginDirectory();
m_context.adopt(WKContextCreateWithInjectedBundlePath(injectedBundlePath()));
+ platformInitializeContext();
WKContextInjectedBundleClient injectedBundleClient = {
0,
@@ -128,7 +134,7 @@ void TestController::initialize(int argc, const char* argv[])
WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
_WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
-
+
m_pageNamespace.adopt(WKPageNamespaceCreate(m_context.get()));
m_mainWebView = adoptPtr(new PlatformWebView(m_pageNamespace.get()));
@@ -140,13 +146,60 @@ void TestController::initialize(int argc, const char* argv[])
0,
0,
0,
+ 0,
0
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
+
+ WKPageLoaderClient pageLoaderClient = {
+ 0,
+ this,
+ 0,
+ 0,
+ 0,
+ 0,
+ didFinishLoadForFrame,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ };
+ WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
+}
+
+void TestController::resetStateToConsistentValues()
+{
+ m_state = Resetting;
+
+ // FIXME: This function should also ensure that there is only one page open.
+
+ // Reset preferences
+ WKPreferencesRef preferences = WKContextGetPreferences(m_context.get());
+ WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
+ WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing);
+
+ m_mainWebView->focus();
+
+ // Reset main page back to about:blank
+ m_doneResetting = false;
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, createWKURL("about:blank"));
+ WKPageLoadURL(m_mainWebView->page(), url.get());
+ TestController::runUntil(m_doneResetting);
}
void TestController::runTest(const char* test)
{
+ resetStateToConsistentValues();
+
+ m_state = RunningTest;
m_currentInvocation.set(new TestInvocation(test));
m_currentInvocation->invoke();
m_currentInvocation.clear();
@@ -177,6 +230,8 @@ void TestController::run()
}
}
+// WKContextInjectedBundleClient
+
void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
{
static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(messageName, messageBody);
@@ -187,4 +242,28 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName
m_currentInvocation->didReceiveMessageFromInjectedBundle(messageName, messageBody);
}
+// WKPageLoaderClient
+
+void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(page, frame);
+}
+
+void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame)
+{
+ if (m_state != Resetting)
+ return;
+
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKFrameCopyURL(frame));
+ RetainPtr<CFURLRef> cfURL= toCF(wkURL);
+ CFStringRef cfURLString = CFURLGetString(cfURL.get());
+ if (!CFEqual(cfURLString, CFSTR("about:blank")))
+ return;
+
+ m_doneResetting = true;
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index 5754728..5f6d99d 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -53,6 +53,9 @@ public:
WKPageNamespaceRef pageNamespace() { return m_pageNamespace.get(); }
WKContextRef context() { return m_context.get(); }
+ // Helper
+ static void runUntil(bool& done);
+
private:
void initialize(int argc, const char* argv[]);
void run();
@@ -61,13 +64,21 @@ private:
void runTest(const char* pathOrURL);
void platformInitialize();
+ void platformInitializeContext();
void initializeInjectedBundlePath();
void initializeTestPluginDirectory();
+ void resetStateToConsistentValues();
+
// WKContextInjectedBundleClient
static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void*);
void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+ // WKPageLoaderClient
+ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void*);
+ void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame);
+
+
OwnPtr<TestInvocation> m_currentInvocation;
bool m_dumpPixels;
@@ -81,6 +92,14 @@ private:
OwnPtr<PlatformWebView> m_mainWebView;
WKRetainPtr<WKContextRef> m_context;
WKRetainPtr<WKPageNamespaceRef> m_pageNamespace;
+
+ enum State {
+ Initial,
+ Resetting,
+ RunningTest
+ };
+ State m_state;
+ bool m_doneResetting;
};
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index 9a0f0aa..47df66b 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -29,7 +29,6 @@
#include "StringFunctions.h"
#include "TestController.h"
#include <WebKit2/WKContextPrivate.h>
-#include <WebKit2/WKPreferencesPrivate.h>
#include <WebKit2/WKRetainPtr.h>
#include <wtf/RetainPtr.h>
@@ -59,7 +58,7 @@ static const unsigned normalHeight = 600;
static void sizeWebViewForCurrentTest(char* pathOrURL)
{
- bool isSVGW3CTest = strstr(pathOrURL, "svg/W3C-SVG-1.1");
+ bool isSVGW3CTest = strstr(pathOrURL, "svg/W3C-SVG-1.1") || strstr(pathOrURL, "svg\\W3C-SVG-1.1");
if (isSVGW3CTest)
TestController::shared().mainWebView()->resizeTo(w3cSVGWidth, w3cSVGHeight);
@@ -67,23 +66,15 @@ static void sizeWebViewForCurrentTest(char* pathOrURL)
TestController::shared().mainWebView()->resizeTo(normalWidth, normalHeight);
}
-void TestInvocation::resetPreferencesToConsistentValues()
-{
- WKPreferencesRef preferences = WKContextGetPreferences(TestController::shared().context());
- WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
- WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing);
-}
-
void TestInvocation::invoke()
{
sizeWebViewForCurrentTest(m_pathOrURL);
- resetPreferencesToConsistentValues();
WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithCFString(CFSTR("BeginTest")));
WKRetainPtr<WKStringRef> messageBody(AdoptWK, WKStringCreateWithCFString(CFSTR("")));
WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), messageBody.get());
- runUntil(m_gotInitialResponse);
+ TestController::runUntil(m_gotInitialResponse);
if (m_error) {
dump("FAIL\n");
return;
@@ -91,7 +82,7 @@ void TestInvocation::invoke()
WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
- runUntil(m_gotFinalMessage);
+ TestController::runUntil(m_gotFinalMessage);
if (m_error) {
dump("FAIL\n");
return;
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h
index 484e61d..1b33e49 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.h
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.h
@@ -42,11 +42,6 @@ public:
private:
void dump(const char*);
- void resetPreferencesToConsistentValues();
-
- // Helper
- static void runUntil(bool& done);
-
WKRetainPtr<WKURLRef> m_url;
char* m_pathOrURL;
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 6f78289..f5ee6d5 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -53,7 +53,6 @@
BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; };
BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; };
BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; };
- BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */; };
BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
/* End PBXBuildFile section */
@@ -132,7 +131,6 @@
BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; };
BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; };
BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; };
- BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestInvocationMac.mm; sourceTree = "<group>"; };
BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -270,7 +268,6 @@
children = (
BC7933FF118F7C84005EA8E2 /* main.mm */,
BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */,
- BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */,
BC8C795B11D2785D004535A1 /* TestControllerMac.mm */,
);
path = mac;
@@ -426,7 +423,6 @@
BC793400118F7C84005EA8E2 /* main.mm in Sources */,
BC793431118F7F19005EA8E2 /* TestController.cpp in Sources */,
BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */,
- BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */,
BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */,
BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */,
);
diff --git a/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
index 4e2a60c..96e6526 100644
--- a/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
@@ -58,4 +58,9 @@ WKPageRef PlatformWebView::page()
return [m_view pageRef];
}
+void PlatformWebView::focus()
+{
+ // Implement.
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
index 1a71b5d..dbe35e2 100644
--- a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -45,4 +45,14 @@ void TestController::initializeTestPluginDirectory()
m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
}
+void TestController::runUntil(bool& done)
+{
+ while (!done)
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
+}
+
+void TestController::platformInitializeContext()
+{
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm b/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm
deleted file mode 100644
index bd01029..0000000
--- a/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 "TestInvocation.h"
-
-namespace WTR {
-
-void TestInvocation::runUntil(bool& done)
-{
- while (!done)
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
-}
-
-} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp b/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp
index e602d0e..deed4ab 100644
--- a/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp
@@ -65,7 +65,7 @@ PlatformWebView::~PlatformWebView()
void PlatformWebView::resizeTo(unsigned width, unsigned height)
{
- // Implement
+ ::SetWindowPos(WKViewGetWindow(m_view), 0, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS);
}
WKPageRef PlatformWebView::page()
@@ -73,4 +73,9 @@ WKPageRef PlatformWebView::page()
return WKViewGetPage(m_view);
}
+void PlatformWebView::focus()
+{
+ ::SetFocus(::WKViewGetWindow(m_view));
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
index f650d7f..e35ee22 100644
--- a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -29,6 +29,7 @@
#include <io.h>
#include <shlwapi.h>
#include <string>
+#include <WebKit2/WKContextPrivateWin.h>
#include <WebKit2/WKStringCF.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
@@ -80,8 +81,17 @@ static void addQTDirToPATH()
::SetEnvironmentVariableW(pathEnvironmentVariable, newPath.data());
}
+static LONG WINAPI exceptionFilter(EXCEPTION_POINTERS*)
+{
+ fputs("#CRASHED\n", stderr);
+ fflush(stderr);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
void TestController::platformInitialize()
{
+ ::SetUnhandledExceptionFilter(exceptionFilter);
+
_setmode(1, _O_BINARY);
_setmode(2, _O_BINARY);
@@ -113,4 +123,22 @@ void TestController::initializeTestPluginDirectory()
m_testPluginDirectory.adopt(WKStringCreateWithCFString(testPluginDirectoryPath.get()));
}
+void TestController::runUntil(bool& done)
+{
+ while (!done) {
+ MSG msg;
+ BOOL result = GetMessage(&msg, 0, 0, 0);
+ if (result == -1)
+ return;
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+}
+
+void TestController::platformInitializeContext()
+{
+ // FIXME: Make DRT pass with Windows native controls. <http://webkit.org/b/25592>
+ WKContextSetShouldPaintNativeControls(m_context.get(), false);
+}
+
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/TestInvocationWin.cpp b/WebKitTools/WebKitTestRunner/win/TestInvocationWin.cpp
deleted file mode 100644
index cfeebcc..0000000
--- a/WebKitTools/WebKitTestRunner/win/TestInvocationWin.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 "TestInvocation.h"
-
-namespace WTR {
-
-void TestInvocation::runUntil(bool& done)
-{
- while (!done) {
- MSG msg;
- BOOL result = GetMessage(&msg, 0, 0, 0);
- if (result == -1)
- return;
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-}
-
-} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj b/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
index 7375bd4..d7ddd5c 100644
--- a/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
+++ b/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
@@ -317,10 +317,6 @@
RelativePath=".\TestControllerWin.cpp"
>
</File>
- <File
- RelativePath=".\TestInvocationWin.cpp"
- >
- </File>
</Filter>
<File
RelativePath="..\PlatformWebView.h"
diff --git a/WebKitTools/gdb/webcore.py b/WebKitTools/gdb/webcore.py
index 83886f8..8dc4d8e 100644
--- a/WebKitTools/gdb/webcore.py
+++ b/WebKitTools/gdb/webcore.py
@@ -26,170 +26,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.
-"""GDB support for WebKit types.
-
-Add this to your gdb by amending your ~/.gdbinit as follows:
- python
- import sys
- sys.path.insert(0, "/path/to/tools/gdb/")
- import webcore
-"""
-
-import gdb
-import struct
-
-def ustring_to_string(ptr, length=None):
- """Convert a pointer to UTF-16 data into a Python Unicode string.
-
- ptr and length are both gdb.Value objects.
- If length is unspecified, will guess at the length."""
- extra = ''
- if length is None:
- # Try to guess at the length.
- for i in xrange(0, 2048):
- if int((ptr + i).dereference()) == 0:
- length = i
- break
- if length is None:
- length = 256
- extra = u' (no trailing NUL found)'
- else:
- length = int(length)
-
- char_vals = [int((ptr + i).dereference()) for i in xrange(length)]
- string = struct.pack('H' * length, *char_vals).decode('utf-16', 'replace')
-
- return string + extra
-
-
-class StringPrinter(object):
- "Shared code between different string-printing classes"
- def __init__(self, val):
- self.val = val
-
- def display_hint(self):
- return 'string'
-
-
-class UCharStringPrinter(StringPrinter):
- "Print a UChar*; we must guess at the length"
- def to_string(self):
- return ustring_to_string(self.val)
-
-
-class WebCoreAtomicStringPrinter(StringPrinter):
- "Print a WebCore::AtomicString"
- def to_string(self):
- return self.val['m_string']
-
-
-class WebCoreStringPrinter(StringPrinter):
- "Print a WebCore::String"
- def get_length(self):
- if not self.val['m_impl']['m_ptr']:
- return 0
- return self.val['m_impl']['m_ptr']['m_length']
-
- def to_string(self):
- if self.get_length() == 0:
- return '(null)'
-
- return ustring_to_string(self.val['m_impl']['m_ptr']['m_data'],
- self.get_length())
-
-
-class WebCoreQualifiedNamePrinter(StringPrinter):
- "Print a WebCore::QualifiedName"
-
- def __init__(self, val):
- super(WebCoreQualifiedNamePrinter, self).__init__(val)
- self.prefix_length = 0
- self.length = 0
- if self.val['m_impl']:
- self.prefix_printer = WebCoreStringPrinter(
- self.val['m_impl']['m_prefix']['m_string'])
- self.local_name_printer = WebCoreStringPrinter(
- self.val['m_impl']['m_localName']['m_string'])
- self.prefix_length = self.prefix_printer.get_length()
- if self.prefix_length > 0:
- self.length = (self.prefix_length + 1 +
- self.local_name_printer.get_length())
- else:
- self.length = self.local_name_printer.get_length()
-
- def get_length(self):
- return self.length
-
- def to_string(self):
- if self.get_length() == 0:
- return "(null)"
- else:
- if self.prefix_length > 0:
- return (self.prefix_printer.to_string() + ":" +
- self.local_name_printer.to_string())
- else:
- return self.local_name_printer.to_string()
-
-
-
-def lookup_function(val):
- """Function used to load pretty printers; will be passed to GDB."""
- lookup_tag = val.type.tag
- printers = {
- "WebCore::AtomicString": WebCoreAtomicStringPrinter,
- "WebCore::String": WebCoreStringPrinter,
- "WebCore::QualifiedName": WebCoreQualifiedNamePrinter,
- }
- name = val.type.tag
- if name in printers:
- return printers[name](val)
-
- if val.type.code == gdb.TYPE_CODE_PTR:
- name = str(val.type.target().unqualified())
- if name == 'UChar':
- return UCharStringPrinter(val)
-
- return None
-
-
-gdb.pretty_printers.append(lookup_function)
-
-
-
-class PrintPathToRootCommand(gdb.Command):
- """Command for printing WebKit Node trees.
-Usage: printpathtoroot variable_name
-"""
-
- def __init__(self):
- super(PrintPathToRootCommand, self).__init__("printpathtoroot",
- gdb.COMMAND_SUPPORT,
- gdb.COMPLETE_NONE)
-
- def invoke(self, arg, from_tty):
- element_type = gdb.lookup_type('WebCore::Element')
- node_type = gdb.lookup_type('WebCore::Node')
- frame = gdb.selected_frame()
- try:
- val = gdb.Frame.read_var(frame, arg)
- except:
- print "No such variable, or invalid type"
- return
-
- target_type = str(val.type.target().strip_typedefs())
- if target_type == str(node_type):
- stack = []
- while val:
- stack.append([val,
- val.cast(element_type.pointer()).dereference()['m_tagName']])
- val = val.dereference()['m_parent']
-
- padding = ''
- while len(stack) > 0:
- pair = stack.pop()
- print padding, pair[1], pair[0]
- padding = padding + ' '
- else:
- print 'Sorry: I don\'t know how to deal with %s yet.' % target_type
-
-PrintPathToRootCommand()
+# For backward compatibility.
+import webkit
+print ("webcore.py is deprecated. Please use 'import webkit' instead of "
+ "'import webcore' in your ~/.gdbinit.")
diff --git a/WebKitTools/gdb/webkit.py b/WebKitTools/gdb/webkit.py
new file mode 100644
index 0000000..2d3b47a
--- /dev/null
+++ b/WebKitTools/gdb/webkit.py
@@ -0,0 +1,272 @@
+# 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.
+
+"""GDB support for WebKit types.
+
+Add this to your gdb by amending your ~/.gdbinit as follows:
+ python
+ import sys
+ sys.path.insert(0, "/path/to/tools/gdb/")
+ import webkit
+"""
+
+import gdb
+import re
+import struct
+
+
+def ustring_to_string(ptr, length=None):
+ """Convert a pointer to UTF-16 data into a Python Unicode string.
+
+ ptr and length are both gdb.Value objects.
+ If length is unspecified, will guess at the length."""
+ extra = ''
+ if length is None:
+ # Try to guess at the length.
+ for i in xrange(0, 2048):
+ if int((ptr + i).dereference()) == 0:
+ length = i
+ break
+ if length is None:
+ length = 256
+ extra = u' (no trailing NUL found)'
+ else:
+ length = int(length)
+
+ char_vals = [int((ptr + i).dereference()) for i in xrange(length)]
+ string = struct.pack('H' * length, *char_vals).decode('utf-16', 'replace')
+
+ return string + extra
+
+
+class StringPrinter(object):
+ "Shared code between different string-printing classes"
+ def __init__(self, val):
+ self.val = val
+
+ def display_hint(self):
+ return 'string'
+
+
+class UCharStringPrinter(StringPrinter):
+ "Print a UChar*; we must guess at the length"
+ def to_string(self):
+ return ustring_to_string(self.val)
+
+
+class WTFAtomicStringPrinter(StringPrinter):
+ "Print a WTF::AtomicString"
+ def to_string(self):
+ return self.val['m_string']
+
+
+class WTFStringPrinter(StringPrinter):
+ "Print a WTF::String"
+ def get_length(self):
+ if not self.val['m_impl']['m_ptr']:
+ return 0
+ return self.val['m_impl']['m_ptr']['m_length']
+
+ def to_string(self):
+ if self.get_length() == 0:
+ return '(null)'
+
+ return ustring_to_string(self.val['m_impl']['m_ptr']['m_data'],
+ self.get_length())
+
+
+class WebCoreQualifiedNamePrinter(StringPrinter):
+ "Print a WebCore::QualifiedName"
+
+ def __init__(self, val):
+ super(WebCoreQualifiedNamePrinter, self).__init__(val)
+ self.prefix_length = 0
+ self.length = 0
+ if self.val['m_impl']:
+ self.prefix_printer = WTFStringPrinter(
+ self.val['m_impl']['m_prefix']['m_string'])
+ self.local_name_printer = WTFStringPrinter(
+ self.val['m_impl']['m_localName']['m_string'])
+ self.prefix_length = self.prefix_printer.get_length()
+ if self.prefix_length > 0:
+ self.length = (self.prefix_length + 1 +
+ self.local_name_printer.get_length())
+ else:
+ self.length = self.local_name_printer.get_length()
+
+ def get_length(self):
+ return self.length
+
+ def to_string(self):
+ if self.get_length() == 0:
+ return "(null)"
+ else:
+ if self.prefix_length > 0:
+ return (self.prefix_printer.to_string() + ":" +
+ self.local_name_printer.to_string())
+ else:
+ return self.local_name_printer.to_string()
+
+
+class WTFVectorPrinter:
+ """Pretty Printer for a WTF::Vector.
+
+ The output of this pretty printer is similar to the output of std::vector's
+ pretty printer, which is bundled in gcc.
+
+ Example gdb session should look like:
+ (gdb) p v
+ $3 = WTF::Vector of length 7, capacity 16 = {7, 17, 27, 37, 47, 57, 67}
+ (gdb) set print elements 3
+ (gdb) p v
+ $6 = WTF::Vector of length 7, capacity 16 = {7, 17, 27...}
+ (gdb) set print array
+ (gdb) p v
+ $7 = WTF::Vector of length 7, capacity 16 = {
+ 7,
+ 17,
+ 27
+ ...
+ }
+ (gdb) set print elements 200
+ (gdb) p v
+ $8 = WTF::Vector of length 7, capacity 16 = {
+ 7,
+ 17,
+ 27,
+ 37,
+ 47,
+ 57,
+ 67
+ }
+ """
+
+ class Iterator:
+ def __init__(self, start, finish):
+ self.item = start
+ self.finish = finish
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.item == self.finish:
+ raise StopIteration
+ count = self.count
+ self.count += 1
+ element = self.item.dereference()
+ self.item += 1
+ return ('[%d]' % count, element)
+
+ def __init__(self, val):
+ self.val = val
+
+ def children(self):
+ start = self.val['m_buffer']['m_buffer']
+ return self.Iterator(start, start + self.val['m_size'])
+
+ def to_string(self):
+ return ('%s of length %d, capacity %d'
+ % ('WTF::Vector', self.val['m_size'], self.val['m_buffer']['m_capacity']))
+
+ def display_hint(self):
+ return 'array'
+
+
+def add_pretty_printers():
+ pretty_printers_dict = {
+ re.compile("^WTF::Vector<.*>$"): WTFVectorPrinter,
+ re.compile("^WTF::AtomicString$"): WTFAtomicStringPrinter,
+ re.compile("^WTF::String$"): WTFStringPrinter,
+ re.compile("^WebCore::QualifiedName$"): WebCoreQualifiedNamePrinter,
+ }
+
+ def lookup_function(val):
+ """Function used to load pretty printers; will be passed to GDB."""
+ type = val.type
+ if type.code == gdb.TYPE_CODE_REF:
+ type = type.target()
+ type = type.unqualified().strip_typedefs()
+ typename = type.tag
+ if not typename:
+ return None
+ for function, pretty_printer in pretty_printers_dict.items():
+ if function.search(typename):
+ return pretty_printer(val)
+
+ if type.code == gdb.TYPE_CODE_PTR:
+ name = str(type.target().unqualified())
+ if name == 'UChar':
+ return UCharStringPrinter(val)
+ return None
+
+ gdb.pretty_printers.append(lookup_function)
+
+
+add_pretty_printers()
+
+
+class PrintPathToRootCommand(gdb.Command):
+ """Command for printing WebKit Node trees.
+
+ Usage: printpathtoroot variable_name"""
+
+ def __init__(self):
+ super(PrintPathToRootCommand, self).__init__("printpathtoroot",
+ gdb.COMMAND_SUPPORT,
+ gdb.COMPLETE_NONE)
+
+ def invoke(self, arg, from_tty):
+ element_type = gdb.lookup_type('WebCore::Element')
+ node_type = gdb.lookup_type('WebCore::Node')
+ frame = gdb.selected_frame()
+ try:
+ val = gdb.Frame.read_var(frame, arg)
+ except:
+ print "No such variable, or invalid type"
+ return
+
+ target_type = str(val.type.target().strip_typedefs())
+ if target_type == str(node_type):
+ stack = []
+ while val:
+ stack.append([val,
+ val.cast(element_type.pointer()).dereference()['m_tagName']])
+ val = val.dereference()['m_parent']
+
+ padding = ''
+ while len(stack) > 0:
+ pair = stack.pop()
+ print padding, pair[1], pair[0]
+ padding = padding + ' '
+ else:
+ print 'Sorry: I don\'t know how to deal with %s yet.' % target_type
+
+
+PrintPathToRootCommand()
diff --git a/WebKitTools/gdb/wtf.py b/WebKitTools/gdb/wtf.py
deleted file mode 100644
index cf4b59b..0000000
--- a/WebKitTools/gdb/wtf.py
+++ /dev/null
@@ -1,133 +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.
-
-"""GDB support for WebKit WTF types.
-
-Add this to your gdb by amending your ~/.gdbinit as follows:
- python
- import sys
- sys.path.insert(0, "/path/to/tools/gdb/")
- import wtf
-
-See http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html for GDB's
-Python API.
-"""
-
-import gdb
-import re
-
-
-class WTFVectorPrinter:
- """Pretty Printer for a WTF::Vector.
-
- The output of this pretty printer is similar to the output of std::vector's
- pretty printer, which is bundled in gcc.
-
- Example gdb session should look like:
- (gdb) p v
- $3 = WTF::Vector of length 7, capacity 16 = {7, 17, 27, 37, 47, 57, 67}
- (gdb) set print elements 3
- (gdb) p v
- $6 = WTF::Vector of length 7, capacity 16 = {7, 17, 27...}
- (gdb) set print array
- (gdb) p v
- $7 = WTF::Vector of length 7, capacity 16 = {
- 7,
- 17,
- 27
- ...
- }
- (gdb) set print elements 200
- (gdb) p v
- $8 = WTF::Vector of length 7, capacity 16 = {
- 7,
- 17,
- 27,
- 37,
- 47,
- 57,
- 67
- }
- """
-
- class Iterator:
- def __init__(self, start, finish):
- self.item = start
- self.finish = finish
- self.count = 0
-
- def __iter__(self):
- return self
-
- def next(self):
- if self.item == self.finish:
- raise StopIteration
- count = self.count
- self.count += 1
- element = self.item.dereference()
- self.item += 1
- return ('[%d]' % count, element)
-
- def __init__(self, val):
- self.val = val
-
- def children(self):
- start = self.val['m_buffer']['m_buffer']
- return self.Iterator(start, start + self.val['m_size'])
-
- def to_string(self):
- return ('%s of length %d, capacity %d'
- % ('WTF::Vector', self.val['m_size'], self.val['m_buffer']['m_capacity']))
-
- def display_hint(self):
- return 'array'
-
-
-def lookup_function(val):
- type = val.type
- if type.code == gdb.TYPE_CODE_REF:
- type = type.target()
- type = type.unqualified().strip_typedefs()
- typename = type.tag
- if not typename:
- return None
- for function, pretty_printer in pretty_printers_dict.items():
- if function.search(typename):
- return pretty_printer(val)
- return None
-
-
-def build_pretty_printers_dict():
- pretty_printers_dict[re.compile('^WTF::Vector<.*>$')] = WTFVectorPrinter
-
-
-pretty_printers_dict = {}
-
-build_pretty_printers_dict()
-
-gdb.pretty_printers.append(lookup_function)
diff --git a/WebKitTools/wx/browser/wscript b/WebKitTools/wx/browser/wscript
index bd2640c..8c22cf6 100644
--- a/WebKitTools/wx/browser/wscript
+++ b/WebKitTools/wx/browser/wscript
@@ -46,9 +46,9 @@ def build(bld):
includes = ' '.join(include_paths),
source = 'browser.cpp',
target = 'wxBrowser',
- uselib = 'WX CURL ICU XSLT XML WXWEBKIT ' + get_config(),
+ uselib = 'WX CURL ICU XSLT XML ' + get_config(),
libpath = [output_dir],
- uselib_local = '',
+ uselib_local = 'wxwebkit',
install_path = output_dir)
if sys.platform.startswith('darwin'):
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index be43873..74d9789 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -97,56 +97,56 @@ jscore_dirs = [
]
webcore_dirs = [
- 'accessibility',
- 'bindings',
- 'bindings/cpp',
- 'bindings/generic',
- 'bindings/js',
- 'bridge',
- 'bridge/c',
- 'bridge/jsc',
- 'css',
- 'DerivedSources',
- 'dom',
- 'dom/default',
- 'editing',
- 'history',
- 'html',
- 'html/canvas',
- 'inspector',
- 'loader',
- 'loader/appcache',
- 'loader/archive',
- 'loader/icon',
- 'notifications',
- 'page',
- 'page/animation',
- 'platform',
- 'platform/animation',
- 'platform/graphics',
- 'platform/graphics/filters',
- 'platform/graphics/transforms',
- 'platform/image-decoders',
- 'platform/image-decoders/bmp',
- 'platform/image-decoders/gif',
- 'platform/image-decoders/ico',
- 'platform/image-decoders/jpeg',
- 'platform/image-decoders/png',
- 'platform/mock',
- 'platform/network',
- 'platform/sql',
- 'platform/text',
- 'platform/text/transcoder',
- 'plugins',
- 'rendering',
- 'rendering/style',
- 'storage',
- 'svg',
- 'svg/animation',
- 'svg/graphics',
- 'svg/graphics/filters',
- 'websockets',
- 'xml'
+ 'WebCore/accessibility',
+ 'WebCore/bindings',
+ 'WebCore/bindings/cpp',
+ 'WebCore/bindings/generic',
+ 'WebCore/bindings/js',
+ 'WebCore/bridge',
+ 'WebCore/bridge/c',
+ 'WebCore/bridge/jsc',
+ 'WebCore/css',
+ 'WebCore/DerivedSources',
+ 'WebCore/dom',
+ 'WebCore/dom/default',
+ 'WebCore/editing',
+ 'WebCore/history',
+ 'WebCore/html',
+ 'WebCore/html/canvas',
+ 'WebCore/inspector',
+ 'WebCore/loader',
+ 'WebCore/loader/appcache',
+ 'WebCore/loader/archive',
+ 'WebCore/loader/icon',
+ 'WebCore/notifications',
+ 'WebCore/page',
+ 'WebCore/page/animation',
+ 'WebCore/platform',
+ 'WebCore/platform/animation',
+ 'WebCore/platform/graphics',
+ 'WebCore/platform/graphics/filters',
+ 'WebCore/platform/graphics/transforms',
+ 'WebCore/platform/image-decoders',
+ 'WebCore/platform/image-decoders/bmp',
+ 'WebCore/platform/image-decoders/gif',
+ 'WebCore/platform/image-decoders/ico',
+ 'WebCore/platform/image-decoders/jpeg',
+ 'WebCore/platform/image-decoders/png',
+ 'WebCore/platform/mock',
+ 'WebCore/platform/network',
+ 'WebCore/platform/sql',
+ 'WebCore/platform/text',
+ 'WebCore/platform/text/transcoder',
+ 'WebCore/plugins',
+ 'WebCore/rendering',
+ 'WebCore/rendering/style',
+ 'WebCore/storage',
+ 'WebCore/svg',
+ 'WebCore/svg/animation',
+ 'WebCore/svg/graphics',
+ 'WebCore/svg/graphics/filters',
+ 'WebCore/websockets',
+ 'WebCore/xml'
]
config = get_config(wk_root)
@@ -180,7 +180,7 @@ os.environ['CREATE_HASH_TABLE'] = create_hash_table
feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER',
'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS',
'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE', 'ENABLE_SVG_FOREIGN_OBJECT',
- 'ENABLE_JIT', 'ENABLE_EXECUTABLE_ALLOCATOR_DEMAND', 'BUILDING_%s' % build_port.upper()]
+ 'ENABLE_JIT', 'BUILDING_%s' % build_port.upper()]
msvc_version = 'msvc2008'
@@ -289,9 +289,6 @@ def common_configure(conf):
conf.env.append_value('CXXDEFINES', ['BUILDING_WX__=1', 'JS_NO_EXPORT'])
- conf.env['LIB_WXWEBKIT'] = ['wxwebkit']
- conf.env['CXXDEFINES_WXWEBKIT'] = ['WXUSINGDLL_WEBKIT']
-
if building_on_win32:
conf.env.append_value('LIBPATH', os.path.join(msvclibs_dir, 'lib'))
# wx settings
@@ -303,22 +300,8 @@ def common_configure(conf):
conf.env['LIB_WX'] = wxlibs
conf.env['LIBPATH_WX'] = wxlibpaths
- if building_on_win32:
- conf.env['LIB_JSCORE'] = [libprefix + 'jscore']
- conf.env['LIB_WEBCORE'] = [libprefix + 'webcore']
- elif sys.platform.startswith('darwin'):
- conf.env['LINKFLAGS_JSCORE'] = ['-Wl,-force_load,%s' % os.path.join(output_dir, 'libjscore.a')]
- conf.env['LINKFLAGS_WEBCORE'] = ['-Wl,-force_load,%s' % os.path.join(output_dir, 'libwebcore.a')]
- else:
- conf.env['LINKFLAGS_JSCORE'] = ['-Wl,-whole-archive', '-ljscore', '-Wl,-no-whole-archive']
- conf.env['LINKFLAGS_WEBCORE'] = ['-Wl,-whole-archive', '-lwebcore', '-Wl,-no-whole-archive']
-
if sys.platform.startswith('darwin'):
conf.env['LIB_ICU'] = ['icucore']
- # Apple does not ship the ICU headers with Mac OS X, so WebKit includes a copy of 3.2 headers
- conf.env.append_value('CPPPATH_JSCORE', os.path.join(jscore_dir, 'icu'))
-
- conf.env.append_value('CPPPATH_WEBCORE', os.path.join(webcore_dir, 'icu'))
conf.env.append_value('CPPPATH', wklibs_dir)
conf.env.append_value('LIBPATH', wklibs_dir)
@@ -340,12 +323,12 @@ def common_configure(conf):
sdk_version = min_version
if min_version == "10.4":
sdk_version += "u"
- conf.env.append_value('LIB_WEBCORE', ['WebKitSystemInterfaceTiger'])
+ conf.env.append_value('LIB_WKINTERFACE', ['WebKitSystemInterfaceTiger'])
else:
# NOTE: There is a WebKitSystemInterfaceSnowLeopard, but when we use that
# on 10.6, we get a strange missing symbol error, and this library seems to
# work fine for wx's purposes.
- conf.env.append_value('LIB_WEBCORE', ['WebKitSystemInterfaceLeopard'])
+ conf.env.append_value('LIB_WKINTERFACE', ['WebKitSystemInterfaceLeopard'])
sdkroot = '/Developer/SDKs/MacOSX%s.sdk' % sdk_version
sdkflags = ['-arch', 'i386', '-isysroot', sdkroot]
diff --git a/WebKitTools/wx/build/waf_extensions.py b/WebKitTools/wx/build/waf_extensions.py
index 6816441..f50f264 100644
--- a/WebKitTools/wx/build/waf_extensions.py
+++ b/WebKitTools/wx/build/waf_extensions.py
@@ -35,7 +35,12 @@ def exec_command(s, **kw):
if sys.platform.startswith('win') and len(' '.join(s)) > 32000:
import tempfile
(fd, filename) = tempfile.mkstemp()
- os.write(fd, ' '.join(s[1:]))
+ t = []
+ for i in s:
+ if i.find(" ") != -1:
+ i = '"%s"' % i
+ t.append(i)
+ os.write(fd, ' '.join(t[1:]))
os.close(fd)
s = [s[0], '@' + filename]
diff --git a/autotools/gsettings.m4 b/autotools/gsettings.m4
new file mode 100644
index 0000000..ac9945e
--- /dev/null
+++ b/autotools/gsettings.m4
@@ -0,0 +1,93 @@
+dnl GLIB_GSETTINGS
+dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
+dnl the schema should be compiled
+dnl
+
+AC_DEFUN([GLIB_GSETTINGS],
+[
+ m4_pattern_allow([AM_V_GEN])
+ AC_ARG_ENABLE(schemas-compile,
+ AC_HELP_STRING([--disable-schemas-compile],
+ [Disable regeneration of gschemas.compiled on install]),
+ [case ${enableval} in
+ yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
+ no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
+ esac])
+ AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
+ PKG_PROG_PKG_CONFIG([0.16])
+ AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
+ if test x$cross_compiling != xyes; then
+ GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
+ else
+ AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
+ fi
+ AC_SUBST(GLIB_COMPILE_SCHEMAS)
+ if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
+ ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
+ else
+ ifelse([$1],,[:],[$1])
+ fi
+
+ GSETTINGS_RULES='
+.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
+
+mostlyclean-am: clean-gsettings-schemas
+
+gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
+
+%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
+ $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
+
+all-am: $(gsettings_SCHEMAS:.xml=.valid)
+uninstall-am: uninstall-gsettings-schemas
+install-data-am: install-gsettings-schemas
+
+.SECONDARY: $(gsettings_SCHEMAS)
+
+gsettings__base_list = \
+ sed "$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g" | \
+ sed "$$!N;$$!N;$$!N;$$!N;s/\n/ /g"
+
+install-gsettings-schemas: $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
+ @$(NORMAL_INSTALL)
+ test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"
+ @list='\''$(gsettings__enum_file) $(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(gsettings__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '\''$(DESTDIR)$(gsettingsschemadir)'\''"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(gsettingsschemadir)" || exit $$?; \
+ done
+ test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
+
+uninstall-gsettings-schemas:
+ @$(NORMAL_UNINSTALL)
+ @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
+ test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
+
+clean-gsettings-schemas:
+ rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
+
+ifdef gsettings_ENUM_NAMESPACE
+$(gsettings__enum_file): $(gsettings_ENUM_FILES)
+ $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" $(gsettings_ENUM_FILES) > [$]@.tmp && mv [$]@.tmp [$]@
+endif
+'
+ _GSETTINGS_SUBST(GSETTINGS_RULES)
+])
+
+dnl _GSETTINGS_SUBST(VARIABLE)
+dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
+AC_DEFUN([_GSETTINGS_SUBST],
+[
+AC_SUBST([$1])
+m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
+]
+)